From 01717d97d82d4401f1b2ce1886b8332bc8dcb8d4 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Apr 2023 16:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1=E8=A1=97=E9=81=93?= =?UTF-8?q?=E3=80=911.=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=85=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=AE=8C=E6=88=90=E4=B8=80=E5=8D=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/LingShanSpecialCrowdTypeEnums.java | 42 +++ .../LingShanSpecialCrowdController.java | 114 ++++++ .../LingshanSpecialCrowdDetailAzbjDao.java | 20 + .../LingshanSpecialCrowdDetailJdryDao.java | 20 + .../LingshanSpecialCrowdDetailJzhzDao.java | 20 + .../LingshanSpecialCrowdDetailSqjzDao.java | 20 + .../LingshanSpecialCrowdDetailXfryDao.java | 20 + .../dao/LingshanSpecialCrowdPersonDao.java | 21 ++ .../LingshanSpecialCrowdPersonTypeDao.java | 20 + .../LingshanSpecialCrowdDetailAzbjEntity.java | 69 ++++ .../LingshanSpecialCrowdDetailBaseEntity.java | 22 ++ .../LingshanSpecialCrowdDetailJdryEntity.java | 69 ++++ .../LingshanSpecialCrowdDetailJzhzEntity.java | 74 ++++ .../LingshanSpecialCrowdDetailSqjzEntity.java | 79 ++++ .../LingshanSpecialCrowdDetailXfryEntity.java | 70 ++++ .../LingshanSpecialCrowdPersonEntity.java | 64 ++++ .../LingshanSpecialCrowdPersonTypeEntity.java | 59 +++ .../LingShanSpecialCrowdIsOrNotConverter.java | 34 ++ .../LingShanSpecialCrowdJzhzConverter.java | 57 +++ .../LingShanSpecialCrowdSqjzConverter.java | 51 +++ ...ngShanSpecialCrowdDetailAzbjExcelData.java | 73 ++++ ...ngShanSpecialCrowdDetailBaseExcelData.java | 30 ++ ...ngshanSpecialCrowdDetailJdryExcelData.java | 79 ++++ ...ngshanSpecialCrowdDetailJzhzExcelData.java | 84 +++++ ...ngshanSpecialCrowdDetailSqjzExcelData.java | 92 +++++ ...ngshanSpecialCrowdDetailXfryExcelData.java | 77 ++++ ...ngShanSpecialCrowdExcelImportListener.java | 351 ++++++++++++++++++ ...anSpecialCrowdAzbjExcelImportListener.java | 49 +++ ...nSpecialCrowdJieduExcelImportListener.java | 45 +++ ...cialCrowdJingZhangExcelImportListener.java | 46 +++ ...anSpecialCrowdSqjzExcelImportListener.java | 45 +++ ...pecialCrowdXinFangExcelImportListener.java | 46 +++ .../service/LingShanSpecialCrowdService.java | 47 +++ .../impl/LingShanSpecialCrowdServiceImpl.java | 163 ++++++++ .../LingshanSpecialCrowdDetailAzbjDao.xml | 57 +++ .../LingshanSpecialCrowdDetailJdryDao.xml | 36 ++ .../LingshanSpecialCrowdDetailJzhzDao.xml | 61 +++ .../LingshanSpecialCrowdDetailSqjzDao.xml | 59 +++ .../LingshanSpecialCrowdDetailXfryDao.xml | 61 +++ .../mapper/LingshanSpecialCrowdPersonDao.xml | 45 +++ .../LingshanSpecialCrowdPersonTypeDao.xml | 36 ++ 41 files changed, 2527 insertions(+) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonTypeDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailAzbjEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailBaseEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJdryEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJzhzEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailSqjzEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailXfryEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonTypeEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdIsOrNotConverter.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdSqjzExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdXinFangExcelImportListener.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanSpecialCrowdService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailAzbjDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJdryDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJzhzDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailSqjzDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailXfryDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonTypeDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java new file mode 100644 index 0000000000..28e0c19e7c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java @@ -0,0 +1,42 @@ +package com.epmet.enums; + +/** + * @description: 灵山街道-特殊人群 + * @param null: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 10:55 AM + */ +public enum LingShanSpecialCrowdTypeEnums { + AZBJ("anzhibangjiao", "安置帮教", 1), + SQJZ("shequjiaozheng", "社区矫正", 1), + JDRY("xidurenyuan", "戒毒人员", 1), + JZHZ("jingzhanghuanzhe", "精障患者", 1), + XFRY("xinfangrenyuan", "信访人员", 1); + + /** + * 类型。anzhibangjiao, + */ + private String type; + private String name; + + private Integer headerRowNumber; + + LingShanSpecialCrowdTypeEnums(String type, String name, Integer headerRowNumber) { + this.type = type; + this.name = name; + this.headerRowNumber = headerRowNumber; + } + + public String getType() { + return type; + } + + public String getName() { + return name; + } + + public Integer getHeaderRowNumber() { + return headerRowNumber; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java new file mode 100644 index 0000000000..aa21a72797 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java @@ -0,0 +1,114 @@ +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.LingShanSpecialCrowdService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Date; + +/** + * @description: 灵山社会维稳(特殊人群) + * @param null: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 9:08 AM + */ +@Slf4j +@RestController +@RequestMapping("lingShan/specialCrowd") +public class LingShanSpecialCrowdController { + + @Autowired + private LingShanSpecialCrowdService lingShanSpecialCrowdService; + + /** + * @description: 特殊人群导入 + * @param file: + * @param crowdCategory: 人群类别 + * anzhibangjiao + * buliangqingshaonian + * shequjiaozheng + * xidurenyuan + * xiejiaorenyuan + * zhaoshizhaohuojingshenbing + * @return + * @author: WangXianZhang + * @date: 2023/4/18 9:12 AM + */ + @PostMapping("import") + public Result importSpecialCowd(MultipartFile file, @RequestParam("crowdCategory") String crowdCategory) { + + // 1.存文件 + Path fileSavePath = saveSpecialCrowdTempFile(file); + + // 2.执行业务导入 + try { + lingShanSpecialCrowdService.importSpecialCrowd(crowdCategory, fileSavePath.toString()); + } catch (Exception e) { + throw e; + // ... + } finally { + // 3.删除文件 + deleteSpecialCrowdTempFile(fileSavePath); + } + + return null; + } + + /** + * @description: 保存特殊人群临时文件 + * @param file: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 9:46 AM + */ + public Path saveSpecialCrowdTempFile(@RequestParam("file") MultipartFile file) { + Path fileSavePath; + FileOutputStream os = null; + try { + Path fileSaveDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("special_crowd_import"); + String fileName = DateUtils.format(new Date(), "yyyyMMdd_HHmmss_" + System.nanoTime()); + 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); + } + } + + /** + * @description: 删除特殊人群临时文件 + * @param fileSavePath: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 9:47 AM + */ + public void deleteSpecialCrowdTempFile(Path fileSavePath) { + if (fileSavePath != null) { + try { + Files.deleteIfExists(fileSavePath); + } catch ( + IOException e) { + log.error("【灵山街道】导入社会维稳数据,删除临时文件失败"); + } + } + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java new file mode 100644 index 0000000000..867b812be2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailAzbjEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-安置帮教 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailAzbjDao extends BaseDao { + + void saveBatchManually(@Param("asbjList") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java new file mode 100644 index 0000000000..46419693c3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailJdryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-戒毒人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailJdryDao extends BaseDao { + + void saveBatchManually(@Param("list") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java new file mode 100644 index 0000000000..727b1f3e07 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailJzhzEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-精障患者 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailJzhzDao extends BaseDao { + + void saveBatchManually(@Param("list") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java new file mode 100644 index 0000000000..331aa3a227 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailSqjzEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-社区矫正 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailSqjzDao extends BaseDao { + + void saveBatchManually(@Param("list") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java new file mode 100644 index 0000000000..e3e3ef3527 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailXfryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-信访人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailXfryDao extends BaseDao { + + void saveBatchManually(@Param("list") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonDao.java new file mode 100644 index 0000000000..5c048ed7fb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonDao.java @@ -0,0 +1,21 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailAzbjEntity; +import com.epmet.entity.LingshanSpecialCrowdPersonEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-人员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdPersonDao extends BaseDao { + + void saveOrUpdateManually(@Param("list") List list); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonTypeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonTypeDao.java new file mode 100644 index 0000000000..5dbb31709b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonTypeDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdPersonTypeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-人员具有的特殊人群类型信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdPersonTypeDao extends BaseDao { + + void saveOrUpdateManually(@Param("types") List types); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailAzbjEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailAzbjEntity.java new file mode 100644 index 0000000000..e8905d6624 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailAzbjEntity.java @@ -0,0 +1,69 @@ +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-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_azbj") +public class LingshanSpecialCrowdDetailAzbjEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 原罪名 + */ + private String originalCharge; + + /** + * 释放日期 + */ + private Date releaseDate; + + /** + * 原判刑期(单位:月) + */ + private Date originPrisonTerm; + + /** + * 是否累犯。0否,1是 + */ + private Integer recidivismFlag; + + /** + * 是否安置。0否,1是 + */ + private Integer emplacementFlag; + + /** + * 安置日期 + */ + private Date emplacementDate; + + /** + * 安置帮教情况 + */ + private String emplacementInfo; + + /** + * 是否注销 + */ + private Integer canceledFlag; + + /** + * 注销原因 + */ + private String canceledReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailBaseEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailBaseEntity.java new file mode 100644 index 0000000000..ae663fc8c1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailBaseEntity.java @@ -0,0 +1,22 @@ +package com.epmet.entity; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; + +@Data +public class LingshanSpecialCrowdDetailBaseEntity extends BaseEpmetEntity { + /** + * 客户Id + */ + private String customerId; + + /** + * org id路径,:分割 + */ + private String orgIdPath; + + /** + * 证件号 + */ + private String idCard; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJdryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJdryEntity.java new file mode 100644 index 0000000000..279af30d10 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJdryEntity.java @@ -0,0 +1,69 @@ +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-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_jdry") +public class LingshanSpecialCrowdDetailJdryEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 有无犯罪史 + */ + private Integer criminalHistoryFlag; + + /** + * 有无复吸史 + */ + private Integer drugRepetitionFlag; + + /** + * 初次发现日期 + */ + private Date firstDiscoveryDate; + + /** + * 管控人姓名 + */ + private String controllerName; + + /** + * 管控人联系方式 + */ + private String controllerContact; + + /** + * 帮扶人姓名 + */ + private String helperName; + + /** + * 帮扶人联系方式 + */ + private String helperContact; + + /** + * 是否脱管 + */ + private Integer detachedFlag; + + /** + * 脱管原因 + */ + private String detachedReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJzhzEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJzhzEntity.java new file mode 100644 index 0000000000..4bdef1f2b0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJzhzEntity.java @@ -0,0 +1,74 @@ +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-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_jzhz") +public class LingshanSpecialCrowdDetailJzhzEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 有无肇事肇祸史 + */ + private Integer causeTroubleHistoryFlag; + + /** + * 肇事肇祸次数 + */ + private Integer causeTroubleTimes; + + /** + * 目前诊断类型。1精神分裂症,2分裂情感性障碍,3持久的妄想性障碍(偏执性精神病),4双相(情感)障碍,5癫痫所致精神障碍,6精神发育迟滞伴发精神障碍,7重度抑郁发作,8精神活性物质所致精神障碍,9其他 + */ + private Integer currentDiagnosis; + + /** + * 危险性评估等级。0,1,2,3,4,5 + */ + private Integer dangerousClass; + + /** + * 是否具备外出能力 + */ + private Integer canGoOutFlag; + + /** + * 是否有暴力倾向 + */ + private Integer violenceFlag; + + /** + * 是否落实监管补助 + */ + private Integer allowanceFlag; + + /** + * 是否纳入低保 + */ + private Integer subsistenceFlag; + + /** + * 监护人姓名 + */ + private String guardianName; + + /** + * 监护人联系方式 + */ + private String guardianContact; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailSqjzEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailSqjzEntity.java new file mode 100644 index 0000000000..66f1b8767a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailSqjzEntity.java @@ -0,0 +1,79 @@ +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-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_sqjz") +public class LingshanSpecialCrowdDetailSqjzEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 矫正类型。1.管制,2缓刑,3假释,4暂予监外执行,5剥夺政治权利 + */ + private Integer rectificateType; + + /** + * 矫正开始日期 + */ + private Date rectificateStartDate; + + /** + * 矫正结束日期 + */ + private Date rectificateEndDate; + + /** + * 原羁押场所 + */ + private String originDetainAddress; + + /** + * 原罪名 + */ + private String originalCharge; + + /** + * 接受方式。1.自行报到,2狱所押送,3当庭交接,4其他 + */ + private Integer receiveWay; + + /** + * 矫正情况说明 + */ + private String rectificateInfo; + + /** + * 是否脱管 + */ + private Integer detachedFlag; + + /** + * 脱管原因 + */ + private String detachedReason; + + /** + * 是否注销 + */ + private Integer canceledFlag; + + /** + * 注销原因 + */ + private String canceledReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailXfryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailXfryEntity.java new file mode 100644 index 0000000000..34605bd8cc --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailXfryEntity.java @@ -0,0 +1,70 @@ +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-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_xfry") +public class LingshanSpecialCrowdDetailXfryEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 反映问题 + */ + private String problem; + + /** + * 稳控措施 + */ + private String stableControlMeasurement; + + /** + * 是否多次上访 + */ + private Integer multipleFlag; + + /** + * 是否在当地 + */ + private Integer localFlag; + + /** + * 分管领导 + */ + private String branchLeader; + + /** + * 分管领导联系方式 + */ + private String branchLeaderContact; + + /** + * 负责人 + */ + private String principal; + + /** + * 负责人联系方式 + */ + private String principalContact; + + /** + * 稳控人员名单 + */ + private String stableControlerList; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonEntity.java new file mode 100644 index 0000000000..8291a3fe24 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonEntity.java @@ -0,0 +1,64 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 灵山-特殊人群-人员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_person") +public class LingshanSpecialCrowdPersonEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * org id路径,:分割 + */ + private String orgIdPath; + + /** + * 姓名 + */ + private String name; + + /** + * 证件号 + */ + private String idCard; + + public LingshanSpecialCrowdPersonEntity() { + } + + public LingshanSpecialCrowdPersonEntity(String id, String customerId, String orgIdPath, String name, String idCard, + String delFlag, Integer revision, Date createdTime, String createdBy, Date updatedTime, + String updatedBy) { + this.customerId = customerId; + this.orgIdPath = orgIdPath; + this.name = name; + this.idCard = idCard; + this.setDelFlag(delFlag); + this.setCreatedBy(createdBy); + this.setCreatedTime(createdTime); + this.setUpdatedBy(updatedBy); + this.setUpdatedTime(updatedTime); + this.setRevision(revision); + this.setId(id); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonTypeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonTypeEntity.java new file mode 100644 index 0000000000..35276f46ef --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonTypeEntity.java @@ -0,0 +1,59 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 灵山-特殊人群-人员具有的特殊人群类型信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_person_type") +public class LingshanSpecialCrowdPersonTypeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * org id路径,:分割 + */ + private String orgIdPath; + + /** + * 证件号 + */ + private String idCard; + + /** + * 特殊人群类别 + */ + private String specialType; + + public LingshanSpecialCrowdPersonTypeEntity(String id, String customerId, String orgIdPath, String idCard, String specialType, String delFlag, + Integer revision, Date createdTime, String createdBy, Date updatedTime, String updatedBy) { + this.customerId = customerId; + this.orgIdPath = orgIdPath; + this.idCard = idCard; + this.specialType = specialType; + this.setDelFlag(delFlag); + this.setCreatedBy(createdBy); + this.setCreatedTime(createdTime); + this.setUpdatedBy(updatedBy); + this.setUpdatedTime(updatedTime); + this.setRevision(revision); + this.setId(id); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdIsOrNotConverter.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdIsOrNotConverter.java new file mode 100644 index 0000000000..e146615243 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdIsOrNotConverter.java @@ -0,0 +1,34 @@ +package com.epmet.excel.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ReadConverterContext; +import com.alibaba.excel.enums.CellDataTypeEnum; +import org.apache.commons.lang3.StringUtils; + +/** + * 灵山-是否转换器 + */ +public class LingShanSpecialCrowdIsOrNotConverter implements Converter { + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Class supportJavaTypeKey() { + return Integer.class; + } + + @Override + public Integer convertToJavaData(ReadConverterContext context) throws Exception { + String content = context.getReadCellData().getStringValue(); + if (StringUtils.isNotBlank(content)) { + if (content.equals("是") || content.equals("有")) { + return 1; + } else if (content.equals("无") || content.equals("否")) { + return 0; + } + } + return Converter.super.convertToJavaData(context); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java new file mode 100644 index 0000000000..fbefaf92fd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java @@ -0,0 +1,57 @@ +package com.epmet.excel.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ReadConverterContext; +import com.alibaba.excel.enums.CellDataTypeEnum; + +/** + * 灵山-诊断类型转换器 + */ +public class LingShanSpecialCrowdJzhzConverter implements Converter { + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Integer convertToJavaData(ReadConverterContext context) throws Exception { + String content = context.getReadCellData().getStringValue(); + if (content instanceof String) { + switch (content) { + // 诊断类型 + case "精神分裂症": + return 1; + case "分裂情感性障碍": + return 2; + case "持久的妄想性障碍(偏执性精神病)": + return 3; + case "双相(情感)障碍": + return 4; + case "癫痫所致精神障碍": + return 5; + case "精神发育迟滞伴发精神障碍": + return 6; + case "重度抑郁发作": + return 7; + case "精神活性物质所致精神障碍": + return 8; + case "其他": + return 9; + // 危险性评估等级 + case "0级": + return 0; + case "1级": + return 1; + case "2级": + return 2; + case "3级": + return 3; + case "4级": + return 4; + case "5级": + return 5; + } + } + return Converter.super.convertToJavaData(context); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java new file mode 100644 index 0000000000..8de25b0e9a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java @@ -0,0 +1,51 @@ +package com.epmet.excel.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ReadConverterContext; +import com.alibaba.excel.enums.CellDataTypeEnum; + +/** + * 灵山-社区矫正转换器 + */ +public class LingShanSpecialCrowdSqjzConverter implements Converter { + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Class supportJavaTypeKey() { + return Integer.class; + } + + @Override + public Integer convertToJavaData(ReadConverterContext context) throws Exception { + Object content = context.getReadCellData().getStringValue(); + if (content instanceof String) { + switch ((String) content) { + // 矫正类型 + case "管制": + return 1; + case "缓刑": + return 2; + case "假释": + return 3; + case "暂予监外执行": + return 4; + case "剥夺政治权利": + return 5; + // 接受方式 + case "自行报到": + return 1; + case "狱所押送": + return 2; + case "当庭交接": + return 3; + case "其他": + return 4; + + } + } + return Converter.super.convertToJavaData(context); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java new file mode 100644 index 0000000000..49bacc91d7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java @@ -0,0 +1,73 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.epmet.excel.converter.LingShanSpecialCrowdIsOrNotConverter; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 安置帮教 + */ +@Data +public class LingShanSpecialCrowdDetailAzbjExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + /** + * 原罪名 + */ + @ExcelProperty(value = "*原罪名") + @NotBlank(message = "原罪名不能为空") + private String originalCharge; + + /** + * 释放日期 + */ + @ExcelProperty(value = "*释放日期") + @NotNull(message = "释放日期不能为空") + private Date releaseDate; + + /** + * 原判刑期(单位:月) + */ + @ExcelProperty(value = "原判刑期(单位:月)") + private Date originPrisonTerm; + + /** + * 是否累犯。0否,1是 + */ + @ExcelProperty(value = "是否累犯", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer recidivismFlag; + + /** + * 是否安置。0否,1是 + */ + @ExcelProperty(value = "是否安置", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer emplacementFlag; + + /** + * 安置日期 + */ + @ExcelProperty(value = "安置日期") + private Date emplacementDate; + + /** + * 安置帮教情况 + */ + @ExcelProperty(value = "安置帮教情况") + private String emplacementInfo; + + /** + * 是否注销 + */ + @ExcelProperty(value = "是否注销", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer canceledFlag; + + /** + * 注销原因 + */ + @ExcelProperty(value = "注销原因") + private String canceledReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java new file mode 100644 index 0000000000..1d43fb5790 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java @@ -0,0 +1,30 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * + */ +@Data +public class LingShanSpecialCrowdDetailBaseExcelData { + /** + * 姓名 + */ + @ExcelProperty(value = "*姓名") + @NotBlank(message = "姓名不能为空") + private String name; + /** + * 证件号 + */ + @ExcelProperty(value = "*身份证号") + @NotBlank(message = "身份证号不能为空") + private String idCard; + + /** + * 错误信息 + */ + private String errorInfo; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java new file mode 100644 index 0000000000..8ca975af70 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java @@ -0,0 +1,79 @@ +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.LingShanSpecialCrowdIsOrNotConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 灵山-特殊人群-戒毒人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +public class LingshanSpecialCrowdDetailJdryExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + /** + * 有无犯罪史 + */ + @ExcelProperty(value = "*有无犯罪史", converter = LingShanSpecialCrowdIsOrNotConverter.class) + @NotNull(message = "有无犯罪史不能为空") + private Integer criminalHistoryFlag; + + /** + * 有无复吸史 + */ + @ExcelProperty(value = "*有无复吸史", converter = LingShanSpecialCrowdIsOrNotConverter.class) + @NotNull(message = "有无复吸史不能为空") + private Integer drugRepetitionFlag; + + /** + * 初次发现日期 + */ + @ExcelProperty(value = "初次发现日期") + private Date firstDiscoveryDate; + + /** + * 管控人姓名 + */ + @ExcelProperty(value = "管控人姓名") + private String controllerName; + + /** + * 管控人联系方式 + */ + @ExcelProperty(value = "管控人联系方式") + private String controllerContact; + + /** + * 帮扶人姓名 + */ + @ExcelProperty(value = "帮扶人姓名") + private String helperName; + + /** + * 帮扶人联系方式 + */ + @ExcelProperty(value = "帮扶人联系方式") + private String helperContact; + + /** + * 是否脱管 + */ + @ExcelProperty(value = "是否脱管", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer detachedFlag; + + /** + * 脱管原因 + */ + @ExcelProperty(value = "脱管原因") + private String detachedReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java new file mode 100644 index 0000000000..067cd35987 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java @@ -0,0 +1,84 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.epmet.excel.converter.LingShanSpecialCrowdIsOrNotConverter; +import com.epmet.excel.converter.LingShanSpecialCrowdJzhzConverter; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 灵山-特殊人群-精障患者 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +public class LingshanSpecialCrowdDetailJzhzExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + private static final long serialVersionUID = 1L; + + /** + * 有无肇事肇祸史 + */ + @ExcelProperty(value = "*有无肇事肇祸史", converter = LingShanSpecialCrowdIsOrNotConverter.class) + @NotNull(message = "有无肇事肇祸史不能为空") + private Integer causeTroubleHistoryFlag; + + /** + * 肇事肇祸次数 + */ + @ExcelProperty(value = "*肇事肇祸次数") + @NotNull(message = "肇事肇祸次数不能为空") + private Integer causeTroubleTimes; + + /** + * 目前诊断类型。1精神分裂症,2分裂情感性障碍,3持久的妄想性障碍(偏执性精神病),4双相(情感)障碍,5癫痫所致精神障碍,6精神发育迟滞伴发精神障碍,7重度抑郁发作,8精神活性物质所致精神障碍,9其他 + */ + @ExcelProperty(value = "目前诊断类型", converter = LingShanSpecialCrowdJzhzConverter.class) + private Integer currentDiagnosis; + + /** + * 危险性评估等级。0,1,2,3,4,5 + */ + @ExcelProperty(value = "危险性评估等级", converter = LingShanSpecialCrowdJzhzConverter.class) + private Integer dangerousClass; + + /** + * 是否具备外出能力 + */ + @ExcelProperty(value = "是否具备外出能力", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer canGoOutFlag; + + /** + * 是否有暴力倾向 + */ + @ExcelProperty(value = "是否有暴力倾向", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer violenceFlag; + + /** + * 是否落实监管补助 + */ + @ExcelProperty(value = "是否落实监管补助", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer allowanceFlag; + + /** + * 是否纳入低保 + */ + @ExcelProperty(value = "是否纳入低保", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer subsistenceFlag; + + /** + * 监护人姓名 + */ + @ExcelProperty(value = "监护人姓名") + private String guardianName; + + /** + * 监护人联系方式 + */ + @ExcelProperty(value = "监护人联系方式") + private String guardianContact; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java new file mode 100644 index 0000000000..950ce47381 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java @@ -0,0 +1,92 @@ +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.LingShanSpecialCrowdIsOrNotConverter; +import com.epmet.excel.converter.LingShanSpecialCrowdSqjzConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 灵山-特殊人群-社区矫正 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +public class LingshanSpecialCrowdDetailSqjzExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + + /** + * 矫正类型。1.管制,2缓刑,3假释,4暂予监外执行,5剥夺政治权利 + */ + @ExcelProperty(value = "*矫正类型", converter = LingShanSpecialCrowdSqjzConverter.class) + @NotNull(message = "矫正类型不能为空") + private Integer rectificateType; + + /** + * 矫正开始日期 + */ + @ExcelProperty(value = "矫正开始日期") + private Date rectificateStartDate; + + /** + * 矫正结束日期 + */ + @ExcelProperty(value = "矫正结束日期") + private Date rectificateEndDate; + + /** + * 原羁押场所 + */ + @ExcelProperty(value = "原羁押场所") + private String originDetainAddress; + + /** + * 原罪名 + */ + @ExcelProperty(value = "原罪名") + private String originalCharge; + + /** + * 接受方式。1.自行报到,2狱所押送,3当庭交接,4其他 + */ + @ExcelProperty(value = "接受方式", converter = LingShanSpecialCrowdSqjzConverter.class) + private Integer receiveWay; + + /** + * 矫正情况说明 + */ + @ExcelProperty(value = "矫正情况说明") + private String rectificateInfo; + + /** + * 是否脱管 + */ + @ExcelProperty(value = "是否脱管", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer detachedFlag; + + /** + * 脱管原因 + */ + @ExcelProperty(value = "脱管原因") + private String detachedReason; + + /** + * 是否注销 + */ + @ExcelProperty(value = "是否注销" , converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer canceledFlag; + + /** + * 注销原因 + */ + @ExcelProperty(value = "注销原因") + private String canceledReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java new file mode 100644 index 0000000000..f7a865a3ba --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java @@ -0,0 +1,77 @@ +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.LingShanSpecialCrowdIsOrNotConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; + +/** + * 灵山-特殊人群-信访人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +public class LingshanSpecialCrowdDetailXfryExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + /** + * 反映问题 + */ + @ExcelProperty(value = "*反映问题") + @NotBlank(message = "反映问题不能为空") + private String problem; + + /** + * 稳控措施 + */ + @ExcelProperty(value = "*稳控措施") + @NotBlank(message = "稳控措施不能为空") + private String stableControlMeasurement; + + /** + * 是否多次上访 + */ + @ExcelProperty(value = "是否多次上访", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer multipleFlag; + + /** + * 是否在当地 + */ + @ExcelProperty(value = "是否在当地", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer localFlag; + + /** + * 分管领导 + */ + @ExcelProperty(value = "分管领导") + private String branchLeader; + + /** + * 分管领导联系方式 + */ + @ExcelProperty(value = "分管领导联系方式") + private String branchLeaderContact; + + /** + * 负责人 + */ + @ExcelProperty(value = "负责人") + private String principal; + + /** + * 负责人联系方式 + */ + @ExcelProperty(value = "负责人联系方式") + private String principalContact; + + /** + * 稳控人员名单 + */ + @ExcelProperty(value = "稳控人员名单") + private String stableControlerList; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java new file mode 100644 index 0000000000..e86d714d11 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java @@ -0,0 +1,351 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.read.listener.ReadListener; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.common.token.util.TokenUtil; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +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.LingshanSpecialCrowdDetailBaseEntity; +import com.epmet.entity.LingshanSpecialCrowdPersonEntity; +import com.epmet.entity.LingshanSpecialCrowdPersonTypeEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingShanSpecialCrowdDetailBaseExcelData; +import com.epmet.service.LingShanSpecialCrowdService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RLock; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 灵山大屏-抽象的导入excel监听器 + */ +public abstract class AbstractLingShanSpecialCrowdExcelImportListener + 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 Integer maxHeadRowNum; + + /** + * 文件的表头中应当有哪些列 + */ + private List headerZhList; + + /** + * 当前表头读到了第几行 + */ + private Integer currentHeadRowNum = 0; + + /** + * 原始数据列表 + */ + private List originDatas = new ArrayList<>(); + + /** + * 错误数据列表 + */ + private List errorDatas = new ArrayList<>(); + + /** + * 正确数据 + */ + private List correctDatas = new ArrayList<>(); + + private List persons = new ArrayList<>(); + private List personTypes = new ArrayList<>(); + + protected LingShanSpecialCrowdService lingShanSpecialCrowdService; + + private Class entityClass; + + private CustomerStaffInfoCacheResult currentStaffInfo; + + private LingShanSpecialCrowdTypeEnums specialCrowdType; + + public AbstractLingShanSpecialCrowdExcelImportListener() { + 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(); + } + + /** + * @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)) { + // 如果是表头最后一行,则校验表头 + + Collection headersFromFile = headMap.values(); + // 2次循环,双向校验 + for (String headerZh : headersFromFile) { + if (StringUtils.isNotBlank(headerZh) && !headerZhList.contains(headerZh)) { + throw new EpmetException("请确认表头内容与模板一致"); + } + } + + for (String headerZh : headerZhList) { + if (StringUtils.isNotBlank(headerZh) && !headersFromFile.contains(headerZh)) { + throw new EpmetException("请确认表头内容与模板一致"); + } + } + } + } + + /** + * @description: 行读取回调函数 + * @param row: + * @param context: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:44 PM + */ + @Override + public void invoke(T row, AnalysisContext context) { + 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 (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.getFromOrgId(), 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 { + persons.add(new LingshanSpecialCrowdPersonEntity(IdWorker.getIdStr(), customerId, orgIdPath, row.getName(), row.getIdCard(), + "0", 0, now, currentStaffInfo.getStaffId(), now, currentStaffInfo.getStaffId())); + personTypes.add(new LingshanSpecialCrowdPersonTypeEntity(IdWorker.getIdStr(), customerId, orgIdPath, row.getIdCard(), specialCrowdType.getType(), + "0", 0, now, currentStaffInfo.getStaffId(), now, currentStaffInfo.getStaffId())); + + 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); + } + } + + // 执行保存 + if(!CollectionUtils.isEmpty(persons) && !CollectionUtils.isEmpty(personTypes)) { + savePersonAndTypes(persons, personTypes); + } + + // 将错误的数据处理 todo + + // 保存人群详情数据 + saveBatchCallback(correctDatas); + } + + /** + * @description: 保存人员信息,人员类型 + * @param persons: + * @param personTypes: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 11:06 AM + */ + private void savePersonAndTypes(List persons, List personTypes) { + lingShanSpecialCrowdService.savePersonAndTypes(persons, personTypes); + } + + /** + * @param : + * @return + * @description: 清理数据 + * @author: WangXianZhang + * @date: 2023/4/18 4:41 PM + */ + protected void clear() { + originDatas.clear(); + errorDatas.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 + */ + protected List getErrorDatas() { + return errorDatas; + } + + /** + * @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: 获取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(); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java new file mode 100644 index 0000000000..6be9cba8b4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java @@ -0,0 +1,49 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.entity.LingshanSpecialCrowdDetailAzbjEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingShanSpecialCrowdDetailAzbjExcelData; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.formula.functions.T; + +import java.io.File; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +/** + * 灵山-安置帮教导入 + */ +public class LingShanSpecialCrowdAzbjExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*原罪名", "*释放日期", "原判刑期(单位:月)", "是否累犯", "是否安置", "安置日期", "安置帮教情况", "是否注销", "注销原因"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailAzbjEntity.class; + } + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailAzbjEntity()); + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.AZBJ; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java new file mode 100644 index 0000000000..98038505a6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java @@ -0,0 +1,45 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.entity.LingshanSpecialCrowdDetailAzbjEntity; +import com.epmet.entity.LingshanSpecialCrowdDetailJdryEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingshanSpecialCrowdDetailJdryExcelData; + +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 灵山-戒毒导入 + */ +public class LingShanSpecialCrowdJieduExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*有无犯罪史", "*有无复吸史", "初次发现日期", "管控人姓名", "管控人联系方式", "帮扶人姓名", "帮扶人联系方式", "是否脱管", "脱管原因"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailJdryEntity.class; + } + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailJdryEntity()); + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.JDRY; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java new file mode 100644 index 0000000000..6ea1034872 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java @@ -0,0 +1,46 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.entity.LingshanSpecialCrowdDetailJdryEntity; +import com.epmet.entity.LingshanSpecialCrowdDetailJzhzEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingshanSpecialCrowdDetailJzhzExcelData; + +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 灵山-精神障碍患者导入 + */ +public class LingShanSpecialCrowdJingZhangExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailJzhzEntity()); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*有无肇事肇祸史", "*肇事肇祸次数", "目前诊断类型", "危险性评估等级", "是否具备外出能力", "是否有暴力倾向", "是否落实监管补助", "是否纳入低保", "监护人姓名", "监护人联系方式"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailJzhzEntity.class; + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.JZHZ; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdSqjzExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdSqjzExcelImportListener.java new file mode 100644 index 0000000000..d347b131d4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdSqjzExcelImportListener.java @@ -0,0 +1,45 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.dao.LingshanSpecialCrowdDetailSqjzDao; +import com.epmet.entity.LingshanSpecialCrowdDetailJzhzEntity; +import com.epmet.entity.LingshanSpecialCrowdDetailSqjzEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingshanSpecialCrowdDetailSqjzExcelData; + +import java.io.File; +import java.util.Arrays; +import java.util.List; + +/** + * 灵山-矫正人员导入 + */ +public class LingShanSpecialCrowdSqjzExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailSqjzEntity()); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*矫正类型", "矫正开始日期", "矫正结束日期", "原羁押场所", "原罪名", "接受方式", "矫正情况说明", "是否脱管", "脱管原因", "是否注销", "注销原因"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailSqjzEntity.class; + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.SQJZ; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdXinFangExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdXinFangExcelImportListener.java new file mode 100644 index 0000000000..062c7bff64 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdXinFangExcelImportListener.java @@ -0,0 +1,46 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.entity.LingshanSpecialCrowdDetailJzhzEntity; +import com.epmet.entity.LingshanSpecialCrowdDetailXfryEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingshanSpecialCrowdDetailXfryExcelData; + +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 灵山-信访人员导入 + */ +public class LingShanSpecialCrowdXinFangExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailXfryEntity()); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*反映问题", "*稳控措施", "是否多次上访", "是否在当地", "分管领导", "分管领导联系方式", "负责人", "负责人联系方式", "稳控人员名单"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailXfryEntity.class; + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.XFRY; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanSpecialCrowdService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanSpecialCrowdService.java new file mode 100644 index 0000000000..bf26d89d83 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanSpecialCrowdService.java @@ -0,0 +1,47 @@ +package com.epmet.service; + +import com.epmet.entity.*; +import com.epmet.excel.data.LingShanSpecialCrowdDetailAzbjExcelData; +import com.epmet.excel.data.LingShanSpecialCrowdDetailBaseExcelData; +import org.apache.poi.ss.formula.functions.T; + +import java.util.List; + +/** + * 灵山特殊人群service + */ +public interface LingShanSpecialCrowdService { + + /** + * @description: 导入特殊人群 + * @param crowdCategory: + * @param fileSavePath: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 5:42 PM + */ + void importSpecialCrowd(String crowdCategory, String fileSavePath); + + /** + * @description: 数据校验 + * @param row: + * @returns + * @author: WangXianZhang + * @date: 2023/4/18 4:49 PM + */ + String validate(LingShanSpecialCrowdDetailBaseExcelData row); + + void savePersonAndTypes(List persons, List personTypes); + + /** + * @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); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java new file mode 100644 index 0000000000..3522ce8a7e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java @@ -0,0 +1,163 @@ +package com.epmet.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ReadConverterContext; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.dao.*; +import com.epmet.entity.*; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.*; +import com.epmet.excel.handler.*; +import com.epmet.service.LingShanSpecialCrowdService; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.util.List; + +/** + * 灵山特殊人群service + */ +@Service +public class LingShanSpecialCrowdServiceImpl implements LingShanSpecialCrowdService { + + @Autowired + private LingshanSpecialCrowdPersonDao specialCrowdPersonDao; + + @Autowired + private LingshanSpecialCrowdPersonTypeDao specialCrowdPersonTypeDao; + + @Autowired + private LingshanSpecialCrowdDetailAzbjDao specialCrowdDetailAzbjDao; + + @Autowired + private LingshanSpecialCrowdDetailSqjzDao specialCrowdDetailSqjzDao; + + @Autowired + private LingshanSpecialCrowdDetailJdryDao specialCrowdDetailJdryDao; + + @Autowired + private LingshanSpecialCrowdDetailJzhzDao specialCrowdDetailJzhzDao; + + @Autowired + private LingshanSpecialCrowdDetailXfryDao specialCrowdDetailXfryDao; + + @Autowired + private IcResiUserDao icResiUserDao; + + @Override + public void importSpecialCrowd(String crowdCategory, String fileSavePath) { + Class excelDataClass; + AbstractLingShanSpecialCrowdExcelImportListener listener; + LingShanSpecialCrowdTypeEnums specialCrowdTypeEnum; + + if (LingShanSpecialCrowdTypeEnums.AZBJ.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdAzbjExcelImportListener(); + excelDataClass = LingShanSpecialCrowdDetailAzbjExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.AZBJ; + } else if (LingShanSpecialCrowdTypeEnums.SQJZ.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdSqjzExcelImportListener(); + excelDataClass = LingshanSpecialCrowdDetailSqjzExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.SQJZ; + } else if (LingShanSpecialCrowdTypeEnums.JDRY.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdJieduExcelImportListener(); + excelDataClass = LingshanSpecialCrowdDetailJdryExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.JDRY; + } else if (LingShanSpecialCrowdTypeEnums.JZHZ.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdJingZhangExcelImportListener(); + excelDataClass = LingshanSpecialCrowdDetailJzhzExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.JZHZ; + } else if (LingShanSpecialCrowdTypeEnums.XFRY.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdXinFangExcelImportListener(); + excelDataClass = LingshanSpecialCrowdDetailXfryExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.XFRY; + } else { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道-维稳】导入。不支持的人群类别:" + crowdCategory); + } + + // Execute reading + // ReadSheet sheet = EasyExcel.readSheet(0).registerReadListener(listener).build(); + // EasyExcel.read(fileSavePath).build().read(sheet); + + EasyExcel.read(fileSavePath, excelDataClass, listener) + .headRowNumber(specialCrowdTypeEnum.getHeaderRowNumber()) + .sheet(0) + .doRead(); + } + + @Override + public String validate(LingShanSpecialCrowdDetailBaseExcelData 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("姓名信息与居民基础信息不一致。(在居民哭华总根据身份证号找到的居民姓名为:{})", name); + } + + return null; + } + + @Override + public void savePersonAndTypes(List persons, List personTypes) { + List> personParts = ListUtils.partition(persons, 50); + List> personTypeParts = ListUtils.partition(personTypes, 50); + + for (List p : personParts) { + specialCrowdPersonDao.saveOrUpdateManually(p); + } + for (List p : personTypeParts) { + specialCrowdPersonTypeDao.saveOrUpdateManually(p); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailAzbjEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailAzbjDao.saveBatchManually(l); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailJdryEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailJdryDao.saveBatchManually(l); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailJzhzEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailJzhzDao.saveBatchManually(l); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailSqjzEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailSqjzDao.saveBatchManually(l); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailXfryEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailXfryDao.saveBatchManually(l); + } + } +} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailAzbjDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailAzbjDao.xml new file mode 100644 index 0000000000..60a3bb3c17 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailAzbjDao.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_detail_azbj ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, ORIGINAL_CHARGE, RELEASE_DATE + , ORIGIN_PRISON_TERM, RECIDIVISM_FLAG, EMPLACEMENT_FLAG, EMPLACEMENT_DATE + , EMPLACEMENT_INFO, CANCELED_FLAG, CANCELED_REASON, DEL_FLAG, REVISION + , CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + ( #{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.originalCharge}, + #{item.releaseDate},#{item.originPrisonTerm},#{item.recidivismFlag},#{item.emplacementFlag}, + #{item.emplacementDate}, #{item.emplacementInfo}, #{item.canceledFlag}, #{item.canceledReason}, #{item.delFlag}, + #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime} + ) + + on duplicate key update ORG_ID_PATH = values(ORG_ID_PATH) + , ID_CARD = values(ID_CARD) + , ORIGINAL_CHARGE = values(ORIGINAL_CHARGE) + , RELEASE_DATE = values(RELEASE_DATE) + , ORIGIN_PRISON_TERM = values(ORIGIN_PRISON_TERM) + , RECIDIVISM_FLAG = values(RECIDIVISM_FLAG) + , EMPLACEMENT_FLAG = values(EMPLACEMENT_FLAG) + , EMPLACEMENT_DATE = values(EMPLACEMENT_DATE) + , EMPLACEMENT_INFO = values(EMPLACEMENT_INFO) + , CANCELED_FLAG = values(CANCELED_FLAG) + , CANCELED_REASON = values(CANCELED_REASON) + , UPDATED_BY = values(UPDATED_BY) + , UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJdryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJdryDao.xml new file mode 100644 index 0000000000..efdc2079e7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJdryDao.xml @@ -0,0 +1,36 @@ + + + + + + insert into lingshan_special_crowd_detail_jdry ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, CRIMINAL_HISTORY_FLAG + , DRUG_REPETITION_FLAG, FIRST_DISCOVERY_DATE, CONTROLLER_NAME + , CONTROLLER_CONTACT, HELPER_NAME, HELPER_CONTACT, DETACHED_FLAG + , DETACHED_REASON, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME + , UPDATED_BY, UPDATED_TIME) + values + + (#{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.criminalHistoryFlag}, + #{item.drugRepetitionFlag}, #{item.firstDiscoveryDate}, #{item.controllerName}, #{item.controllerContact}, #{item.helperName}, + #{item.helperContact}, #{item.detachedFlag}, #{item.detachedReason}, #{item.delFlag}, #{item.revision}, + #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}) + + on duplicate key update + ORG_ID_PATH = values(ORG_ID_PATH), + CRIMINAL_HISTORY_FLAG = values(CRIMINAL_HISTORY_FLAG), + DRUG_REPETITION_FLAG = values(DRUG_REPETITION_FLAG), + FIRST_DISCOVERY_DATE = values(FIRST_DISCOVERY_DATE), + CONTROLLER_NAME = values(CONTROLLER_NAME), + CONTROLLER_CONTACT = values(CONTROLLER_CONTACT), + HELPER_NAME = values(HELPER_NAME), + HELPER_CONTACT = values(HELPER_CONTACT), + DETACHED_FLAG = values(DETACHED_FLAG), + DETACHED_REASON = values(DETACHED_REASON), + DEL_FLAG = values(DEL_FLAG), + REVISION = values(REVISION), + UPDATED_BY = values(UPDATED_BY), + UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJzhzDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJzhzDao.xml new file mode 100644 index 0000000000..e750b74a6c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJzhzDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_detail_jzhz ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, CAUSE_TROUBLE_HISTORY_FLAG + , CAUSE_TROUBLE_TIMES, CURRENT_DIAGNOSIS, DANGEROUS_CLASS + , CAN_GO_OUT_FLAG, VIOLENCE_FLAG, ALLOWANCE_FLAG, SUBSISTENCE_FLAG + , GUARDIAN_NAME, GUARDIAN_CONTACT, DEL_FLAG, REVISION, CREATED_BY + , CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + (#{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.causeTroubleHistoryFlag}, + #{item.causeTroubleTimes}, #{item.currentDiagnosis}, #{item.dangerousClass}, #{item.canGoOutFlag}, #{item.violenceFlag}, + #{item.allowanceFlag}, #{item.subsistenceFlag}, #{item.guardianName}, #{item.guardianContact}, #{item.delFlag}, + #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime} + ) + + on duplicate key update ORG_ID_PATH = values(ORG_ID_PATH) + , ID_CARD = values(ID_CARD) + , CAUSE_TROUBLE_HISTORY_FLAG = values(CAUSE_TROUBLE_HISTORY_FLAG) + , CAUSE_TROUBLE_TIMES = values(CAUSE_TROUBLE_TIMES) + , CURRENT_DIAGNOSIS = values(CURRENT_DIAGNOSIS) + , DANGEROUS_CLASS = values(DANGEROUS_CLASS) + , CAN_GO_OUT_FLAG = values(CAN_GO_OUT_FLAG) + , VIOLENCE_FLAG = values(VIOLENCE_FLAG) + , ALLOWANCE_FLAG = values(ALLOWANCE_FLAG) + , SUBSISTENCE_FLAG = values(SUBSISTENCE_FLAG) + , GUARDIAN_NAME = values(GUARDIAN_NAME) + , GUARDIAN_CONTACT = values(GUARDIAN_CONTACT) + , UPDATED_BY = values(UPDATED_BY) + , UPDATED_TIME = values(UPDATED_TIME) + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailSqjzDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailSqjzDao.xml new file mode 100644 index 0000000000..fd26ee7938 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailSqjzDao.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_detail_sqjz ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, RECTIFICATE_TYPE + , RECTIFICATE_START_DATE, RECTIFICATE_END_DATE, ORIGIN_DETAIN_ADDRESS + , ORIGINAL_CHARGE, RECEIVE_WAY, RECTIFICATE_INFO, DETACHED_FLAG + , DETACHED_REASON, CANCELED_FLAG, CANCELED_REASON, DEL_FLAG, REVISION + , CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + (#{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.rectificateType}, + #{item.rectificateStartDate}, #{item.rectificateEndDate}, #{item.originDetainAddress}, #{item.originalCharge}, #{item.receiveWay}, + #{item.rectificateInfo}, #{item.detachedFlag}, #{item.detachedReason}, #{item.canceledFlag}, #{item.canceledReason}, + #{item.delFlag}, #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, + #{item.updatedTime}) + + on duplicate key update + ORG_ID_PATH = values(ORG_ID_PATH) + , RECTIFICATE_TYPE = values(RECTIFICATE_TYPE) + , RECTIFICATE_START_DATE = values(RECTIFICATE_START_DATE) + , RECTIFICATE_END_DATE = values(RECTIFICATE_END_DATE) + , ORIGIN_DETAIN_ADDRESS = values(ORIGIN_DETAIN_ADDRESS) + , ORIGINAL_CHARGE = values(ORIGINAL_CHARGE), RECEIVE_WAY = values(RECEIVE_WAY) + , RECTIFICATE_INFO = values(RECTIFICATE_INFO), DETACHED_FLAG = values(DETACHED_FLAG) + , DETACHED_REASON = values(DETACHED_REASON), CANCELED_FLAG = values(CANCELED_FLAG) + , CANCELED_REASON = values(CANCELED_REASON) + , UPDATED_BY = values(UPDATED_BY), + , UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailXfryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailXfryDao.xml new file mode 100644 index 0000000000..149129d3ec --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailXfryDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_detail_xfry ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, PROBLEM + , STABLE_CONTROL_MEASUREMENT, MULTIPLE_FLAG, LOCAL_FLAG, BRANCH_LEADER + , BRANCH_LEADER_CONTACT, PRINCIPAL, PRINCIPAL_CONTACT + , STABLE_CONTROLER_LIST, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME + , UPDATED_BY, UPDATED_TIME) + values + + (#{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.problem}, + #{item.stableControlMeasurement}, #{item.multipleFlag}, #{item.localFlag}, #{item.branchLeader}, #{item.branchLeaderContact}, + #{item.principal}, #{item.principalContact}, #{item.stableControlerList}, #{item.delFlag}, #{item.revision}, + #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}) + + on duplicate key update + ORG_ID_PATH = values (ORG_ID_PATH) + , PROBLEM = values(PROBLEM) + , STABLE_CONTROL_MEASUREMENT = values(STABLE_CONTROL_MEASUREMENT) + , MULTIPLE_FLAG = values(MULTIPLE_FLAG) + , LOCAL_FLAG = values(LOCAL_FLAG) + , BRANCH_LEADER = values(BRANCH_LEADER) + , BRANCH_LEADER_CONTACT = values(BRANCH_LEADER_CONTACT) + , PRINCIPAL = values(PRINCIPAL) + , PRINCIPAL_CONTACT = values(PRINCIPAL_CONTACT) + , STABLE_CONTROLER_LIST = values(STABLE_CONTROLER_LIST) + , DEL_FLAG = values(DEL_FLAG) + , REVISION = values(REVISION), CREATED_BY = values(CREATED_BY) + , CREATED_TIME = values(CREATED_TIME) + , UPDATED_BY = values(UPDATED_BY) + , UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonDao.xml new file mode 100644 index 0000000000..bdf6bfb32b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + insert into lingshan_special_crowd_person ( ID, CUSTOMER_ID, ORG_ID_PATH, `NAME`, ID_CARD, + DEL_FLAG, REVISION, CREATED_BY , CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + ( #{item.id}, + #{item.customerId}, + #{item.orgIdPath}, + #{item.name}, + #{item.idCard}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + #{item.createdTime}, + #{item.updatedBy}, + #{item.updatedTime} + ) + + on duplicate key update NAME=values(name) + , UPDATED_BY=values(UPDATED_BY) + , UPDATED_TIME=values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonTypeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonTypeDao.xml new file mode 100644 index 0000000000..1fc8a8b92b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonTypeDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_person_type ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, SPECIAL_TYPE, + DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + (#{type.id}, #{type.customerId}, #{type.orgIdPath}, #{type.idCard}, #{type.specialType}, + #{type.delFlag}, #{type.revision}, #{type.createdBy}, #{type.createdTime}, #{type.updatedBy}, #{type.updatedTime}) + + on duplicate key update + ORG_ID_PATH=values(ORG_ID_PATH) + , SPECIAL_TYPE =values(SPECIAL_TYPE) + , UPDATED_BY =values(UPDATED_BY) + , UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file