From aa4b5363339ef6e6399d7989e26b77e5858bf87a Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 18 May 2023 18:00:02 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../enums/LingShanHelpCrowdCommonEnums.java | 88 ++++ .../epmet/dao/LingshanHelpCrowdCanjiDao.java | 16 + .../epmet/dao/LingshanHelpCrowdDabingDao.java | 16 + .../epmet/dao/LingshanHelpCrowdDibaoDao.java | 16 + .../epmet/dao/LingshanHelpCrowdDujuDao.java | 16 + .../dao/LingshanHelpCrowdGaolingDao.java | 16 + .../dao/LingshanHelpCrowdKongchaoDao.java | 16 + .../dao/LingshanHelpCrowdLiushouDao.java | 16 + .../epmet/dao/LingshanHelpCrowdTekunDao.java | 16 + .../entity/LingshanHelpCrowdBaseEntity.java | 34 ++ .../entity/LingshanHelpCrowdCanjiEntity.java | 52 +++ .../entity/LingshanHelpCrowdDabingEntity.java | 47 ++ .../entity/LingshanHelpCrowdDibaoEntity.java | 118 +++++ .../entity/LingshanHelpCrowdDujuEntity.java | 52 +++ .../LingshanHelpCrowdGaolingEntity.java | 57 +++ .../LingshanHelpCrowdKongchaoEntity.java | 52 +++ .../LingshanHelpCrowdLiushouEntity.java | 57 +++ .../entity/LingshanHelpCrowdTekunEntity.java | 118 +++++ .../LingShanHelpCrowdExcelConverter.java | 156 +++++++ .../data/LingShanHelpCrowdBaseExcelData.java | 44 ++ .../data/LingshanHelpCrowdCanjiExcelData.java | 60 +++ .../LingshanHelpCrowdDabingExcelData.java | 50 +++ .../data/LingshanHelpCrowdDibaoExcelData.java | 136 ++++++ ...ingshanHelpCrowdDujuKongchaoExcelData.java | 61 +++ .../LingshanHelpCrowdLiushouExcelData.java | 60 +++ .../data/LingshanHelpCrowdTekunExcelData.java | 137 ++++++ ...tLingShanHelpCrowdExcelImportListener.java | 409 ++++++++++++++++++ .../service/LingShanHelpCrowdService.java | 103 +++++ .../mapper/LingshanHelpCrowdCanjiDao.xml | 27 ++ .../mapper/LingshanHelpCrowdDabingDao.xml | 26 ++ .../mapper/LingshanHelpCrowdDibaoDao.xml | 40 ++ .../mapper/LingshanHelpCrowdDujuDao.xml | 28 ++ .../mapper/LingshanHelpCrowdGaolingDao.xml | 28 ++ .../mapper/LingshanHelpCrowdKongchaoDao.xml | 28 ++ .../mapper/LingshanHelpCrowdLiushouDao.xml | 28 ++ .../mapper/LingshanHelpCrowdTekunDao.xml | 40 ++ 37 files changed, 2265 insertions(+), 1 deletion(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanHelpCrowdCommonEnums.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdCanjiDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDabingDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDibaoDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDujuDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdGaolingDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdKongchaoDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdLiushouDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdTekunDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdBaseEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdCanjiEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDabingEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdGaolingEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdKongchaoEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdLiushouEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanHelpCrowdExcelConverter.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanHelpCrowdBaseExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDabingExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuKongchaoExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdLiushouExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdCanjiDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDabingDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDibaoDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDujuDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdGaolingDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdKongchaoDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdLiushouDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdTekunDao.xml diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 28e9fae188..d40f38cbd4 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.140:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.140:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: root #oracle配置 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanHelpCrowdCommonEnums.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanHelpCrowdCommonEnums.java new file mode 100644 index 0000000000..5e5f3486df --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanHelpCrowdCommonEnums.java @@ -0,0 +1,88 @@ +package com.epmet.enums; + +/** + * @Description 灵山重点帮扶人员通用枚举 + * @Author wangxianzhang + * @Time 2023/5/18 3:25 PM + */ +public enum LingShanHelpCrowdCommonEnums { + HJLX_NC(100, "农村户籍"), + + HJLX_CZ(101, "城镇户籍"), + + DBLX_NC(200, "农村低保"), + + DBLX_CZ(201, "城镇低保"), + + LDNL_NO(300, "无"), + + LDNL_BFSS(301, "部分丧失劳动能力"), + + LDNL_WQSS(302, "完全丧失劳动能力"), + + JKZK_YB(400, "一般或较弱"), + + JKZK_LH(401, "健康或良好"), + + CBLX_CX(500, "城乡居民基本医疗保险"), + + CBLX_ZG(501, "职工医疗保险"), + + CBLX_NH(502, "新型农村合作医疗"), + + JZJJSFS_QT(600, "其他"), + + JZJJSFS_BC(601, "补差"), + + ZLQK_BUZL(700, "不能自理"), + + ZLQK_NGZL(701, "能够自理"), + + SHZLNL_JB(800, "具备生活自理能力"), + + SHZLNL_BFSS(801, "部分丧失生活能力"), + + SHZLNL_WQSS(802, "完全丧失生活自理能力"), + + GYFS_JZGY(900, "集中供养"), + + GYFS_FSGY(901, "分散供养"), + JZZK_KC(1000, "空巢"), + JZZK_DU(1001, "独居"); + + private int code; + private String name; + + LingShanHelpCrowdCommonEnums(int code, String name) { + this.code = code; + this.name = name; + } + + public static LingShanHelpCrowdCommonEnums getByCode(int code) { + for (LingShanHelpCrowdCommonEnums value : LingShanHelpCrowdCommonEnums.values()) { + if (value.code == code) { + return value; + } + } + + return null; + } + + public static LingShanHelpCrowdCommonEnums getByName(String name) { + for (LingShanHelpCrowdCommonEnums value : LingShanHelpCrowdCommonEnums.values()) { + if (value.name.equals(name)) { + return value; + } + } + + return null; + } + + public int getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdCanjiDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdCanjiDao.java new file mode 100644 index 0000000000..6ba32c69d8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdCanjiDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdCanjiEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 重点帮扶-残疾人 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Mapper +public interface LingshanHelpCrowdCanjiDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDabingDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDabingDao.java new file mode 100644 index 0000000000..91cd4c6c1f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDabingDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdDabingEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 重点帮扶-大病 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Mapper +public interface LingshanHelpCrowdDabingDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDibaoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDibaoDao.java new file mode 100644 index 0000000000..5d09294b16 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDibaoDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdDibaoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 重点帮扶-低保 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Mapper +public interface LingshanHelpCrowdDibaoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDujuDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDujuDao.java new file mode 100644 index 0000000000..c149790a6c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdDujuDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdDujuEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 重点帮扶-独居老人 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Mapper +public interface LingshanHelpCrowdDujuDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdGaolingDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdGaolingDao.java new file mode 100644 index 0000000000..13c18143fa --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdGaolingDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdGaolingEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 重点帮扶-高龄老人 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Mapper +public interface LingshanHelpCrowdGaolingDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdKongchaoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdKongchaoDao.java new file mode 100644 index 0000000000..849da5ec42 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdKongchaoDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdKongchaoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 重点帮扶-空巢老人 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Mapper +public interface LingshanHelpCrowdKongchaoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdLiushouDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdLiushouDao.java new file mode 100644 index 0000000000..1c68de449b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdLiushouDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdLiushouEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 重点帮扶-留守儿童 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Mapper +public interface LingshanHelpCrowdLiushouDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdTekunDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdTekunDao.java new file mode 100644 index 0000000000..42989ab2b8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdTekunDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdTekunEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 重点帮扶-特困人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Mapper +public interface LingshanHelpCrowdTekunDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdBaseEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdBaseEntity.java new file mode 100644 index 0000000000..5abe3dbc0b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdBaseEntity.java @@ -0,0 +1,34 @@ +package com.epmet.entity; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; + +/** + * 重点帮扶-基础entity + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +public class LingshanHelpCrowdBaseEntity extends BaseEpmetEntity { + + /** + * 客户Id + */ + private String customerId; + + /** + * org id路径,:分割 + */ + private String orgIdPath; + + /** + * 居民id + */ + private String resiId; + + /** + * 证件号 + */ + private String idCard; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdCanjiEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdCanjiEntity.java new file mode 100644 index 0000000000..9e29452f2e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdCanjiEntity.java @@ -0,0 +1,52 @@ +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-05-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_canji") +public class LingshanHelpCrowdCanjiEntity extends LingshanHelpCrowdBaseEntity { + + /** + * 残疾证号 + */ + private String cjzh; + + /** + * 残疾类别 + */ + private String cjlb; + + /** + * 残疾登记(状况) + */ + private String cjzk; + + /** + * 有效期开始时间 + */ + private Date validityStart; + + /** + * 是否在世。0否,1是 + */ + private Integer living; + + /** + * 去世时间 + */ + private Date dieDate; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDabingEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDabingEntity.java new file mode 100644 index 0000000000..cd97bc5293 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDabingEntity.java @@ -0,0 +1,47 @@ +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-05-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_dabing") +public class LingshanHelpCrowdDabingEntity extends LingshanHelpCrowdBaseEntity { + + /** + * 所患病种(大病) + */ + private String shbz; + + /** + * 患病时间 + */ + private Date hbsj; + + /** + * 救助情况 + */ + private String jzqk; + + /** + * 救助金额(元) + */ + private Integer jzje; + + /** + * 个人负担(元) + */ + private Integer grfd; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java new file mode 100644 index 0000000000..439df1298d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java @@ -0,0 +1,118 @@ +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.math.BigDecimal; +import java.util.Date; + +/** + * 重点帮扶-低保 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_dibao") +public class LingshanHelpCrowdDibaoEntity extends LingshanHelpCrowdBaseEntity { + + /** + * 户籍类型。0农村户籍,1城镇户籍 + */ + private Integer hjlx; + + /** + * 低保类型。0农村低保,1城镇低保 + */ + private Integer dblx; + + /** + * 低保(特困)证号 + */ + private String dbzh; + + /** + * 婚姻状况(字典) + */ + private Integer hyzk; + + /** + * 就业情况(字典) + */ + private Integer jyqk; + + /** + * 年收入 + */ + private Integer nsr; + + /** + * 是否残疾【是:1 否:0】 + */ + private Integer isCj; + + /** + * 是否有劳动能力。【0:无,1:部分丧失劳动能力,2:完全丧失劳动能力】 + */ + private Integer ynLdnl; + + /** + * 健康状况【0:一般或较弱,1:健康或良好】 + */ + private Integer jkzk; + + /** + * 所患病种 + */ + private String shbz; + + /** + * 参保类型【0城乡居民基本医疗保险,1职工医疗保险,2新型农村合作医疗】 + */ + private Integer cblx; + + /** + * 最初享受月份 + */ + private String zcxsyf; + + /** + * 是否建档立卡扶贫对象。0否,1是 + */ + private Integer jdlkfpdx; + + /** + * 开户银行 + */ + private String khyh; + + /** + * 户头名称 + */ + private String htmc; + + /** + * 银行账号(一本通账号) + */ + private String yhzh; + + /** + * 户月保障金额(元) + */ + private BigDecimal hybzje; + + /** + * 人员附加政策(元) + */ + private BigDecimal ryfjzc; + + /** + * 救助金计算方式【0其他,1补差】 + */ + private Integer jzjjsfs; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java new file mode 100644 index 0000000000..9ff11df213 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java @@ -0,0 +1,52 @@ +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-05-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_duju") +public class LingshanHelpCrowdDujuEntity extends LingshanHelpCrowdBaseEntity { + + /** + * 监护人姓名 + */ + private String jhrxm; + + /** + * 监护人电话 + */ + private String jhrdh; + + /** + * 监护人与老人关系 + */ + private String jhrylrgx; + + /** + * 健康状况【0:一般或较弱,1:健康或良好】 + */ + private String jkzk; + + /** + * 子女探视间隔时间 + */ + private String tsjg; + + /** + * 帮扶及其他情况说明 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdGaolingEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdGaolingEntity.java new file mode 100644 index 0000000000..e460d62d06 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdGaolingEntity.java @@ -0,0 +1,57 @@ +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-05-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_gaoling") +public class LingshanHelpCrowdGaolingEntity extends LingshanHelpCrowdBaseEntity { + + /** + * 银行卡号 + */ + private String yhzh; + + /** + * 津贴金额(元) + */ + private String jtje; + + /** + * 津贴发放情况说明 + */ + private String ffqk; + + /** + * 自理情况【0不能自理,1能够自理】 + */ + private Integer zlqk; + + /** + * 监护人姓名 + */ + private String jhrxm; + + /** + * 监护人电话 + */ + private String jhrdh; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdKongchaoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdKongchaoEntity.java new file mode 100644 index 0000000000..b3f6663e96 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdKongchaoEntity.java @@ -0,0 +1,52 @@ +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-05-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_kongchao") +public class LingshanHelpCrowdKongchaoEntity extends LingshanHelpCrowdBaseEntity { + + /** + * 监护人姓名 + */ + private String jhrxm; + + /** + * 监护人电话 + */ + private String jhrdh; + + /** + * 监护人与老人关系 + */ + private String jhrylrgx; + + /** + * 健康状况【0:一般或较弱,1:健康或良好】 + */ + private String jkzk; + + /** + * 子女探视间隔时间 + */ + private String tsjg; + + /** + * 帮扶及其他情况说明 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdLiushouEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdLiushouEntity.java new file mode 100644 index 0000000000..63f3bcc226 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdLiushouEntity.java @@ -0,0 +1,57 @@ +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-05-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_liushou") +public class LingshanHelpCrowdLiushouEntity extends LingshanHelpCrowdBaseEntity { + + /** + * 监护人姓名 + */ + private String jhrxm; + + /** + * 监护人电话 + */ + private String jhrdh; + + /** + * 与监护人关系 + */ + private String yjhrgx; + + /** + * 所在学校及班级 + */ + private String szxxjbj; + + /** + * 班主任姓名 + */ + private String bzrxm; + + /** + * 班主任电话 + */ + private String bzrdh; + + /** + * 帮扶情况及其他说明 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java new file mode 100644 index 0000000000..f1c2df0f17 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java @@ -0,0 +1,118 @@ +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.math.BigDecimal; +import java.util.Date; + +/** + * 重点帮扶-特困人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_tekun") +public class LingshanHelpCrowdTekunEntity extends LingshanHelpCrowdBaseEntity { + + /** + * 户籍类型。0农村户籍,1城镇户籍 + */ + private Integer hjlx; + + /** + * 低保(特困)证号 + */ + private Integer dbzh; + + /** + * 婚姻状况(字典) + */ + private Integer hyzk; + + /** + * 就业情况(字典) + */ + private Integer jyqk; + + /** + * 年收入 + */ + private Integer nsr; + + /** + * 是否残疾【是:1 否:0】 + */ + private Integer isCj; + + /** + * 生活自理能力。0具备生活自理能力,1部分丧失生活能力,2完全丧失生活自理能力 + */ + private Integer shzlnl; + + /** + * 健康状况【0:一般或较弱,1:健康或良好】 + */ + private Integer jkzk; + + /** + * 所患病种 + */ + private String shbz; + + /** + * 参保类型【0城乡居民基本医疗保险,1职工医疗保险,2新型农村合作医疗】 + */ + private Integer cblx; + + /** + * 最初享受月份 + */ + private String zcxsyf; + + /** + * 是否建档立卡扶贫对象。0否,1是 + */ + private Integer jdlkfpdx; + + /** + * 开户银行 + */ + private String khyh; + + /** + * 户头名称 + */ + private String htmc; + + /** + * 银行账号(一本通账号) + */ + private String yhzh; + + /** + * 供养方式。0集中供养,1分散供养 + */ + private Integer gyfs; + + /** + * 供养机构名称 + */ + private Integer gyjgmc; + + /** + * 基本生活标准(元) + */ + private BigDecimal jbshbz; + + /** + * 照料护理费用(元) + */ + private BigDecimal zlhlfy; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanHelpCrowdExcelConverter.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanHelpCrowdExcelConverter.java new file mode 100644 index 0000000000..641c24fc3b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanHelpCrowdExcelConverter.java @@ -0,0 +1,156 @@ +package com.epmet.excel.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.enums.LingShanHelpCrowdCommonEnums; +import com.epmet.feign.EpmetAdminOpenFeignClient; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +public class LingShanHelpCrowdExcelConverter implements Converter , ResultDataResolver { + + public static final List DICT_COLUMNS = Arrays.asList("cjdj", "cjlb", "hyzk", "jyqk"); + + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + { + adminOpenFeignClient = SpringContextUtils.getBean(EpmetAdminOpenFeignClient.class); + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Class supportJavaTypeKey() { + return Integer.class; + } + + /** + * @Description: 将label转化为字典值 + * @param cellData: + * @param contentProperty: + * @param globalConfiguration: + * @Return java.lang.Integer + * @Author: wangxianzhang + * @Date: 2023/5/18 4:40 PM + */ + @Override + public Integer convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { + String fieldName = contentProperty.getField().getName(); + String value = cellData.getStringValue(); + + if (DICT_COLUMNS.contains(fieldName)) { + // 是字典,查字典 + String dictValue = getValueFromDict(fieldName, value); + return Integer.valueOf(dictValue); + } + + // 不是字典,那么遍历枚举 + LingShanHelpCrowdCommonEnums enumObj = LingShanHelpCrowdCommonEnums.getByName(value); + if (enumObj == null) { + return null; + } else { + return enumObj.getCode(); + } + } + + /** + * @Description: 将字典值转化为label + * @param value: + * @param contentProperty: + * @param globalConfiguration: + * @Return com.alibaba.excel.metadata.data.WriteCellData + * @Author: wangxianzhang + * @Date: 2023/5/18 4:40 PM + */ + @Override + public WriteCellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { + + String fieldName = contentProperty.getField().getName(); + + if (DICT_COLUMNS.contains(fieldName)) { + // 是字典,查字典 + if (value == null) { + return null; + } + String dictLabel = getLabelFromDict(fieldName, value.toString()); + return new WriteCellData<>(dictLabel); + } + + // 不是字典,那么遍历枚举 + LingShanHelpCrowdCommonEnums enumObj = LingShanHelpCrowdCommonEnums.getByCode(value); + if (enumObj == null) { + return null; + } else { + return new WriteCellData<>(enumObj.getName()); + } + } + + private String getDictTypeFromFieldName(String fieldName) { + String dictType; + if ("cjlb".equals(fieldName)) { + dictType = "disability_category_code"; + } else if ("cjdj".equals(fieldName)) { + dictType = "disability_level"; + } else if("hyzk".equals(fieldName)) { + dictType = "marriage"; + } else if ("jyqk".equals(fieldName)) { + dictType = "job"; + } else { + logger.error("【灵山-重点帮扶】导入:未找到对应的字典类型,fieldName:" + fieldName); + return null; + } + + return dictType; + } + + /** + * @Description: 根据值获取label + * @param fieldName: + * @param value: + * @Return java.lang.String + * @Author: wangxianzhang + * @Date: 2023/5/18 4:36 PM + */ + private String getLabelFromDict(String fieldName, String value) { + Map dictMap; + String dictType = getDictTypeFromFieldName(fieldName); + dictMap = getResultDataOrReturnNull(adminOpenFeignClient.dictMap(dictType), ServiceConstant.EPMET_ADMIN_SERVER); + + return dictMap.get(value); + } + + /** + * @Description: 从字典,根据label查找值 + * @param fieldName: + * @param label: + * @Return java.lang.String + * @Author: wangxianzhang + * @Date: 2023/5/18 4:36 PM + */ + private String getValueFromDict(String fieldName, String label) { + Map dictMap; + String dictType = getDictTypeFromFieldName(fieldName); + + dictMap = getResultDataOrReturnNull(adminOpenFeignClient.dictMap(dictType), ServiceConstant.EPMET_ADMIN_SERVER); + + for (Map.Entry entry : dictMap.entrySet()) { + if (entry.getValue().equals(label)) { + return entry.getKey(); + } + } + + return null; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanHelpCrowdBaseExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanHelpCrowdBaseExcelData.java new file mode 100644 index 0000000000..71919be3c4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanHelpCrowdBaseExcelData.java @@ -0,0 +1,44 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * + */ +@Data +public class LingShanHelpCrowdBaseExcelData { + /** + * 姓名 + */ + @ExcelProperty(value = "*姓名") + @NotBlank(message = "姓名不能为空") + private String name; + /** + * 证件号 + */ + @ExcelProperty(value = "*身份证号") + @NotBlank(message = "身份证号不能为空") + private String idCard; + + /** + * 错误信息 + */ + @ExcelProperty(value = "错误信息") + private String errorInfo; + + /** + * 居民id + */ + @ExcelIgnore + private String resiId; + + /** + * 网格id + */ + @ExcelIgnore + private String resiGridId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java new file mode 100644 index 0000000000..685194c606 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java @@ -0,0 +1,60 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 重点帮扶-残疾人 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +public class LingshanHelpCrowdCanjiExcelData extends LingShanHelpCrowdBaseExcelData { + + /** + * 残疾证号 + */ + @ExcelProperty(value = "*残疾证号") + private String cjzh; + + /** + * 残疾类别,字典 + */ + @ExcelProperty(value = "*残疾类型", converter = LingShanHelpCrowdExcelConverter.class) + private String cjlb; + + /** + * 残疾登记(状况) 字典 + */ + @ExcelProperty(value = "*残疾等级", converter = LingShanHelpCrowdExcelConverter.class) + private String cjzk; + + /** + * 有效期开始时间 + */ + @ExcelProperty(value = "有效期开始时间") + @DateTimeFormat("yyyy/MM/dd") + private Date validityStart; + + /** + * 是否在世。0否,1是 + */ + @ExcelProperty(value = "是否在世", converter = LingShanHelpCrowdExcelConverter.class) + private Integer living; + + /** + * 去世时间 + */ + @ExcelProperty(value = "去世时间") + @DateTimeFormat("yyyy/MM/dd") + private Date dieDate; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDabingExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDabingExcelData.java new file mode 100644 index 0000000000..93e0dd353b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDabingExcelData.java @@ -0,0 +1,50 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +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-05-18 + */ +@Data +public class LingshanHelpCrowdDabingExcelData extends LingShanHelpCrowdBaseExcelData { + + /** + * 所患病种(大病) + */ + @ExcelProperty(value = "*患病病种") + private String shbz; + + /** + * 患病时间 + */ + @ExcelProperty(value = "*患病时间") + private Date hbsj; + + /** + * 救助情况 + */ + @ExcelProperty(value = "救助情况说明") + private String jzqk; + + /** + * 救助金额(元) + */ + @ExcelProperty(value = "救助金额(元)") + private Integer jzje; + + /** + * 个人负担(元) + */ + @ExcelProperty(value = "个人负担(元)") + private Integer grfd; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java new file mode 100644 index 0000000000..99ddc2e9fd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java @@ -0,0 +1,136 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; +import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 重点帮扶-低保 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +public class LingshanHelpCrowdDibaoExcelData { + + /** + * 户籍类型。0农村户籍,1城镇户籍 + */ + @ExcelProperty(value = "*户籍类型", converter = LingShanHelpCrowdExcelConverter.class) + private Integer hjlx; + + /** + * 低保类型。0农村低保,1城镇低保 + */ + @ExcelProperty(value = "*低保类型", converter = LingShanHelpCrowdExcelConverter.class) + private Integer dblx; + + /** + * 低保(特困)证号 + */ + @ExcelProperty(value = "*低保(特困)证号") + private String dbzh; + + /** + * 婚姻状况(字典) + */ + @ExcelProperty(value = "婚姻状况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer hyzk; + + /** + * 就业情况(字典) + */ + @ExcelProperty(value = "就业情况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer jyqk; + + /** + * 年收入 + */ + @ExcelProperty(value = "年收入(元)") + private Integer nsr; + + /** + * 是否残疾【是:1 否:0】 + */ + @ExcelProperty(value = "是否残疾人", converter = LingShanSpecialCrowdYesOrNoConverter.class) + private Integer isCj; + + /** + * 是否有劳动能力。【0:无,1:部分丧失劳动能力,2:完全丧失劳动能力】 + */ + @ExcelProperty(value = "劳动能力", converter = LingShanHelpCrowdExcelConverter.class) + private Integer ynLdnl; + + /** + * 健康状况【0:一般或较弱,1:健康或良好】 + */ + @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer jkzk; + + /** + * 所患病种 + */ + @ExcelProperty(value = "患病病种") + private String shbz; + + /** + * 参保类型【0城乡居民基本医疗保险,1职工医疗保险,2新型农村合作医疗】 + */ + @ExcelProperty(value = "参保类型", converter = LingShanHelpCrowdExcelConverter.class) + private Integer cblx; + + /** + * 最初享受月份 + */ + @ExcelProperty(value = "最初享受月份") + private String zcxsyf; + + /** + * 是否建档立卡扶贫对象。0否,1是 + */ + @ExcelProperty(value = "是否建档立卡扶贫对象", converter = LingShanSpecialCrowdYesOrNoConverter.class) + private Integer jdlkfpdx; + + /** + * 开户银行 + */ + @ExcelProperty(value = "开户银行") + private String khyh; + + /** + * 户头名称 + */ + @ExcelProperty(value = "户头名称") + private String htmc; + + /** + * 银行账号(一本通账号) + */ + @ExcelProperty(value = "银行账号(一本通账号)") + private String yhzh; + + /** + * 户月保障金额(元) + */ + @ExcelProperty(value = "户月保障金额(元)") + private BigDecimal hybzje; + + /** + * 人员附加政策(元) + */ + @ExcelProperty(value = "人员附加政策(元)") + private BigDecimal ryfjzc; + + /** + * 救助金计算方式【0其他,1补差】 + */ + @ExcelProperty(value = "救助金计算方式", converter = LingShanHelpCrowdExcelConverter.class) + private Integer jzjjsfs; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuKongchaoExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuKongchaoExcelData.java new file mode 100644 index 0000000000..bc9bd0010f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuKongchaoExcelData.java @@ -0,0 +1,61 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 重点帮扶-独居老人 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +public class LingshanHelpCrowdDujuKongchaoExcelData { + + /** + * 居住状况 + */ + @ExcelProperty(value = "*居住状况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer jzzk; + + /** + * 监护人姓名 + */ + @ExcelProperty(value = "*监护人姓名") + private String jhrxm; + + /** + * 监护人电话 + */ + @ExcelProperty(value = "*监护人电话") + private String jhrdh; + + /** + * 监护人与老人关系 + */ + @ExcelProperty(value = "监护人与老人关系") + private String jhrylrgx; + + /** + * 健康状况【0:一般或较弱,1:健康或良好】 + */ + @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) + private String jkzk; + + /** + * 子女探视间隔时间 + */ + @ExcelProperty(value = "子女探视间隔时间") + private String tsjg; + + /** + * 帮扶及其他情况说明 + */ + @ExcelProperty(value = "帮扶及其他情况说明") + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdLiushouExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdLiushouExcelData.java new file mode 100644 index 0000000000..6bda729fb8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdLiushouExcelData.java @@ -0,0 +1,60 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +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-05-18 + */ +@Data +public class LingshanHelpCrowdLiushouExcelData { + + /** + * 监护人姓名 + */ + @ExcelProperty(value = "*监护人姓名") + private String jhrxm; + + /** + * 监护人电话 + */ + @ExcelProperty(value = "*监护人电话") + private String jhrdh; + + /** + * 与监护人关系 + */ + @ExcelProperty(value = "*与监护人关系") + private String yjhrgx; + + /** + * 所在学校及班级 + */ + @ExcelProperty(value = "*所在学校及班级") + private String szxxjbj; + + /** + * 班主任姓名 + */ + @ExcelProperty(value = "班主任姓名") + private String bzrxm; + + /** + * 班主任电话 + */ + @ExcelProperty(value = "班主任电话") + private String bzrdh; + + /** + * 帮扶情况及其他说明 + */ + @ExcelProperty(value = "帮扶情况及其他说明") + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java new file mode 100644 index 0000000000..564beb02a9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java @@ -0,0 +1,137 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; +import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 重点帮扶-特困人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +public class LingshanHelpCrowdTekunExcelData { + + /** + * 户籍类型。0农村户籍,1城镇户籍 + */ + @ExcelProperty(value = "户籍类型", converter = LingShanHelpCrowdExcelConverter.class) + private Integer hjlx; + + /** + * 低保(特困)证号 + */ + @ExcelProperty(value = "*低保(特困)证号", converter = LingShanHelpCrowdExcelConverter.class) + private Integer dbzh; + + /** + * 婚姻状况(字典) + */ + @ExcelProperty(value = "婚姻状况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer hyzk; + + /** + * 就业情况(字典) + */ + @ExcelProperty(value = "就业情况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer jyqk; + + /** + * 年收入 + */ + @ExcelProperty(value = "年收入(元)") + private Integer nsr; + + /** + * 是否残疾【是:1 否:0】 + */ + @ExcelProperty(value = "是否残疾人", converter = LingShanSpecialCrowdYesOrNoConverter.class) + private Integer isCj; + + /** + * 生活自理能力。0具备生活自理能力,1部分丧失生活能力,2完全丧失生活自理能力 + */ + @ExcelProperty(value = "生活自理能力", converter = LingShanHelpCrowdExcelConverter.class) + private Integer shzlnl; + + /** + * 健康状况【0:一般或较弱,1:健康或良好】 + */ + @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer jkzk; + + /** + * 所患病种 + */ + @ExcelProperty(value = "患病病种") + private String shbz; + + /** + * 参保类型【0城乡居民基本医疗保险,1职工医疗保险,2新型农村合作医疗】 + */ + @ExcelProperty(value = "参保类型", converter = LingShanHelpCrowdExcelConverter.class) + private Integer cblx; + + /** + * 最初享受月份 + */ + @ExcelProperty(value = "最初享受月份") + private String zcxsyf; + + /** + * 是否建档立卡扶贫对象。0否,1是 + */ + @ExcelProperty(value = "是否建档立卡扶贫对象", converter = LingShanSpecialCrowdYesOrNoConverter.class) + private Integer jdlkfpdx; + + /** + * 开户银行 + */ + @ExcelProperty(value = "开户银行") + private String khyh; + + /** + * 户头名称 + */ + @ExcelProperty(value = "户头名称") + private String htmc; + + /** + * 银行账号(一本通账号) + */ + @ExcelProperty(value = "银行账号(一本通账号)") + private String yhzh; + + /** + * 供养方式。0集中供养,1分散供养 + */ + @ExcelProperty(value = "供养方式", converter = LingShanHelpCrowdExcelConverter.class) + private Integer gyfs; + + /** + * 供养机构名称 + */ + @ExcelProperty(value = "供养机构名称") + private Integer gyjgmc; + + /** + * 基本生活标准(元) + */ + @ExcelProperty(value = "基本生活标准(元)") + private BigDecimal jbshbz; + + /** + * 照料护理费用(元) + */ + @ExcelProperty(value = "照料护理费用(元)") + private BigDecimal zlhlfy; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java new file mode 100644 index 0000000000..09632f088b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java @@ -0,0 +1,409 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.bean.PersonSpecialTypeBean; +import com.epmet.commons.tools.distributedlock.DistributedLock; +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.ValidateException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.PidUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.entity.LingshanHelpCrowdBaseEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingShanHelpCrowdBaseExcelData; +import com.epmet.exceptions.ReadExcelHeaderOnlyException; +import com.epmet.service.LingShanSpecialCrowdService; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RLock; + +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 灵山大屏-抽象的导入excel监听器 + */ +@Data +@Slf4j +public abstract class AbstractLingShanHelpCrowdExcelImportListener + extends AnalysisEventListener { + + /** + * @description: 分布式锁 + * @param null: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:43 PM + */ + private DistributedLock distributedLock; + + /** + * 按批次保存,单次最大数据量 + */ + private static final Integer MAX_BATCH_SIZE = 500; + + private String templateFileName; + + /** + * 表头应有行数 + */ + private Integer maxHeadRowNum; + + /** + * 文件的表头中应当有哪些列 + */ + private List headerZhList; + + /** + * @description: 是否只校验表头 + * @param null: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 5:16 PM + */ + private Boolean validateHeaderOnly = false; + + /** + * 当前表头读到了第几行 + */ + private Integer currentHeadRowNum = 0; + + /** + * 原始数据列表 + */ + private List originDatas = new ArrayList<>(); + + /** + * 错误数据列表 + */ + private List errorDatas = new ArrayList<>(); + + /** + * 正确数据 + */ + private List correctDatas = new ArrayList<>(); + + private AtomicInteger correctDatasQty = new AtomicInteger(); + + // 为什么去掉了?因为需求改成了:直接用type根居民基础信息关联 + // private List persons = new ArrayList<>(); + // private List personTypes = new ArrayList<>(); + private List specialTypes = new ArrayList<>(); + + protected LingShanSpecialCrowdService lingShanSpecialCrowdService; + + private Class entityClass; + + private CustomerStaffInfoCacheResult currentStaffInfo; + + private LingShanSpecialCrowdTypeEnums specialCrowdType; + + public AbstractLingShanHelpCrowdExcelImportListener() { + lingShanSpecialCrowdService = SpringContextUtils.getBean(LingShanSpecialCrowdService.class); + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + currentStaffInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + maxHeadRowNum = setMaxHeadRowNum(); + headerZhList = setHeaderZhList(); + specialCrowdType = getSpecialCrowdType(); + entityClass = getEntityClass(); + templateFileName = setTemplateFileName(); + } + + /** + * @param headMap: + * @param context: + * @return + * @description: 表头回调函数,此处做统一表头校验,确认文件内容与当前要导入的数据的字段一致,防止导错类型. + * @author: WangXianZhang + * @date: 2023/4/18 10:42 AM + */ + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + // super.invokeHeadMap(headMap, context); + + if (maxHeadRowNum == null || CollectionUtils.isEmpty(headerZhList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道】社会维稳数据导入-子类未设置header行数以及header字段列表。"); + } + + if ((++currentHeadRowNum).equals(maxHeadRowNum)) { + // 如果是表头最后一行,则校验表头 + List redundentHeaders = new ArrayList<>(); + List lackHeaders = new ArrayList<>(); + + Collection headersFromFile = headMap.values(); + // 2次循环,双向校验 + for (String headerZh : headersFromFile) { + if (StringUtils.isNotBlank(headerZh) && !headerZhList.contains(headerZh)) { + redundentHeaders.add(headerZh); + } + } + + for (String headerZh : headerZhList) { + if (StringUtils.isNotBlank(headerZh) && !headersFromFile.contains(headerZh)) { + lackHeaders.add(headerZh); + } + } + + // 汇总错误字段,成一句话 + String preValidTipStr = ""; + if (CollectionUtils.isNotEmpty(redundentHeaders)) { + preValidTipStr += "多余【" + String.join(",", redundentHeaders) + "】字段。"; + } + + if (CollectionUtils.isNotEmpty(lackHeaders)) { + preValidTipStr += "缺少【" + String.join(",", lackHeaders) + "】必填字段。"; + } + + if (StringUtils.isNotBlank(preValidTipStr)) { + log.error("【灵山街道-社会维稳导入】表格表头不对应," + preValidTipStr); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "上传文件有误!" + preValidTipStr + "请确认表格格式正确"); + } + } + } + + /** + * @description: 行读取回调函数 + * @param row: + * @param context: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:44 PM + */ + @Override + public void invoke(T row, AnalysisContext context) { + if (validateHeaderOnly) { + // 如果仅解析表头,那么抛出异常,外层接住 + throw new ReadExcelHeaderOnlyException(); + } + try { + ValidatorUtils.validateEntity(row); + } catch (ValidateException e) { + // 加入到错误记录中去 + errorDatas.add(row); + return; + } + + originDatas.add(row); + + if (originDatas.size() >= MAX_BATCH_SIZE) { + // 满足了一批次的数量,执行保存 + saveBatchWithLock(); + clear(); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + if (validateHeaderOnly) { + throw new ReadExcelHeaderOnlyException(); + } + + if (originDatas.size() > 0) { + saveBatchWithLock(); + clear(); + } + } + + /** + * @param : + * @return + * @description: 批量保存,带锁的。因为要在Listener中过滤出哪些数据不能导入,返回给前端。 + * 所以需要再lisener中做批量检查,然后批量保存。过程需要一点时间,为了防止并发问题,加分布式锁。以agencyId为粒度。 + * @author: WangXianZhang + * @date: 2023/4/18 4:33 PM + */ + private void saveBatchWithLock() { + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, EpmetRequestHolder.getLoginUserId()); + RLock lock = distributedLock.getLock(String.format("{}:{}:{}", "lock:specialcrowd", customerId, staffInfo.getAgencyId())); + try { + this.saveBatch(); + } catch (Exception e) { + throw e; + } finally { + if (lock != null && lock.isHeldByCurrentThread()) { + lock.unlock(); + } + } + } + + /** + * @param : + * @return + * @description: 批量保存 + * @author: WangXianZhang + * @date: 2023/4/18 3:42 PM + */ + protected void saveBatch() { + String orgIdPath = PidUtils.convertPid2OrgIdPath(currentStaffInfo.getAgencyId(), currentStaffInfo.getAgencyPIds()); + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + Date now = new Date(); + Iterator it = getOriginDatas().iterator(); + for (; it.hasNext(); ) { + T row = it.next(); + String errorInfo = lingShanSpecialCrowdService.validate(row); + if (StringUtils.isNotBlank(errorInfo)) { + row.setErrorInfo(errorInfo); + errorDatas.add(row); + it.remove(); + } else { + specialTypes.add(new PersonSpecialTypeBean(row.getResiId(), row.getIdCard(), specialCrowdType.getType())); + + orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), orgIdPath); + + E e = ConvertUtils.sourceToTarget(row, entityClass); + e.setCustomerId(customerId); + e.setOrgIdPath(orgIdPath); + e.setId(IdWorker.getIdStr()); + e.setRevision(0); + e.setCreatedTime(now); + e.setUpdatedTime(now); + e.setCreatedBy(currentStaffInfo.getStaffId()); + e.setUpdatedBy(currentStaffInfo.getStaffId()); + e.setDelFlag("0"); + correctDatas.add(e); + correctDatasQty.incrementAndGet(); + } + } + + // 执行保存 + if(!CollectionUtils.isEmpty(specialTypes)) { + savePersonAndTypes(specialTypes); + } + + // 将错误的数据处理 todo + + // 保存人群详情数据 + saveBatchCallback(correctDatas); + } + + /** + * @description: 保存人员信息,人员类型 + * @param personTypes: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 11:06 AM + */ + private void savePersonAndTypes(List personTypes) { + lingShanSpecialCrowdService.savePersonAndTypes(personTypes, false); + } + + /** + * @param : + * @return + * @description: 清理数据 + * @author: WangXianZhang + * @date: 2023/4/18 4:41 PM + */ + protected void clear() { + originDatas.clear(); + } + + /** + * @description: 获取读取到的原始数据 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:21 PM + */ + protected List getOriginDatas() { + return originDatas; + } + + /** + * @description: 获取错误数据行 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:22 PM + */ + public List getErrorDatas() { + return errorDatas; + } + + public Integer getFailedItemsQty() { + return errorDatas.size(); + } + + public Integer getSuccessedItemsQty() { + return correctDatasQty.get(); + } + + /** + * @description: 获取正确数据行 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:22 PM + */ + protected List getCorrectDatas() { + return correctDatas; + } + + /** + * @param : + * @return + * @description: 批量保存,子类实现 + * @author: WangXianZhang + * @date: 2023/4/18 4:32 PM + */ + abstract void saveBatchCallback(List entities); + + /** + * @description: 设置表头行数 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:22 PM + */ + abstract Integer setMaxHeadRowNum(); + + /** + * @description: 设置header字段列表。子类应当调用该方法设置该值 + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:21 PM + */ + abstract List setHeaderZhList(); + + /** + * @description: 设置模板名称 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/20 9:07 AM + */ + abstract String setTemplateFileName(); + + /** + * @description: 获取entity的class,用于数据拷贝 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/19 9:47 AM + */ + abstract Class getEntityClass(); + + /** + * @description: 指定特殊人群类型 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/19 11:00 AM + */ + abstract LingShanSpecialCrowdTypeEnums getSpecialCrowdType(); + + /** + * 人员类别信息bean,用于导入临时存储数据 + */ + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java new file mode 100644 index 0000000000..d49e7887ac --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java @@ -0,0 +1,103 @@ +package com.epmet.service; + +import com.epmet.bean.PersonSpecialTypeBean; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveFormDTO; +import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveResultDTO; +import com.epmet.dto.result.LingShanSpecialCrowdListResultDTO; +import com.epmet.entity.*; +import com.epmet.excel.data.LingShanHelpCrowdBaseExcelData; +import com.epmet.excel.data.LingShanSpecialCrowdDetailBaseExcelData; + +import java.util.List; + +/** + * 灵山特殊人群service + */ +public interface LingShanHelpCrowdService { + + /** + * @description: 导入特殊人群 + * @param crowdCategory: + * @param fileSavePath: + * @return taskId 导入任务id + * @author: WangXianZhang + * @date: 2023/4/18 5:42 PM + */ + String importSpecialCrowd(String crowdCategory, String fileSavePath, String originFilename); + + /** + * @description: 数据校验 + * @param row: + * @returns + * @author: WangXianZhang + * @date: 2023/4/18 4:49 PM + */ + String validate(LingShanHelpCrowdBaseExcelData row); + + /** + * @description: + * @param personTypes: + * @param hard: 是否硬性写入。true:会覆盖现有的,用于页面的修改。false:会与现有的合并,用户导入 + * @return + * @author: WangXianZhang + * @date: 2023/4/24 3:25 PM + */ + void savePersonAndTypes(List personTypes, Boolean hard); + + /** + * @description: 安置帮教-导入 + * @return + * @author: WangXianZhang + * @date: 2023/4/18 4:11 PM + */ + void saveBatch(List entities, LingshanSpecialCrowdDetailAzbjEntity e); + void saveBatch(List entities, LingshanSpecialCrowdDetailJdryEntity e); + void saveBatch(List entities, LingshanSpecialCrowdDetailJzhzEntity e); + void saveBatch(List entities, LingshanSpecialCrowdDetailSqjzEntity e); + void saveBatch(List entities, LingshanSpecialCrowdDetailXfryEntity e); + + // /** + // * @description: 新增-安置帮教 + // * @param azbjData: + // * @return + // * @author: WangXianZhang + // * @date: 2023/4/20 2:51 PM + // */ + // void createSpecialCrowd(LingShanSpecialCrowdDetailBaseExcelData azbjData, String specialType); + + /** + * @description: 特殊人群详情 + * @param idCard: + * @return + * @author: WangXianZhang + * @date: 2023/4/20 3:45 PM + */ + LingShanSpecialTypeSaveResultDTO getPersonSpecialTypeDetail(String resiId); + + /** + * @description: 列表查询 + * @param orgId: + * @param orgType: + * @param specialType: + * @param name: + * @param mobile: + * @param idCard: + * @return + * @author: WangXianZhang + * @date: 2023/4/20 5:44 PM + */ + PageData listSpecialCrowds(String orgId, String orgType, String specialType, String name, String mobile, + String idCard, Integer pageNo, Integer pageSize); + + void deleteByResi(String resiId); + + /** + * @description: 保存或修改 + * @param input: + * @return + * @author: WangXianZhang + * @date: 2023/4/23 11:06 AM + */ + void saveSpecialCrowd(LingShanSpecialTypeSaveFormDTO input); +} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdCanjiDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdCanjiDao.xml new file mode 100644 index 0000000000..8f1cfe5e74 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdCanjiDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDabingDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDabingDao.xml new file mode 100644 index 0000000000..3efbf952e6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDabingDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDibaoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDibaoDao.xml new file mode 100644 index 0000000000..98171f4db4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDibaoDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDujuDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDujuDao.xml new file mode 100644 index 0000000000..95acced075 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdDujuDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdGaolingDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdGaolingDao.xml new file mode 100644 index 0000000000..1f256d27fb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdGaolingDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdKongchaoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdKongchaoDao.xml new file mode 100644 index 0000000000..de0743feab --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdKongchaoDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdLiushouDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdLiushouDao.xml new file mode 100644 index 0000000000..27157a60e2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdLiushouDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdTekunDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdTekunDao.xml new file mode 100644 index 0000000000..cd174a7ff8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdTekunDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From a4c8cc2184924d0b0cd06921ff571acbc3d79fad Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 24 May 2023 09:29:45 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E5=A4=A7=E5=B1=8F=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E4=BA=BA=E7=BE=A4=E6=9F=B1=E7=8A=B6=E5=9B=BE=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/IcResiUserDao.java | 10 ++++ .../impl/LingShanScreenServiceImpl.java | 47 ++++++++++--------- .../main/resources/mapper/IcResiUserDao.xml | 14 ++++++ 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 31f4614347..58b836df68 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; @@ -470,4 +471,13 @@ public interface IcResiUserDao extends BaseDao { * @return */ IcResiUserEntity getById(String icResiUserId); + + /** + * @Description: 根据orgIdPath计算各个组织下的特殊人群数量 + * @param orgIdPath: + * @Return java.util.List + * @Author: wangxianzhang + * @Date: 2023/5/24 9:27 AM + */ + List countSpecialQtyByOrgIdPath(@Param("orgIdPath") List orgIdPath); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java index bb2438083e..c4f3c079dc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java @@ -18,7 +18,6 @@ import com.epmet.entity.*; import com.epmet.enums.LingShanSpecialCrowdTypeEnums; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.LingShanScreenService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -47,6 +46,9 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcResiUserDao icResiUserDao; + @Override public List specialCrowdStatsCountBySubOrg(String parentAgencyId, String specialType) { List subOrgs = getResultDataOrThrowsException(govOrgOpenFeignClient.subOrgList(parentAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, null); @@ -77,30 +79,31 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD return t; }).collect(Collectors.toList()); - - List ol = new ArrayList<>(); - if (LingShanSpecialCrowdTypeEnums.AZBJ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(azbjDao.statsCountsByOrgIds(orgIdPaths)); - } - if (LingShanSpecialCrowdTypeEnums.SQJZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(sqjzDao.statsCountsByOrgIds(orgIdPaths)); - } - if (LingShanSpecialCrowdTypeEnums.XFRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(xfryDao.statsCountsByOrgIds(orgIdPaths)); - } - if (LingShanSpecialCrowdTypeEnums.JDRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(jdryDao.statsCountsByOrgIds(orgIdPaths)); - } - if (LingShanSpecialCrowdTypeEnums.JZHZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(jzhzDao.statsCountsByOrgIds(orgIdPaths)); - } + List ol = icResiUserDao.countSpecialQtyByOrgIdPath(orgIdPaths); + + // List ol = new ArrayList<>(); + // if (LingShanSpecialCrowdTypeEnums.AZBJ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(azbjDao.statsCountsByOrgIds(orgIdPaths)); + // } + // if (LingShanSpecialCrowdTypeEnums.SQJZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(sqjzDao.statsCountsByOrgIds(orgIdPaths)); + // } + // if (LingShanSpecialCrowdTypeEnums.XFRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(xfryDao.statsCountsByOrgIds(orgIdPaths)); + // } + // if (LingShanSpecialCrowdTypeEnums.JDRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(jdryDao.statsCountsByOrgIds(orgIdPaths)); + // } + // if (LingShanSpecialCrowdTypeEnums.JZHZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(jzhzDao.statsCountsByOrgIds(orgIdPaths)); + // } // 开始给rl++ - for (LingShanSpecialCrowdStatsByOrgResultDTO o : ol) { - for (LingShanSpecialCrowdStatsByOrgResultDTO r : rl) { - if (o.getOrgIdPath().contains(r.getOrgIdPath())) { + for (LingShanSpecialCrowdStatsByOrgResultDTO qtyData : ol) { + for (LingShanSpecialCrowdStatsByOrgResultDTO subOrg : rl) { + if (qtyData.getOrgIdPath().contains(subOrg.getOrgIdPath())) { // 如果ol中的数据,orgIdPath包含了这个组织的orgIdPath,说明这条数据就是这个组织的数据,那就++把 - r.setQuantity(r.getQuantity() + o.getQuantity()); + subOrg.setQuantity(subOrg.getQuantity() + qtyData.getQuantity()); } } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index b2b6b36861..5b835aa4f7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -1531,4 +1531,18 @@ + + + From 42fe27d2c0453510d47e8bb0c93b1b3b8d462797 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 25 May 2023 10:18:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E3=80=90=E7=81=B5?= =?UTF-8?q?=E5=B1=B1-=E9=87=8D=E7=82=B9=E5=B8=AE=E6=89=B6=E4=BA=BA?= =?UTF-8?q?=E7=BE=A4=E3=80=91=E7=AE=A1=E7=90=86=EF=BC=9A=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LingShanSpecialCrowdListResultDTO.java | 6 + .../enums/LingShanHelpCrowdCommonEnums.java | 2 +- .../com/epmet/bean/PersonHelpTypeBean.java | 34 ++ .../LingShanHelpCrowdController.java | 68 +++ .../dao/LingshanHelpCrowdResiMergeDao.java | 16 + .../entity/LingshanHelpCrowdDibaoEntity.java | 4 +- .../entity/LingshanHelpCrowdDujuEntity.java | 2 +- .../LingshanHelpCrowdResiMergeEntity.java | 52 ++ .../entity/LingshanHelpCrowdTekunEntity.java | 6 +- .../LingShanHelpCrowdExcelConverter.java | 15 +- .../data/LingshanHelpCrowdCanjiExcelData.java | 3 +- .../data/LingshanHelpCrowdDibaoExcelData.java | 8 +- .../data/LingshanHelpCrowdDujuExcelData.java | 52 ++ .../LingshanHelpCrowdGaolingExcelData.java | 61 +++ ...> LingshanHelpCrowdKongchaoExcelData.java} | 10 +- .../LingshanHelpCrowdLiushouExcelData.java | 2 +- .../data/LingshanHelpCrowdTekunExcelData.java | 10 +- ...tLingShanHelpCrowdExcelImportListener.java | 51 +- ...ShanHelpCrowdCanjiExcelImportListener.java | 41 ++ ...hanHelpCrowdDabingExcelImportListener.java | 43 ++ ...ShanHelpCrowdDibaoExcelImportListener.java | 45 ++ ...gShanHelpCrowdDujuExcelImportListener.java | 42 ++ ...anHelpCrowdGaolingExcelImportListener.java | 42 ++ ...nHelpCrowdKongchaoExcelImportListener.java | 42 ++ ...anHelpCrowdLiushouExcelImportListener.java | 42 ++ ...ShanHelpCrowdTekunExcelImportListener.java | 44 ++ .../service/LingShanHelpCrowdService.java | 106 ++-- .../impl/LingShanHelpCrowdServiceImpl.java | 476 ++++++++++++++++++ .../main/resources/mapper/IcSpecialDao.xml | 5 +- .../mapper/LingshanHelpCrowdResiMergeDao.xml | 22 + 30 files changed, 1238 insertions(+), 114 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/bean/PersonHelpTypeBean.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdResiMergeDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdResiMergeEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdGaolingExcelData.java rename epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/{LingshanHelpCrowdDujuKongchaoExcelData.java => LingshanHelpCrowdKongchaoExcelData.java} (84%) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdCanjiExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDabingExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDibaoExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDujuExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdGaolingExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdKongchaoExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdLiushouExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdTekunExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanHelpCrowdServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdResiMergeDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LingShanSpecialCrowdListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LingShanSpecialCrowdListResultDTO.java index efa7a61b47..3d9cd904b6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LingShanSpecialCrowdListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LingShanSpecialCrowdListResultDTO.java @@ -23,4 +23,10 @@ public class LingShanSpecialCrowdListResultDTO { @JsonFormat(pattern = "yyyy-MM-dd") private Date updatedTime; + private Integer gender; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date birthday; + + private Integer age; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanHelpCrowdCommonEnums.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanHelpCrowdCommonEnums.java index 5e5f3486df..da970bfe7b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanHelpCrowdCommonEnums.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanHelpCrowdCommonEnums.java @@ -14,7 +14,7 @@ public enum LingShanHelpCrowdCommonEnums { DBLX_CZ(201, "城镇低保"), - LDNL_NO(300, "无"), + LDNL_NO(300, "有劳动能力"), LDNL_BFSS(301, "部分丧失劳动能力"), diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/PersonHelpTypeBean.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/PersonHelpTypeBean.java new file mode 100644 index 0000000000..a09fdd53c1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/PersonHelpTypeBean.java @@ -0,0 +1,34 @@ +package com.epmet.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Objects; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PersonHelpTypeBean { + private String resiId; + private String idCard; + + private String helpCrowdType; + + private String orgIdPath; + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + PersonHelpTypeBean that = (PersonHelpTypeBean) o; + return Objects.equals(resiId, that.resiId) && Objects.equals(helpCrowdType, that.helpCrowdType); + } + + @Override + public int hashCode() { + return Objects.hash(resiId, helpCrowdType); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java new file mode 100644 index 0000000000..2fc1565c4b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java @@ -0,0 +1,68 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.FileUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.LingShanHelpCrowdService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Date; + +@Slf4j +@RestController +@RequestMapping("helpCrowd") +public class LingShanHelpCrowdController { + + @Autowired + private LingShanHelpCrowdService helpCrowdService; + + @PostMapping("import") + public Result importExcel(@RequestBody MultipartFile file, @RequestParam("crowdType") String crowdType) { + + String originalFilename = file.getOriginalFilename(); + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".")); + + // 1.存文件 + Path fileSavePath = saveHelpCrowdTempFile(file, suffix); + + // 2.执行业务导入 + try { + String taskId = helpCrowdService.importHelpCrowd(crowdType, fileSavePath.toString(), originalFilename); + return new Result().ok(taskId); + } catch (Exception e) { + // 3.出错的话,删除文件。不能在finally中删除,因为正常执行的话,是在异步线程中执行导入,这里删除了,那子线程就获取不到文件了,所以子线程中有单独的删除逻辑 + FileUtils.deleteFileIfExists(fileSavePath); + throw e; + } + + } + + public Path saveHelpCrowdTempFile(@RequestParam("file") MultipartFile file, String suffix) { + Path fileSavePath; + FileOutputStream os = null; + try { + Path fileSaveDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("help_crowd_import"); + String fileName = DateUtils.format(new Date(), "yyyyMMdd_HHmmss_" + System.nanoTime()) + suffix; + fileSavePath = fileSaveDir.resolve(fileName); + IOUtils.copy(file.getInputStream(), (os = new FileOutputStream(fileSavePath.toString()))); + return fileSavePath; + } catch ( + IOException e) { + log.error("【灵山街道】导入重点帮扶数据,缓存文件失败。"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, null); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(os); + } + } + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdResiMergeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdResiMergeDao.java new file mode 100644 index 0000000000..7c8c141b4d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanHelpCrowdResiMergeDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanHelpCrowdResiMergeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民-重点帮扶人群对应关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-22 + */ +@Mapper +public interface LingshanHelpCrowdResiMergeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java index 439df1298d..69090f749d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java @@ -38,12 +38,12 @@ public class LingshanHelpCrowdDibaoEntity extends LingshanHelpCrowdBaseEntity { /** * 婚姻状况(字典) */ - private Integer hyzk; + private String hyzk; /** * 就业情况(字典) */ - private Integer jyqk; + private String jyqk; /** * 年收入 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java index 9ff11df213..e7e3fb254e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java @@ -37,7 +37,7 @@ public class LingshanHelpCrowdDujuEntity extends LingshanHelpCrowdBaseEntity { /** * 健康状况【0:一般或较弱,1:健康或良好】 */ - private String jkzk; + private Integer jkzk; /** * 子女探视间隔时间 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdResiMergeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdResiMergeEntity.java new file mode 100644 index 0000000000..3acb5f0898 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdResiMergeEntity.java @@ -0,0 +1,52 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +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-05-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_help_crowd_resi_merge") +public class LingshanHelpCrowdResiMergeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * org id路径,:分割 + */ + private String orgIdPath; + + /** + * 居民id + */ + private String resiId; + + /** + * 证件号 + */ + private String idCard; + + /** + * 人员类别。【canji残疾人,dabing大病,dibao低保,gaoling高龄老人,kongchao空巢老人,duju独居老人,liushou留守儿童, tekun特困人员】 + */ + private String crowdType; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java index f1c2df0f17..f0ffdf9e0d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java @@ -28,17 +28,17 @@ public class LingshanHelpCrowdTekunEntity extends LingshanHelpCrowdBaseEntity { /** * 低保(特困)证号 */ - private Integer dbzh; + private String dbzh; /** * 婚姻状况(字典) */ - private Integer hyzk; + private String hyzk; /** * 就业情况(字典) */ - private Integer jyqk; + private String jyqk; /** * 年收入 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanHelpCrowdExcelConverter.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanHelpCrowdExcelConverter.java index 641c24fc3b..49f14bdcea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanHelpCrowdExcelConverter.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanHelpCrowdExcelConverter.java @@ -16,9 +16,10 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -public class LingShanHelpCrowdExcelConverter implements Converter , ResultDataResolver { +public class LingShanHelpCrowdExcelConverter implements Converter , ResultDataResolver { - public static final List DICT_COLUMNS = Arrays.asList("cjdj", "cjlb", "hyzk", "jyqk"); + // 残疾类别,婚姻状况,就业情况,残疾等级,从字典查询 + public static final List DICT_COLUMNS = Arrays.asList("cjlb", "hyzk", "jyqk", "cjzk"); private EpmetAdminOpenFeignClient adminOpenFeignClient; @@ -46,14 +47,14 @@ public class LingShanHelpCrowdExcelConverter implements Converter , Res * @Date: 2023/5/18 4:40 PM */ @Override - public Integer convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { + public Object convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { String fieldName = contentProperty.getField().getName(); String value = cellData.getStringValue(); if (DICT_COLUMNS.contains(fieldName)) { // 是字典,查字典 String dictValue = getValueFromDict(fieldName, value); - return Integer.valueOf(dictValue); + return dictValue; } // 不是字典,那么遍历枚举 @@ -75,7 +76,7 @@ public class LingShanHelpCrowdExcelConverter implements Converter , Res * @Date: 2023/5/18 4:40 PM */ @Override - public WriteCellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { + public WriteCellData convertToExcelData(Object value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { String fieldName = contentProperty.getField().getName(); @@ -89,7 +90,7 @@ public class LingShanHelpCrowdExcelConverter implements Converter , Res } // 不是字典,那么遍历枚举 - LingShanHelpCrowdCommonEnums enumObj = LingShanHelpCrowdCommonEnums.getByCode(value); + LingShanHelpCrowdCommonEnums enumObj = LingShanHelpCrowdCommonEnums.getByCode(Integer.valueOf(value.toString())); if (enumObj == null) { return null; } else { @@ -101,7 +102,7 @@ public class LingShanHelpCrowdExcelConverter implements Converter , Res String dictType; if ("cjlb".equals(fieldName)) { dictType = "disability_category_code"; - } else if ("cjdj".equals(fieldName)) { + } else if ("cjzk".equals(fieldName)) { dictType = "disability_level"; } else if("hyzk".equals(fieldName)) { dictType = "marriage"; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java index 685194c606..f2b6569385 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.format.DateTimeFormat; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; +import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; import lombok.Data; import lombok.EqualsAndHashCode; @@ -47,7 +48,7 @@ public class LingshanHelpCrowdCanjiExcelData extends LingShanHelpCrowdBaseExcelD /** * 是否在世。0否,1是 */ - @ExcelProperty(value = "是否在世", converter = LingShanHelpCrowdExcelConverter.class) + @ExcelProperty(value = "是否在世", converter = LingShanSpecialCrowdYesOrNoConverter.class) private Integer living; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java index 99ddc2e9fd..e293f66932 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java @@ -17,12 +17,12 @@ import java.math.BigDecimal; * @since v1.0.0 2023-05-18 */ @Data -public class LingshanHelpCrowdDibaoExcelData { +public class LingshanHelpCrowdDibaoExcelData extends LingShanHelpCrowdBaseExcelData { /** * 户籍类型。0农村户籍,1城镇户籍 */ - @ExcelProperty(value = "*户籍类型", converter = LingShanHelpCrowdExcelConverter.class) + @ExcelProperty(value = "户籍类型", converter = LingShanHelpCrowdExcelConverter.class) private Integer hjlx; /** @@ -41,13 +41,13 @@ public class LingshanHelpCrowdDibaoExcelData { * 婚姻状况(字典) */ @ExcelProperty(value = "婚姻状况", converter = LingShanHelpCrowdExcelConverter.class) - private Integer hyzk; + private String hyzk; /** * 就业情况(字典) */ @ExcelProperty(value = "就业情况", converter = LingShanHelpCrowdExcelConverter.class) - private Integer jyqk; + private String jyqk; /** * 年收入 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuExcelData.java new file mode 100644 index 0000000000..9ccc713395 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuExcelData.java @@ -0,0 +1,52 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; +import lombok.Data; + +/** + * 重点帮扶-独居老人 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +public class LingshanHelpCrowdDujuExcelData extends LingShanHelpCrowdBaseExcelData { + + /** + * 监护人姓名 + */ + @ExcelProperty(value = "*监护人姓名") + private String jhrxm; + + /** + * 监护人电话 + */ + @ExcelProperty(value = "*监护人电话") + private String jhrdh; + + /** + * 监护人与老人关系 + */ + @ExcelProperty(value = "监护人与老人关系") + private String jhrylrgx; + + /** + * 健康状况【0:一般或较弱,1:健康或良好】 + */ + @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer jkzk; + + /** + * 子女探视间隔时间 + */ + @ExcelProperty(value = "子女探视间隔时间") + private String tsjg; + + /** + * 帮扶及其他情况说明 + */ + @ExcelProperty(value = "帮扶及其他情况说明") + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdGaolingExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdGaolingExcelData.java new file mode 100644 index 0000000000..4dbfebbe09 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdGaolingExcelData.java @@ -0,0 +1,61 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.entity.LingshanHelpCrowdBaseEntity; +import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 重点帮扶-高龄老人 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-18 + */ +@Data +public class LingshanHelpCrowdGaolingExcelData extends LingShanHelpCrowdBaseExcelData { + + /** + * 银行卡号 + */ + @ExcelProperty(value = "银行卡号") + private String yhzh; + + /** + * 津贴金额(元) + */ + @ExcelProperty(value = "*津贴金额(元)") + private String jtje; + + /** + * 津贴发放情况说明 + */ + @ExcelProperty(value = "津贴发放情况说明") + private String ffqk; + + /** + * 自理情况【0不能自理,1能够自理】 + */ + @ExcelProperty(value = "自理情况", converter = LingShanHelpCrowdExcelConverter.class) + private Integer zlqk; + + /** + * 监护人姓名 + */ + @ExcelProperty(value = "监护人姓名") + private String jhrxm; + + /** + * 监护人电话 + */ + @ExcelProperty(value = "监护人电话") + private String jhrdh; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuKongchaoExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdKongchaoExcelData.java similarity index 84% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuKongchaoExcelData.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdKongchaoExcelData.java index bc9bd0010f..4142f5a0bc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuKongchaoExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdKongchaoExcelData.java @@ -14,13 +14,7 @@ import lombok.EqualsAndHashCode; * @since v1.0.0 2023-05-18 */ @Data -public class LingshanHelpCrowdDujuKongchaoExcelData { - - /** - * 居住状况 - */ - @ExcelProperty(value = "*居住状况", converter = LingShanHelpCrowdExcelConverter.class) - private Integer jzzk; +public class LingshanHelpCrowdKongchaoExcelData extends LingShanHelpCrowdBaseExcelData { /** * 监护人姓名 @@ -44,7 +38,7 @@ public class LingshanHelpCrowdDujuKongchaoExcelData { * 健康状况【0:一般或较弱,1:健康或良好】 */ @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) - private String jkzk; + private Integer jkzk; /** * 子女探视间隔时间 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdLiushouExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdLiushouExcelData.java index 6bda729fb8..88a2c7e33b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdLiushouExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdLiushouExcelData.java @@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode; * @since v1.0.0 2023-05-18 */ @Data -public class LingshanHelpCrowdLiushouExcelData { +public class LingshanHelpCrowdLiushouExcelData extends LingShanHelpCrowdBaseExcelData { /** * 监护人姓名 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java index 564beb02a9..75966f441e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java @@ -18,7 +18,7 @@ import java.util.Date; * @since v1.0.0 2023-05-18 */ @Data -public class LingshanHelpCrowdTekunExcelData { +public class LingshanHelpCrowdTekunExcelData extends LingShanHelpCrowdBaseExcelData{ /** * 户籍类型。0农村户籍,1城镇户籍 @@ -29,20 +29,20 @@ public class LingshanHelpCrowdTekunExcelData { /** * 低保(特困)证号 */ - @ExcelProperty(value = "*低保(特困)证号", converter = LingShanHelpCrowdExcelConverter.class) - private Integer dbzh; + @ExcelProperty(value = "*低保(特困)证号") + private String dbzh; /** * 婚姻状况(字典) */ @ExcelProperty(value = "婚姻状况", converter = LingShanHelpCrowdExcelConverter.class) - private Integer hyzk; + private String hyzk; /** * 就业情况(字典) */ @ExcelProperty(value = "就业情况", converter = LingShanHelpCrowdExcelConverter.class) - private Integer jyqk; + private String jyqk; /** * 年收入 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java index 09632f088b..0ea1f100f3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanHelpCrowdExcelImportListener.java @@ -3,23 +3,25 @@ package com.epmet.excel.handler; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.baomidou.mybatisplus.core.toolkit.IdWorker; -import com.epmet.bean.PersonSpecialTypeBean; +import com.epmet.bean.PersonHelpTypeBean; import com.epmet.commons.tools.distributedlock.DistributedLock; 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.ValidateException; +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.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.PidUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.entity.LingshanHelpCrowdBaseEntity; -import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; import com.epmet.excel.data.LingShanHelpCrowdBaseExcelData; import com.epmet.exceptions.ReadExcelHeaderOnlyException; -import com.epmet.service.LingShanSpecialCrowdService; +import com.epmet.service.LingShanHelpCrowdService; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -97,23 +99,23 @@ public abstract class AbstractLingShanHelpCrowdExcelImportListener persons = new ArrayList<>(); // private List personTypes = new ArrayList<>(); - private List specialTypes = new ArrayList<>(); + private List helpTypes = new ArrayList<>(); - protected LingShanSpecialCrowdService lingShanSpecialCrowdService; + protected LingShanHelpCrowdService lingShanHelpCrowdService; private Class entityClass; private CustomerStaffInfoCacheResult currentStaffInfo; - private LingShanSpecialCrowdTypeEnums specialCrowdType; + private LingShanHelpCrowdTypeEnum helpCrowdType; public AbstractLingShanHelpCrowdExcelImportListener() { - lingShanSpecialCrowdService = SpringContextUtils.getBean(LingShanSpecialCrowdService.class); + lingShanHelpCrowdService = SpringContextUtils.getBean(LingShanHelpCrowdService.class); distributedLock = SpringContextUtils.getBean(DistributedLock.class); currentStaffInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); maxHeadRowNum = setMaxHeadRowNum(); headerZhList = setHeaderZhList(); - specialCrowdType = getSpecialCrowdType(); + helpCrowdType = getHelpCrowdType(); entityClass = getEntityClass(); templateFileName = setTemplateFileName(); } @@ -188,6 +190,7 @@ public abstract class AbstractLingShanHelpCrowdExcelImportListener it = getOriginDatas().iterator(); for (; it.hasNext(); ) { T row = it.next(); - String errorInfo = lingShanSpecialCrowdService.validate(row); + String errorInfo = lingShanHelpCrowdService.validate(row); if (StringUtils.isNotBlank(errorInfo)) { row.setErrorInfo(errorInfo); errorDatas.add(row); it.remove(); } else { - specialTypes.add(new PersonSpecialTypeBean(row.getResiId(), row.getIdCard(), specialCrowdType.getType())); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(row.getResiGridId()); - orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), orgIdPath); + if (gridInfo == null) { + log.error("未找到网格信息,网格ID:{}", row.getResiGridId()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "未找到网格信息,网格ID:" + row.getResiGridId()); + } + + String orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), gridInfo.getPids()); + + // 添加人员-类别对应关系 + helpTypes.add(new PersonHelpTypeBean(row.getResiId(), row.getIdCard(), helpCrowdType.getType(), orgIdPath)); E e = ConvertUtils.sourceToTarget(row, entityClass); e.setCustomerId(customerId); e.setOrgIdPath(orgIdPath); - e.setId(IdWorker.getIdStr()); e.setRevision(0); e.setCreatedTime(now); e.setUpdatedTime(now); e.setCreatedBy(currentStaffInfo.getStaffId()); e.setUpdatedBy(currentStaffInfo.getStaffId()); e.setDelFlag("0"); + + // 添加类别详情 correctDatas.add(e); correctDatasQty.incrementAndGet(); } } // 执行保存 - if(!CollectionUtils.isEmpty(specialTypes)) { - savePersonAndTypes(specialTypes); + if(!CollectionUtils.isEmpty(helpTypes)) { + savePersonAndTypes(helpTypes); } - // 将错误的数据处理 todo - // 保存人群详情数据 saveBatchCallback(correctDatas); } @@ -293,8 +302,8 @@ public abstract class AbstractLingShanHelpCrowdExcelImportListener personTypes) { - lingShanSpecialCrowdService.savePersonAndTypes(personTypes, false); + private void savePersonAndTypes(List personTypes) { + lingShanHelpCrowdService.savePersonAndTypes(personTypes, false); } /** @@ -400,7 +409,7 @@ public abstract class AbstractLingShanHelpCrowdExcelImportListener { + @Override + void saveBatchCallback(List entities) { + lingShanHelpCrowdService.save(entities, new LingshanHelpCrowdCanjiEntity()); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*残疾证号", "*残疾类型", "*残疾等级", "有效期开始时间", "是否在世", "去世时间"); + } + + @Override + String setTemplateFileName() { + return "excel/lingshan/lingshan_help_crowd_canji_export.xlsx"; + } + + @Override + Class getEntityClass() { + return LingshanHelpCrowdCanjiEntity.class; + } + + @Override + LingShanHelpCrowdTypeEnum getHelpCrowdType() { + return LingShanHelpCrowdTypeEnum.CANJI; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDabingExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDabingExcelImportListener.java new file mode 100644 index 0000000000..9190cca145 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDabingExcelImportListener.java @@ -0,0 +1,43 @@ +package com.epmet.excel.handler; + +import com.epmet.entity.LingshanHelpCrowdCanjiEntity; +import com.epmet.entity.LingshanHelpCrowdDabingEntity; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; +import com.epmet.excel.data.LingshanHelpCrowdCanjiExcelData; +import com.epmet.excel.data.LingshanHelpCrowdDabingExcelData; + +import java.util.Arrays; +import java.util.List; + +public class LingShanHelpCrowdDabingExcelImportListener + extends AbstractLingShanHelpCrowdExcelImportListener { + @Override + void saveBatchCallback(List entities) { + lingShanHelpCrowdService.save(entities, entities.get(0)); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*患病病种", "*患病时间", "救助情况说明", "救助金额(元)", "个人负担(元)"); + } + + @Override + String setTemplateFileName() { + return "excel/lingshan/lingshan_help_crowd_dabing_export.xlsx"; + } + + @Override + Class getEntityClass() { + return LingshanHelpCrowdDabingEntity.class; + } + + @Override + LingShanHelpCrowdTypeEnum getHelpCrowdType() { + return LingShanHelpCrowdTypeEnum.DABING; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDibaoExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDibaoExcelImportListener.java new file mode 100644 index 0000000000..aad26377c1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDibaoExcelImportListener.java @@ -0,0 +1,45 @@ +package com.epmet.excel.handler; + +import com.epmet.entity.LingshanHelpCrowdDabingEntity; +import com.epmet.entity.LingshanHelpCrowdDibaoEntity; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; +import com.epmet.excel.data.LingshanHelpCrowdDabingExcelData; +import com.epmet.excel.data.LingshanHelpCrowdDibaoExcelData; + +import java.util.Arrays; +import java.util.List; + +public class LingShanHelpCrowdDibaoExcelImportListener + extends AbstractLingShanHelpCrowdExcelImportListener { + @Override + void saveBatchCallback(List entities) { + lingShanHelpCrowdService.save(entities, entities.get(0)); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "户籍类型", "*低保类型", "*低保(特困)证号", "婚姻状况", "就业情况", "年收入(元)", + "是否残疾人", "劳动能力", "健康状况", "患病病种", "参保类型", "最初享受月份", "是否建档立卡扶贫对象", "开户银行", "户头名称", + "银行账号(一本通账号)", "户月保障金额(元)", "人员附加政策(元)", "救助金计算方式"); + } + + @Override + String setTemplateFileName() { + return "excel/lingshan/lingshan_help_crowd_dibao_export.xlsx"; + } + + @Override + Class getEntityClass() { + return LingshanHelpCrowdDibaoEntity.class; + } + + @Override + LingShanHelpCrowdTypeEnum getHelpCrowdType() { + return LingShanHelpCrowdTypeEnum.DIBAO; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDujuExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDujuExcelImportListener.java new file mode 100644 index 0000000000..c3c9072332 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDujuExcelImportListener.java @@ -0,0 +1,42 @@ +package com.epmet.excel.handler; + +import com.epmet.entity.LingshanHelpCrowdDujuEntity; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; +import com.epmet.excel.data.LingshanHelpCrowdDujuExcelData; + +import java.util.Arrays; +import java.util.List; + +public class LingShanHelpCrowdDujuExcelImportListener + extends AbstractLingShanHelpCrowdExcelImportListener { + + @Override + void saveBatchCallback(List entities) { + lingShanHelpCrowdService.save(entities, entities.get(0)); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*监护人姓名", "*监护人电话", "监护人与老人关系", "健康状况", "子女探视间隔时间", "帮扶及其他情况说明"); + } + + @Override + String setTemplateFileName() { + return "excel/lingshan/lingshan_help_crowd_duju_export.xlsx"; + } + + @Override + Class getEntityClass() { + return LingshanHelpCrowdDujuEntity.class; + } + + @Override + LingShanHelpCrowdTypeEnum getHelpCrowdType() { + return LingShanHelpCrowdTypeEnum.DUJU; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdGaolingExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdGaolingExcelImportListener.java new file mode 100644 index 0000000000..8948a26eaa --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdGaolingExcelImportListener.java @@ -0,0 +1,42 @@ +package com.epmet.excel.handler; + +import com.epmet.entity.LingshanHelpCrowdGaolingEntity; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; +import com.epmet.excel.data.LingshanHelpCrowdGaolingExcelData; + +import java.util.Arrays; +import java.util.List; + +public class LingShanHelpCrowdGaolingExcelImportListener + extends AbstractLingShanHelpCrowdExcelImportListener { + + @Override + void saveBatchCallback(List entities) { + lingShanHelpCrowdService.save(entities, entities.get(0)); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名","*身份证号","银行卡号","*津贴金额(元)","津贴发放情况说明","自理情况","监护人姓名","监护人电话","备注"); + } + + @Override + String setTemplateFileName() { + return "excel/lingshan/lingshan_help_crowd_gaoling_export.xlsx"; + } + + @Override + Class getEntityClass() { + return LingshanHelpCrowdGaolingEntity.class; + } + + @Override + LingShanHelpCrowdTypeEnum getHelpCrowdType() { + return LingShanHelpCrowdTypeEnum.GAOLING; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdKongchaoExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdKongchaoExcelImportListener.java new file mode 100644 index 0000000000..c3b2037dc6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdKongchaoExcelImportListener.java @@ -0,0 +1,42 @@ +package com.epmet.excel.handler; + +import com.epmet.entity.LingshanHelpCrowdKongchaoEntity; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; +import com.epmet.excel.data.LingshanHelpCrowdKongchaoExcelData; + +import java.util.Arrays; +import java.util.List; + +public class LingShanHelpCrowdKongchaoExcelImportListener + extends AbstractLingShanHelpCrowdExcelImportListener { + + @Override + void saveBatchCallback(List entities) { + lingShanHelpCrowdService.save(entities, entities.get(0)); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*监护人姓名", "*监护人电话", "监护人与老人关系", "健康状况", "子女探视间隔时间", "帮扶及其他情况说明"); + } + + @Override + String setTemplateFileName() { + return "excel/lingshan/lingshan_help_crowd_kongchao_export.xlsx"; + } + + @Override + Class getEntityClass() { + return LingshanHelpCrowdKongchaoEntity.class; + } + + @Override + LingShanHelpCrowdTypeEnum getHelpCrowdType() { + return LingShanHelpCrowdTypeEnum.KONGCHAO; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdLiushouExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdLiushouExcelImportListener.java new file mode 100644 index 0000000000..f7000f471e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdLiushouExcelImportListener.java @@ -0,0 +1,42 @@ +package com.epmet.excel.handler; + +import com.epmet.entity.LingshanHelpCrowdLiushouEntity; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; +import com.epmet.excel.data.LingshanHelpCrowdLiushouExcelData; + +import java.util.Arrays; +import java.util.List; + +public class LingShanHelpCrowdLiushouExcelImportListener + extends AbstractLingShanHelpCrowdExcelImportListener { + + @Override + void saveBatchCallback(List entities) { + lingShanHelpCrowdService.save(entities, entities.get(0)); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*监护人姓名", "*监护人电话", "*与监护人关系", "*所在学校及班级", "班主任姓名", "班主任电话", "帮扶情况及其他说明"); + } + + @Override + String setTemplateFileName() { + return "excel/lingshan/lingshan_help_crowd_liushou_export.xlsx"; + } + + @Override + Class getEntityClass() { + return LingshanHelpCrowdLiushouEntity.class; + } + + @Override + LingShanHelpCrowdTypeEnum getHelpCrowdType() { + return LingShanHelpCrowdTypeEnum.LIUSHOU; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdTekunExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdTekunExcelImportListener.java new file mode 100644 index 0000000000..a8219a82e8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdTekunExcelImportListener.java @@ -0,0 +1,44 @@ +package com.epmet.excel.handler; + +import com.epmet.entity.LingshanHelpCrowdTekunEntity; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; +import com.epmet.excel.data.LingshanHelpCrowdTekunExcelData; + +import java.util.Arrays; +import java.util.List; + +public class LingShanHelpCrowdTekunExcelImportListener + extends AbstractLingShanHelpCrowdExcelImportListener { + + @Override + void saveBatchCallback(List entities) { + lingShanHelpCrowdService.save(entities, entities.get(0)); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "户籍类型", "*低保(特困)证号", "婚姻状况", "就业情况", "年收入(元)", "是否残疾人", + "生活自理能力", "健康状况", "患病病种", "参保类型", "最初享受月份", "是否建档立卡扶贫对象", "开户银行", "户头名称", + "银行账号(一本通账号)", "供养方式", "供养机构名称", "基本生活标准(元)", "照料护理费用(元)"); + } + + @Override + String setTemplateFileName() { + return "excel/lingshan/lingshan_help_crowd_tekun_export.xlsx"; + } + + @Override + Class getEntityClass() { + return LingshanHelpCrowdTekunEntity.class; + } + + @Override + LingShanHelpCrowdTypeEnum getHelpCrowdType() { + return LingShanHelpCrowdTypeEnum.TEKUN; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java index d49e7887ac..ef2b4569c6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.bean.PersonHelpTypeBean; import com.epmet.bean.PersonSpecialTypeBean; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveFormDTO; @@ -12,20 +13,10 @@ import com.epmet.excel.data.LingShanSpecialCrowdDetailBaseExcelData; import java.util.List; /** - * 灵山特殊人群service + * 灵山帮扶人群service */ public interface LingShanHelpCrowdService { - /** - * @description: 导入特殊人群 - * @param crowdCategory: - * @param fileSavePath: - * @return taskId 导入任务id - * @author: WangXianZhang - * @date: 2023/4/18 5:42 PM - */ - String importSpecialCrowd(String crowdCategory, String fileSavePath, String originFilename); - /** * @description: 数据校验 * @param row: @@ -43,61 +34,58 @@ public interface LingShanHelpCrowdService { * @author: WangXianZhang * @date: 2023/4/24 3:25 PM */ - void savePersonAndTypes(List personTypes, Boolean hard); + void savePersonAndTypes(List personTypes, Boolean hard); - /** - * @description: 安置帮教-导入 - * @return - * @author: WangXianZhang - * @date: 2023/4/18 4:11 PM - */ - void saveBatch(List entities, LingshanSpecialCrowdDetailAzbjEntity e); - void saveBatch(List entities, LingshanSpecialCrowdDetailJdryEntity e); - void saveBatch(List entities, LingshanSpecialCrowdDetailJzhzEntity e); - void saveBatch(List entities, LingshanSpecialCrowdDetailSqjzEntity e); - void saveBatch(List entities, LingshanSpecialCrowdDetailXfryEntity e); + String importHelpCrowd(String crowdType, String toString, String originalFilename); + + void save(List entities, LingshanHelpCrowdCanjiEntity t); + + void save(List entities, LingshanHelpCrowdDabingEntity t); + + void save(List entities, LingshanHelpCrowdDibaoEntity lingshanHelpCrowdDibaoEntity); + + void save(List entities, LingshanHelpCrowdDujuEntity lingshanHelpCrowdDujuEntity); + + void save(List entities, LingshanHelpCrowdGaolingEntity lingshanHelpCrowdGaolingEntity); + + void save(List entities, LingshanHelpCrowdKongchaoEntity lingshanHelpCrowdKongchaoEntity); + + void save(List entities, LingshanHelpCrowdLiushouEntity lingshanHelpCrowdLiushouEntity); + + void save(List entities, LingshanHelpCrowdTekunEntity lingshanHelpCrowdTekunEntity); // /** - // * @description: 新增-安置帮教 - // * @param azbjData: + // * @description: 特殊人群详情 + // * @param idCard: // * @return // * @author: WangXianZhang - // * @date: 2023/4/20 2:51 PM + // * @date: 2023/4/20 3:45 PM // */ - // void createSpecialCrowd(LingShanSpecialCrowdDetailBaseExcelData azbjData, String specialType); + // LingShanSpecialTypeSaveResultDTO getPersonHelpTypeDetail(String resiId); - /** - * @description: 特殊人群详情 - * @param idCard: - * @return - * @author: WangXianZhang - * @date: 2023/4/20 3:45 PM - */ - LingShanSpecialTypeSaveResultDTO getPersonSpecialTypeDetail(String resiId); - - /** - * @description: 列表查询 - * @param orgId: - * @param orgType: - * @param specialType: - * @param name: - * @param mobile: - * @param idCard: - * @return - * @author: WangXianZhang - * @date: 2023/4/20 5:44 PM - */ - PageData listSpecialCrowds(String orgId, String orgType, String specialType, String name, String mobile, - String idCard, Integer pageNo, Integer pageSize); + // /** + // * @description: 列表查询 + // * @param orgId: + // * @param orgType: + // * @param helpType: + // * @param name: + // * @param mobile: + // * @param idCard: + // * @return + // * @author: WangXianZhang + // * @date: 2023/4/20 5:44 PM + // */ + // PageData listHelpCrowds(String orgId, String orgType, String helpType, String name, String mobile, + // String idCard, Integer pageNo, Integer pageSize); - void deleteByResi(String resiId); + // void deleteByResi(String resiId); - /** - * @description: 保存或修改 - * @param input: - * @return - * @author: WangXianZhang - * @date: 2023/4/23 11:06 AM - */ - void saveSpecialCrowd(LingShanSpecialTypeSaveFormDTO input); + // /** + // * @description: 保存或修改 + // * @param input: + // * @return + // * @author: WangXianZhang + // * @date: 2023/4/23 11:06 AM + // */ + // void saveHelpCrowd(LingShanSpecialTypeSaveFormDTO input); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanHelpCrowdServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanHelpCrowdServiceImpl.java new file mode 100644 index 0000000000..ecd754ccc4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanHelpCrowdServiceImpl.java @@ -0,0 +1,476 @@ +package com.epmet.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.bean.PersonHelpTypeBean; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.BizTypeEnum; +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.feign.ResultDataResolver; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.FileUtils; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dao.*; +import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.entity.*; +import com.epmet.enums.LingShanHelpCrowdTypeEnum; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.*; +import com.epmet.excel.handler.*; +import com.epmet.exceptions.ReadExcelHeaderOnlyException; +import com.epmet.feign.OssFeignClient; +import com.epmet.service.LingShanHelpCrowdService; +import com.epmet.utils.ImportTaskUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.http.entity.ContentType; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.commons.CommonsMultipartFile; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, ResultDataResolver { + + @Autowired + private OssFeignClient ossFeignClient; + + @Autowired + private ExecutorService executorService; + + @Autowired + private IcResiUserDao icResiUserDao; + + @Autowired + private LingshanHelpCrowdResiMergeDao helpCrowdResiMergeDao; + + @Autowired + private LingshanHelpCrowdCanjiDao lingshanHelpCrowdCanjiDao; + + @Autowired + private LingshanHelpCrowdDabingDao lingshanHelpCrowdDabingDao; + + @Autowired + private LingshanHelpCrowdDibaoDao lingshanHelpCrowdDibaoDao; + + @Autowired + private LingshanHelpCrowdDujuDao lingshanHelpCrowdDujuDao; + + @Autowired + private LingshanHelpCrowdGaolingDao lingshanHelpCrowdGaolingDao; + + @Autowired + private LingshanHelpCrowdKongchaoDao lingshanHelpCrowdKongchaoDao; + + @Autowired + private LingshanHelpCrowdLiushouDao lingshanHelpCrowdLiushouDao; + + @Autowired + private LingshanHelpCrowdTekunDao lingshanHelpCrowdTekunDao; + + private String[] COPY_IGNORED_FIELDS = { "id", "customerId", "resiId", "idCard", "createdTime", "createdBy" }; + + @Override + public String validate(LingShanHelpCrowdBaseExcelData row) { + String idCard = row.getIdCard(); + String name = row.getName(); + + IcResiUserEntity resiEntity = icResiUserDao.selectResiUserEntityByIdCard(idCard, EpmetRequestHolder.getLoginUserCustomerId()); + if (resiEntity == null) { + // 居民不存在,报错 + return "居民信息不存在,请先维护居民基础信息。"; + } + if (!resiEntity.getName().equals(name)) { + return String.format("姓名信息与居民基础信息不一致。(在居民库中根据身份证号找到的居民姓名为:%s)", resiEntity.getName()); + } + + // 设置居民id + row.setResiId(resiEntity.getId()); + row.setResiGridId(resiEntity.getGridId()); + + return null; + } + + @Override + public void savePersonAndTypes(List personTypes, Boolean hard) { + + if (hard) { + // > + HashMap> resiIdAndTypeBeans = new HashMap<>(); + + for (PersonHelpTypeBean personType : personTypes) { + + Set typeBeans = resiIdAndTypeBeans.get(personType.getResiId()); + if (typeBeans == null) { + typeBeans = new HashSet<>(); + resiIdAndTypeBeans.put(personType.getResiId(), typeBeans); + } + + typeBeans.add(personType); + } + + for (Map.Entry> kv : resiIdAndTypeBeans.entrySet()) { + String resiId = kv.getKey(); + Set typeBeans = kv.getValue(); + + // 按照居民,一个一个来,先清除,后新增,别怕,暴力一点 + LambdaQueryWrapper dq = new LambdaQueryWrapper<>(); + dq.eq(LingshanHelpCrowdResiMergeEntity::getResiId, resiId); + dq.in(LingshanHelpCrowdResiMergeEntity::getCrowdType, typeBeans.stream().map(PersonHelpTypeBean::getHelpCrowdType).collect(Collectors.toSet())); + helpCrowdResiMergeDao.delete(dq); + + for (PersonHelpTypeBean typeBean : typeBeans) { + LingshanHelpCrowdResiMergeEntity e2insert = new LingshanHelpCrowdResiMergeEntity(); + e2insert.setCrowdType(typeBean.getHelpCrowdType()); + e2insert.setOrgIdPath(typeBean.getOrgIdPath()); + e2insert.setResiId(resiId); + e2insert.setIdCard(typeBean.getIdCard()); + helpCrowdResiMergeDao.insert(e2insert); + } + } + } else { + // 增加新的 + for (PersonHelpTypeBean personAndType : personTypes) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdResiMergeEntity::getResiId, personAndType.getResiId()); + q.eq(LingshanHelpCrowdResiMergeEntity::getCrowdType, personAndType.getHelpCrowdType()); + + if (helpCrowdResiMergeDao.selectCount(q) == 0) { + // 需要新增 + LingshanHelpCrowdResiMergeEntity e2insert = new LingshanHelpCrowdResiMergeEntity(); + e2insert.setCrowdType(personAndType.getHelpCrowdType()); + e2insert.setOrgIdPath(personAndType.getOrgIdPath()); + e2insert.setResiId(personAndType.getResiId()); + e2insert.setIdCard(personAndType.getIdCard()); + helpCrowdResiMergeDao.insert(e2insert); + } + } + } + } + + @Override + public String importHelpCrowd(String crowdType, String fileSavePath, String originalFilename) { + Class excelDataClass; + AbstractLingShanHelpCrowdExcelImportListener listener; + + if (LingShanHelpCrowdTypeEnum.CANJI.getType().equals(crowdType)) { + listener = new LingShanHelpCrowdCanjiExcelImportListener(); + excelDataClass = LingshanHelpCrowdCanjiExcelData.class; + } else if (LingShanHelpCrowdTypeEnum.DABING.getType().equals(crowdType)) { + listener = new LingShanHelpCrowdDabingExcelImportListener(); + excelDataClass = LingshanHelpCrowdDabingExcelData.class; + } else if (LingShanHelpCrowdTypeEnum.DIBAO.getType().equals(crowdType)) { + listener = new LingShanHelpCrowdDibaoExcelImportListener(); + excelDataClass = LingshanHelpCrowdDibaoExcelData.class; + } else if (LingShanHelpCrowdTypeEnum.DUJU.getType().equals(crowdType)) { + listener = new LingShanHelpCrowdDujuExcelImportListener(); + excelDataClass = LingshanHelpCrowdDujuExcelData.class; + } else if (LingShanHelpCrowdTypeEnum.GAOLING.getType().equals(crowdType)) { + listener = new LingShanHelpCrowdGaolingExcelImportListener(); + excelDataClass = LingshanHelpCrowdGaolingExcelData.class; + } else if (LingShanHelpCrowdTypeEnum.KONGCHAO.getType().equals(crowdType)) { + listener = new LingShanHelpCrowdKongchaoExcelImportListener(); + excelDataClass = LingshanHelpCrowdKongchaoExcelData.class; + } else if (LingShanHelpCrowdTypeEnum.LIUSHOU.getType().equals(crowdType)) { + listener = new LingShanHelpCrowdLiushouExcelImportListener(); + excelDataClass = LingshanHelpCrowdLiushouExcelData.class; + } else if (LingShanHelpCrowdTypeEnum.TEKUN.getType().equals(crowdType)) { + listener = new LingShanHelpCrowdTekunExcelImportListener(); + excelDataClass = LingshanHelpCrowdTekunExcelData.class; + } else { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道-重点帮扶】导入。不支持的人群类别:" + crowdType); + } + + // Execute reading + // ReadSheet sheet = EasyExcel.readSheet(0).registerReadListener(listener).build(); + // EasyExcel.read(fileSavePath).build().read(sheet); + + // 解析表头,判断表头是否合格 + try { + listener.setValidateHeaderOnly(true); + EasyExcel.read(fileSavePath, excelDataClass, listener) + .headRowNumber(listener.getMaxHeadRowNum()) + .sheet(0) + .doRead(); + } catch ( + ReadExcelHeaderOnlyException e) { + log.info("【灵山街道-导入社会维稳】验证通过,可以继续导入"); + } + + // 正式开始导入。异步导入 + listener.setValidateHeaderOnly(false); + + // 创建导入任务 + ImportTaskCommonResultDTO importTaskRst = getResultDataOrThrowsException(ImportTaskUtils.createImportTask(originalFilename, + BizTypeEnum.SPECIAL_CROWD.getType()), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + null, "【灵山街道-导入重点帮扶人群】创建导入任务失败"); + + try { + submitAsyncImport(fileSavePath, excelDataClass, listener, importTaskRst.getTaskId()); + return importTaskRst.getTaskId(); + } catch (Exception e) { + // 如果提交异步任务失败了,也要将导入任务置为结束,并且返回一个未知错误 + log.error("【灵山街道-导入重点帮扶人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e)); + ImportTaskUtils.finishImportTask(importTaskRst.getTaskId(), + ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误"); + + // 删除文件 + FileUtils.deleteFileIfExists(fileSavePath); + + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "导入失败,未知错误"); + } + } + + /** + * @Description: 提交异步任务 + * @param fileSavePath: + * @param excelDataClass: + * @param listener: + * @param taskId: + * @Return void + * @Author: wangxianzhang + * @Date: 2023/5/19 4:02 PM + */ + private void submitAsyncImport(String fileSavePath, Class excelDataClass, AbstractLingShanHelpCrowdExcelImportListener listener, String taskId) { + CompletableFuture.runAsync(() -> { + try { + EasyExcel.read(fileSavePath, excelDataClass, listener) + .headRowNumber(listener.getMaxHeadRowNum()) + .sheet(0) + .doRead(); + + List errorDatas = listener.getErrorDatas(); + if (CollectionUtils.isNotEmpty(errorDatas)) { + // 有错误数据需要提示 + String resultDescFilePath = uploadResultDescFilePath(errorDatas, listener.getTemplateFileName()); + ImportTaskUtils.finishImportTask(taskId, + ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, resultDescFilePath, "失败,请导出文件查看详细信息", + listener.getSuccessedItemsQty(), listener.getFailedItemsQty()); + } else { + // 全部成功 + ImportTaskUtils.finishImportTask(taskId, + ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, null, "成功"); + } + } catch (Exception e) { + log.error("【灵山街道-导入重点帮扶人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e)); + ImportTaskUtils.finishImportTask(taskId, + ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误"); + } finally { + FileUtils.deleteFileIfExists(fileSavePath); + } + }, executorService); + } + + /** + * @description: 上传错误描述文件 + * @param errorDatas: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 10:19 PM + */ + private String uploadResultDescFilePath(List errorDatas, String templateFileName) { + FileItem fileItem = null; + try { + String fileName = + DateUtils.format(new Date(), "yyyyMMdd_HHmmss_") + System.nanoTime() + "重点帮扶人群导入失败数据.xlsx"; + + // 创建临时文件 + fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, FileUtils.getAndCreateDirUnderEpmetFilesDir("temp").toFile()) + .createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); + + // 写入临时文件 + try (OutputStream os = fileItem.getOutputStream()) { + WriteSheet sheet = EasyExcel.writerSheet(0).build(); + InputStream templateIs = this.getClass().getClassLoader().getResourceAsStream(templateFileName); + ExcelWriter excelWriter = EasyExcel.write(os).withTemplate(templateIs).build().fill(errorDatas, sheet); + excelWriter.finish(); + } catch (IOException e) { + throw new RuntimeException(e); + } + + // 上传文件 + UploadImgResultDTO uploadRst = getResultDataOrThrowsException(ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)), ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + null, "【灵山街道-导入重点帮扶人群】上传错误描述文件失败。"); + + return uploadRst.getUrl(); + + } catch (IOException e) { + throw new RuntimeException("【灵山街道-导入重点帮扶人群】生成错误描述文件-创建临时目录失败"); + } finally { + try { + fileItem.delete(); + } catch (Exception e) { + log.error("【灵山街道-导入重点帮扶人群】删除fileItem临时文件失败"); + } + } + } + + + @Override + public void save(List entities, LingshanHelpCrowdCanjiEntity t) { + for (LingshanHelpCrowdCanjiEntity entity : entities) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdCanjiEntity::getResiId, entity.getResiId()); + + LingshanHelpCrowdCanjiEntity existsOne; + if ((existsOne = lingshanHelpCrowdCanjiDao.selectOne(q)) != null) { + BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); + lingshanHelpCrowdCanjiDao.updateById(existsOne); + continue; + } + + entity.setId(IdWorker.getIdStr()); + lingshanHelpCrowdCanjiDao.insert(entity); + } + } + + @Override + public void save(List entities, LingshanHelpCrowdDabingEntity t) { + for (LingshanHelpCrowdDabingEntity entity : entities) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdDabingEntity::getResiId, entity.getResiId()); + + LingshanHelpCrowdDabingEntity existsOne; + if ((existsOne = lingshanHelpCrowdDabingDao.selectOne(q)) != null) { + BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); + lingshanHelpCrowdDabingDao.updateById(existsOne); + continue; + } + + entity.setId(IdWorker.getIdStr()); + lingshanHelpCrowdDabingDao.insert(entity); + } + } + + @Override + public void save(List entities, LingshanHelpCrowdDibaoEntity lingshanHelpCrowdDibaoEntity) { + for (LingshanHelpCrowdDibaoEntity entity : entities) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdDibaoEntity::getResiId, entity.getResiId()); + + LingshanHelpCrowdDibaoEntity existsOne; + if ((existsOne = lingshanHelpCrowdDibaoDao.selectOne(q)) != null) { + BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); + lingshanHelpCrowdDibaoDao.updateById(existsOne); + continue; + } + + entity.setId(IdWorker.getIdStr()); + + lingshanHelpCrowdDibaoDao.insert(entity); + } + } + + @Override + public void save(List entities, LingshanHelpCrowdDujuEntity lingshanHelpCrowdDujuEntity) { + for (LingshanHelpCrowdDujuEntity entity : entities) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdDujuEntity::getResiId, entity.getResiId()); + + LingshanHelpCrowdDujuEntity existsOne; + if ((existsOne = lingshanHelpCrowdDujuDao.selectOne(q)) != null) { + BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); + lingshanHelpCrowdDujuDao.updateById(existsOne); + continue; + } + + entity.setId(IdWorker.getIdStr()); + + lingshanHelpCrowdDujuDao.insert(entity); + } + + } + + @Override + public void save(List entities, LingshanHelpCrowdGaolingEntity lingshanHelpCrowdGaolingEntity) { + for (LingshanHelpCrowdGaolingEntity entity : entities) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdGaolingEntity::getResiId, entity.getResiId()); + + LingshanHelpCrowdGaolingEntity existsOne; + if ((existsOne = lingshanHelpCrowdGaolingDao.selectOne(q)) != null) { + BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); + lingshanHelpCrowdGaolingDao.updateById(existsOne); + continue; + } + + lingshanHelpCrowdGaolingDao.insert(entity); + } + } + + @Override + public void save(List entities, LingshanHelpCrowdKongchaoEntity lingshanHelpCrowdKongchaoEntity) { + for (LingshanHelpCrowdKongchaoEntity entity : entities) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdKongchaoEntity::getResiId, entity.getResiId()); + + LingshanHelpCrowdKongchaoEntity existsOne; + if ((existsOne = lingshanHelpCrowdKongchaoDao.selectOne(q)) != null) { + BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); + lingshanHelpCrowdKongchaoDao.updateById(existsOne); + continue; + } + + lingshanHelpCrowdKongchaoDao.insert(entity); + } + } + + @Override + public void save(List entities, LingshanHelpCrowdLiushouEntity lingshanHelpCrowdLiushouEntity) { + for (LingshanHelpCrowdLiushouEntity entity : entities) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdLiushouEntity::getResiId, entity.getResiId()); + + LingshanHelpCrowdLiushouEntity existsOne; + if ((existsOne = lingshanHelpCrowdLiushouDao.selectOne(q)) != null) { + BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); + lingshanHelpCrowdLiushouDao.updateById(existsOne); + continue; + } + + lingshanHelpCrowdLiushouDao.insert(entity); + } + } + + @Override + public void save(List entities, LingshanHelpCrowdTekunEntity lingshanHelpCrowdTekunEntity) { + + for (LingshanHelpCrowdTekunEntity entity : entities) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(LingshanHelpCrowdTekunEntity::getResiId, entity.getResiId()); + + LingshanHelpCrowdTekunEntity existsOne; + if ((existsOne = lingshanHelpCrowdTekunDao.selectOne(q)) != null) { + BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); + lingshanHelpCrowdTekunDao.updateById(existsOne); + continue; + } + + lingshanHelpCrowdTekunDao.insert(entity); + } + + } +} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcSpecialDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcSpecialDao.xml index 9535299885..a96d4d2d06 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcSpecialDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcSpecialDao.xml @@ -15,7 +15,10 @@ , r.HOME_ID , s.CREATED_TIME , s.UPDATED_TIME - , s.SPECIAL_RQLB SPECIAL_TYPES_STR + , s.SPECIAL_RQLB SPECIAL_TYPES_STR, + , r.GENDER + , r.BIRTHDAY + , year(now()) - year(r.BIRTHDAY) as age from ic_resi_user r inner join ic_special s on (r.ID = s.IC_RESI_USER and s.DEL_FLAG = 0) where diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdResiMergeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdResiMergeDao.xml new file mode 100644 index 0000000000..cce3b1ffa0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanHelpCrowdResiMergeDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From c619a021197e751e05e46c913c24df76bc33a9ef Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 25 May 2023 10:28:10 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=A1=A5=E5=85=85import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/IcResiUserDao.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 5bbd9ad996..4fd2411767 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -25,6 +25,8 @@ import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; +import com.epmet.dto.result.resi.ResiPortrayalDetailDTO; +import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; From 3019e9e84d84ed6eca800d5a1b1ff7baa6a80261 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 25 May 2023 11:43:34 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LingShanHelpCrowdController.java | 2 +- .../entity/LingshanHelpCrowdDibaoEntity.java | 16 +++++++--------- .../entity/LingshanHelpCrowdDujuEntity.java | 6 +----- .../entity/LingshanHelpCrowdGaolingEntity.java | 8 +++----- .../entity/LingshanHelpCrowdKongchaoEntity.java | 8 ++------ .../entity/LingshanHelpCrowdLiushouEntity.java | 4 ---- .../entity/LingshanHelpCrowdResiMergeEntity.java | 3 --- .../entity/LingshanHelpCrowdTekunEntity.java | 16 +++++++--------- .../data/LingshanHelpCrowdCanjiExcelData.java | 2 +- .../data/LingshanHelpCrowdDibaoExcelData.java | 15 ++++++++------- .../data/LingshanHelpCrowdDujuExcelData.java | 2 +- .../data/LingshanHelpCrowdGaolingExcelData.java | 6 ++++-- .../data/LingshanHelpCrowdKongchaoExcelData.java | 2 +- .../data/LingshanHelpCrowdTekunExcelData.java | 14 +++++++------- 14 files changed, 43 insertions(+), 61 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java index 2fc1565c4b..ad8e791bde 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanHelpCrowdController.java @@ -19,7 +19,7 @@ import java.util.Date; @Slf4j @RestController -@RequestMapping("helpCrowd") +@RequestMapping("lingShan/helpCrowd") public class LingShanHelpCrowdController { @Autowired diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java index 69090f749d..73aa29f86a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDibaoEntity.java @@ -1,8 +1,6 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -21,12 +19,12 @@ import java.util.Date; public class LingshanHelpCrowdDibaoEntity extends LingshanHelpCrowdBaseEntity { /** - * 户籍类型。0农村户籍,1城镇户籍 + * 户籍类型。100农村户籍,101城镇户籍 */ private Integer hjlx; /** - * 低保类型。0农村低保,1城镇低保 + * 低保类型。200农村低保,201城镇低保 */ private Integer dblx; @@ -56,12 +54,12 @@ public class LingshanHelpCrowdDibaoEntity extends LingshanHelpCrowdBaseEntity { private Integer isCj; /** - * 是否有劳动能力。【0:无,1:部分丧失劳动能力,2:完全丧失劳动能力】 + * 是否有劳动能力。【300:有劳动能力,301:部分丧失劳动能力,302:完全丧失劳动能力】 */ private Integer ynLdnl; /** - * 健康状况【0:一般或较弱,1:健康或良好】 + * 健康状况【400:一般或较弱,401:健康或良好】 */ private Integer jkzk; @@ -71,14 +69,14 @@ public class LingshanHelpCrowdDibaoEntity extends LingshanHelpCrowdBaseEntity { private String shbz; /** - * 参保类型【0城乡居民基本医疗保险,1职工医疗保险,2新型农村合作医疗】 + * 参保类型【500城乡居民基本医疗保险,501职工医疗保险,502新型农村合作医疗】 */ private Integer cblx; /** * 最初享受月份 */ - private String zcxsyf; + private Date zcxsyf; /** * 是否建档立卡扶贫对象。0否,1是 @@ -111,7 +109,7 @@ public class LingshanHelpCrowdDibaoEntity extends LingshanHelpCrowdBaseEntity { private BigDecimal ryfjzc; /** - * 救助金计算方式【0其他,1补差】 + * 救助金计算方式【600其他,601补差】 */ private Integer jzjjsfs; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java index e7e3fb254e..361ca18072 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdDujuEntity.java @@ -1,13 +1,9 @@ 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; - /** * 重点帮扶-独居老人 * @@ -35,7 +31,7 @@ public class LingshanHelpCrowdDujuEntity extends LingshanHelpCrowdBaseEntity { private String jhrylrgx; /** - * 健康状况【0:一般或较弱,1:健康或良好】 + * 健康状况【400:一般或较弱,401:健康或良好】 */ private Integer jkzk; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdGaolingEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdGaolingEntity.java index e460d62d06..3ece232d1e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdGaolingEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdGaolingEntity.java @@ -1,12 +1,10 @@ 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; +import java.math.BigDecimal; /** * 重点帮扶-高龄老人 @@ -27,7 +25,7 @@ public class LingshanHelpCrowdGaolingEntity extends LingshanHelpCrowdBaseEntity /** * 津贴金额(元) */ - private String jtje; + private BigDecimal jtje; /** * 津贴发放情况说明 @@ -35,7 +33,7 @@ public class LingshanHelpCrowdGaolingEntity extends LingshanHelpCrowdBaseEntity private String ffqk; /** - * 自理情况【0不能自理,1能够自理】 + * 自理情况【700不能自理,701能够自理】 */ private Integer zlqk; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdKongchaoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdKongchaoEntity.java index b3f6663e96..6b002edcc4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdKongchaoEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdKongchaoEntity.java @@ -1,13 +1,9 @@ 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; - /** * 重点帮扶-空巢老人 * @@ -35,9 +31,9 @@ public class LingshanHelpCrowdKongchaoEntity extends LingshanHelpCrowdBaseEntity private String jhrylrgx; /** - * 健康状况【0:一般或较弱,1:健康或良好】 + * 健康状况【400:一般或较弱,401:健康或良好】 */ - private String jkzk; + private Integer jkzk; /** * 子女探视间隔时间 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdLiushouEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdLiushouEntity.java index 63f3bcc226..48f9a55852 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdLiushouEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdLiushouEntity.java @@ -1,13 +1,9 @@ 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; - /** * 重点帮扶-留守儿童 * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdResiMergeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdResiMergeEntity.java index 3acb5f0898..dfcd4be660 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdResiMergeEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdResiMergeEntity.java @@ -3,13 +3,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 居民-重点帮扶人群对应关系 * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java index f0ffdf9e0d..42b7fbce16 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanHelpCrowdTekunEntity.java @@ -1,8 +1,6 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -21,7 +19,7 @@ import java.util.Date; public class LingshanHelpCrowdTekunEntity extends LingshanHelpCrowdBaseEntity { /** - * 户籍类型。0农村户籍,1城镇户籍 + * 户籍类型。100农村户籍,101城镇户籍 */ private Integer hjlx; @@ -51,12 +49,12 @@ public class LingshanHelpCrowdTekunEntity extends LingshanHelpCrowdBaseEntity { private Integer isCj; /** - * 生活自理能力。0具备生活自理能力,1部分丧失生活能力,2完全丧失生活自理能力 + * 生活自理能力。800具备生活自理能力,801部分丧失生活能力,802完全丧失生活自理能力 */ private Integer shzlnl; /** - * 健康状况【0:一般或较弱,1:健康或良好】 + * 健康状况【400:一般或较弱,401:健康或良好】 */ private Integer jkzk; @@ -66,14 +64,14 @@ public class LingshanHelpCrowdTekunEntity extends LingshanHelpCrowdBaseEntity { private String shbz; /** - * 参保类型【0城乡居民基本医疗保险,1职工医疗保险,2新型农村合作医疗】 + * 参保类型【500城乡居民基本医疗保险,501职工医疗保险,502新型农村合作医疗】 */ private Integer cblx; /** * 最初享受月份 */ - private String zcxsyf; + private Date zcxsyf; /** * 是否建档立卡扶贫对象。0否,1是 @@ -96,14 +94,14 @@ public class LingshanHelpCrowdTekunEntity extends LingshanHelpCrowdBaseEntity { private String yhzh; /** - * 供养方式。0集中供养,1分散供养 + * 供养方式。900集中供养,901分散供养 */ private Integer gyfs; /** * 供养机构名称 */ - private Integer gyjgmc; + private String gyjgmc; /** * 基本生活标准(元) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java index f2b6569385..8152eec568 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdCanjiExcelData.java @@ -42,7 +42,7 @@ public class LingshanHelpCrowdCanjiExcelData extends LingShanHelpCrowdBaseExcelD * 有效期开始时间 */ @ExcelProperty(value = "有效期开始时间") - @DateTimeFormat("yyyy/MM/dd") + @DateTimeFormat("yyyy/MM") private Date validityStart; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java index e293f66932..beb96e2e27 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDibaoExcelData.java @@ -9,6 +9,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; +import java.util.Date; /** * 重点帮扶-低保 @@ -20,13 +21,13 @@ import java.math.BigDecimal; public class LingshanHelpCrowdDibaoExcelData extends LingShanHelpCrowdBaseExcelData { /** - * 户籍类型。0农村户籍,1城镇户籍 + * 户籍类型。100农村户籍,101城镇户籍 */ @ExcelProperty(value = "户籍类型", converter = LingShanHelpCrowdExcelConverter.class) private Integer hjlx; /** - * 低保类型。0农村低保,1城镇低保 + * 低保类型。200农村低保,201城镇低保 */ @ExcelProperty(value = "*低保类型", converter = LingShanHelpCrowdExcelConverter.class) private Integer dblx; @@ -62,13 +63,13 @@ public class LingshanHelpCrowdDibaoExcelData extends LingShanHelpCrowdBaseExcelD private Integer isCj; /** - * 是否有劳动能力。【0:无,1:部分丧失劳动能力,2:完全丧失劳动能力】 + * 是否有劳动能力。【300:有劳动能力,301:部分丧失劳动能力,302:完全丧失劳动能力】 */ @ExcelProperty(value = "劳动能力", converter = LingShanHelpCrowdExcelConverter.class) private Integer ynLdnl; /** - * 健康状况【0:一般或较弱,1:健康或良好】 + * 健康状况【400:一般或较弱,401:健康或良好】 */ @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) private Integer jkzk; @@ -80,7 +81,7 @@ public class LingshanHelpCrowdDibaoExcelData extends LingShanHelpCrowdBaseExcelD private String shbz; /** - * 参保类型【0城乡居民基本医疗保险,1职工医疗保险,2新型农村合作医疗】 + * 参保类型【500城乡居民基本医疗保险,501职工医疗保险,502新型农村合作医疗】 */ @ExcelProperty(value = "参保类型", converter = LingShanHelpCrowdExcelConverter.class) private Integer cblx; @@ -89,7 +90,7 @@ public class LingshanHelpCrowdDibaoExcelData extends LingShanHelpCrowdBaseExcelD * 最初享受月份 */ @ExcelProperty(value = "最初享受月份") - private String zcxsyf; + private Date zcxsyf; /** * 是否建档立卡扶贫对象。0否,1是 @@ -128,7 +129,7 @@ public class LingshanHelpCrowdDibaoExcelData extends LingShanHelpCrowdBaseExcelD private BigDecimal ryfjzc; /** - * 救助金计算方式【0其他,1补差】 + * 救助金计算方式【600其他,601补差】 */ @ExcelProperty(value = "救助金计算方式", converter = LingShanHelpCrowdExcelConverter.class) private Integer jzjjsfs; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuExcelData.java index 9ccc713395..d4587a9b98 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdDujuExcelData.java @@ -32,7 +32,7 @@ public class LingshanHelpCrowdDujuExcelData extends LingShanHelpCrowdBaseExcelDa private String jhrylrgx; /** - * 健康状况【0:一般或较弱,1:健康或良好】 + * 健康状况【400:一般或较弱,401:健康或良好】 */ @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) private Integer jkzk; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdGaolingExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdGaolingExcelData.java index 4dbfebbe09..95f261caf0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdGaolingExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdGaolingExcelData.java @@ -7,6 +7,8 @@ import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; import lombok.Data; import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + /** * 重点帮扶-高龄老人 * @@ -26,7 +28,7 @@ public class LingshanHelpCrowdGaolingExcelData extends LingShanHelpCrowdBaseExce * 津贴金额(元) */ @ExcelProperty(value = "*津贴金额(元)") - private String jtje; + private BigDecimal jtje; /** * 津贴发放情况说明 @@ -35,7 +37,7 @@ public class LingshanHelpCrowdGaolingExcelData extends LingShanHelpCrowdBaseExce private String ffqk; /** - * 自理情况【0不能自理,1能够自理】 + * 自理情况【700不能自理,701能够自理】 */ @ExcelProperty(value = "自理情况", converter = LingShanHelpCrowdExcelConverter.class) private Integer zlqk; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdKongchaoExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdKongchaoExcelData.java index 4142f5a0bc..70fa06a071 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdKongchaoExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdKongchaoExcelData.java @@ -35,7 +35,7 @@ public class LingshanHelpCrowdKongchaoExcelData extends LingShanHelpCrowdBaseExc private String jhrylrgx; /** - * 健康状况【0:一般或较弱,1:健康或良好】 + * 健康状况【400:一般或较弱,401:健康或良好】 */ @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) private Integer jkzk; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java index 75966f441e..44c96f1c06 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanHelpCrowdTekunExcelData.java @@ -21,7 +21,7 @@ import java.util.Date; public class LingshanHelpCrowdTekunExcelData extends LingShanHelpCrowdBaseExcelData{ /** - * 户籍类型。0农村户籍,1城镇户籍 + * 户籍类型。100农村户籍,101城镇户籍 */ @ExcelProperty(value = "户籍类型", converter = LingShanHelpCrowdExcelConverter.class) private Integer hjlx; @@ -57,13 +57,13 @@ public class LingshanHelpCrowdTekunExcelData extends LingShanHelpCrowdBaseExcelD private Integer isCj; /** - * 生活自理能力。0具备生活自理能力,1部分丧失生活能力,2完全丧失生活自理能力 + * 生活自理能力。800具备生活自理能力,801部分丧失生活能力,802完全丧失生活自理能力 */ @ExcelProperty(value = "生活自理能力", converter = LingShanHelpCrowdExcelConverter.class) private Integer shzlnl; /** - * 健康状况【0:一般或较弱,1:健康或良好】 + * 健康状况【400:一般或较弱,401:健康或良好】 */ @ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) private Integer jkzk; @@ -75,7 +75,7 @@ public class LingshanHelpCrowdTekunExcelData extends LingShanHelpCrowdBaseExcelD private String shbz; /** - * 参保类型【0城乡居民基本医疗保险,1职工医疗保险,2新型农村合作医疗】 + * 参保类型【500城乡居民基本医疗保险,501职工医疗保险,502新型农村合作医疗】 */ @ExcelProperty(value = "参保类型", converter = LingShanHelpCrowdExcelConverter.class) private Integer cblx; @@ -84,7 +84,7 @@ public class LingshanHelpCrowdTekunExcelData extends LingShanHelpCrowdBaseExcelD * 最初享受月份 */ @ExcelProperty(value = "最初享受月份") - private String zcxsyf; + private Date zcxsyf; /** * 是否建档立卡扶贫对象。0否,1是 @@ -111,7 +111,7 @@ public class LingshanHelpCrowdTekunExcelData extends LingShanHelpCrowdBaseExcelD private String yhzh; /** - * 供养方式。0集中供养,1分散供养 + * 供养方式。900集中供养,901分散供养 */ @ExcelProperty(value = "供养方式", converter = LingShanHelpCrowdExcelConverter.class) private Integer gyfs; @@ -120,7 +120,7 @@ public class LingshanHelpCrowdTekunExcelData extends LingShanHelpCrowdBaseExcelD * 供养机构名称 */ @ExcelProperty(value = "供养机构名称") - private Integer gyjgmc; + private String gyjgmc; /** * 基本生活标准(元) From 170bb78e6e80bcf2bf7809f89fec6a3e48e11d42 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 25 May 2023 14:42:32 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E3=80=91?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=EF=BC=8Cfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/utils/FileDownloadHelper.java | 29 +++++++++++ .../main/java/com/epmet/dto/IcEventDTO.java | 1 + .../dto/result/IcEventListResultDTO.java | 2 + .../epmet/controller/IcEventController.java | 7 +++ .../java/com/epmet/entity/IcEventEntity.java | 2 + .../service/impl/IcEventServiceImpl.java | 8 +++ .../src/main/resources/mapper/IcEventDao.xml | 40 +++++++------- .../LingShanHelpCrowdController.java | 52 +++++++++++++++++++ .../data/LingshanHelpCrowdCanjiExcelData.java | 2 +- 9 files changed, 122 insertions(+), 21 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileDownloadHelper.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileDownloadHelper.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileDownloadHelper.java new file mode 100644 index 0000000000..8b5daf0b28 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileDownloadHelper.java @@ -0,0 +1,29 @@ +package com.epmet.commons.tools.utils; + +import javax.servlet.http.HttpServletResponse; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +/** + * @Description 文件下载工具类 + * @Author wangxianzhang + * @Time 2023/5/25 2:23 PM + */ +public class FileDownloadHelper { + + /** + * @Description: 为下载xlsx文件设置response + * @param response: + * @param fileName: + * @Return void + * @Author: wangxianzhang + * @Date: 2023/5/25 2:23 PM + */ + public static void setResponseForXlsx(HttpServletResponse response, String fileName) throws UnsupportedEncodingException { + response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + // response.setHeader("content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8")); + } + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java index ae22f9570e..b90800f2e1 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java @@ -218,4 +218,5 @@ public class IcEventDTO implements Serializable { */ private Date updatedTime; + private Integer replyStatus; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java index bb23c45258..0d781e06c2 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java @@ -206,6 +206,8 @@ public class IcEventListResultDTO implements Serializable { */ private String difficultPointName; + private Integer replyStatus; + /** * 事件附件 */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java index 26e2b2895f..327c768be2 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java @@ -624,6 +624,13 @@ public class IcEventController { @PostMapping("updateReply") public Result updateReply(@RequestBody IcEventReplyFormDTO formDTO) { icEventReplyService.updateByReplyId(formDTO); + if (null != formDTO.getIcEventId()) { + IcEventDTO entity = icEventService.get(formDTO.getId()); + if (formDTO.getManageStatus() > entity.getReplyStatus()) { + entity.setReplyStatus(formDTO.getManageStatus()); + icEventService.update(entity); + } + } return new Result(); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java index 3cb9cd00b9..0ec2bff965 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java @@ -186,4 +186,6 @@ public class IcEventEntity extends BaseEpmetEntity { */ private String difficultPoint; + private Integer replyStatus; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index c61a8cbbde..eacefe3c01 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -798,6 +798,14 @@ public class IcEventServiceImpl extends BaseServiceImpl formDTO.getManageStatus()) { + //如果事件已经存在处理流程,且当前处理流程状态大于之前的状态则更新最新的处理状态 + entity.setReplyStatus(formDTO.getManageStatus()); + } baseDao.updateById(entity); //3.新增回复数据 diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml index 9b9da5cf0f..9f5c3ba791 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -133,6 +133,7 @@ +