{
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyGridStaffEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyGridStaffEntity.java
new file mode 100644
index 0000000000..1c59536017
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyGridStaffEntity.java
@@ -0,0 +1,84 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity.evaluationindex.indexcoll;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 平阴区网格员基础信息
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("screen_py_grid_staff")
+public class ScreenPyGridStaffEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 网格Id
+ */
+ private String gridId;
+
+ /**
+ * 网格编码
+ */
+ private String gridCode;
+
+ /**
+ * 网格名称
+ */
+ private String gridName;
+
+ /**
+ * 网格名称
+ */
+ private String pids;
+
+ /**
+ * 工作人员Id
+ */
+ private String staffId;
+
+ /**
+ * 网格员姓名
+ */
+ private String staffName;
+
+ /**
+ * 手机号
+ */
+ private String mobile;
+
+ /**
+ * 是否离职,格式为Y:是、N:否
+ */
+ private String isLeave;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailEntity.java
new file mode 100644
index 0000000000..f1e06c0ff5
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailEntity.java
@@ -0,0 +1,134 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity.evaluationindex.indexcoll;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * 平阴历史得分明细表
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("screen_py_history_score_detail")
+public class ScreenPyHistoryScoreDetailEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * screen_py_history_score.id
+ */
+ private String historyScoreId;
+
+ /**
+ * 街道组织Id
+ */
+ private String agencyId;
+
+ /**
+ * 街道名称
+ */
+ private String agencyName;
+
+ /**
+ * 网格活跃度
+ */
+ private BigDecimal wghyd;
+
+ /**
+ * 事件赋分
+ */
+ private BigDecimal sjff;
+
+ /**
+ * 接入率
+ */
+ private BigDecimal jrl;
+
+ /**
+ * 在线率
+ */
+ private BigDecimal zxl;
+
+ /**
+ * 出图率
+ */
+ private BigDecimal ctl;
+
+ /**
+ * 雪亮工程
+ */
+ private BigDecimal xlgc;
+
+ /**
+ * 完成进度
+ */
+ private BigDecimal wcjd;
+
+ /**
+ * 未补检
+ */
+ private BigDecimal wbj;
+
+ /**
+ * 反馈抽检
+ */
+ private BigDecimal fkcj;
+
+ /**
+ * 日核周调
+ */
+ private BigDecimal rhzt;
+
+ /**
+ * 亮点工作
+ */
+ private BigDecimal ldgz;
+
+ /**
+ * 亮点工作备注
+ */
+ private String ldgzbz;
+
+ /**
+ * 其他工作
+ */
+ private BigDecimal qtgz;
+
+ /**
+ * 其他工作备注
+ */
+ private String qtgzbz;
+
+ /**
+ * 能力得分
+ */
+ private BigDecimal nldf;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreEntity.java
new file mode 100644
index 0000000000..db484429cd
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreEntity.java
@@ -0,0 +1,64 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity.evaluationindex.indexcoll;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 平阴历史得分主表
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("screen_py_history_score")
+public class ScreenPyHistoryScoreEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 标题
+ */
+ private String title;
+
+ /**
+ * 起始时间
+ */
+ private Date startTime;
+
+ /**
+ * 截止时间
+ */
+ private Date endTime;
+
+ /**
+ * 发布时间
+ */
+ private Date releaseTime;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyWeightConfigurationEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyWeightConfigurationEntity.java
new file mode 100644
index 0000000000..1997025a99
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyWeightConfigurationEntity.java
@@ -0,0 +1,74 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity.evaluationindex.indexcoll;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * 平阴政法能力权重配置
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("screen_py_weight_configuration")
+public class ScreenPyWeightConfigurationEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 网格活跃度
+ */
+ private BigDecimal wghyd;
+
+ /**
+ * 事件赋分
+ */
+ private BigDecimal sjff;
+
+ /**
+ * 雪亮工程
+ */
+ private BigDecimal xlgc;
+
+ /**
+ * 日核周调
+ */
+ private BigDecimal rhzt;
+
+ /**
+ * 亮点工作
+ */
+ private BigDecimal ldgz;
+
+ /**
+ * 其他工作
+ */
+ private BigDecimal qtgz;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPyEventDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPyEventDataEntity.java
new file mode 100644
index 0000000000..2b31ed2fed
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPyEventDataEntity.java
@@ -0,0 +1,70 @@
+package com.epmet.entity.evaluationindex.screen;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 上报到市平台中间库的事件
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-12-08
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("screen_py_event_data")
+public class ScreenPyEventDataEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ ///**
+ // * 客户Id
+ // */
+ //private String customerId;
+
+ /**
+ * 上级组织Id
+ */
+ private String orgId;
+
+ /**
+ * 所有上级ID,用英文逗号分开
+ */
+ private String pids;
+
+ /**
+ * 事件Id
+ */
+ private String eventId;
+
+ /**
+ * 事件类别 上报事件:project;例行工作:work
+ */
+ private String eventType;
+
+ /**
+ * 事件时间
+ */
+ private Date eventCreateTime;
+
+ /**
+ * 事件分类编码
+ */
+ private String categoryCode;
+
+ private String title;
+
+ private String staffName;
+
+ private String mobile;
+
+ ///**
+ // * 父类事件分类编码
+ // */
+ //private String parentCategoryCode;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/HistoryScoreDetailExcel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/HistoryScoreDetailExcel.java
new file mode 100644
index 0000000000..e086132a19
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/HistoryScoreDetailExcel.java
@@ -0,0 +1,57 @@
+package com.epmet.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadStyle;
+import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 政法能力历史得分-导出
+ *
+ * @author generator generator@elink-cn.com
+ */
+@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44)
+@HeadRowHeight(40)
+@Data
+public class HistoryScoreDetailExcel implements Serializable {
+
+ private static final long serialVersionUID = -12110233388005838L;
+ @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "下级单位"})
+ @ColumnWidth(15)
+ @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44)
+ private String agencyName;
+
+ @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "网格活跃度"})
+ @ColumnWidth(15)
+ private BigDecimal wghyd;
+
+ @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "事件赋值得分"})
+ @ColumnWidth(20)
+ private BigDecimal sjff;
+
+ @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "雪亮工程"})
+ @ColumnWidth(15)
+ private BigDecimal xlgc;
+
+ @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "日核周调"})
+ @ColumnWidth(15)
+ private BigDecimal rhzt;
+
+ @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "亮点工作"})
+ @ColumnWidth(15)
+ private BigDecimal ldgz;
+
+ @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "其他工作"})
+ @ColumnWidth(15)
+ private BigDecimal qtgz;
+
+ @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "能力得分"})
+ @ColumnWidth(15)
+ private BigDecimal nldf;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyGridStaffService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyGridStaffService.java
new file mode 100644
index 0000000000..057a9aa6af
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyGridStaffService.java
@@ -0,0 +1,15 @@
+package com.epmet.service.evaluationindex.indexcoll;
+
+import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO;
+
+import java.util.List;
+
+/**
+ * 平阴区网格员基础信息
+ *
+ * @author generator generator@elink-cn.com
+ */
+public interface ScreenPyGridStaffService {
+
+ void saveList(List dtoList);
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailService.java
new file mode 100644
index 0000000000..0fea59c676
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailService.java
@@ -0,0 +1,18 @@
+package com.epmet.service.evaluationindex.indexcoll;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO;
+
+import java.util.List;
+
+/**
+ * 平阴历史得分明细表
+ *
+ * @author generator generator@elink-cn.com
+ */
+public interface ScreenPyHistoryScoreDetailService {
+
+ PageData selectScoreDetailList(HistoryScoreListFormDTO formDTO);
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java
new file mode 100644
index 0000000000..53d012a042
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java
@@ -0,0 +1,35 @@
+package com.epmet.service.evaluationindex.indexcoll;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO;
+import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO;
+import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO;
+
+import java.util.List;
+
+/**
+ * 平阴历史得分主表
+ *
+ * @author generator generator@elink-cn.com
+ */
+public interface ScreenPyHistoryScoreService {
+
+ PageData list(HistoryScoreListFormDTO formDTO);
+
+ void save(HistoryScoreFormDTO dto);
+
+ void update(HistoryScoreFormDTO dto);
+
+ void deleteById(HistoryScoreFormDTO dto);
+
+ HistoryScoreDetailResultDTO detail(HistoryScoreFormDTO formDTO);
+
+ HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO);
+
+ HistoryScoreComputeResultDTO nldfScore(HistoryScoreFormDTO.Detail dto);
+
+ List dplist(HistoryScoreListFormDTO formDTO);
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyWeightConfigurationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyWeightConfigurationService.java
new file mode 100644
index 0000000000..fe5b41076b
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyWeightConfigurationService.java
@@ -0,0 +1,23 @@
+package com.epmet.service.evaluationindex.indexcoll;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO;
+import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO;
+import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO;
+
+/**
+ * 平阴政法能力权重配置
+ *
+ * @author generator generator@elink-cn.com
+ */
+public interface ScreenPyWeightConfigurationService {
+
+ PageData list(WeightConfigurationListFormDTO formDTO);
+
+ void save(WeightConfigurationFormDTO dto);
+
+ void update(WeightConfigurationFormDTO dto);
+
+ void deleteById(WeightConfigurationFormDTO dto);
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyGridStaffServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyGridStaffServiceImpl.java
new file mode 100644
index 0000000000..35fc1058a7
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyGridStaffServiceImpl.java
@@ -0,0 +1,53 @@
+package com.epmet.service.evaluationindex.indexcoll.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.StrConstant;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
+import com.epmet.commons.tools.exception.EpmetException;
+import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.evaluationindex.indexcoll.ScreenPyGridStaffDao;
+import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO;
+import com.epmet.entity.evaluationindex.indexcoll.ScreenPyGridStaffEntity;
+import com.epmet.service.evaluationindex.indexcoll.ScreenPyGridStaffService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 平阴区网格员基础信息
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Slf4j
+@Service
+@DataSource(DataSourceConstant.EVALUATION_INDEX)
+public class ScreenPyGridStaffServiceImpl extends BaseServiceImpl implements ScreenPyGridStaffService {
+
+ @Override
+ public void saveList(List dtoList) {
+ dtoList.forEach(d -> {
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(StrConstant.PY_CUSTOMER, d.getStaffId());
+ if (null == staffInfo) {
+ throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", d.getStaffId()));
+ }
+ ScreenPyGridStaffEntity entity = baseDao.selectStaff(d.getGridId(), d.getStaffId());
+ //存在就更新 不存在就新增
+ if (null != entity) {
+ ScreenPyGridStaffEntity entity1 = ConvertUtils.sourceToTarget(d, ScreenPyGridStaffEntity.class);
+ entity1.setId(entity.getId());
+ entity1.setPids(("".equals(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":") + staffInfo.getAgencyId());
+ baseDao.updateById(entity1);
+ } else {
+ ScreenPyGridStaffEntity saveEntity = ConvertUtils.sourceToTarget(d, ScreenPyGridStaffEntity.class);
+ saveEntity.setId(IdWorker.getIdStr());
+ saveEntity.setPids(("".equals(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":") + staffInfo.getAgencyId());
+ insert(saveEntity);
+ }
+ });
+ }
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreDetailServiceImpl.java
new file mode 100644
index 0000000000..aab939444f
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreDetailServiceImpl.java
@@ -0,0 +1,40 @@
+package com.epmet.service.evaluationindex.indexcoll.impl;
+
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao;
+import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO;
+import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity;
+import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 平阴历史得分明细表
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Slf4j
+@Service
+@DataSource(DataSourceConstant.EVALUATION_INDEX)
+public class ScreenPyHistoryScoreDetailServiceImpl extends BaseServiceImpl implements ScreenPyHistoryScoreDetailService {
+
+
+ @Override
+ public PageData selectScoreDetailList(HistoryScoreListFormDTO formDTO) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
+ List list = baseDao.selectScoreDetailList(formDTO);
+ PageInfo pageInfo = new PageInfo<>(list);
+ return new PageData<>(list, pageInfo.getTotal());
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java
new file mode 100644
index 0000000000..bf657668e2
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java
@@ -0,0 +1,251 @@
+package com.epmet.service.evaluationindex.indexcoll.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
+import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDao;
+import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao;
+import com.epmet.dao.evaluationindex.indexcoll.ScreenPyWeightConfigurationDao;
+import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
+import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO;
+import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient;
+import com.epmet.dto.indexcollect.ScreenPyHistoryScoreDetailDTO;
+import com.epmet.dto.indexcollect.ScreenPyWeightConfigurationDTO;
+import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO;
+import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO;
+import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO;
+import com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO;
+import com.epmet.dto.result.IcMoveInListResultDTO;
+import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity;
+import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity;
+import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService;
+import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.text.NumberFormat;
+import java.util.*;
+
+/**
+ * 平阴历史得分主表
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Slf4j
+@Service
+@DataSource(DataSourceConstant.EVALUATION_INDEX_READ)
+public class ScreenPyHistoryScoreServiceImpl implements ScreenPyHistoryScoreService {
+
+ @Autowired
+ private ScreenPyHistoryScoreDao screenPyHistoryScoreDao;
+ @Autowired
+ private ScreenPyHistoryScoreDetailServiceImpl screenPyHistoryScoreDetailServiceImpl;
+ @Autowired
+ private ScreenPyHistoryScoreDetailDao screenPyHistoryScoreDetailDao;
+ @Autowired
+ private DataAggregatorOpenFeignClient dataAggregatorOpenFeignClient;
+ @Autowired
+ private ScreenPyWeightConfigurationDao screenPyWeightConfigurationDao;
+
+
+ @Override
+ public PageData list(HistoryScoreListFormDTO formDTO) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
+ List list = screenPyHistoryScoreDao.selectHistoryScoreList(formDTO);
+ list.forEach(l->{
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), l.getUpdatedById());
+ if (null != staffInfo) {
+ l.setUpdatedBy(staffInfo.getRealName());
+ }
+ });
+ PageInfo pageInfo = new PageInfo<>(list);
+ return new PageData<>(list, pageInfo.getTotal());
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(HistoryScoreFormDTO formDTO) {
+ //1.主表新增数据
+ ScreenPyHistoryScoreEntity entity = ConvertUtils.sourceToTarget(formDTO, ScreenPyHistoryScoreEntity.class);
+ entity.setReleaseTime(new Date());
+ screenPyHistoryScoreDao.insert(entity);
+ //2.明细表新增数据
+ ScreenPyWeightConfigurationDTO wcDTO = screenPyWeightConfigurationDao.selectOneDTO();
+ List list = new ArrayList<>();
+ formDTO.getDetailList().forEach(dto -> {
+ ScreenPyHistoryScoreDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, ScreenPyHistoryScoreDetailEntity.class);
+ detailEntity.setCustomerId(formDTO.getCustomerId());
+ detailEntity.setHistoryScoreId(entity.getId());
+ if (null != wcDTO) {
+ BigDecimal nldf = detailEntity.getWghyd().multiply(wcDTO.getWghyd()).add(detailEntity.getSjff().multiply(wcDTO.getSjff()))
+ .add(detailEntity.getXlgc().multiply(wcDTO.getXlgc())).add(detailEntity.getRhzt().multiply(wcDTO.getRhzt()))
+ .add(detailEntity.getLdgz().multiply(wcDTO.getLdgz())).add(detailEntity.getQtgz().multiply(wcDTO.getQtgz()));
+ detailEntity.setNldf(nldf);
+ }
+ list.add(detailEntity);
+ });
+ screenPyHistoryScoreDetailServiceImpl.insertBatch(list);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(HistoryScoreFormDTO formDTO) {
+ ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId());
+ if (entity == null) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息");
+ }
+ //1.更新主表
+ ScreenPyHistoryScoreEntity newEntity = ConvertUtils.sourceToTarget(formDTO, ScreenPyHistoryScoreEntity.class);
+ newEntity.setId(entity.getId());
+ screenPyHistoryScoreDao.updateById(newEntity);
+ //2.更新字表 字表先删后增
+ List list = new ArrayList<>();
+ ScreenPyWeightConfigurationDTO wcDTO = screenPyWeightConfigurationDao.selectOneDTO();
+ formDTO.getDetailList().forEach(dto -> {
+ ScreenPyHistoryScoreDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, ScreenPyHistoryScoreDetailEntity.class);
+ detailEntity.setCustomerId(entity.getCustomerId());
+ detailEntity.setHistoryScoreId(entity.getId());
+ if (null != wcDTO) {
+ BigDecimal nldf = detailEntity.getWghyd().multiply(wcDTO.getWghyd()).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd()))
+ .add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd()))
+ .add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd()));
+ detailEntity.setNldf(nldf);
+ }
+ list.add(detailEntity);
+ });
+ screenPyHistoryScoreDetailDao.delByHistoryScoreId(formDTO.getId(), formDTO.getUserId());
+ screenPyHistoryScoreDetailServiceImpl.insertBatch(list);
+ }
+
+ @Override
+ public void deleteById(HistoryScoreFormDTO formDTO) {
+ ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId());
+ if (entity == null) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息");
+ }
+ entity.setDelFlag("1");
+ screenPyHistoryScoreDao.deleteById(entity);
+ screenPyHistoryScoreDetailDao.delByHistoryScoreId(formDTO.getId(), formDTO.getUserId());
+ }
+
+ @Override
+ public HistoryScoreDetailResultDTO detail(HistoryScoreFormDTO formDTO) {
+ HistoryScoreDetailResultDTO resultDTO = new HistoryScoreDetailResultDTO();
+ //1.主表数据
+ ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId());
+ if (entity == null) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息");
+ }
+ resultDTO = ConvertUtils.sourceToTarget(entity, HistoryScoreDetailResultDTO.class);
+ //2.字表数据
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(ScreenPyHistoryScoreDetailEntity::getHistoryScoreId, formDTO.getId());
+ wrapper.eq(ScreenPyHistoryScoreDetailEntity::getDelFlag, "0");
+ wrapper.orderByDesc(ScreenPyHistoryScoreDetailEntity::getNldf);
+ List list = screenPyHistoryScoreDetailDao.selectList(wrapper);
+ List detailList = ConvertUtils.sourceToTarget(list, HistoryScoreDetailResultDTO.Detail.class);
+ resultDTO.setDetailList(detailList);
+ return resultDTO;
+ }
+
+ @Override
+ public HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO) {
+ HistoryScoreComputeResultDTO resultDTO = new HistoryScoreComputeResultDTO();
+ resultDTO.setAgencyId(formDTO.getAgencyId());
+ //计算百分比使用,保留小数点后两位
+ NumberFormat numberFormat = NumberFormat.getInstance();
+ numberFormat.setMaximumFractionDigits(NumConstant.TWO);
+ if ("grid".equals(formDTO.getType())) {
+ /**
+ * 网格活跃度每周得分=(活跃网格数/本街镇网格数)x100+(正常网格数/本街镇网格数)x80
+ * 1周内每个末级网格有五天及五天以上上传事件或开展例行工作的为活跃网格;有2天及2天以上,5天以下上传事件或开展例行工作的为正常运行网格;只有1天上传事件或开展例行工作的为僵尸网格
+ * 本街镇网格数基于本街镇基础网格总数进行计算,不包含专属网格
+ */
+ //1.获取街道下时间区间内的网格活跃度数据
+ GridLivelyFormDTO form = ConvertUtils.sourceToTarget(formDTO, GridLivelyFormDTO.class);
+ form.setType("historyScore");
+ Result> result = dataAggregatorOpenFeignClient.grdiLively(form);
+ if (!result.success() || result.getData() == null) {
+ throw new RenException("统计街道下网格活跃度数据失败");
+ }
+ if (!CollectionUtils.isEmpty(result.getData())) {
+ GridLivelyResultDTO gridLively = result.getData().get(NumConstant.ZERO);
+ String score = (gridLively.getGridSumNum() <= 0) ? "0" : numberFormat.format(((float) gridLively.getGridLivelyNum() / (float) gridLively.getGridSumNum()) * 100 + ((float)gridLively.getGridOrdinaryNum() / (float)gridLively.getGridSumNum()) * 80);
+ resultDTO.setScore(score);
+ }
+ } else if ("event".equals(formDTO.getType())) {
+ /**
+ * 事件赋分= 街道下末级网格上报事件数量乘以对应的每项事件分值的累加和除以街道下有效未离职状态的网格员总数
+ * 加上街道下末级网格例行工作数量乘以对应的每项事件分值的累加和除以街道下有效未离职状态的网格员总数
+ */
+ //查询街道下时间区间内事件总分
+ HistoryScoreSjffResultDTO dto1 = screenPyHistoryScoreDao.sumEventScore(formDTO);
+ //查询街道下时间区间内例行工作总分
+ HistoryScoreSjffResultDTO dto2 = screenPyHistoryScoreDao.sumProjectScore(formDTO);
+ //查询街道下有效网格员数
+ HistoryScoreSjffResultDTO dto3 = screenPyHistoryScoreDao.sumGridNum(formDTO);
+ String score = numberFormat.format(((float) dto1.getEventScore() / (float) dto3.getGridStaffNum()) + ((float)dto2.getProjectScore() / (float)dto3.getGridStaffNum()));
+ resultDTO.setScore(score);
+ }
+ return resultDTO;
+ }
+
+ /**
+ * 政法能力-历史得分-填完六个数后计算能力得分使用
+ * @param dto
+ * @return
+ */
+ @Override
+ public HistoryScoreComputeResultDTO nldfScore(HistoryScoreFormDTO.Detail dto) {
+ HistoryScoreComputeResultDTO resultDTO = new HistoryScoreComputeResultDTO();
+ resultDTO.setAgencyId(dto.getAgencyId());
+ ScreenPyWeightConfigurationDTO wcDTO = screenPyWeightConfigurationDao.selectOneDTO();
+ if (null != wcDTO) {
+ BigDecimal nldf = dto.getWghyd().multiply(wcDTO.getWghyd()).add(dto.getWghyd().multiply(wcDTO.getWghyd()))
+ .add(dto.getWghyd().multiply(wcDTO.getWghyd())).add(dto.getWghyd().multiply(wcDTO.getWghyd()))
+ .add(dto.getWghyd().multiply(wcDTO.getWghyd())).add(dto.getWghyd().multiply(wcDTO.getWghyd()));
+ resultDTO.setScore(nldf.toString());
+ }
+ return resultDTO;
+ }
+
+ @Override
+ public List dplist(HistoryScoreListFormDTO formDTO) {
+ //按条件查询数据,并做加和取平均值操作
+ List resultList = screenPyHistoryScoreDao.selectDpList(formDTO);
+ Map map = new HashMap<>();
+ map.put("1258587398679126017","榆山街道");map.put("1215437824174608386","锦水街道");
+ map.put("f8d4a6af53b3fc5991ab1434b6ad39b8","东阿镇");map.put("d20a7488eedf5bcfd5231c3771bc0e3d","玫瑰镇");
+ map.put("ea78a8e9252f567517c4a8d60250c714","安城镇");map.put("1234085031077498881","孔村镇");
+ map.put("f279343a67653fc20d8333c6b2e4dbee","孝直镇");map.put("c259c3b1d27f960b9b379fb2886179ba","洪范池镇");
+ resultList.forEach(re->{
+ map.remove(re.getAgencyId());
+ });
+ for (String ma : map.keySet()){
+ HistoryScoreDetailResultDTO.Detail detail = new HistoryScoreDetailResultDTO.Detail();
+ detail.setAgencyId(ma);
+ detail.setAgencyName(map.get(ma));
+ resultList.add(detail);
+ }
+ return resultList;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyWeightConfigurationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyWeightConfigurationServiceImpl.java
new file mode 100644
index 0000000000..e40c30e023
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyWeightConfigurationServiceImpl.java
@@ -0,0 +1,74 @@
+package com.epmet.service.evaluationindex.indexcoll.impl;
+
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.evaluationindex.indexcoll.ScreenPyWeightConfigurationDao;
+import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO;
+import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO;
+import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO;
+import com.epmet.entity.evaluationindex.indexcoll.ScreenPyWeightConfigurationEntity;
+import com.epmet.service.evaluationindex.indexcoll.ScreenPyWeightConfigurationService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 平阴政法能力权重配置
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Slf4j
+@Service
+@DataSource(DataSourceConstant.EVALUATION_INDEX)
+public class ScreenPyWeightConfigurationServiceImpl extends BaseServiceImpl implements ScreenPyWeightConfigurationService {
+
+
+ @Override
+ public PageData list(WeightConfigurationListFormDTO formDTO) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
+ List list = baseDao.selectWeightConfigurationList(formDTO);
+ PageInfo pageInfo = new PageInfo<>(list);
+ return new PageData<>(list, pageInfo.getTotal());
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(WeightConfigurationFormDTO formDTO) {
+ //1.主表新增数据
+ ScreenPyWeightConfigurationEntity entity = ConvertUtils.sourceToTarget(formDTO, ScreenPyWeightConfigurationEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(WeightConfigurationFormDTO formDTO) {
+ ScreenPyWeightConfigurationEntity entity = baseDao.selectById(formDTO.getId());
+ if (entity == null) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息");
+ }
+ ScreenPyWeightConfigurationEntity newEntity = ConvertUtils.sourceToTarget(formDTO, ScreenPyWeightConfigurationEntity.class);
+ newEntity.setId(entity.getId());
+ baseDao.updateById(newEntity);
+ }
+
+ @Override
+ public void deleteById(WeightConfigurationFormDTO formDTO) {
+ ScreenPyWeightConfigurationEntity entity = baseDao.selectById(formDTO.getId());
+ if (entity == null) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息");
+ }
+ entity.setDelFlag("1");
+ baseDao.deleteById(entity);
+ }
+
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPyEventDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPyEventDataService.java
new file mode 100644
index 0000000000..3c060d2ad6
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPyEventDataService.java
@@ -0,0 +1,24 @@
+package com.epmet.service.evaluationindex.screen;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.dto.screen.form.SavePyEventDataFormDTO;
+import com.epmet.entity.evaluationindex.screen.ScreenPyEventDataEntity;
+
+/**
+ * 上报到市平台中间库的事件
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-12-08
+ */
+public interface ScreenPyEventDataService extends BaseService {
+ /**
+ * 保存同步到中间库的数据
+ *
+ * @Param formDTO
+ * @Return
+ * @Author zhaoqifeng
+ * @Date 2022/12/8 11:14
+ */
+ void saveData(SavePyEventDataFormDTO formDTO);
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPyEventDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPyEventDataServiceImpl.java
new file mode 100644
index 0000000000..b916f891a7
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPyEventDataServiceImpl.java
@@ -0,0 +1,95 @@
+package com.epmet.service.evaluationindex.screen.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao;
+import com.epmet.dao.evaluationindex.screen.ScreenPyEventDataDao;
+import com.epmet.dto.screen.form.SavePyEventDataFormDTO;
+import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
+import com.epmet.entity.evaluationindex.screen.ScreenPyEventDataEntity;
+import com.epmet.service.evaluationindex.screen.ScreenPyEventDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * 上报到市平台中间库的事件
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-12-08
+ */
+@Slf4j
+@Service
+@DataSource(DataSourceConstant.EVALUATION_INDEX)
+public class ScreenPyEventDataServiceImpl extends BaseServiceImpl implements ScreenPyEventDataService {
+
+ @Resource
+ private ScreenProjectDataDao screenProjectDataDao;
+ /**
+ * 保存同步到中间库的数据
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return
+ * @Author zhaoqifeng
+ * @Date 2022/12/8 11:14
+ */
+ @Override
+ public void saveData(SavePyEventDataFormDTO formDTO) {
+ if (CollectionUtils.isNotEmpty(formDTO.getProjectList())) {
+ formDTO.getProjectList().forEach(item -> {
+ ScreenPyEventDataEntity entity = new ScreenPyEventDataEntity();
+ entity.setEventId(item.getEventCode().replace("py_", ""));
+ entity.setEventType("project");
+ entity.setEventCreateTime(item.getReportTime());
+ entity.setCategoryCode(item.getEventCategory());
+ ScreenProjectDataEntity project = screenProjectDataDao.selectById(entity.getEventId());
+ if (null != project) {
+ entity.setOrgId(project.getOrgId());
+ entity.setPids(project.getAllParentIds());
+ entity.setTitle(project.getProjectTitle());
+ entity.setStaffName(project.getLinkName());
+ entity.setMobile(project.getLinkMobile());
+ }
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(ScreenPyEventDataEntity::getEventId, entity.getEventId());
+ wrapper.eq(ScreenPyEventDataEntity::getEventType, entity.getEventType());
+ ScreenPyEventDataEntity event = baseDao.selectOne(wrapper);
+ if (null == event) {
+ baseDao.insert(entity);
+ } else {
+ entity.setId(event.getId());
+ baseDao.updateById(entity);
+ }
+ });
+ }
+ if (CollectionUtils.isNotEmpty(formDTO.getWorkList())) {
+ formDTO.getWorkList().forEach(item -> {
+ ScreenPyEventDataEntity entity = new ScreenPyEventDataEntity();
+ entity.setEventId(item.getId());
+ entity.setEventType("work");
+ entity.setEventCreateTime(item.getHappenTime());
+ entity.setCategoryCode(item.getWorkType());
+ entity.setOrgId(item.getOrgId());
+ entity.setPids(item.getPids());
+ entity.setTitle(item.getTitle());
+ entity.setStaffName(item.getStaffName());
+ entity.setMobile(item.getMobile());
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(ScreenPyEventDataEntity::getEventId, entity.getEventId());
+ wrapper.eq(ScreenPyEventDataEntity::getEventType, entity.getEventType());
+ ScreenPyEventDataEntity event = baseDao.selectOne(wrapper);
+ if (null == event) {
+ baseDao.insert(entity);
+ } else {
+ entity.setId(event.getId());
+ baseDao.updateById(entity);
+ }
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyGridStaffDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyGridStaffDao.xml
new file mode 100644
index 0000000000..207b413c14
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyGridStaffDao.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml
new file mode 100644
index 0000000000..1b311eb25c
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.xml
new file mode 100644
index 0000000000..df3891e1b8
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+ UPDATE
+ screen_py_history_score_detail
+ SET
+ updated_by = #{userId},
+ updated_time = NOW(),
+ del_flag = '1'
+ WHERE
+ history_score_id = #{historyScoreId}
+ AND del_flag = '0'
+
+
+
+
+
+
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.xml
new file mode 100644
index 0000000000..4a29b5dc19
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPyEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPyEventDataDao.xml
new file mode 100644
index 0000000000..9f07fd4b0b
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPyEventDataDao.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
index 0115706902..1217ea6875 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
@@ -179,5 +179,9 @@ public class IcPartyActivityDTO implements Serializable {
*/
@JsonIgnore
private Date updatedTime;
-
+ /**
+ * actId不为空小程序
+ * 为空管理平台
+ */
+ private String originName;
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
index 1aed3be19f..b269fa0d5b 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
@@ -86,6 +86,11 @@ public class IcPartyUnitDTO implements Serializable {
*/
private List serviceMatterNameList;
+ /**
+ * 服务事项名称多个按照中文顿号隔开
+ */
+ private String serviceMatterName;
+
/**
* 联系人
*/
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java
new file mode 100644
index 0000000000..255d395e0a
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java
@@ -0,0 +1,110 @@
+package com.epmet.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 公共服务组织管理(烟台需求)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2023-02-03
+ */
+@Data
+public class IcPublicServiceOrgDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 组织ID
+ */
+ private String agencyId;
+
+ /**
+ * AGENCY_ID的pids
+ */
+ private String pids;
+
+ /**
+ * 名称
+ */
+ private String name;
+
+ /**
+ * 1:实有单位;2:社会服务组织3:志愿团队
+ */
+ private String type;
+
+ /**
+ * 联系人
+ */
+ private String contact;
+
+ /**
+ * 联系电话
+ */
+ private String contactMobile;
+
+ /**
+ * 地址
+ */
+ private String address;
+
+ /**
+ * 中心位置经度
+ */
+ private String longitude;
+
+ /**
+ * 中心位置纬度
+ */
+ private String latitude;
+
+ /**
+ * 备注
+ */
+ private String remark;
+
+ /**
+ * 删除标识 0未删除、1已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+ private List serviceMatterList;
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java
new file mode 100644
index 0000000000..64a993efa9
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java
@@ -0,0 +1,90 @@
+package com.epmet.dto;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 公共服务组织服务事项(烟台需求)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2023-02-03
+ */
+@Data
+public class IcPublicServiceOrgServiceMatterDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ @JsonIgnore
+ private String id;
+
+ /**
+ * 客户id
+ */
+ @JsonIgnore
+ private String customerId;
+
+ /**
+ * ic_public_service_org.ID
+ */
+ @JsonIgnore
+ private String orgId;
+
+ /**
+ * ic_service_item_dict.ID
+ */
+ private String categoryId;
+
+ /**
+ * 服务事项编码ic_service_item_dict.CATEGORY_CODE
+ */
+ private String categoryCode;
+
+ /**
+ * 删除标识 0未删除、1已删除
+ */
+ @JsonIgnore
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ @JsonIgnore
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ @JsonIgnore
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ @JsonIgnore
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ @JsonIgnore
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ @JsonIgnore
+ private Date updatedTime;
+
+ /**
+ * 详情页面显示
+ */
+ private String categoryName;
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java
new file mode 100644
index 0000000000..f5aa42b008
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java
@@ -0,0 +1,133 @@
+package com.epmet.dto.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description
+ * @Author yzm
+ * @Date 2023/2/3 15:04
+ */
+@Data
+public class IcPublicServiceOrgFormDTO {
+ public interface AddUserInternalGroup {
+ }
+
+ public interface AddUserShowGroup extends CustomerClientShowGroup {
+ }
+
+ public interface UpdateUserInternalGroup {
+ }
+
+ public interface UpdateUserShowGroup extends CustomerClientShowGroup {
+ }
+
+ /**
+ * 主键
+ */
+ @NotBlank(message = "id为空", groups = UpdateUserInternalGroup.class)
+ private String id;
+
+ /**
+ * 客户id
+ */
+ @NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class})
+ private String customerId;
+
+ /**
+ * 组织ID
+ */
+ @NotBlank(message = "agencyId不能为空",groups =UpdateUserInternalGroup.class )
+ private String agencyId;
+
+ /**
+ * AGENCY_ID的pids
+ */
+ private String pids;
+
+ /**
+ * 名称
+ */
+ @Length(max = 100, groups = AddUserShowGroup.class, message = "最多输入100字")
+ @NotBlank(message = "名称不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
+ private String name;
+
+ /**
+ * 1:实有单位;2:社会服务组织3:志愿团队
+ */
+ @NotBlank(message = "类别不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
+ private String type;
+
+ /**
+ * 联系人
+ */
+ @NotBlank(message = "联系人不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
+ private String contact;
+
+ /**
+ * 联系电话
+ */
+ @NotBlank(message = "联系电话不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
+ private String contactMobile;
+
+ /**
+ * 地址
+ */
+ @NotBlank(message = "地址不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
+ private String address;
+
+ /**
+ * 中心位置经度
+ */
+ private String longitude;
+
+ /**
+ * 中心位置纬度
+ */
+ private String latitude;
+
+ /**
+ * 备注
+ */
+ @Length(max = 500,message = "最多输入500字",groups ={UpdateUserShowGroup.class,AddUserShowGroup.class} )
+ private String remark;
+
+ /**
+ * 删除标识 0未删除、1已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ private List serviceMatterList;
+}
+
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java
new file mode 100644
index 0000000000..d056c4af1d
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java
@@ -0,0 +1,28 @@
+package com.epmet.dto.form;
+
+import com.epmet.commons.tools.dto.form.PageFormDTO;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description
+ * @Author yzm
+ * @Date 2023/2/3 16:02
+ */
+@Data
+public class IcPublicServiceOrgPageFormDTO extends PageFormDTO {
+ private String customerId;
+ private String agencyId;
+ private String name;
+ private List categoryIds;
+ private String type;
+ private String contact;
+ private String contactMobile;
+
+ /**
+ * 工作端当前登录人员
+ */
+ private String currentStaffId;
+}
+
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java
index fb67921cd8..76f6d485db 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java
@@ -1,5 +1,6 @@
package com.epmet.dto.form;
+import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
@@ -15,7 +16,7 @@ import java.util.Date;
*/
@NoArgsConstructor
@Data
-public class PartyActivityFormDTO implements Serializable {
+public class PartyActivityFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -2510068555703677L;
@NotBlank(message = "组织Id不能为空" )
private String agencyId;
@@ -27,7 +28,7 @@ public class PartyActivityFormDTO implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date endTime;
private String serviceMatter;
- private Integer pageNo;
- private Integer pageSize;
+ // private Integer pageNo;
+ // private Integer pageSize;
private String customerId;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java
index ec4a1751dd..f238e5dbe1 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java
@@ -1,5 +1,6 @@
package com.epmet.dto.form;
+import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -12,7 +13,7 @@ import java.io.Serializable;
*/
@NoArgsConstructor
@Data
-public class PartyUnitFormDTO implements Serializable {
+public class PartyUnitFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 1256798619648265622L;
private String customerId;
@@ -22,8 +23,8 @@ public class PartyUnitFormDTO implements Serializable {
private String type;
private String contact;
private String contactMobile;
- private Integer pageNo;
- private Integer pageSize;
+ // private Integer pageNo;
+ // private Integer pageSize;
/**
* 工作端当前登录人员
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java
new file mode 100644
index 0000000000..a596953035
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java
@@ -0,0 +1,87 @@
+package com.epmet.dto.result;
+
+import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description
+ * @Author yzm
+ * @Date 2023/2/3 15:52
+ */
+@Data
+public class IcPublicServiceOrgDetailResDTO {
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 组织ID
+ */
+ private String agencyId;
+
+
+ private String agencyName;
+
+ /**
+ * AGENCY_ID的pids
+ */
+ private String pids;
+
+ /**
+ * 名称
+ */
+ private String name;
+
+ /**
+ * 1:实有单位;2:社会服务组织3:志愿团队
+ */
+ private String type;
+
+ private String typeName;
+
+ /**
+ * 联系人
+ */
+ private String contact;
+
+ /**
+ * 联系电话
+ */
+ private String contactMobile;
+
+ /**
+ * 地址
+ */
+ private String address;
+
+ /**
+ * 中心位置经度
+ */
+ private String longitude;
+
+ /**
+ * 中心位置纬度
+ */
+ private String latitude;
+
+ /**
+ * 备注
+ */
+ private String remark;
+ /**
+ * 服务事项名称
+ * 多个,按照英文逗号隔开
+ */
+ private String serviceMatterName;
+
+ private List serviceMatterList;
+}
+
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java
index 3408b5f724..7a745fa207 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java
@@ -13,6 +13,10 @@ import java.io.Serializable;
public class ServiceItemResultDTO implements Serializable {
private static final long serialVersionUID = -590440160577071133L;
private String categoryId;
+ /**
+ * 分类编码
+ */
+ private String categoryCode;
private String categoryName;
private Integer awardPoint;
private Boolean usableFlag;
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
index 168d343a79..f0906621f7 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
@@ -119,6 +119,7 @@ public interface EpmetHeartOpenFeignClient {
/**
* Desc: 获取联建单位名字
+ * 查询项目处理进展时调用
* @param formDTO
* @author zxc
* @date 2022/5/17 17:53
diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml
index 2ab5b46da6..d812566efc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml
@@ -308,7 +308,7 @@
true
- 192.168.10.165:9876
+ 192.168.10.161:9876
true
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
index 38b63b836d..7e428aa6a0 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
@@ -17,15 +17,21 @@
package com.epmet.controller;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
-import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
-import com.epmet.commons.tools.utils.DateUtils;
-import com.epmet.commons.tools.utils.ExcelUtils;
-import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.*;
+import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
@@ -40,19 +46,23 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcPartyActivityService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
+import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
+import java.io.FileOutputStream;
import java.io.IOException;
-import java.util.ArrayList;
+import java.io.InputStream;
+import java.net.URLEncoder;
+import java.nio.file.Path;
+import java.util.Date;
import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
+import java.util.UUID;
/**
@@ -64,7 +74,7 @@ import java.util.stream.Collectors;
@Slf4j
@RestController
@RequestMapping("icpartyactivity")
-public class IcPartyActivityController {
+public class IcPartyActivityController implements ResultDataResolver {
@Autowired
private IcPartyActivityService icPartyActivityService;
@@ -111,23 +121,36 @@ public class IcPartyActivityController {
}
@PostMapping("export")
- public void export(@RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception {
- List list = icPartyActivityService.list(formDTO);
- List excelList = new ArrayList<>();
- AtomicInteger i = new AtomicInteger(1);
- if (CollectionUtils.isNotEmpty(list)) {
- excelList = list.stream().map(item -> {
- IcPartyActivityExcel excel = new IcPartyActivityExcel();
- excel.setIndex(i.getAndIncrement());
- excel.setUnitName(item.getUnitName());
- excel.setTitle(item.getTitle());
- excel.setAddress(item.getAddress());
- excel.setPeopleCount(item.getPeopleCount());
- excel.setActivityTime(DateUtils.format(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN));
- return excel;
- }).collect(Collectors.toList());
+ public void export(@LoginUser TokenDto tokenDto, @RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setIsPage(false);
+ ExcelWriter excelWriter = null;
+ formDTO.setPageSize(NumConstant.TEN_THOUSAND);
+ int pageNo = formDTO.getPageNo();
+ try {
+ // 这里 需要指定写用哪个class去写
+ String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
+ String fileName = "联建活动".concat(today);
+ excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyActivityExcel.class).build();
+ WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
+ PageData data = null;
+ List list = null;
+ do {
+ data = icPartyActivityService.search(formDTO);
+ list = ConvertUtils.sourceToTarget(data.getList(), IcPartyActivityExcel.class);
+ formDTO.setPageNo(++pageNo);
+ excelWriter.write(list, writeSheet);
+ } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
+
+ } catch (Exception e) {
+ log.error("export exception", e);
+ } finally {
+ // 千万别忘记finish 会帮忙关闭流
+ if (excelWriter != null) {
+ excelWriter.finish();
+ }
}
- ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyActivityExcel.class);
+
}
/**
@@ -141,58 +164,49 @@ public class IcPartyActivityController {
*/
@PostMapping("import")
public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException {
- if (file.isEmpty()) {
- throw new RenException("请上传文件");
+ // 1.暂存文件
+ String originalFilename = file.getOriginalFilename();
+ String extName = originalFilename.substring(originalFilename.lastIndexOf("."));
+
+ Path fileSavePath;
+ try {
+ Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_party_activity", "import");
+ fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName));
+ } catch (IOException e) {
+ String errorMsg = ExceptionUtils.getErrorStackTrace(e);
+ log.error("【联建活动导入】创建临时存储文件失败:{}", errorMsg);
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败");
}
- String originalFilename = file.getOriginalFilename();
- // 校验文件类型
- String extension = FilenameUtils.getExtension(originalFilename);
- if (!"xls".equals(extension) && !"xlsx".equals(extension)) {
- throw new RenException("文件类型不匹配");
+ InputStream is = null;
+ FileOutputStream os = null;
+
+ try {
+ is = file.getInputStream();
+ os = new FileOutputStream(fileSavePath.toString());
+ IOUtils.copy(is, os);
+ } catch (Exception e) {
+ log.error("method exception", e);
+ } finally {
+ org.apache.poi.util.IOUtils.closeQuietly(is);
+ org.apache.poi.util.IOUtils.closeQuietly(os);
}
- //1.查询当前工作人员是否有再导入的党员先锋数据,有则不允许导入,没有则进行新的导入
+ // 2.生成导入任务记录
ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
- importTaskForm.setOriginFileName(file.getOriginalFilename());
importTaskForm.setOperatorId(tokenDto.getUserId());
- importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_UNIT);
- Result result = commonServiceOpenFeignClient.createImportTask(importTaskForm);
- if (!result.success()) {
- throw new RenException(result.getInternalMsg());
- }
-
- // 异步执行导入
- CompletableFuture.runAsync(() -> {
- try {
- Thread.sleep(1000L);
- } catch (InterruptedException e) {
- log.error("method exception", e);
- }
- submitResiImportTask(tokenDto, response, file, result.getData().getTaskId());
- });
- return new Result();
- }
+ importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_ACTIVITY);
+ importTaskForm.setOriginFileName(originalFilename);
- private void submitResiImportTask(TokenDto tokenDto, HttpServletResponse response, MultipartFile file, String importTaskId) {
+ ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm),
+ ServiceConstant.EPMET_COMMON_SERVICE,
+ EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
+ "联建活动导入错误",
+ "联建活动导入失败");
- try {
- icPartyActivityService.importData(tokenDto, response, file, importTaskId);
- } catch (Throwable e) {
- String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e);
- log.error("【导入联建活动信息失败】导入失败:{}", errorMsg);
-
- ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
- importTaskForm.setOperatorId(tokenDto.getUserId());
- importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_ACTIVITY);
- importTaskForm.setTaskId(importTaskId);
- importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
- importTaskForm.setResultDesc("联建活动信息导入失败,请查看系统日志");
- Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm);
- if (!result.success()) {
- throw new RenException(result.getInternalMsg());
- }
- }
+ // 3.执行导入
+ icPartyActivityService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),tokenDto.getCustomerId(),tokenDto.getUserId());
+ return new Result();
}
/**
@@ -214,4 +228,30 @@ public class IcPartyActivityController {
PageData page = icPartyActivityService.getActivityList(tokenDto, formDTO);
return new Result>().ok(page);
}
+
+ /**
+ * 下载联建活动导入模板
+ * @param response
+ * @throws IOException
+ */
+ @RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST})
+ public void downloadTemplate(HttpServletResponse response) throws IOException {
+ response.setCharacterEncoding("UTF-8");
+ response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
+ //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
+ response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+ response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("联建活动导入模板", "UTF-8") + ".xlsx");
+
+ InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/icpartyactivity_import_tem.xlsx");
+ try {
+ ServletOutputStream os = response.getOutputStream();
+ IOUtils.copy(is, os);
+ } finally {
+ if (is != null) {
+ is.close();
+ }
+ }
+ }
+
+
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
index 4545cb226b..d94fcf94ce 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
@@ -1,16 +1,24 @@
package com.epmet.controller;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.AppClientConstant;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
-import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
-import com.epmet.commons.tools.utils.ExcelUtils;
-import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.*;
+import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
@@ -26,20 +34,25 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcPartyUnitService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
+import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLEncoder;
import java.nio.file.Path;
-import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.UUID;
import java.util.stream.Collectors;
@@ -52,18 +65,13 @@ import java.util.stream.Collectors;
@Slf4j
@RestController
@RequestMapping("icpartyunit")
-public class IcPartyUnitController {
+public class IcPartyUnitController implements ResultDataResolver {
@Autowired
private IcPartyUnitService icPartyUnitService;
@Resource
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
- /**
- * 联建单位上传临时目录
- */
- private Path IC_PARTY_UNIT_UPLOAD_DIR;
-
/**
* 联建单位-列表查询
@@ -117,25 +125,38 @@ public class IcPartyUnitController {
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO, HttpServletResponse response) throws Exception {
formDTO.setCustomerId(tokenDto.getCustomerId());
- List list = icPartyUnitService.list(formDTO);
- List excelList = new ArrayList<>();
- AtomicInteger i = new AtomicInteger(1);
- if (CollectionUtils.isNotEmpty(list)) {
- excelList = list.stream().map(item -> {
- IcPartyUnitExcel excel = new IcPartyUnitExcel();
- excel.setIndex(i.getAndIncrement());
- excel.setUnitName(item.getUnitName());
- excel.setContact(item.getContact());
- excel.setContactMobile(item.getContactMobile());
- excel.setType(item.getType());
- excel.setMemberCount(item.getMemberCount());
- excel.setRemark(item.getRemark());
- excel.setSatisfaction(item.getSatisfaction());
- excel.setServiceMatter(String.join(String.valueOf((char) 10), item.getServiceMatterList()));
- return excel;
- }).collect(Collectors.toList());
+ formDTO.setIsPage(false);
+ formDTO.setCurrentStaffId(tokenDto.getUserId());
+ ExcelWriter excelWriter = null;
+ formDTO.setPageSize(NumConstant.TEN_THOUSAND);
+ int pageNo = formDTO.getPageNo();
+ try {
+ // 这里 需要指定写用哪个class去写
+ String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
+ String fileName = "联建单位".concat(today);
+ excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyUnitExcel.class).build();
+ WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
+ PageData data = null;
+ List list = null;
+ do {
+ data = icPartyUnitService.search(formDTO);
+ data.getList().stream().map(item -> {
+ item.setServiceMatterName(StringUtils.join(item.getServiceMatterList(), StrConstant.COMMA_ZH));
+ return item;
+ }).collect(Collectors.toList());
+ list = ConvertUtils.sourceToTarget(data.getList(), IcPartyUnitExcel.class);
+ formDTO.setPageNo(++pageNo);
+ excelWriter.write(list, writeSheet);
+ } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
+
+ } catch (Exception e) {
+ log.error("export exception", e);
+ } finally {
+ // 千万别忘记finish 会帮忙关闭流
+ if (excelWriter != null) {
+ excelWriter.finish();
+ }
}
- ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyUnitExcel.class);
}
/**
@@ -172,42 +193,53 @@ public class IcPartyUnitController {
*/
@PostMapping("import")
public Result importData(@LoginUser TokenDto tokenDto, HttpServletRequest multipartRequest, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException {
+ // 1.暂存文件
+ String originalFilename = file.getOriginalFilename();
+ String extName = originalFilename.substring(originalFilename.lastIndexOf("."));
- if (file.isEmpty()) {
- throw new RenException("请上传文件");
+ Path fileSavePath;
+ try {
+ Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_party_unit", "import");
+ fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName));
+ } catch (IOException e) {
+ String errorMsg = ExceptionUtils.getErrorStackTrace(e);
+ log.error("【联建单位导入】创建临时存储文件失败:{}", errorMsg);
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败");
}
- String originalFilename = file.getOriginalFilename();
- // 校验文件类型
- String extension = FilenameUtils.getExtension(originalFilename);
- if (!"xls".equals(extension) && !"xlsx".equals(extension)) {
- throw new RenException("文件类型不匹配");
+ InputStream is = null;
+ FileOutputStream os = null;
+
+ try {
+ is = file.getInputStream();
+ os = new FileOutputStream(fileSavePath.toString());
+ IOUtils.copy(is, os);
+ } catch (Exception e) {
+ log.error("method exception", e);
+ } finally {
+ org.apache.poi.util.IOUtils.closeQuietly(is);
+ org.apache.poi.util.IOUtils.closeQuietly(os);
}
- //1.查询当前工作人员是否有再导入的党员先锋数据,有则不允许导入,没有则进行新的导入
+ // 2.生成导入任务记录
ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
- importTaskForm.setOriginFileName(file.getOriginalFilename());
importTaskForm.setOperatorId(tokenDto.getUserId());
importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_UNIT);
- Result result = commonServiceOpenFeignClient.createImportTask(importTaskForm);
- if (!result.success()) {
- throw new RenException(result.getInternalMsg());
- }
+ importTaskForm.setOriginFileName(originalFilename);
- // 异步执行导入
- CompletableFuture.runAsync(() -> {
- try {
- Thread.sleep(1000L);
- } catch (InterruptedException e) {
- log.error("method exception", e);
- }
- submitResiImportTask(tokenDto, response, file, result.getData().getTaskId());
- });
+ ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm),
+ ServiceConstant.EPMET_COMMON_SERVICE,
+ EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
+ "联建单位导入错误",
+ "联建单位导入失败");
+
+ // 3.执行导入
+ icPartyUnitService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),tokenDto.getCustomerId(),tokenDto.getUserId());
return new Result();
}
/**
- * @Description 按类型统计单位数量
+ * @Description 按类型统计单位数量、可视化平台-社区党建-联建单位分析-饼图展示分类下的联建单位数量
* @Param dto
* @Return {@link Result< List< OptionDataResultDTO>>}
* @Author zhaoqifeng
@@ -216,7 +248,7 @@ public class IcPartyUnitController {
@PostMapping("typestatistics")
public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
- return new Result>().ok(icPartyUnitService.typeStatistics(formDTO));
+ return new Result>().ok(icPartyUnitService.typeStatistics(formDTO.getAgencyId()));
}
/**
@@ -233,7 +265,8 @@ public class IcPartyUnitController {
}
/**
- * 联建单位-简要信息列表
+ * 可视化平台-社区党建-联建单位分析
+ * 联建单位-简要信息列表展示:单位名称、单位类型
*
* @param form
* @return com.epmet.commons.tools.utils.Result
@@ -266,7 +299,7 @@ public class IcPartyUnitController {
/**
* 计算区域化党建单位的群众满意度
- *
+ * 服务完成后,会发mq
* @param formDTO
* @return
*/
@@ -277,29 +310,9 @@ public class IcPartyUnitController {
return new Result();
}
- private void submitResiImportTask(TokenDto tokenDto, HttpServletResponse response, MultipartFile file, String importTaskId) {
-
- try {
- icPartyUnitService.importData(tokenDto, response, file, importTaskId);
- } catch (Throwable e) {
- String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e);
- log.error("【导入联建单位信息失败】导入失败:{}", errorMsg);
-
- ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
- importTaskForm.setOperatorId(tokenDto.getUserId());
- importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_UNIT);
- importTaskForm.setTaskId(importTaskId);
- importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
- importTaskForm.setResultDesc("联建单位信息导入失败,请查看系统日志");
- Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm);
- if (!result.success()) {
- throw new RenException(result.getInternalMsg());
- }
- }
- }
-
/**
* Desc: 获取联建单位名字
+ * 查询项目处理进展时调用
* @param formDTO
* @author zxc
* @date 2022/5/17 17:53
@@ -310,7 +323,8 @@ public class IcPartyUnitController {
}
/**
- * Desc: 协办单位列表
+ * Desc: 协办单位列表、本来是前端调用,后面需求升级,联建单位+社区自组织同步到了部门中
+ * 此接口已弃用
* @param tokenDto
* @author zxc
* @date 2022/5/18 13:37
@@ -330,4 +344,27 @@ public class IcPartyUnitController {
return new Result();
}
+ /**
+ * 下载联建单位导入模板
+ * @param response
+ * @throws IOException
+ */
+ @RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST})
+ public void downloadTemplate(HttpServletResponse response) throws IOException {
+ response.setCharacterEncoding("UTF-8");
+ response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
+ //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
+ response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+ response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("联建单位导入模板", "UTF-8") + ".xlsx");
+
+ InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/icpartyunit_impoort_tem.xlsx");
+ try {
+ ServletOutputStream os = response.getOutputStream();
+ IOUtils.copy(is, os);
+ } finally {
+ if (is != null) {
+ is.close();
+ }
+ }
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java
new file mode 100644
index 0000000000..ddfd674cfd
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java
@@ -0,0 +1,101 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.constant.AppClientConstant;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.dto.form.IcPublicServiceOrgFormDTO;
+import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO;
+import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO;
+import com.epmet.service.IcPublicServiceOrgService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 公共服务组织管理(烟台需求)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2023-02-03
+ */
+@RestController
+@RequestMapping("icPublicServiceOrg")
+public class IcPublicServiceOrgController {
+
+ @Autowired
+ private IcPublicServiceOrgService icPublicServiceOrgService;
+
+ /**
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @RequestMapping("page")
+ public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgPageFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ //工作端调用的话,赋值当前登录用户id
+ if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){
+ formDTO.setCurrentStaffId(tokenDto.getUserId());
+ }
+ PageData page = icPublicServiceOrgService.page(formDTO);
+ return new Result>().ok(page);
+ }
+
+ @PostMapping("detail/{id}")
+ public Result get(@PathVariable("id") String id){
+ IcPublicServiceOrgDetailResDTO data = icPublicServiceOrgService.get(id);
+ return new Result().ok(data);
+ }
+
+ /**
+ * 新增;名称组织下唯一
+ * @param formDTO
+ * @return
+ */
+ @NoRepeatSubmit
+ @PostMapping("save")
+ public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setCreatedBy(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.AddUserShowGroup.class, IcPublicServiceOrgFormDTO.AddUserInternalGroup.class);
+ icPublicServiceOrgService.save(formDTO);
+ return new Result();
+ }
+
+ /**
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@LoginUser TokenDto tokenDto,@RequestBody IcPublicServiceOrgFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setCreatedBy(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.UpdateUserShowGroup.class, IcPublicServiceOrgFormDTO.UpdateUserInternalGroup.class);
+ icPublicServiceOrgService.update(formDTO);
+ return new Result();
+ }
+
+ /**
+ * 同时删除服务事项表
+ * @param ids
+ * @return
+ */
+ @PostMapping("delete")
+ public Result delete(@RequestBody List ids){
+ if(CollectionUtils.isNotEmpty(ids)){
+ icPublicServiceOrgService.delete(ids);
+ }
+ return new Result();
+ }
+
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
index 7608069b76..b2b12c40e8 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
@@ -87,6 +87,18 @@ public class IcServiceItemDictController {
return new Result>().ok(icServiceItemDictService.queryDictListForSelect(formDTO));
}
+ /**
+ * 烟台的公共服务组织:服务事项列表
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @PostMapping("dict-options")
+ public Result> queryDictOption(@LoginUser TokenDto tokenDto, @RequestBody ServiceItemSelectFormDTO formDTO) {
+ return new Result>().ok(icServiceItemDictService.queryDictOption(formDTO.getType(), tokenDto.getCustomerId()));
+ }
+
/**
* 客户初始化数据
* @Param customerId
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java
new file mode 100644
index 0000000000..227091f5cc
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java
@@ -0,0 +1,21 @@
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO;
+import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO;
+import com.epmet.entity.IcPublicServiceOrgEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 公共服务组织管理(烟台需求)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2023-02-03
+ */
+@Mapper
+public interface IcPublicServiceOrgDao extends BaseDao {
+
+ List pageList(IcPublicServiceOrgPageFormDTO formDTO);
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java
new file mode 100644
index 0000000000..3994195445
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java
@@ -0,0 +1,20 @@
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO;
+import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 公共服务组织服务事项(烟台需求)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2023-02-03
+ */
+@Mapper
+public interface IcPublicServiceOrgServiceMatterDao extends BaseDao {
+
+ List selectServiceMatter(String orgId);
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java
new file mode 100644
index 0000000000..4c044abd5b
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java
@@ -0,0 +1,76 @@
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 公共服务组织管理(烟台需求)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2023-02-03
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("ic_public_service_org")
+public class IcPublicServiceOrgEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 组织ID
+ */
+ private String agencyId;
+
+ /**
+ * AGENCY_ID的pids
+ */
+ private String pids;
+
+ /**
+ * 名称
+ */
+ private String name;
+
+ /**
+ * 1:实有单位;2:社会服务组织3:志愿团队
+ */
+ private String type;
+
+ /**
+ * 联系人
+ */
+ private String contact;
+
+ /**
+ * 联系电话
+ */
+ private String contactMobile;
+
+ /**
+ * 地址
+ */
+ private String address;
+
+ /**
+ * 中心位置经度
+ */
+ private String longitude;
+
+ /**
+ * 中心位置纬度
+ */
+ private String latitude;
+
+ /**
+ * 备注
+ */
+ private String remark;
+
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java
new file mode 100644
index 0000000000..98dd6ebc71
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java
@@ -0,0 +1,44 @@
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 公共服务组织服务事项(烟台需求)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2023-02-03
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("ic_public_service_org_service_matter")
+public class IcPublicServiceOrgServiceMatterEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * ic_public_service_org.ID
+ */
+ private String orgId;
+
+ /**
+ * ic_service_item_dict.ID
+ */
+ private String categoryId;
+
+ /**
+ * 服务事项编码ic_service_item_dict.CATEGORY_CODE
+ */
+ private String categoryCode;
+
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java
index 9ea9544285..4b52917350 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java
@@ -17,9 +17,13 @@
package com.epmet.excel;
-import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
+import java.util.Date;
+
/**
* 联建活动
*
@@ -28,23 +32,31 @@ import lombok.Data;
*/
@Data
public class IcPartyActivityExcel {
-
- @Excel(name = "序号")
- private Integer index;
-
- @Excel(name = "单位名称")
+ @ColumnWidth(20)
+ @ExcelProperty(value = "单位名称")
private String unitName;
- @Excel(name = "活动标题")
+ @ColumnWidth(25)
+ @ExcelProperty(value = "活动标题")
private String title;
- @Excel(name = "活动地址")
+ @ColumnWidth(35)
+ @ExcelProperty(value = "活动地址")
private String address;
- @Excel(name = "服务人数")
+ @ColumnWidth(15)
+ @ExcelProperty(value = "服务人数")
private Integer peopleCount;
- @Excel(name = "活动时间")
- private String activityTime;
-
+ @ColumnWidth(20)
+ @ExcelProperty(value = "活动时间")
+ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date activityTime;
+ /**
+ * actId不为空小程序
+ * 为空管理平台
+ */
+ @ColumnWidth(20)
+ @ExcelProperty(value = "来源")
+ private String originName;
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java
index 6a2d4116ef..6998d20078 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java
@@ -17,9 +17,16 @@
package com.epmet.excel;
-import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
/**
* 联建活动
@@ -28,39 +35,57 @@ import lombok.Data;
* @since v1.0.0 2021-11-19
*/
@Data
-public class IcPartyActivityImportExcel extends ExcelVerifyInfo {
-
- @Excel(name = "单位名称")
- private String unitName;
+public class IcPartyActivityImportExcel extends ExcelVerifyInfo {
- @Excel(name = "服务事项")
- private String serviceMatter;
-
- @Excel(name = "活动标题")
+ @NotBlank(message = "活动标题必填")
+ @Length(max = 50, message = "活动标题最多输入50字")
+ @ExcelProperty(value = "活动标题*")
private String title;
- @Excel(name = "活动目标")
+ @NotBlank(message = "活动目标必填")
+ @Length(max = 100, message = "活动目标最多输入100字")
+ @ExcelProperty(value = "活动目标*")
private String target;
- @Excel(name = "活动内容")
- private String content;
+ @NotNull(message = "服务人数必填")
+ @ExcelProperty(value = "服务人数*")
+ private Integer peopleCount;
- @Excel(name = "活动地址")
+ @NotNull(message = "活动时间不能为空")
+ @ExcelProperty("活动时间*")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date activityTime;
+
+ @NotBlank(message = "详细地址")
+ @Length(max = 250, message = "详细地址最多输入250字")
+ @ExcelProperty(value = "详细地址*")
private String address;
- @Excel(name = "活动地址经度")
- private String longitude;
- @Excel(name = "活动地址纬度")
- private String latitude;
+ @Data
+ public static class ErrorRow {
+ @ColumnWidth(38)
+ @ExcelProperty(value = "活动标题*")
+ private String title;
- @Excel(name = "服务人数")
- private Integer peopleCount;
+ @ColumnWidth(40)
+ @ExcelProperty(value = "活动目标*")
+ private String target;
+
+ @ColumnWidth(10)
+ @ExcelProperty(value = "服务人数*")
+ private Integer peopleCount;
- @Excel(name = "活动时间")
- private String activityTime;
+ @ColumnWidth(25)
+ @ExcelProperty("活动时间*")
+ private Date activityTime;
- @Excel(name = "活动结果")
- private String result;
+ @ColumnWidth(40)
+ @ExcelProperty(value = "详细地址*")
+ private String address;
+ @ColumnWidth(60)
+ @ExcelProperty("错误信息")
+ private String errorInfo;
+ }
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java
index 652542ef62..36e9484acc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java
@@ -17,7 +17,8 @@
package com.epmet.excel;
-import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
@@ -29,30 +30,42 @@ import lombok.Data;
@Data
public class IcPartyUnitExcel {
- @Excel(name = "序号")
- private Integer index;
-
- @Excel(name = "单位名称")
+ @ColumnWidth(30)
+ @ExcelProperty(value = "单位名称")
private String unitName;
- @Excel(name = "分类")
- private String type;
+ @ColumnWidth(25)
+ @ExcelProperty(value = "所属组织")
+ private String agencyName;
+
+ @ColumnWidth(25)
+ @ExcelProperty(value = "分类")
+ private String typeName;
- @Excel(name = "服务事项")
- private String serviceMatter;
+ /**
+ * 服务事项名称多个按照中文顿号隔开
+ */
+ @ColumnWidth(100)
+ @ExcelProperty(value = "服务事项")
+ private String serviceMatterName;
- @Excel(name = "联系人")
+ @ColumnWidth(16)
+ @ExcelProperty(value = "联系人")
private String contact;
- @Excel(name = "联系电话")
+ @ColumnWidth(16)
+ @ExcelProperty(value = "联系电话")
private String contactMobile;
- @Excel(name = "在职党员")
+ @ColumnWidth(18)
+ @ExcelProperty(value = "在职党员数")
private Integer memberCount;
- @Excel(name = "群众满意度")
+ @ColumnWidth(18)
+ @ExcelProperty(value = "群众满意度")
private String satisfaction;
- @Excel(name = "备注")
+ @ColumnWidth(100)
+ @ExcelProperty(value = "备注")
private String remark;
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java
index 13e8f27c6a..b1fd6d7dff 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java
@@ -17,9 +17,14 @@
package com.epmet.excel;
-import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
/**
* 联建单位
@@ -30,33 +35,73 @@ import lombok.Data;
@Data
public class IcPartyUnitImportExcel extends ExcelVerifyInfo {
- @Excel(name = "单位名称")
+ @NotBlank(message = "单位名称必填")
+ @Length(max = 50,message = "单位名称最多输入50字")
+ @ExcelProperty(value = "单位名称*")
private String unitName;
- @Excel(name = "分类")
- private String type;
-
- @Excel(name = "服务事项")
- private String serviceMatter;
+ @NotBlank(message = "分类必填")
+ @ExcelProperty(value = "分类*")
+ private String typeName;
- @Excel(name = "联系人")
+ @Length(max = 30,message = "联系人最多输入30字")
+ @NotBlank(message = "联系人必填")
+ @ExcelProperty(value = "联系人*")
private String contact;
- @Excel(name = "联系电话")
+
+ @Length(max = 30,message = "联系电话最多输入30字")
+ @NotBlank(message = "联系电话必填")
+ @ExcelProperty(value = "联系电话*")
private String contactMobile;
- @Excel(name = "在职党员")
+
+ @NotNull(message = "在职党员必填")
+ @ExcelProperty(value = "在职党员*")
private Integer memberCount;
- @Excel(name = "地址")
+ @Length(max = 500,message = "备注最多输入50字")
+ @ExcelProperty(value = "备注")
+ private String remark;
+
+
+ @Length(max = 250,message = "详细地址最多输入250字")
+ @NotBlank(message = "详细地址必填")
+ @ExcelProperty(value = "详细地址*")
private String address;
- @Excel(name = "中心位置经度")
- private String longitude;
+ @Data
+ public static class ErrorRow {
+ @ColumnWidth(40)
+ @ExcelProperty("单位名称*")
+ private String unitName;
- @Excel(name = "中心位置纬度")
- private String latitude;
+ @ColumnWidth(20)
+ @ExcelProperty("分类*")
+ private String type;
- @Excel(name = "备注")
- private String remark;
+ @ColumnWidth(20)
+ @ExcelProperty("联系人*")
+ private String contact;
+
+ @ColumnWidth(20)
+ @ExcelProperty("联系电话*")
+ private String contactMobile;
+
+ @ColumnWidth(10)
+ @ExcelProperty("在职党员*")
+ private Integer memberCount;
+
+ @ColumnWidth(30)
+ @ExcelProperty("备注")
+ private String remark;
+
+ @ColumnWidth(50)
+ @ExcelProperty("详细地址*")
+ private String address;
+
+ @ColumnWidth(50)
+ @ExcelProperty("错误信息")
+ private String errorInfo;
+ }
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportFailedExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportFailedExcel.java
index 2cd7e44e2a..fe47433803 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportFailedExcel.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportFailedExcel.java
@@ -30,9 +30,27 @@ import lombok.Data;
@Data
public class IcPartyUnitImportFailedExcel extends ExcelVerifyInfo {
- @Excel(name = "单位名称", width = 40)
+ @Excel(name = "单位名称*", width = 40)
private String unitName;
+ @Excel(name = "分类*",width = 20)
+ private String type;
+
+ @Excel(name = "联系人*",width = 20)
+ private String contact;
+
+ @Excel(name = "联系电话*",width = 20)
+ private String contactMobile;
+
+ @Excel(name = "在职党员*",width = 10)
+ private Integer memberCount;
+
+ @Excel(name = "备注",width = 30)
+ private String remark;
+
+ @Excel(name = "详细地址*",width = 50)
+ private String address;
+
@Excel(name = "错误信息", width = 50)
private String errorInfo;
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyActivityImportListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyActivityImportListener.java
new file mode 100644
index 0000000000..26e1d9d2a3
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyActivityImportListener.java
@@ -0,0 +1,111 @@
+package com.epmet.excel.handler;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.read.listener.ReadListener;
+import com.epmet.commons.tools.constant.StrConstant;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
+import com.epmet.commons.tools.exception.ExceptionUtils;
+import com.epmet.commons.tools.exception.ValidateException;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.entity.IcPartyActivityEntity;
+import com.epmet.excel.IcPartyActivityImportExcel;
+import com.epmet.service.impl.IcPartyActivityServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description
+ * @Author yzm
+ * @Date 2023/2/20 15:36
+ */
+@Slf4j
+public class IcPartyActivityImportListener implements ReadListener {
+ /**
+ * 最大条数阈值
+ */
+ public static final int MAX_THRESHOLD = 200;
+ /**
+ * 当前操作用户
+ */
+ private CustomerStaffInfoCacheResult staffInfo;
+ private String customerId;
+ /**
+ * 数据
+ */
+ private List datas = new ArrayList<>();
+
+ /**
+ * 错误项列表
+ */
+ private List errorRows = new ArrayList<>();
+ private IcPartyActivityServiceImpl icPartyActivityService;
+
+ public IcPartyActivityImportListener(String customerId, CustomerStaffInfoCacheResult staffInfo, IcPartyActivityServiceImpl icPartyActivityService) {
+ this.customerId=customerId;
+ this.staffInfo = staffInfo;
+ this.icPartyActivityService = icPartyActivityService;
+ }
+
+
+ @Override
+ public void invoke(IcPartyActivityImportExcel data, AnalysisContext context) {
+ try {
+ // 先校验数据
+ ValidatorUtils.validateEntity(data);
+ IcPartyActivityEntity e = ConvertUtils.sourceToTarget(data, IcPartyActivityEntity.class);
+ e.setCustomerId(customerId);
+ e.setAgencyId(staffInfo.getAgencyId());
+ e.setPids(staffInfo.getAgencyPIds());
+ e.setContent(StrConstant.EPMETY_STR);
+ datas.add(e);
+
+ if (datas.size() == MAX_THRESHOLD) {
+ execPersist();
+ }
+ } catch (Exception e) {
+ String errorMsg = null;
+ if (e instanceof ValidateException) {
+ errorMsg = ((ValidateException) e).getMsg();
+ } else {
+ errorMsg = "未知错误";
+ log.error("【联建活动导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
+ }
+
+ IcPartyActivityImportExcel.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,IcPartyActivityImportExcel.ErrorRow.class);
+ errorRow.setErrorInfo(errorMsg);
+ errorRows.add(errorRow);
+ }
+ }
+
+ @Override
+ public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+ // 最后几条达不到阈值,这里必须再调用一次
+ execPersist();
+ }
+
+
+ /**
+ * 执行持久化
+ */
+ private void execPersist() {
+ try {
+ if (datas != null && datas.size() > 0) {
+ icPartyActivityService.batchPersist(datas);
+ }
+ } finally {
+ datas.clear();
+ }
+ }
+
+ /**
+ * 获取错误行
+ * @return
+ */
+ public List getErrorRows() {
+ return errorRows;
+ }
+}
+
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyUnitExcelImportListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyUnitExcelImportListener.java
new file mode 100644
index 0000000000..eb823af8e4
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyUnitExcelImportListener.java
@@ -0,0 +1,139 @@
+package com.epmet.excel.handler;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.read.listener.ReadListener;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
+import com.epmet.commons.tools.exception.ExceptionUtils;
+import com.epmet.commons.tools.exception.ValidateException;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.entity.IcPartyUnitEntity;
+import com.epmet.excel.IcPartyUnitImportExcel;
+import com.epmet.service.impl.IcPartyUnitServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * @Description
+ * @Author yzm
+ * @Date 2023/2/20 15:36
+ */
+@Slf4j
+public class IcPartyUnitExcelImportListener implements ReadListener {
+ /**
+ * 最大条数阈值
+ */
+ public static final int MAX_THRESHOLD = 200;
+ /**
+ * 当前操作用户
+ */
+ private CustomerStaffInfoCacheResult staffInfo;
+ private String customerId;
+ /**
+ * 数据
+ */
+ private List datas = new ArrayList<>();
+
+ /**
+ * 错误项列表
+ */
+ private List errorRows = new ArrayList<>();
+ private IcPartyUnitServiceImpl icPartyUnitService;
+ //字典表数据
+ private Map partyUnitTypeMap;
+
+ public IcPartyUnitExcelImportListener(String customerId, CustomerStaffInfoCacheResult staffInfo, IcPartyUnitServiceImpl icPartyUnitService,Map partyUnitTypeMap) {
+ this.customerId=customerId;
+ this.staffInfo = staffInfo;
+ this.icPartyUnitService = icPartyUnitService;
+ this.partyUnitTypeMap=partyUnitTypeMap;
+ }
+
+
+ @Override
+ public void invoke(IcPartyUnitImportExcel data, AnalysisContext context) {
+ try {
+ // 先校验数据
+ ValidatorUtils.validateEntity(data);
+ AtomicBoolean bl = new AtomicBoolean(false);
+ StringBuffer errMsg = new StringBuffer("");
+ //先对一下字段值填写是否正确做判断
+ if (!partyUnitTypeMap.containsKey(data.getTypeName())) {
+ errMsg.append("‘返回方式’值填写错误;");
+ bl.set(true);
+ }
+ //错误数据记录到错误文件
+ if (bl.get()) {
+ IcPartyUnitImportExcel.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,IcPartyUnitImportExcel.ErrorRow.class);
+ errorRow.setErrorInfo(errMsg.toString());
+ errorRows.add(errorRow);
+ return;
+ }
+ // 判断名称是否已存在
+ if(icPartyUnitService.checkUnitName(data.getUnitName(),staffInfo.getAgencyId(),null)){
+ IcPartyUnitImportExcel.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,IcPartyUnitImportExcel.ErrorRow.class);
+ errorRow.setErrorInfo("联建单位名称已存在");
+ errorRows.add(errorRow);
+ return;
+ }
+
+ IcPartyUnitEntity e = ConvertUtils.sourceToTarget(data, IcPartyUnitEntity.class);
+ if (partyUnitTypeMap.containsKey(data.getTypeName())) {
+ e.setType(partyUnitTypeMap.get(data.getTypeName()));
+ }
+ e.setCustomerId(customerId);
+ e.setAgencyId(staffInfo.getAgencyId());
+ e.setPids(staffInfo.getAgencyPIds());
+ datas.add(e);
+
+ if (datas.size() == MAX_THRESHOLD) {
+ execPersist();
+ }
+ } catch (Exception e) {
+ String errorMsg = null;
+ if (e instanceof ValidateException) {
+ errorMsg = ((ValidateException) e).getMsg();
+ } else {
+ errorMsg = "未知错误";
+ log.error("【联建单位导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
+ }
+
+ IcPartyUnitImportExcel.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,IcPartyUnitImportExcel.ErrorRow.class);
+ errorRow.setErrorInfo(errorMsg);
+ errorRows.add(errorRow);
+ }
+ }
+
+ @Override
+ public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+ // 最后几条达不到阈值,这里必须再调用一次
+ execPersist();
+ }
+
+
+ /**
+ * 执行持久化
+ */
+ private void execPersist() {
+ try {
+ if (datas != null && datas.size() > 0) {
+ icPartyUnitService.batchPersist(datas);
+ }
+ } finally {
+ datas.clear();
+ }
+ }
+
+ /**
+ * 获取错误行
+ * @return
+ */
+ public List getErrorRows() {
+ return errorRows;
+ }
+}
+
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
index 6fe8225b11..22c559aace 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
@@ -24,10 +24,8 @@ import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyActivityEntity;
-import org.springframework.web.multipart.MultipartFile;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
+import java.nio.file.Path;
import java.util.List;
/**
@@ -88,17 +86,6 @@ public interface IcPartyActivityService extends BaseService {
List options(IcPartyUnitDTO dto);
/**
- * 导入数据
- *
- * @Param tokenDto
- * @Param response
- * @Param file
- * @Return
- * @Author zhaoqifeng
- * @Date 2021/11/29 11:01
- */
- void importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file, String taskId) throws IOException;
-
- /**
- * @Description 按类型统计单位数量
- * @Param formDTO
+ * @Description 按类型统计单位数量、可视化平台-社区党建-联建单位分析-饼图展示分类下的联建单位数量
+ * @Param agencyId
* @Return {@link List< OptionDataResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/8 14:56
*/
- List typeStatistics(PartyActivityFormDTO formDTO);
+ List typeStatistics(String agencyId);
/**
* 联建单位分布
@@ -149,6 +135,7 @@ public interface IcPartyUnitService extends BaseService {
/**
* Desc: 获取联建单位名字
+ * 查询项目处理进展时调用
* @param formDTO
* @author zxc
* @date 2022/5/17 17:53
@@ -165,7 +152,8 @@ public interface IcPartyUnitService extends BaseService {
/**
- * 联建单位-简要信息列表
+ * 可视化平台-社区党建-联建单位分析
+ * 联建单位-简要信息列表展示:单位名称、单位类型
*
* @param form
*/
@@ -187,4 +175,10 @@ public interface IcPartyUnitService extends BaseService {
* @return
*/
List getUnitNames(List unitIds);
+
+ /**
+ * 执行Excel导入
+ * @param filePath
+ */
+ void execAsyncExcelImport(Path filePath, String importTaskId,String customerId,String userId);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java
new file mode 100644
index 0000000000..79bf76d182
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java
@@ -0,0 +1,34 @@
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.form.IcPublicServiceOrgFormDTO;
+import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO;
+import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO;
+import com.epmet.entity.IcPublicServiceOrgEntity;
+
+import java.util.List;
+
+/**
+ * 公共服务组织管理(烟台需求)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2023-02-03
+ */
+public interface IcPublicServiceOrgService extends BaseService {
+
+ /**
+ * 公共服务组织
+ * @param dto
+ * @return
+ */
+ String save(IcPublicServiceOrgFormDTO dto);
+
+ String update(IcPublicServiceOrgFormDTO formDTO);
+
+ void delete(List orgIds);
+
+ IcPublicServiceOrgDetailResDTO get(String id);
+
+ PageData page(IcPublicServiceOrgPageFormDTO formDTO);
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
index 6ed62cbdf2..92a6dc4ef6 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
@@ -81,4 +81,6 @@ public interface IcServiceItemDictService extends BaseService queryDictOption(String type, String customerId);
}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
index 388594a48b..0036e17a81 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
@@ -30,6 +30,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.ActConstant;
import com.epmet.dao.ActInfoDao;
import com.epmet.dao.ActUserRelationDao;
@@ -66,16 +67,13 @@ public class ActInfoServiceImpl extends BaseServiceImpl option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
+ Map option = SpringContextUtils.getBean(IcPartyUnitService.class).option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List unitIds = icActivityUnitRelationService.getUnitList(dto.getId());
List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
detailResultDTO.setUnitIdList(unitIds);
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
index 4d89c1bef8..180877f027 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
@@ -17,25 +17,20 @@
package com.epmet.service.impl;
-import cn.afterturn.easypoi.excel.ExcelExportUtil;
-import cn.afterturn.easypoi.excel.entity.ExportParams;
-import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
+import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.ExceptionUtils;
-import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
-import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.utils.DateUtils;
-import com.epmet.commons.tools.utils.ExcelPoiUtils;
-import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPartyActivityDao;
import com.epmet.dto.IcPartyActivityDTO;
@@ -49,7 +44,7 @@ import com.epmet.entity.IcActivityServiceRelationEntity;
import com.epmet.entity.IcActivityUnitRelationEntity;
import com.epmet.entity.IcPartyActivityEntity;
import com.epmet.excel.IcPartyActivityImportExcel;
-import com.epmet.excel.IcPartyActivityImportFailedExcel;
+import com.epmet.excel.handler.IcPartyActivityImportListener;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.*;
@@ -62,16 +57,16 @@ import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@@ -121,15 +116,17 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(dto -> {
- //联建单位ID与单位名匹配
- List unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA));
- // List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
- // if(CollectionUtils.isEmpty(unitNames)){
- List unitNames=icPartyUnitService.getUnitNames(unitIds);
- // }
- dto.setUnitIdList(unitIds);
- dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA));
- dto.setUnitNameList(unitNames);
+ if(StringUtils.isNotBlank(dto.getUnitId())){
+ //联建单位ID与单位名匹配
+ List unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA));
+ // List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
+ // if(CollectionUtils.isEmpty(unitNames)){
+ List unitNames=icPartyUnitService.getUnitNames(unitIds);
+ // }
+ dto.setUnitIdList(unitIds);
+ dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA));
+ dto.setUnitNameList(unitNames);
+ }
if (StringUtils.isNotEmpty(dto.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfo) {
@@ -151,6 +148,11 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl fileList = new ArrayList<>();
- ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartyActivityImportExcel.class);
- List failList = importResult.getFailList();
- //存放错误数据行号
- if (!org.springframework.util.CollectionUtils.isEmpty(failList)) {
- for (IcPartyActivityImportExcel entity : failList) {
- //打印失败的行 和失败的信息
- log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(entity, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo(entity.getErrorMsg());
- fileList.add(failed);
- }
- }
- List result = importResult.getList();
-
- CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
- //获取服务事项
- List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
- Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
- //获取联建单位
- IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
- unitDTO.setAgencyId(staffInfoCache.getAgencyId());
- Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue));
-
- //1.数据校验
- Iterator iterator = result.iterator();
- while (iterator.hasNext()) {
- IcPartyActivityImportExcel obj = iterator.next();
- //单位名称校验
- if (StringUtils.isBlank(obj.getUnitName())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("单位名称为空");
- fileList.add(failed);
- log.warn(String.format("单位名称为空,行号->%s", obj.getRowNum()));
- iterator.remove();
- } else {
- List unitList = Arrays.asList(obj.getUnitName().split(StrConstant.COMMA));
- unitList.forEach(unit -> {
- if (null == option.get(unit)) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("单位名称不存在");
- fileList.add(failed);
- log.warn(String.format("单位名称不存在,行号->%s", obj.getRowNum()));
- iterator.remove();
- }
- });
- }
- //服务事项校验
- if (StringUtils.isBlank(obj.getServiceMatter())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("服务事项为空");
- fileList.add(failed);
- log.warn(String.format("服务事项为空,行号->%s", obj.getRowNum()));
- iterator.remove();
- } else {
- List serviceList = Arrays.asList(obj.getServiceMatter().split(StrConstant.SEMICOLON));
- serviceList.forEach(service -> {
- if (null == categoryMap.get(service)) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("服务事项不存在");
- fileList.add(failed);
- log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum()));
- iterator.remove();
- }
- });
-
- }
- //活动标题 活动目标 活动内容 活动时间 活动地址 活动地址经度 活动地址纬度 活动结果
- if (StringUtils.isBlank(obj.getTitle())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("活动标题为空");
- fileList.add(failed);
- log.warn(String.format("活动标题为空,行号->%s", obj.getRowNum()));
- iterator.remove();
- } else if (StringUtils.isBlank(obj.getTarget())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("活动目标为空");
- fileList.add(failed);
- log.warn(String.format("活动目标为空,行号->%s", obj.getRowNum()));
- } else if (StringUtils.isBlank(obj.getContent())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("活动内容为空");
- fileList.add(failed);
- log.warn(String.format("活动内容为空,行号->%s", obj.getRowNum()));
- } else if (StringUtils.isBlank(obj.getActivityTime())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("活动时间为空");
- fileList.add(failed);
- log.warn(String.format("活动时间为空,行号->%s", obj.getRowNum()));
- } else if (StringUtils.isBlank(obj.getAddress())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("活动地址为空");
- fileList.add(failed);
- log.warn(String.format("活动地址为空,行号->%s", obj.getRowNum()));
- } else if (StringUtils.isBlank(obj.getLatitude())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("活动地址纬度为空");
- fileList.add(failed);
- log.warn(String.format("活动地址纬度为空,行号->%s", obj.getRowNum()));
- } else if (StringUtils.isBlank(obj.getLongitude())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("活动地址经度为空");
- fileList.add(failed);
- log.warn(String.format("活动地址经度为空,行号->%s", obj.getRowNum()));
- } else if (StringUtils.isBlank(obj.getResult())) {
- IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class);
- failed.setErrorInfo("活动结果为空");
- fileList.add(failed);
- log.warn(String.format("活动结果为空,行号->%s", obj.getRowNum()));
- }
- }
- if (CollectionUtils.isNotEmpty(result)) {
- result.forEach(item -> {
- IcPartyActivityEntity entity = new IcPartyActivityEntity();
- entity.setCustomerId(tokenDto.getCustomerId());
- entity.setAgencyId(staffInfoCache.getAgencyId());
- entity.setPids(staffInfoCache.getAgencyPIds());
- entity.setTitle(item.getTitle());
- entity.setTarget(item.getTarget());
- entity.setContent(item.getContent());
- entity.setPeopleCount(item.getPeopleCount());
- entity.setActivityTime(DateUtils.parse(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN));
- entity.setAddress(item.getAddress());
- entity.setLatitude(item.getLatitude());
- entity.setLongitude(item.getLongitude());
- entity.setResult(item.getResult());
- insert(entity);
-
- //保存活动与单位关系
- icActivityUnitRelationService.deleteByActivity(entity.getId());
- AtomicInteger i = new AtomicInteger(NumConstant.ONE);
- List unitRelationList = Arrays.stream(item.getUnitName().split(StrConstant.COMMA)).map(unit -> {
- IcActivityUnitRelationEntity relation = new IcActivityUnitRelationEntity();
- relation.setCustomerId(entity.getCustomerId());
- relation.setAgencyId(entity.getAgencyId());
- relation.setPids(entity.getPids());
- relation.setActivityId(entity.getId());
- relation.setUnitId(option.get(unit));
- relation.setSort(i.getAndIncrement());
- return relation;
- }).collect(Collectors.toList());
- icActivityUnitRelationService.insertBatch(unitRelationList);
-
- //保存活动与服务关系
- icActivityServiceRelationService.deleteByActivity(entity.getId());
- AtomicInteger j = new AtomicInteger(NumConstant.ONE);
- List serviceRelationList = Arrays.stream(item.getServiceMatter().split(StrConstant.SEMICOLON)).map(service -> {
- IcActivityServiceRelationEntity relation = new IcActivityServiceRelationEntity();
- relation.setCustomerId(entity.getCustomerId());
- relation.setAgencyId(entity.getAgencyId());
- relation.setPids(entity.getPids());
- relation.setActivityId(entity.getId());
- relation.setServiceMatter(categoryMap.get(service));
- relation.setSort(j.getAndIncrement());
- return relation;
- }).collect(Collectors.toList());
- icActivityServiceRelationService.insertBatch(serviceRelationList);
- });
- }
- String str = String.format("共%s条,成功导入%s条。", fileList.size() + result.size(), fileList.size() + result.size() - fileList.size());
-
- if (fileList.size() > NumConstant.ZERO) {
- List numList = fileList.stream().map(IcPartyActivityImportFailedExcel::getRowNum).sorted().collect(Collectors.toList());
- String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、"));
- log.warn(str + "第" + subList + "行未成功!");
- }
-
- //错误数据生成文件,修改导入任务状态
- erroeImport(fileList, taskId, tokenDto.getUserId());
- }
-
- private void erroeImport(List fileList, String importTaskId, String staffId) throws IOException {
- String url = "";
- //1.有错误数据则生成错误数据存放文件传到阿里云服务
- if (CollectionUtils.isNotEmpty(fileList)) {
- Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表", "导入失败的数据列表"),
- IcPartyActivityImportFailedExcel.class, fileList);
- // 文件名
- String resultDescFileName = UUID.randomUUID().toString().concat(".xlsx");
- FileItemFactory factory = new DiskFileItemFactory(16, null);
- FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName);
- OutputStream os = fileItem.getOutputStream();
- Result uploadResult = null;
- try {
- workbook.write(os);
- uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
- } catch (Exception e) {
- String errormsg = ExceptionUtils.getErrorStackTrace(e);
- log.error("【联建活动信息导入】上传错误描述文件:{}", errormsg);
- } finally {
- try {
- os.close();
- } catch (IOException e) {
- String errormsg = ExceptionUtils.getErrorStackTrace(e);
- log.error("【联建活动信息导入】上传错误描述文件关闭输出流:{}", errormsg);
- }
- try {
- fileItem.delete();
- } catch (Exception e) {
- String errormsg = ExceptionUtils.getErrorStackTrace(e);
- log.error("【联建活动信息导入】上传错误描述文件删除临时文件:{}", errormsg);
- }
- }
-
- if (uploadResult == null || !uploadResult.success()) {
- log.error("【联建活动信息导入】调用OSS上传结果描述文件失败");
- } else {
- url = uploadResult.getData().getUrl();
- }
- }
- //2.更新导入任务数据
- ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
- importTaskForm.setOperatorId(staffId);
- importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_ACTIVITY);
- importTaskForm.setTaskId(importTaskId);
- importTaskForm.setResultDescFilePath(url);
- importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS);
- if (CollectionUtils.isNotEmpty(fileList)) {
- importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
- importTaskForm.setResultDesc("联建活动导入存在错误数据");
- }
- Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm);
- if (!result.success()) {
- throw new RenException(result.getInternalMsg());
- }
- }
-
/**
* 联建活动统计
*
@@ -651,4 +411,102 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl errorRows = listener.getErrorRows();
+
+ boolean failed = errorRows.size() > 0;
+ if (failed) {
+ // 生成并上传错误文件
+ try {
+ // 文件生成
+ Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_party_activity", "import", "error_des");
+ String fileName = UUID.randomUUID().toString().concat(".xlsx");
+ errorDescFile = errorDescDir.resolve(fileName);
+
+ FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile());
+ FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName);
+ OutputStream os = fileItem.getOutputStream();
+
+ EasyExcel.write(os, IcPartyActivityImportExcel.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows);
+
+ // 文件上传oss
+ Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
+ if (errorDesFileUploadResult.success()) {
+ errorDesFileUrl = errorDesFileUploadResult.getData().getUrl();
+ }
+ } finally {
+ if (Files.exists(errorDescFile)) {
+ Files.delete(errorDescFile);
+ }
+ }
+ }
+
+ ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO();
+ importFinishTaskForm.setTaskId(importTaskId);
+ importFinishTaskForm.setProcessStatus(failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS);
+ importFinishTaskForm.setOperatorId(userId);
+ importFinishTaskForm.setResultDesc("");
+ importFinishTaskForm.setResultDescFilePath(errorDesFileUrl);
+
+ Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
+ if (!result.success()) {
+ log.error("【联建活动导入】finishImportTask失败");
+ }
+ } catch (Exception e) {
+ String errorMsg = ExceptionUtils.getErrorStackTrace(e);
+ log.error("【联建活动导入】出错:{}", errorMsg);
+
+ ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO();
+ importFinishTaskForm.setTaskId(importTaskId);
+ importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
+ importFinishTaskForm.setOperatorId(userId);
+ importFinishTaskForm.setResultDesc("导入失败");
+
+ Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
+ if (!result.success()) {
+ log.error("【联建活动导入】导入记录状态修改为'完成'失败");
+ }
+ } finally {
+ // 删除临时文件
+ if (Files.exists(filePath)) {
+ try {
+ Files.delete(filePath);
+ } catch (IOException e) {
+ log.error("method exception", e);
+ }
+ }
+ }
+ }
+
+ /**
+ * 批量持久化
+ * @param entities
+ */
+ public void batchPersist(List entities) {
+ entities.forEach(e -> {
+ String id = IdWorker.getIdStr(e);
+ e.setId(id);
+ baseDao.insert(e);
+ });
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
index 0f31a1287d..d0d8c5d541 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
@@ -17,12 +17,11 @@
package com.epmet.service.impl;
-import cn.afterturn.easypoi.excel.ExcelExportUtil;
-import cn.afterturn.easypoi.excel.entity.ExportParams;
-import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
+import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.constant.FieldConstant;
@@ -33,11 +32,9 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.enums.DictTypeEnum;
-import com.epmet.commons.tools.enums.PartyUnitTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
-import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
@@ -45,8 +42,9 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.utils.ExcelPoiUtils;
+import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.UserDemandConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPartyUnitDao;
@@ -59,7 +57,7 @@ import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.entity.IcCommunitySelfOrganizationEntity;
import com.epmet.entity.IcPartyUnitEntity;
import com.epmet.excel.IcPartyUnitImportExcel;
-import com.epmet.excel.IcPartyUnitImportFailedExcel;
+import com.epmet.excel.handler.IcPartyUnitExcelImportListener;
import com.epmet.feign.*;
import com.epmet.service.IcCommunitySelfOrganizationService;
import com.epmet.service.IcPartyUnitService;
@@ -75,18 +73,18 @@ import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
-import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
+import java.nio.file.Files;
+import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;
@@ -102,16 +100,16 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取单位积分
- Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
+ Map pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> {
+ item.setTypeName(unitTypeMap.getData().get(item.getType()));
+ //这是错误的,应该是赋值type,遗留bug, 先不改了....
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA));
@@ -181,8 +181,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取单位积分
- Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
+ Map pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> {
+ item.setTypeName(unitTypeMap.getData().get(item.getType()));
+ //这是错误的,应该是赋值type,遗留bug, 先不改了....
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA));
@@ -210,13 +212,15 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT);
+ Map pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)));
dto.setScore(null == pointMap.get(id) ? NumConstant.ZERO : pointMap.get(id));
// 分类名称
//获取分类名称字典
Result