Browse Source

Merge branch 'lingshan_master' of http://git.elinkit.com.cn:7070/r/epmet-cloud

# Conflicts:
#	epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ZhzlResiCategoryEnum.java
master
wxz 3 years ago
parent
commit
62c4f7261b
  1. 9
      doc/epmet-cloud.md
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java
  3. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ZhzlResiCategoryEnum.java
  4. 28
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java
  5. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java
  6. 2
      epmet-gateway/src/main/resources/bootstrap.yml
  7. 10
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java
  8. 3
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ImportTaskCommonResultDTO.java
  9. 2
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
  10. 27
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/utils/ImportTaskUtils.java
  11. 21
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java
  12. 10
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ImportTaskDao.java
  13. 3
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ImportTaskEntity.java
  14. 5
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ImportTaskService.java
  15. 13
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java
  16. 2
      epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.15__importtask_add_number.sql
  17. 4
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ImportTaskDao.xml
  18. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java
  19. 59
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcDangerousChemicalsDTO.java
  20. 82
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsAddEditFormDTO.java
  21. 52
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsListFormDTO.java
  22. 58
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcDangerousChemicalsListResultDTO.java
  23. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  24. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  25. 77
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java
  26. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java
  27. 64
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcDangerousChemicalsEntity.java
  28. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java
  29. 192
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsImportListener.java
  30. 146
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsModel.java
  31. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  32. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  33. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  34. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java
  35. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  36. 41
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  37. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  38. 171
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java
  39. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/lingshan_dangerous_chemicals_template.xlsx
  40. 86
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml
  41. 83
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventAddEditFormDTO.java
  42. 86
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventFormsDTO.java
  43. 102
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventResultDTO.java
  44. 88
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java
  45. 19
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/EventEntityDao.java
  46. 43
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventDetailEntity.java
  47. 97
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventEntity.java
  48. 19
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/EventService.java
  49. 136
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java
  50. 13
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/EventEntityDao.xml
  51. 20
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java
  52. 10
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java
  53. 15
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateArticleFormDTO.java
  54. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java
  55. 10
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java
  56. 83
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java
  57. 9
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.java
  58. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java
  59. 90
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  60. 13
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java
  61. 13
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java
  62. 14
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml
  63. 17
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml
  64. 294
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/lingshan/LingShanSpecialTypeSaveFormDTO.java
  65. 295
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/lingshan/LingShanSpecialTypeSaveResultDTO.java
  66. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LingShanSpecialCrowdListResultDTO.java
  67. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/lingshan/LingShanSpecialCrowdStatsByOrgResultDTO.java
  68. 16
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/lingshan/LingShanSpecialCrowdStatsBySpecialTypeResultDTO.java
  69. 53
      epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java
  70. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/bean/PersonSpecialTypeBean.java
  71. 53
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanScreenController.java
  72. 218
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java
  73. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSpecialDao.java
  74. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java
  75. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java
  76. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java
  77. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java
  78. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java
  79. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java
  80. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSpecialEntity.java
  81. 69
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailAzbjEntity.java
  82. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailBaseEntity.java
  83. 69
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJdryEntity.java
  84. 74
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJzhzEntity.java
  85. 79
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailSqjzEntity.java
  86. 70
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailXfryEntity.java
  87. 129
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java
  88. 126
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java
  89. 78
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdYesOrNoConverter.java
  90. 77
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java
  91. 43
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java
  92. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailResultExtraInfo.java
  93. 77
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java
  94. 83
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java
  95. 91
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java
  96. 74
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java
  97. 409
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java
  98. 54
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java
  99. 50
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java
  100. 51
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java

9
doc/epmet-cloud.md

@ -10,4 +10,11 @@
例如:有A、B2个服务,并且A调用B,如果我们只需要开发A服务,那本地只启动A服务即可,A调用B的时候,会调用服务器的B服务。
如果需要开发AB2个服务,那么将A中的FeignClient的url属性指向localhost。
PS:目前正在测试通过负载均衡器和本地环境变量实现动态修改目标服务IP,成功之后就不需要再修改FeignClient的url,配置一下环境变量即可,到时候具体说
```
```
## 私有化部署
##### 需要开放哪些域名
- epmet-cloud.elinkservice.cn 微信交互代理
- dysmsapi.aliyuncs.com 阿里云短信

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java

@ -19,6 +19,7 @@ public enum BizTypeEnum {
GRID_PROJECT("grid_project", "网格项目"),
PROJECT("project", "项目"),
ARTICLE("article", "文章(党建声音)"),
SPECIAL_CROWD("special_crowd", "社会维稳(特殊人群)"),
;
public static BizTypeEnum getEnum(String code) {

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ZhzlResiCategoryEnum.java

@ -12,7 +12,7 @@ public enum ZhzlResiCategoryEnum {
// buliangqingshaonian 不良青少年
// shequjiaozheng 社区矫正
// zhaoshizhaohuojingshenbing 肇事肇祸精神病
// xidurenyuan 吸毒人员
// jiedurenyuan 吸毒人员
xinfangrenyuan("xinfangrenyuan", "信访人员", "equal", "ic_resi_user", "IS_XFRY", "1", 1),
anzhibangjiao("anzhibangjiao", "安置帮教", "list_equal", "ic_special", "SPECIAL_RQLB", "anzhibangjiao", 2),

28
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java

@ -153,4 +153,32 @@ public class FileUtils {
return templateFilePathStr;
}
/**
* @description: 删除文件
* @param path:
* @return
* @author: WangXianZhang
* @date: 2023/4/18 9:47 AM
*/
public static void deleteFileIfExists(Path path) {
if (path != null) {
try {
Files.deleteIfExists(path);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
/**
* @description: 删除文件
* @param path:
* @return
* @author: WangXianZhang
* @date: 2023/4/18 9:47 AM
*/
public static void deleteFileIfExists(String path) {
deleteFileIfExists(Paths.get(path));
}
}

8
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java

@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class TCCCClientUtils {
private static String SDKAPPID = "1400801042";
private static Long SDKAPPID = 1400801042L;
private static String USERID = "286388969@qq.com";
@ -34,12 +34,12 @@ public class TCCCClientUtils {
CccClient client = new CccClient(cred, "", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
CreateSDKLoginTokenRequest req = new CreateSDKLoginTokenRequest();
req.setSdkAppId(1400801042L);
req.setSeatUserId("286388969@qq.com");
req.setSdkAppId(SDKAPPID);
req.setSeatUserId(USERID);
// 返回的resp是一个CreateSDKLoginTokenResponse的实例,与请求对象对应
CreateSDKLoginTokenResponse resp = client.CreateSDKLoginToken(req);
// 输出json格式的字符串回包
System.out.println(CreateSDKLoginTokenResponse.toJsonString(resp));
log.info(CreateSDKLoginTokenResponse.toJsonString(resp));
return CreateSDKLoginTokenResponse.toJsonString(resp);
} catch (TencentCloudSDKException e) {
log.error(e.toString());

2
epmet-gateway/src/main/resources/bootstrap.yml

@ -528,6 +528,8 @@ epmet:
# 员工登记、受众群体登记
- /gov/org/icEmployeeRegister/add
- /gov/org/icGroupPeopleRegister/add
# 组织树,灵山大屏需要无登录调用,放开
- /gov/org/agency/maporg
# 外部应用认证,使用AccessToken等头进行认证
externalOpenUrls:
- /data/report/**

10
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java

@ -56,4 +56,14 @@ public class ImportTaskCommonFormDTO extends PageFormDTO {
*/
private String resultDesc;
/**
* 成功行数
*/
private Integer successItemsQty;
/**
* 失败行数
*/
private Integer failItemsQty;
}

3
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ImportTaskCommonResultDTO.java

@ -40,4 +40,7 @@ public class ImportTaskCommonResultDTO implements Serializable {
*/
private String resultDescFile;
private Integer successItemsQty;
private Integer failItemsQty;
}

2
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java

@ -22,7 +22,7 @@ import java.util.Map;
* @date 2020/6/4 10:28
*/
@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallbackFactory = EpmetCommonServiceOpenFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallbackFactory = EpmetCommonServiceOpenFeignClientFallbackFactory.class, url = "http://localhost:8103")
// @FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallbackFactory = EpmetCommonServiceOpenFeignClientFallbackFactory.class, url = "http://localhost:8103")
public interface EpmetCommonServiceOpenFeignClient {
/**
* @param formDTO

27
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/utils/ImportTaskUtils.java

@ -21,11 +21,17 @@ public class ImportTaskUtils implements ResultDataResolver {
* @return Result
*/
public static Result<ImportTaskCommonResultDTO> createImportTask(String originFileName, String bizType) {
return createImportTask(originFileName, bizType, null, null);
}
public static Result<ImportTaskCommonResultDTO> createImportTask(String originFileName, String bizType,
Integer successItemsQty, Integer failItemsQty) {
ImportTaskCommonFormDTO form = new ImportTaskCommonFormDTO();
form.setOriginFileName(originFileName);
form.setOperatorId(EpmetRequestHolder.getHeader(AppClientConstant.USER_ID));
form.setBizType(bizType);
form.setSuccessItemsQty(successItemsQty);
form.setFailItemsQty(failItemsQty);
return SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class).createImportTask(form);
}
@ -48,4 +54,23 @@ public class ImportTaskUtils implements ResultDataResolver {
return SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class).finishImportTask(form);
}
/**
* @description: 结束导入任务
* @return
* @author: WangXianZhang
* @date: 2023/4/20 9:55 AM
*/
public static Result finishImportTask(String taskId, String processStatus, String resultDescFilePath, String resultDesc, Integer successItemsQty, Integer failItemsQty) {
ImportTaskCommonFormDTO form = new ImportTaskCommonFormDTO();
form.setTaskId(taskId);
form.setOperatorId(EpmetRequestHolder.getHeader(AppClientConstant.USER_ID));
form.setProcessStatus(processStatus);
form.setResultDescFilePath(resultDescFilePath);
form.setResultDesc(resultDesc);
form.setSuccessItemsQty(successItemsQty);
form.setFailItemsQty(failItemsQty);
return SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class).finishImportTask(form);
}
}

21
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java

@ -21,6 +21,19 @@ public class ImportTaskController {
@Autowired
private ImportTaskService importTaskService;
/**
* @description: 通过id查找
* @param taskId:
* @return
* @author: WangXianZhang
* @date: 2023/4/20 2:17 PM
*/
@RequestMapping("/getById")
public Result<ImportTaskCommonResultDTO> getById(@RequestParam("taskId") String taskId) {
ImportTaskCommonResultDTO r = importTaskService.getById(taskId);
return new Result<ImportTaskCommonResultDTO>().ok(r);
}
/**
* desc:分页获取个人导入记录
* @param tokenDto
@ -59,7 +72,13 @@ public class ImportTaskController {
@RequestMapping("finish")
public Result finishTask(@RequestBody ImportTaskCommonFormDTO input) {
ValidatorUtils.validateEntity(input, ImportTaskCommonFormDTO.Finish.class);
Boolean finished = importTaskService.finish(input.getTaskId(), input.getProcessStatus(), input.getOperatorId(), input.getResultDescFilePath(), input.getResultDesc());
Boolean finished = importTaskService.finish(input.getTaskId(),
input.getProcessStatus(),
input.getOperatorId(),
input.getResultDescFilePath(),
input.getResultDesc(),
input.getSuccessItemsQty(),
input.getFailItemsQty());
if (!finished) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"失败,请确认任务是否存在,以及是否已完成",

10
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ImportTaskDao.java

@ -24,8 +24,10 @@ public interface ImportTaskDao extends BaseDao<ImportTaskEntity> {
* @return
*/
int finish(@Param("taskId") String taskId,
@Param("process_status") String processStatus,
@Param("operatorId") String operatorId,
@Param("resultDesc") String resultDesc,
@Param("resultDescFile") String resultDescFile);
@Param("process_status") String processStatus,
@Param("operatorId") String operatorId,
@Param("resultDesc") String resultDesc,
@Param("resultDescFile") String resultDescFile,
@Param("successItemsQty") Integer successItemsQty,
@Param("failItemsQty") Integer failItemsQty);
}

3
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ImportTaskEntity.java

@ -54,4 +54,7 @@ public class ImportTaskEntity extends BaseEpmetEntity {
private String resultDesc;
private Integer successItemsQty;
private Integer failItemsQty;
}

5
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ImportTaskService.java

@ -36,7 +36,8 @@ public interface ImportTaskService {
* @param resultDescFile 结果描述文件
* @param resultDesc 结果描述文本
*/
Boolean finish(String taskId, String processStatus, String operatorId, String resultDescFile, String resultDesc);
Boolean finish(String taskId, String processStatus, String operatorId, String resultDescFile, String resultDesc,
Integer successItemsQty, Integer failItemsQty);
/**
* desc分页获取个人导入记录
@ -51,4 +52,6 @@ public interface ImportTaskService {
* @return
*/
Boolean processingTaskCheck(String bizType);
ImportTaskCommonResultDTO getById(String taskId);
}

13
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java

@ -89,8 +89,9 @@ public class ImportTaskServiceImpl implements ImportTaskService {
}
@Override
public Boolean finish(String taskId, String processStatus, String operatorId, String resultDescFile, String resultDesc) {
return importRecordDao.finish(taskId, processStatus, operatorId, resultDesc, resultDescFile) > 0;
public Boolean finish(String taskId, String processStatus, String operatorId, String resultDescFile, String resultDesc,
Integer successItemsQty, Integer failItemsQty) {
return importRecordDao.finish(taskId, processStatus, operatorId, resultDesc, resultDescFile, successItemsQty, failItemsQty) > 0;
}
@Override
@ -120,4 +121,12 @@ public class ImportTaskServiceImpl implements ImportTaskService {
return importRecordDao.selectCount(query) > 0;
}
@Override
public ImportTaskCommonResultDTO getById(String taskId) {
ImportTaskEntity task = importRecordDao.selectById(taskId);
ImportTaskCommonResultDTO r = ConvertUtils.sourceToTarget(task, ImportTaskCommonResultDTO.class);
r.setTaskId(taskId);
return r;
}
}

2
epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.15__importtask_add_number.sql

@ -0,0 +1,2 @@
alter table import_task add column SUCCESS_ITEMS_QTY int comment '成功条数' after RESULT_DESC;
alter table import_task add column FAIL_ITEMS_QTY int comment '失败条数' after SUCCESS_ITEMS_QTY;

4
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ImportTaskDao.xml

@ -12,6 +12,8 @@
<result property="startTime" column="START_TIME"/>
<result property="resultDescFile" column="RESULT_DESC_FILE"/>
<result property="resultDesc" column="RESULT_DESC"/>
<result property="successItemsQty" column="SUCCESS_ITEMS_QTY"/>
<result property="failItemsQty" column="FAIL_ITEMS_QTY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
@ -26,6 +28,8 @@
set PROCESS_STATUS = #{process_status},
RESULT_DESC = #{resultDesc},
RESULT_DESC_FILE = #{resultDescFile},
SUCCESS_ITEMS_QTY = #{successItemsQty},
FAIL_ITEMS_QTY = #{failItemsQty},
UPDATED_BY=#{operatorId},
UPDATED_TIME=NOW()
where ID=#{taskId}

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java

@ -14,7 +14,7 @@ public class TCCCAuthController {
public String getTcccAuth() {
try {
String tcccAuth = TCCCClientUtils.getToken();
System.out.println(tcccAuth);
log.info(tcccAuth);
return tcccAuth;
} catch (Exception e) {
log.error(e.toString());

59
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcDangerousChemicalsDTO.java

@ -1,8 +1,9 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -21,6 +22,20 @@ public class IcDangerousChemicalsDTO implements Serializable {
*/
private String id;
/**
* 灵山企业所属组织/网格
*/
private String orgId;
/**
* 灵山组织agency网格grid
*/
private String orgType;
/**
* 灵山ORG_ID的全路径包含ORG_ID
*/
private String orgIdPath;
/**
* 客户Id
*/
@ -62,19 +77,19 @@ public class IcDangerousChemicalsDTO implements Serializable {
private String dangerType;
/**
* 负责人姓名
* 负责人姓名灵山项目中此列叫联系人
*/
private String principalName;
private String principalName;
/**
* 负责人电话
* 负责人电话灵山项目中此列叫联系电话
*/
private String principalMobile;
private String principalMobile;
/**
* 经营地址
* 经营地址灵山项目中此列叫企业地址
*/
private String address;
private String address;
/**
* 经度
@ -91,6 +106,36 @@ public class IcDangerousChemicalsDTO implements Serializable {
*/
private String remark;
/**
* 灵山是否重点安全企业1是0不是必填
*/
private Boolean securityFlag;
/**
* 灵山安全负责人姓名
*/
private String securityPrincipalName;
/**
* 灵山手机号
*/
private String securityPrincipalMobile;
/**
* 灵山包企领导
*/
private String bqLd;
/**
* 灵山包企干部
*/
private String bqGb;
/**
* 灵山企业介绍
*/
private String companyProfile;
/**
* 删除标识
*/

82
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsAddEditFormDTO.java

@ -1,12 +1,11 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
@ -21,22 +20,42 @@ public class IcDangerousChemicalsAddEditFormDTO implements Serializable {
public interface Del extends CustomerClientShowGroup {
}
public interface LingShanAddGroup extends CustomerClientShowGroup {
}
public interface LingShanEditGroup extends CustomerClientShowGroup {
}
/**
* 灵山企业所属组织/网格
*/
@NotBlank(message = "所属组织不能为空", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
private String orgId;
/**
* 灵山组织agency网格grid
*/
@NotBlank(message = "所属组织类型不能为空", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
private String orgType;
/**
* 场所Id
*/
@NotBlank(message = "场所Id不能为空", groups = {UpdateGroup.class, Del.class})
@NotBlank(message = "企业Id不能为空", groups = {LingShanEditGroup.class, Del.class})
private String icDangerousChemicalsId;
/**
* 企业名称
*/
@NotBlank(message = "企业名称不能为空", groups = {AddGroup.class})
@Length(max = 50, message = "场所名称不能超过50位", groups = AddGroup.class)
@NotBlank(message = "企业名称不能为空", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
@Length(max = 35, message = "企业名称最多输入35字", groups = LingShanAddGroup.class)
private String name;
/**
* 企业类型值
*/
@NotBlank(message = "企业类型不能为空", groups = {AddGroup.class})
@NotBlank(message = "企业类型不能为空", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
private String category;
/**
* 周边安全距离
*/
@ -46,36 +65,71 @@ public class IcDangerousChemicalsAddEditFormDTO implements Serializable {
*/
private String dangerType;
/**
* 负责人
* 负责人姓名灵山项目中此列叫联系人
*/
private String principalName;
/**
* 联系电话
* 负责人电话灵山项目中此列叫联系电话
*/
private String principalMobile;
/**
* 经度
*/
@NotBlank(message = "经度不能为空", groups = {AddGroup.class})
@NotBlank(message = "请完善经度信息", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
private String longitude;
/**
* 维度
*/
@NotBlank(message = "维度不能为空", groups = {AddGroup.class})
@NotBlank(message = "请完善纬度信息", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
private String latitude;
/**
* 地址
* 经营地址灵山项目中此列叫企业地址
*/
@NotBlank(message = "地址不能为空", groups = {AddGroup.class})
@Length(max = 50, message = "地址不能超过50位", groups = AddGroup.class)
@NotBlank(message = "企业地址不能为空", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
@Length(max = 200, message = "企业地址最多输入200字", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
private String address;
/**
* 备注
*/
private String remark;
/**
* 灵山是否重点安全企业1是0不是必填
*/
@NotNull(message = "是否重点安全企业不能为空", groups = {LingShanAddGroup.class, LingShanEditGroup.class})
private Boolean securityFlag;
/**
* 灵山安全负责人姓名
*/
private String securityPrincipalName;
/**
* 灵山手机号
*/
private String securityPrincipalMobile;
/**
* 灵山包企领导
*/
private String bqLd;
/**
* 灵山包企干部
*/
private String bqGb;
/**
* 灵山企业介绍
*/
@Length(max = 1000,groups = {LingShanAddGroup.class, LingShanEditGroup.class},message = "企业介绍最多输入1000字")
private String companyProfile;
private String customerId;
private String userId;
}

52
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsListFormDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
@ -9,34 +10,67 @@ import java.io.Serializable;
* @Author sun
*/
@Data
public class IcDangerousChemicalsListFormDTO implements Serializable {
public class IcDangerousChemicalsListFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
/**
* 场所名称
* 组织或者网格id
*/
private String orgId;
/**
* 组织agency
* 网格grid
*/
private String orgType;
/**
* 灵山GRID_ID的全路径包含grid_id
* 接口内部赋值用于sql只有orgType=agency时使用此列查询
*/
private String orgIdPath;
/**
* 企业名称
*/
private String name;
/**
* 场所分类字典表值
* 企业类型字典表值
*/
private String category;
/**
* 危化品种类字典值
* 灵山界面暂无此列
*/
private String dangerType;
/**
* 页码
* 企业地址
* 经营地址灵山项目中此列叫企业地址
*/
private Integer pageNo = 1;
private String address;
/**
* 联系人
* 负责人姓名灵山项目中此列叫联系人
*/
private String principalName;
/**
* 每页显示数量
* 灵山安全负责人姓名
*/
private Integer pageSize = 20;
private String securityPrincipalName;
private Boolean isPage = true;
private String icDangerousChemicalsId;
/**
* tokenDto.customerId
*/
private String customerId;
/**
* tokenDto.userId
*/
private String staffId;
private String agencyId;
}

58
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcDangerousChemicalsListResultDTO.java

@ -17,7 +17,26 @@ public class IcDangerousChemicalsListResultDTO implements Serializable {
*/
private String icDangerousChemicalsId;
/**
* 组织Id
* 灵山企业所属组织/网格
*/
private String orgId;
/**
* 灵山组织agency网格grid
*/
private String orgType;
/**
* 灵山ORG_ID的全路径包含ORG_ID
*/
private String orgIdPath;
/**
* 所属组织可能是网格名也可能是组织名
*/
private String orgName;
/**
* 所属组织机构Id灵山工作人员所属组织id
*/
private String agencyId;
/**
@ -53,13 +72,15 @@ public class IcDangerousChemicalsListResultDTO implements Serializable {
*/
private String dangerTypeName;
/**
* 负责人
* 负责人姓名灵山项目中此列叫联系人
*/
private String principalName;
/**
* 联系电话
* 负责人电话灵山项目中此列叫联系电话
*/
private String principalMobile;
/**
* 经度
*/
@ -69,7 +90,7 @@ public class IcDangerousChemicalsListResultDTO implements Serializable {
*/
private String latitude;
/**
* 地址
* 经营地址灵山项目中此列叫企业地址
*/
private String address;
/**
@ -77,4 +98,33 @@ public class IcDangerousChemicalsListResultDTO implements Serializable {
*/
private String remark;
/**
* 灵山是否重点安全企业1是0不是必填
*/
private Boolean securityFlag;
/**
* 灵山安全负责人姓名
*/
private String securityPrincipalName;
/**
* 灵山手机号
*/
private String securityPrincipalMobile;
/**
* 灵山包企领导
*/
private String bqLd;
/**
* 灵山包企干部
*/
private String bqGb;
/**
* 灵山企业介绍
*/
private String companyProfile;
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -362,14 +362,13 @@ public class AgencyController {
/**
* @param formDTO
* @param tokenDto
* @Description 地图配置组织查询
* @author zxc
* @date 2021/10/25 10:50 上午
*/
@PostMapping("maporg")
public Result<MapOrgResultDTO> mapOrg(@RequestBody MapOrgFormDTO formDTO, @LoginUser TokenDto tokenDto) {
return new Result<MapOrgResultDTO>().ok(agencyService.mapOrg(formDTO, tokenDto));
public Result<MapOrgResultDTO> mapOrg(@RequestBody MapOrgFormDTO formDTO) {
return new Result<MapOrgResultDTO>().ok(agencyService.mapOrg(formDTO));
}
/**

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -351,7 +351,7 @@ public class CustomerAgencyController {
@PostMapping("agencylist")
public Result<AgencyTreeResultDTO> getAgencyList(@LoginUser TokenDto tokenDTO,@RequestBody GetAgencyListFormDTO formDTO) {
if(AppClientConstant.APP_OPER.equals(tokenDTO.getApp())){
ValidatorUtils.validateEntity(formDTO.getCustomerId(),GetAgencyListFormDTO.OperAddUserShowGroup.class);
ValidatorUtils.validateEntity(formDTO,GetAgencyListFormDTO.OperAddUserShowGroup.class);
}else{
if (StringUtils.isBlank(formDTO.getCustomerId())){
formDTO.setCustomerId(tokenDTO.getCustomerId());
@ -405,6 +405,17 @@ public class CustomerAgencyController {
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId(),tokenDTO.getCustomerId()));
}
/**
* 根组织开始含网格
* @param formDTO
* @return
*/
@PostMapping("agencygridtreeV2")
public Result<AgencyTreeResultDTO> getOrgList(@RequestBody GetAgencyListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO,GetAgencyListFormDTO.OperAddUserShowGroup.class);
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(formDTO.getUserId(),formDTO.getCustomerId()));
}
/**
* @Description 事件社区服务热线
* @author sun

77
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java

@ -10,7 +10,6 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
@ -19,9 +18,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcDangerousChemicalsDTO;
import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO;
@ -32,7 +28,6 @@ import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcDangerousChemicalsExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcDangerousChemicalsService;
import com.epmet.utils.ImportTaskUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
@ -72,6 +67,12 @@ public class IcDangerousChemicalsController {
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
/**
* 重点危化品企业 列表分页
* @param tokenDto
* @param formDTO
* @return
*/
@RequestMapping("list")
public Result<PageData<IcDangerousChemicalsListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -85,26 +86,44 @@ public class IcDangerousChemicalsController {
return new Result<IcDangerousChemicalsDTO>().ok(data);
}
/**
* 重点危化品企业 新增
* @param tokenDto
* @param dto
* @return
*/
@NoRepeatSubmit
@PostMapping("add")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsAddEditFormDTO dto) {
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
ValidatorUtils.validateEntity(dto, IcDangerousChemicalsAddEditFormDTO.LingShanAddGroup.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserId(tokenDto.getUserId());
icDangerousChemicalsService.save(dto);
return new Result();
}
/**
* 重点危化品企业 编辑
* @param tokenDto
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("edit")
public Result update(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsAddEditFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
ValidatorUtils.validateEntity(formDTO, IcDangerousChemicalsAddEditFormDTO.LingShanEditGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icDangerousChemicalsService.update(formDTO);
return new Result();
}
/**
* 重点危化品企业 删除
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("del")
public Result delete(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsAddEditFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcDangerousChemicalsAddEditFormDTO.Del.class);
@ -114,19 +133,49 @@ public class IcDangerousChemicalsController {
return new Result();
}
/**
* 批量删除
* @param tokenDto
* @param ids
* @return
*/
@PostMapping("batch-del")
public Result delete(@LoginUser TokenDto tokenDto, @RequestBody List<String> ids) {
ids.forEach(id->{
IcDangerousChemicalsAddEditFormDTO formDTO=new IcDangerousChemicalsAddEditFormDTO();
formDTO.setIcDangerousChemicalsId(id);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icDangerousChemicalsService.delete(formDTO);
});
return new Result();
}
/**
* 重点危化品企业 查看详情
* @param formDTO
* @return
*/
@RequestMapping("detail")
public Result<IcDangerousChemicalsListResultDTO> detail(@RequestBody IcDangerousChemicalsListFormDTO formDTO) {
return new Result<IcDangerousChemicalsListResultDTO>().ok(icDangerousChemicalsService.detail(formDTO));
}
/**
* 重点危化品企业 下载导入模板
* @param response
* @throws IOException
*/
@RequestMapping(value = "download", method = {RequestMethod.GET, RequestMethod.POST})
public void downloadTemplate(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("重点危化管理导入模板", "UTF-8") + ".xlsx");
// response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("重点危化管理导入模板", "UTF-8") + ".xlsx");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("企业档案导入模板", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/dangerous_chemicals_template.xlsx");
// InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/dangerous_chemicals_template.xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/lingshan_dangerous_chemicals_template.xlsx");
try {
ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os);
@ -137,6 +186,13 @@ public class IcDangerousChemicalsController {
}
}
/**
* 重点危化品企业 导出
* @param tokenDto
* @param formDTO
* @param response
* @throws IOException
*/
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody IcDangerousChemicalsListFormDTO formDTO, HttpServletResponse response) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -146,7 +202,8 @@ public class IcDangerousChemicalsController {
formDTO.setPageNo(NumConstant.ONE);
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
try {
String fileName = "重点危化管理" + DateUtils.format(new Date()) + ".xlsx";
// String fileName = "重点危化管理" + DateUtils.format(new Date()) + ".xlsx";
String fileName = "企业档案" + DateUtils.format(new Date()) + ".xlsx";
// 头的策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// 背景设置为红色

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java

@ -20,9 +20,8 @@ public interface IcDangerousChemicalsDao extends BaseDao<IcDangerousChemicalsEnt
List<IcDangerousChemicalsListResultDTO> selectDangerousChemicalsList(IcDangerousChemicalsListFormDTO formDTO);
void del(IcDangerousChemicalsEntity entity);
void del(@Param("id") String id,@Param("updatedBy") String updatedBy);
void importInsert(@Param("entityList") List<IcDangerousChemicalsEntity> entityList);
void delByAgencyAndName(IcDangerousChemicalsEntity entity);
}

64
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcDangerousChemicalsEntity.java

@ -24,8 +24,22 @@ public class IcDangerousChemicalsEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 灵山企业所属组织/网格
*/
private String orgId;
/**
* 灵山组织agency网格grid
*/
private String orgType;
/**
* 灵山ORG_ID的全路径包含ORG_ID
*/
private String orgIdPath;
/**
* 所属组织机构Id
* 所属组织机构Id灵山工作人员所属组织id
*/
private String agencyId;
@ -59,19 +73,19 @@ public class IcDangerousChemicalsEntity extends BaseEpmetEntity {
*/
private String dangerType;
/**
* 负责人姓名
*/
/**
* 负责人姓名灵山项目中此列叫联系人
*/
private String principalName;
/**
* 负责人电话
*/
/**
* 负责人电话灵山项目中此列叫联系电话
*/
private String principalMobile;
/**
* 经营地址
*/
/**
* 经营地址灵山项目中此列叫企业地址
*/
private String address;
/**
@ -89,6 +103,36 @@ public class IcDangerousChemicalsEntity extends BaseEpmetEntity {
*/
private String remark;
/**
* 灵山是否重点安全企业1是0不是必填
*/
private Boolean securityFlag;
/**
* 灵山安全负责人姓名
*/
private String securityPrincipalName;
/**
* 灵山手机号
*/
private String securityPrincipalMobile;
/**
* 灵山包企领导
*/
private String bqLd;
/**
* 灵山包企干部
*/
private String bqGb;
/**
* 灵山企业介绍
*/
private String companyProfile;
@TableField(exist = false)
private String dangerTypeName;

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java

@ -13,27 +13,31 @@ import lombok.Data;
@Data
public class IcDangerousChemicalsExcel {
@ExcelProperty(value = "所属组织")
@ColumnWidth(25)
private String orgName;
@ExcelProperty(value = "企业名称")
@ColumnWidth(25)
private String name;
@ExcelProperty(value = "企业类")
@ExcelProperty(value = "企业类")
@ColumnWidth(20)
private String categoryName;
@ExcelProperty(value = "周边安全距离")
@ColumnWidth(20)
private String safeDistanceName;
// @ExcelProperty(value = "周边安全距离")
// @ColumnWidth(20)
// private String safeDistanceName;
//
// @ExcelProperty(value = "危化品种类")
// @ColumnWidth(20)
// private String dangerTypeName;
@ExcelProperty(value = "危化品种类")
@ColumnWidth(20)
private String dangerTypeName;
@ExcelProperty(value = "经营地址")
@ExcelProperty(value = "企业地址")
@ColumnWidth(25)
private String address;
@ExcelProperty(value = "负责人")
@ExcelProperty(value = "联系人")
@ColumnWidth(20)
private String principalName;
@ -41,8 +45,12 @@ public class IcDangerousChemicalsExcel {
@ColumnWidth(20)
private String principalMobile;
@ExcelProperty(value = "备注")
@ExcelProperty(value = "安全负责人")
@ColumnWidth(25)
private String securityPrincipalName;
@ExcelProperty(value = "安全负责人电话")
@ColumnWidth(25)
private String remark;
private String securityPrincipalMobile;
}

192
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsImportListener.java

@ -2,35 +2,30 @@ package com.epmet.model;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.CoveragePlaceTypeEnum;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dao.IcDangerousChemicalsDao;
import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.entity.IcDangerousChemicalsEntity;
import com.epmet.excel.IcCityManagementExcel;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.CoverageService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.service.IcDangerousChemicalsService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author zxc
@ -42,24 +37,51 @@ import java.util.stream.Collectors;
public class DangerousChemicalsImportListener extends AnalysisEventListener<DangerousChemicalsModel> {
private IcDangerousChemicalsService icDangerousChemicalsService;
private EpmetAdminOpenFeignClient adminOpenFeignClient;
private CoverageService coverageService;
private AgencyInfoCache agencyInfo;
private IcDangerousChemicalsDao icDangerousChemicalsDao;
private CustomerAgencyService customerAgencyService;
private CustomerGridService customerGridService;
private String currentUserId;
private String customerId;
private String staffAgencyId;
private String staffAgencyPath;
private List<DangerousChemicalsModel.RowRemarkMessage> errorRows = new ArrayList<>();
private List<DangerousChemicalsModel.RowRemarkMessage> otherRows = new ArrayList<>();
private List<IcDangerousChemicalsEntity> insertList = new ArrayList<>();
private Map<String,String> existMap = null;
private List<IcDangerousChemicalsEntity> updateList = new ArrayList<>();
// /**
// * 危化品种类
// */
// private Map<String, String> dangerTypeMap;
/**
* 企业类别
*/
private Map<String, String> categoryDictMap;
/**
* key网格id
* value:网格名称
*/
private Map<String, String> gridMap;
public DangerousChemicalsImportListener(String currentUserId, AgencyInfoCache agencyInfo, IcDangerousChemicalsService icDangerousChemicalsService, CoverageService coverageService, EpmetAdminOpenFeignClient adminOpenFeignClient, IcDangerousChemicalsDao icDangerousChemicalsDao){
public DangerousChemicalsImportListener(String currentUserId,
String customerId,
String staffAgencyId,
String staffAgencyPath,
IcDangerousChemicalsService icDangerousChemicalsService,
CoverageService coverageService,
CustomerAgencyService customerAgencyService,
CustomerGridService customerGridService,
Map<String, String> dangerTypeMap,
Map<String, String> categoryDictMap){
this.currentUserId = currentUserId;
this.agencyInfo = agencyInfo;
this.customerId=customerId;
this.staffAgencyId=staffAgencyId;
this.staffAgencyPath=staffAgencyPath;
this.icDangerousChemicalsService = icDangerousChemicalsService;
this.coverageService = coverageService;
this.adminOpenFeignClient = adminOpenFeignClient;
this.icDangerousChemicalsDao = icDangerousChemicalsDao;
this.customerAgencyService=customerAgencyService;
this.customerGridService=customerGridService;
// this.dangerTypeMap=dangerTypeMap;
this.categoryDictMap=categoryDictMap;
}
@Override
@ -68,29 +90,72 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang
data.setRowNum(rowNum);
try {
ValidatorUtils.validateEntity(data);
/*existMap = null == existMap ? getExistMap(agencyInfo.getId()) : existMap;
if (StringUtils.isNotBlank(existMap.get(data.getName()))){
DangerousChemicalsModel.RowRemarkMessage errorRow = ConvertUtils.sourceToTarget(data, DangerousChemicalsModel.RowRemarkMessage.class);
errorRow.setErrorInfo("数据库存在该条数据");
errorRows.add(errorRow);
return;
}*/
IcDangerousChemicalsEntity e = ConvertUtils.sourceToTarget(data, IcDangerousChemicalsEntity.class);
//验证所属组织填写的是否正确
CustomerAgencyDTO customerAgencyDTO=customerAgencyService.getByAgencyName(customerId,data.getAgencyName());
if(null==customerAgencyDTO){
throw new ValidateException(String.format("当前客户下,不存在【%s】",data.getAgencyName()));
}
//验证所属网格
if(StringUtils.isNotBlank(data.getGridName())){
CustomerGridDTO gridFormDto=new CustomerGridDTO();
gridFormDto.setCustomerId(customerId);
gridFormDto.setPid(customerAgencyDTO.getId());
gridFormDto.setGridName(data.getGridName());
CustomerGridDTO gridDTO= customerGridService.get(gridFormDto);
if(null==gridDTO){
throw new ValidateException(String.format("%s下,不存在【%s】",data.getAgencyName(),data.getGridName()));
}
// 企业属于网格
e.setOrgId(gridDTO.getId());
e.setOrgType(OrgTypeEnum.GRID.getCode());
e.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridDTO.getId(),gridDTO.getPids()));
}else{
// 企业属于组织
e.setOrgId(customerAgencyDTO.getId());
e.setOrgType(OrgTypeEnum.AGENCY.getCode());
e.setOrgIdPath(PidUtils.convertPid2OrgIdPath(customerAgencyDTO.getId(),customerAgencyDTO.getPids()));
}
// 验证企业类别
String categoryKey = StrConstant.EPMETY_STR;
for (Map.Entry<String, String> entry : categoryDictMap.entrySet()) {
if (data.getCategoryName().equals(entry.getValue())) {
categoryKey = entry.getKey();
break;
}
}
if (StringUtils.isBlank(categoryKey)) {
throw new ValidateException("【" + data.getCategoryName() + "】此企业类别不存在");
}
e.setCategory(categoryKey);
e.setSourceType("import");
e.setAgencyId(agencyInfo.getId());
e.setCustomerId(agencyInfo.getCustomerId());
e.setAgencyIdPath(agencyInfo.getPids().equals(NumConstant.ZERO_STR) || agencyInfo.getPids().equals("") ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId()));
e.setCustomerId(customerId);
e.setAgencyId(staffAgencyId);
e.setAgencyIdPath(staffAgencyPath);
e.setCreatedBy(currentUserId);
e.setUpdatedBy(currentUserId);
insertList.add(e);
if (insertList.size() == NumConstant.ONE_HUNDRED){
e.setSecurityFlag("是".equals(data.getSecurityFlagName()) ? true : false);
// 判断是否存在
IcDangerousChemicalsEntity origin=icDangerousChemicalsService.get(e.getOrgId(),e.getName());
if (null != origin) {
e.setId(origin.getId());
updateList.add(origin);
} else {
insertList.add(e);
}
if (insertList.size() == NumConstant.ONE_HUNDRED) {
execPersist();
}
if (updateList.size() == NumConstant.ONE_HUNDRED) {
execPersist();
}
}catch (Exception e){
String errorMsg = null;
if (e instanceof ValidateException) {
errorMsg = ((ValidateException) e).getMsg();
} else {
}else if(e instanceof EpmetException){
errorMsg=((EpmetException) e).getMsg();
}else {
errorMsg = "未知错误";
log.error("【重点危化品企业导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
}
@ -105,68 +170,21 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang
execPersist();
}
public Map<String,String> getExistMap(String agencyId){
LambdaQueryWrapper<IcDangerousChemicalsEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(IcDangerousChemicalsEntity::getAgencyId, agencyId);
List<IcDangerousChemicalsEntity> entityList = icDangerousChemicalsDao.selectList(tWrapper);
Map<String,String> existMap = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(entityList)){
existMap = entityList.stream().collect(Collectors.toMap(IcDangerousChemicalsEntity::getName,IcDangerousChemicalsEntity::getId,(v1,v2) -> v1));
}
return existMap;
}
/**
* Desc: 数据库插入
*/
private void execPersist() {
try {
if (CollectionUtils.isNotEmpty(insertList)) {
//危化品种类字典
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode());
if (!statusRes.success()){
throw new EpmetException("获取IC_DANGER_TYPE字典表失败");
}
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(16);
//企业类别字典数据
List<IcCoverageCategoryDictListResultDTO> dictList = coverageService.dictMap(agencyInfo.getCustomerId(), CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode());
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel));
insertList.forEach(i -> {
statusMap.forEach((k,v) -> {
if (i.getDangerTypeName().equals(v)){
i.setDangerType(k);
}
});
dictMap.forEach((k,v) -> {
if (i.getCategoryName().equals(v)){
i.setCategory(k);
}
});
});
Map<String, Long> groupByName = insertList.stream().collect(Collectors.groupingBy(IcDangerousChemicalsEntity::getName, Collectors.counting()));
groupByName.forEach((k,v) -> {
if (v.compareTo(NumConstant.ONE_L) != NumConstant.ZERO){
insertList.forEach(i -> {
if (i.getName().equals(k)){
i.setExistStatus(true);
}
});
}
});
Map<Boolean, List<IcDangerousChemicalsEntity>> groupByStatus = insertList.stream().collect(Collectors.groupingBy(IcDangerousChemicalsEntity::getExistStatus));
if (CollectionUtils.isNotEmpty(groupByStatus.get(true))){
groupByStatus.get(true).forEach(t -> {
DangerousChemicalsModel.RowRemarkMessage errorRow = ConvertUtils.sourceToTarget(t, DangerousChemicalsModel.RowRemarkMessage.class);
errorRow.setErrorInfo("表格中存在重复数据");
errorRows.add(errorRow);
});
}
if (CollectionUtils.isNotEmpty(groupByStatus.get(false))){
icDangerousChemicalsService.importInsert(groupByStatus.get(false));
}
icDangerousChemicalsService.insertBatch(insertList);
}
if (CollectionUtils.isNotEmpty(updateList)) {
icDangerousChemicalsService.updateBatchById(updateList);
}
} finally {
insertList.clear();
existMap = null;
updateList.clear();
}
}

146
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsModel.java

@ -3,7 +3,6 @@ package com.epmet.model;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -17,46 +16,98 @@ import javax.validation.constraints.NotBlank;
@Data
public class DangerousChemicalsModel {
@NotBlank(message = "所属组织不能为空")
@ExcelProperty(value = "所属组织")
private String agencyName;
@ExcelProperty(value = "所属网格")
private String gridName;
@NotBlank(message = "企业名称不能为空")
@Length(max = 50,message = "企业名称长度超出50字限制")
@Length(max = 35, message = "企业名称最多输入35字")
@ExcelProperty(value = "企业名称")
private String name;
@NotBlank(message = "企业类型不能为空")
@ExcelProperty(value = "企业类型")
@NotBlank(message = "企业类不能为空")
@ExcelProperty(value = "企业类")
private String categoryName;
@ExcelProperty(value = "周边安全间距(公里)")
private String safeDistance = NumConstant.ZERO_STR;
@ExcelProperty(value = "危化品种类")
private String dangerTypeName;
/**
* 灵山是否重点安全企业1是0不是必填
*/
@NotBlank(message = "是否重点安全企业不能为空")
@ExcelProperty(value = "是否重点安全企业")
private String securityFlagName;
// @ExcelProperty(value = "周边安全间距(公里)")
// private String safeDistance = NumConstant.ZERO_STR;
//
// @ExcelProperty(value = "危化品种类")
// private String dangerTypeName;
@NotBlank(message = "企业地址不能为空")
@Length(max = 200, message = "企业地址最多输入200字")
@ExcelProperty(value = "企业地址")
private String address;
@ExcelProperty(value = "负责人")
@ExcelProperty(value = "联系人")
private String principalName;
@Length(max = 50,message = "联系电话长度超出50字限制")
@Length(max = 50, message = "联系电话长度超出50字限制")
@ExcelProperty(value = "联系电话")
private String principalMobile;
@NotBlank(message = "经营地址不能为空")
@Length(max = 50,message = "经营地址长度超出50字限制")
@ExcelProperty(value = "经营地址")
private String address;
@ExcelProperty(value = "备注")
private String remark;
// @ExcelProperty(value = "备注")
// private String remark;
/**
* 灵山安全负责人姓名
*/
@ExcelProperty(value = "安全负责人姓名")
private String securityPrincipalName;
/**
* 灵山手机号
*/
@ExcelProperty(value = "手机号")
private String securityPrincipalMobile;
/**
* 灵山包企领导
*/
@ExcelProperty(value = "包企领导")
private String bqLd;
/**
* 灵山包企干部
*/
@ExcelProperty(value = "包企干部")
private String bqGb;
/**
* 灵山企业介绍
*/
@Length(max = 1000, message = "企业介绍最多输入1000字")
@ExcelProperty(value = "企业介绍")
private String companyProfile;
@ExcelIgnore
private Integer rowNum;
@Data
public static class RowRemarkMessage {
@ExcelProperty(value = "行号")
private Integer rowNum;
@ColumnWidth(20)
@ExcelProperty(value = "所属组织")
private String agencyName;
@ColumnWidth(20)
@ExcelProperty(value = "所属网格")
private String gridName;
@ColumnWidth(40)
@ExcelProperty(value = "企业名称")
private String name;
@ -64,29 +115,62 @@ public class DangerousChemicalsModel {
@ExcelProperty(value = "企业类型")
private String categoryName;
/**
* 灵山是否重点安全企业1是0不是必填
*/
@ColumnWidth(20)
@ExcelProperty(value = "周边安全间距(公里)")
private String safeDistance = NumConstant.ZERO_STR;
@ExcelProperty(value = "是否重点安全企业")
private String securityFlag;
@ColumnWidth(20)
@ExcelProperty(value = "危化品种类")
private String dangerTypeName;
@ColumnWidth(50)
@ExcelProperty(value = "企业地址")
private String address;
@ColumnWidth(20)
@ExcelProperty(value = "负责人")
@ExcelProperty(value = "联系人")
private String principalName;
@ColumnWidth(20)
@ExcelProperty(value = "联系电话")
private String principalMobile;
@ColumnWidth(40)
@ExcelProperty(value = "经营地址")
private String address;
// @ExcelProperty(value = "备注")
// private String remark;
@ColumnWidth(60)
@ExcelProperty(value = "备注")
private String remark;
/**
* 灵山安全负责人姓名
*/
@ColumnWidth(20)
@ExcelProperty(value = "安全负责人姓名")
private String securityPrincipalName;
/**
* 灵山手机号
*/
@ColumnWidth(20)
@ExcelProperty(value = "手机号")
private String securityPrincipalMobile;
/**
* 灵山包企领导
*/
@ColumnWidth(30)
@ExcelProperty(value = "包企领导")
private String bqLd;
/**
* 灵山包企干部
*/
@ColumnWidth(30)
@ExcelProperty(value = "包企干部")
private String bqGb;
/**
* 灵山企业介绍
*/
@ColumnWidth(50)
@ExcelProperty(value = "企业介绍")
private String companyProfile;
@ColumnWidth(60)
@ExcelProperty("错误信息")

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -118,12 +118,11 @@ public interface AgencyService {
/**
* @param formDTO
* @param tokenDto
* @Description 地图配置组织查询
* @author zxc
* @date 2021/10/25 10:50 上午
*/
MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto);
MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO);
/**
* @param formDTO

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -18,7 +18,6 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -268,7 +267,7 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
/**
* desc:获取用户所属组织的组织及网格树
* @param staffId
* @param staffId 为空时从根组织返回
* @return
*/
AgencyTreeResultDTO getOrgTreeData(String staffId,String customerId);
@ -355,4 +354,6 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Date 2022/11/30 22:41
**/
Result<List<CurrentUserCommunityInfoResultDTO>> getCurrentUserCommunityInfo(TokenDto tokenDTO);
CustomerAgencyDTO getByAgencyName(String customerId,String agencyName);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -387,4 +387,6 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @param formDTO
*/
void abandonGridForDealBizData(AbandonGridFormDTO formDTO);
CustomerGridDTO get(CustomerGridDTO forDto);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java

@ -81,5 +81,5 @@ public interface IcDangerousChemicalsService extends BaseService<IcDangerousChem
void dangerousChemicalsImport(Path filePath, String importTaskId, TokenDto tokenDto);
void importInsert(List<IcDangerousChemicalsEntity> entityList);
IcDangerousChemicalsEntity get(String orgId, String name);
}

28
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -32,6 +32,7 @@ import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*;
@ -732,7 +733,6 @@ public class AgencyServiceImpl implements AgencyService {
/**
* @param formDTO
* @param tokenDto
* @Description 地图配置组织查询
* 根据level查询去查询不同的表类型组织agency网格grid小区neighborHood
* 组织类型去查 customer_agency看本级是不是 community下级组织就是网格查询customer_grid不是继续查customer_agency
@ -743,19 +743,35 @@ public class AgencyServiceImpl implements AgencyService {
* @date 2021/10/25 10:50 上午
*/
@Override
public MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto) {
public MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO) {
MapOrgResultDTO result = new MapOrgResultDTO();
LambdaQueryWrapper<CustomerAgencyEntity> qw = new LambdaQueryWrapper();
qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId, tokenDto.getCustomerId());
CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectOne(qw);
String customerId = null;
if (StringUtils.isBlank(formDTO.getOrgId())) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
// 没有传参,则使用当前用户所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo((customerId = EpmetRequestHolder.getLoginUserCustomerId()), EpmetRequestHolder.getLoginUserId());
if (null == staffInfo) {
return result;
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setLevel(OrgInfoConstant.AGENCY);
} else {
// 前段传递了,那就用前端传递的level和orgId,并且查出来这个组织的客户id,用于后面查询跟组织中心点
if (OrgInfoConstant.AGENCY.equals(formDTO.getLevel())) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId());
customerId = agencyInfo.getCustomerId();
} else if (OrgInfoConstant.GRID.equals(formDTO.getLevel())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
customerId = gridInfo.getCustomerId();
}
}
// 查询客户跟组织中心点
LambdaQueryWrapper<CustomerAgencyEntity> qw = new LambdaQueryWrapper();
qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId, customerId);
CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectOne(qw);
if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())) {
result.setLatitude(new BigDecimal(customerAgencyEntity.getLatitude()));
}

41
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -1177,14 +1178,35 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
/**
* 从登录用户所属组织开始包含网格的一颗组织树
* @param staffId 如果staffId为空时从根组织返回
* @param customerId
* @return
*/
@Override
public AgencyTreeResultDTO getOrgTreeData(String staffId,String customerId) {
AgencyTreeResultDTO result = new AgencyTreeResultDTO();
//1.查询工作人员所属组织信息
AgencyResultDTO rootAgency = baseDao.selectAgencyByStaffId(staffId);
if (null == rootAgency) {
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId));
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION);
AgencyResultDTO rootAgency=new AgencyResultDTO();
if(StringUtils.isNotBlank(staffId)){
//1.查询工作人员所属组织信息
rootAgency = baseDao.selectAgencyByStaffId(staffId);
if (null == rootAgency) {
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId));
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION);
}
}else{
LambdaQueryWrapper<CustomerAgencyEntity> rootQuery=new LambdaQueryWrapper<>();
rootQuery.eq(CustomerAgencyEntity::getCustomerId,customerId)
.eq(CustomerAgencyEntity::getPid,NumConstant.ZERO_STR);
CustomerAgencyEntity rootEntity=baseDao.selectOne(rootQuery);
rootAgency.setAgencyId(rootEntity.getId());
rootAgency.setAgencyName(rootEntity.getOrganizationName());
rootAgency.setPids(rootEntity.getPids());
rootAgency.setPid(rootEntity.getPid());
rootAgency.setLevel(rootEntity.getLevel());
rootAgency.setLongitude(rootEntity.getLongitude());
rootAgency.setLatitude(rootEntity.getLatitude());
}
result.setPid(rootAgency.getPid());
result.setAgencyName(rootAgency.getAgencyName());
@ -1607,4 +1629,13 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return new Result<List<CurrentUserCommunityInfoResultDTO>>().ok(list);
}
@Override
public CustomerAgencyDTO getByAgencyName(String customerId,String agencyName) {
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(CustomerAgencyEntity::getOrganizationName,agencyName)
.eq(CustomerAgencyEntity::getCustomerId,customerId)
.last("limit 1");
CustomerAgencyEntity customerAgencyEntity=baseDao.selectOne(queryWrapper);
return ConvertUtils.sourceToTarget(customerAgencyEntity,CustomerAgencyDTO.class);
}
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -1095,4 +1095,14 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
baseDao.update(null,updateGrid);
}
@Override
public CustomerGridDTO get(CustomerGridDTO formDto) {
LambdaQueryWrapper<CustomerGridEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(StringUtils.isNotBlank(formDto.getCustomerId()),CustomerGridEntity::getCustomerId,formDto.getCustomerId())
.eq(StringUtils.isNotBlank(formDto.getPid()),CustomerGridEntity::getPid,formDto.getPid())
.eq(StringUtils.isNotBlank(formDto.getGridName()),CustomerGridEntity::getGridName,formDto.getGridName())
.last("limit 1");
CustomerGridEntity customerGridEntity=baseDao.selectOne(queryWrapper);
return ConvertUtils.sourceToTarget(customerGridEntity,CustomerGridDTO.class);
}
}

171
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java

@ -2,41 +2,41 @@ package com.epmet.service.impl;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.CoveragePlaceTypeEnum;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.OrgTypeEnum;
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.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcDangerousChemicalsDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcDangerousChemicalsDTO;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO;
import com.epmet.dto.form.IcDangerousChemicalsListFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.IcCityManagementListResultDTO;
import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO;
import com.epmet.dto.result.IcDangerousChemicalsListResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcDangerousChemicalsEntity;
import com.epmet.entity.IcSuperiorResourceEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.model.DangerousChemicalsImportListener;
import com.epmet.model.DangerousChemicalsModel;
import com.epmet.service.CoverageService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.service.IcDangerousChemicalsService;
import com.epmet.utils.ImportTaskUtils;
import com.github.pagehelper.PageHelper;
@ -84,16 +84,26 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private IcDangerousChemicalsDao icDangerousChemicalsDao;
private CustomerGridService customerGridService;
@Autowired
private CustomerAgencyService customerAgencyService;
@Override
public PageData<IcDangerousChemicalsListResultDTO> list(IcDangerousChemicalsListFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo) {
throw new EpmetException("获取工作人员信息失败");
if(StringUtils.isBlank(formDTO.getOrgId())||StringUtils.isBlank(formDTO.getOrgType())){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo) {
throw new EpmetException("获取工作人员信息失败");
}
//查询当前组织及下级数据
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType(OrgTypeEnum.AGENCY.getCode());
}
//查询当前组织及下级数据
formDTO.setAgencyId(staffInfo.getAgencyId());
if(OrgTypeEnum.AGENCY.getCode().equals(formDTO.getOrgType())){
CustomerAgencyDTO agencyDTO=SpringContextUtils.getBean(CustomerAgencyService.class).get(formDTO.getOrgId());
formDTO.setOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyDTO.getId(),agencyDTO.getPids()));
}
//列表/导出查询
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<IcDangerousChemicalsListResultDTO> list = baseDao.selectDangerousChemicalsList(formDTO);
@ -114,20 +124,20 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
if (StringUtils.isNotBlank(v.getDangerType())) {
v.setDangerTypeName(statusMap.get(v.getDangerType()));
}
if(OrgTypeEnum.GRID.getCode().equals(v.getOrgType())){
BelongGridNameFormDTO belongGridNameFormDTO=new BelongGridNameFormDTO();
belongGridNameFormDTO.setGridId(v.getOrgId());
v.setOrgName(customerGridService.getGridNameByGridId(belongGridNameFormDTO).getBelongsGridName());
}else if(OrgTypeEnum.AGENCY.getCode().equals(v.getOrgType())){
v.setOrgName(customerAgencyService.getAgencyName(v.getOrgId()));
}
}
}
return new PageData<>(list, pageInfo.getTotal());
}
private QueryWrapper<IcDangerousChemicalsEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcDangerousChemicalsEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcDangerousChemicalsDTO get(String id) {
@ -138,60 +148,68 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcDangerousChemicalsAddEditFormDTO formDTO) {
//1.获取当前工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
//2.校验同组织下服务组织名称不能重复
LambdaQueryWrapper<IcDangerousChemicalsEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(IcDangerousChemicalsEntity::getAgencyId, staffInfo.getAgencyId());
tWrapper.eq(IcDangerousChemicalsEntity::getName, formDTO.getName());
List<IcDangerousChemicalsEntity> entityList = baseDao.selectList(tWrapper);
if (!CollectionUtils.isEmpty(entityList)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的场所");
}
//3.新增服务组织数据
//同一网格下,企业名称唯一
checkNameUnqiue(formDTO.getOrgId(),formDTO.getName(), StrConstant.EPMETY_STR);
//新增服务组织数据
IcDangerousChemicalsEntity entity = ConvertUtils.sourceToTarget(formDTO, IcDangerousChemicalsEntity.class);
entity.setSourceType("add");
entity.setAgencyId(staffInfo.getAgencyId());
entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId());
CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getUserId());
entity.setAgencyId(staffInfoCacheResult.getAgencyId());
entity.setAgencyIdPath(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) ? staffInfoCacheResult.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfoCacheResult.getAgencyId()) : staffInfoCacheResult.getAgencyId());
if(OrgTypeEnum.GRID.getCode().equals(formDTO.getOrgType())){
// 获取网格信息
CustomerGridDTO customerGridDTO=SpringContextUtils.getBean(CustomerGridService.class).get(formDTO.getOrgId());
entity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(customerGridDTO.getId(),customerGridDTO.getPids()));
}else if(OrgTypeEnum.AGENCY.getCode().equals(formDTO.getOrgType())){
CustomerAgencyDTO customerAgencyDTO=SpringContextUtils.getBean(CustomerAgencyService.class).get(formDTO.getOrgId());
entity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(customerAgencyDTO.getId(),customerAgencyDTO.getPids()));
}
insert(entity);
}
/**
* 同一网格下企业名称唯一
* @param orgId
* @param name
* @param icDangerousChemicalsId
*/
public void checkNameUnqiue(String orgId, String name, String icDangerousChemicalsId) {
LambdaQueryWrapper<IcDangerousChemicalsEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(IcDangerousChemicalsEntity::getOrgId, orgId);
tWrapper.eq(IcDangerousChemicalsEntity::getName, name)
.ne(StringUtils.isNotBlank(icDangerousChemicalsId),IcDangerousChemicalsEntity::getId,icDangerousChemicalsId);
if (baseDao.selectCount(tWrapper) > NumConstant.ZERO) {
String msg = String.format("所属组织下已存在%s", name);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcDangerousChemicalsAddEditFormDTO formDTO) {
//1.获取当前工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
//2.校验同组织下服务组织名称不能重复
LambdaQueryWrapper<IcDangerousChemicalsEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(IcDangerousChemicalsEntity::getAgencyId, staffInfo.getAgencyId());
tWrapper.ne(IcDangerousChemicalsEntity::getId, formDTO.getIcDangerousChemicalsId());
tWrapper.eq(IcDangerousChemicalsEntity::getName, formDTO.getName());
List<IcDangerousChemicalsEntity> entityList = baseDao.selectList(tWrapper);
if (!CollectionUtils.isEmpty(entityList)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织");
}
// 2.同一网格下,企业名称唯一
checkNameUnqiue(formDTO.getOrgId(),formDTO.getName(), formDTO.getIcDangerousChemicalsId());
//3.更新服务组织数据
IcDangerousChemicalsEntity entity = ConvertUtils.sourceToTarget(formDTO, IcDangerousChemicalsEntity.class);
entity.setId(formDTO.getIcDangerousChemicalsId());
CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getUserId());
entity.setAgencyId(staffInfoCacheResult.getAgencyId());
entity.setAgencyIdPath(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) ? staffInfoCacheResult.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfoCacheResult.getAgencyId()) : staffInfoCacheResult.getAgencyId());
if(OrgTypeEnum.GRID.getCode().equals(formDTO.getOrgType())){
// 获取网格信息
CustomerGridDTO customerGridDTO=SpringContextUtils.getBean(CustomerGridService.class).get(formDTO.getOrgId());
entity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(customerGridDTO.getId(),customerGridDTO.getPids()));
}else if(OrgTypeEnum.AGENCY.getCode().equals(formDTO.getOrgType())){
CustomerAgencyDTO customerAgencyDTO=SpringContextUtils.getBean(CustomerAgencyService.class).get(formDTO.getOrgId());
entity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(customerAgencyDTO.getId(),customerAgencyDTO.getPids()));
}
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(IcDangerousChemicalsAddEditFormDTO formDTO) {
IcDangerousChemicalsEntity entity = baseDao.selectById(formDTO.getIcDangerousChemicalsId());
//先删除本组织先可能存在的名称相同的已经是无效的历史数据,为了表中的唯一索引不失效
baseDao.delByAgencyAndName(entity);
//再把当前数据置为无效数据
entity.setId(formDTO.getIcDangerousChemicalsId());
entity.setUpdatedBy(formDTO.getUserId());
baseDao.del(entity);
baseDao.del(formDTO.getIcDangerousChemicalsId(),formDTO.getUserId());
}
@Override
@ -231,15 +249,32 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
@Async
public void dangerousChemicalsImport(Path filePath, String importTaskId, TokenDto tokenDto) {
try {
// 获取当前登录用户所属组织id、组织全路径
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("查询工作人员信息失败:"+tokenDto.getUserId());
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
if (null == agencyInfo){
throw new EpmetException("查询所属组织失败:"+staffInfo.getAgencyId());
CustomerAgencyDTO staffAgencyInfo=SpringContextUtils.getBean(CustomerAgencyService.class).get(staffInfo.getAgencyId());
String staffAgencyPath=PidUtils.convertPid2OrgIdPath(staffInfo.getAgencyId(),staffAgencyInfo.getPids());
//危化品种类字典
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode());
if (!statusRes.success() || MapUtils.isEmpty(statusRes.getData())) {
throw new EpmetException("获取IC_DANGER_TYPE字典表失败");
}
DangerousChemicalsImportListener listener = new DangerousChemicalsImportListener(tokenDto.getUserId(), agencyInfo,this,coverageService,adminOpenFeignClient,icDangerousChemicalsDao);
Map<String, String> dangerTypeMap = statusRes.getData();
//企业类别字典数据
List<IcCoverageCategoryDictListResultDTO> dictList = coverageService.dictMap(tokenDto.getCustomerId(), CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode());
Map<String, String> categoryDictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel));
DangerousChemicalsImportListener listener = new DangerousChemicalsImportListener(tokenDto.getUserId(), tokenDto.getCustomerId(),
staffInfo.getAgencyId(),staffAgencyPath,
this,
coverageService,
customerAgencyService,
customerGridService,
dangerTypeMap,
categoryDictMap);
EasyExcel.read(filePath.toFile(), DangerousChemicalsModel.class, listener).headRowNumber(1).sheet(0).doRead();
String errorDesFileUrl = null;
List<DangerousChemicalsModel.RowRemarkMessage> errorRows = listener.getErrorRows();
@ -291,7 +326,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
importFinishTaskForm.setTaskId(importTaskId);
importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importFinishTaskForm.setOperatorId(tokenDto.getUserId());
importFinishTaskForm.setResultDesc("导入失败");
importFinishTaskForm.setResultDesc("导入失败"+errorMsg);
Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
if (!result.success()) {
@ -314,4 +349,10 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
baseDao.importInsert(entityList);
}
@Override
public IcDangerousChemicalsEntity get(String orgId, String name) {
LambdaQueryWrapper<IcDangerousChemicalsEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(IcDangerousChemicalsEntity::getOrgId,orgId).eq(IcDangerousChemicalsEntity::getName,name);
return baseDao.selectOne(queryWrapper);
}
}

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/lingshan_dangerous_chemicals_template.xlsx

Binary file not shown.

86
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml

@ -67,48 +67,73 @@
updated_time = NOW()
</insert>
<select id="selectDangerousChemicalsList" resultType="com.epmet.dto.result.IcDangerousChemicalsListResultDTO">
<select id="selectDangerousChemicalsList" parameterType="com.epmet.dto.form.IcDangerousChemicalsListFormDTO" resultType="com.epmet.dto.result.IcDangerousChemicalsListResultDTO">
SELECT
id icDangerousChemicalsId,
agency_id agencyId,
source_type sourceType,
`name` name,
category category,
safe_distance safeDistance,
CONCAT(safe_distance,'公里') safeDistanceName,
danger_type dangerType,
principal_name principalName,
principal_mobile principalMobile,
address address,
longitude longitude,
latitude latitude,
remark remark
dc.id icDangerousChemicalsId,
dc.ORG_ID orgId,
dc.org_type orgType,
dc.org_id_path as orgIdPath,
dc.agency_id agencyId,
dc.source_type sourceType,
dc.`name` name,
dc.category category,
dc.safe_distance safeDistance,
CONCAT(dc.safe_distance,'公里') safeDistanceName,
dc.danger_type dangerType,
dc.principal_name principalName,
dc.principal_mobile principalMobile,
dc.address address,
dc.longitude longitude,
dc.latitude latitude,
dc.remark remark,
dc.SECURITY_FLAG securityFlag,
dc.SECURITY_PRINCIPAL_NAME securityPrincipalName,
dc.SECURITY_PRINCIPAL_MOBILE securityPrincipalMobile,
dc.BQ_LD bqLd,
dc.BQ_GB bqGb,
dc.COMPANY_PROFILE companyProfile
FROM
ic_dangerous_chemicals
ic_dangerous_chemicals dc
WHERE
del_flag = '0'
dc.del_flag = '0'
<if test="icDangerousChemicalsId != null and icDangerousChemicalsId != '' ">
AND id = #{icDangerousChemicalsId}
AND dc.id = #{icDangerousChemicalsId}
</if>
<if test="customerId != null and customerId != '' ">
AND customer_id = #{customerId}
AND dc.customer_id = #{customerId}
</if>
<if test="agencyId != null and agencyId != '' ">
AND agency_id_path LIKE CONCAT('%',#{agencyId},'%')
<if test='orgType == "agency"'>
<if test="orgIdPath != null and orgIdPath != '' ">
AND dc.AGENCY_ID_PATH like concat(#{orgIdPath},'%')
</if>
</if>
<if test='orgType == "grid"'>
<if test="orgId != null and orgId != '' ">
AND dc.ORG_ID=#{orgId}
</if>
</if>
<if test="name != null and name != '' ">
AND name LIKE CONCAT('%', #{name}, '%')
AND dc.name LIKE CONCAT('%', #{name}, '%')
</if>
<if test="category != null and category != '' ">
AND category = #{category}
AND dc.category = #{category}
</if>
<if test="dangerType != null and dangerType != '' ">
AND danger_type = #{dangerType}
AND dc.danger_type = #{dangerType}
</if>
<if test="address != null and address != '' ">
AND dc.ADDRESS LIKE CONCAT('%',#{address},'%')
</if>
<if test="principalName != null and principalName != '' ">
AND dc.PRINCIPAL_NAME LIKE CONCAT('%',#{principalName},'%')
</if>
<if test="securityPrincipalName != null and securityPrincipalName != '' ">
AND dc.SECURITY_PRINCIPAL_NAME LIKE CONCAT('%',#{securityPrincipalName},'%')
</if>
ORDER BY created_time DESC
ORDER BY dc.created_time DESC
</select>
<delete id="del">
<delete id="del" parameterType="map">
UPDATE ic_dangerous_chemicals
SET del_flag = '1',
updated_by = #{updatedBy},
@ -118,14 +143,5 @@
AND del_flag = '0'
</delete>
<delete id="delByAgencyAndName">
DELETE
FROM
ic_dangerous_chemicals
WHERE
del_flag != '0'
AND agency_id = #{agencyId}
AND `name` = #{name}
</delete>
</mapper>

83
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventAddEditFormDTO.java

@ -0,0 +1,83 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class EventAddEditFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 事件编号
*/
private String code;
/**
* 事件状态
*/
private String status;
/**
* 上报人员
*/
private String reporter;
/**
* 联系电话
*/
private String phone;
/**
* 上报事件
*/
private Date reportDate;
/**
* 紧急程度
*/
private String urgency;
/**
* 所属网格
*/
private String grid;
/**
* 事件类型
*/
private String eventType;
/**
* 即办类型
*/
private String type;
/**
* 办理期限
*/
private Date lastDate;
/**
* 满意度
*/
private String satisficing;
/**
* 页码
*/
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize = 20;
private Boolean isPage = true;
private String customerId;
private String agencyId;
private String staffId;
private String userId;
private String app;
private String client;
}

86
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventFormsDTO.java

@ -0,0 +1,86 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 灵山项目事件 formDTO
*/
@Data
public class EventFormsDTO implements Serializable {
private static final long serialVersionUID = 1;
public interface Detail extends CustomerClientShowGroup {
}
public interface GovRedDot extends CustomerClientShowGroup {
}
/**
* 事件编号
*/
private String code;
/**
* 事件状态
*/
private String status;
/**
* 上报人员
*/
private String reporter;
/**
* 联系电话
*/
private String phone;
/**
* 上报事件
*/
private Date reportDate;
/**
* 紧急程度
*/
private String urgency;
/**
* 所属网格
*/
private String grid;
/**
* 事件类型
*/
private String eventType;
/**
* 即办类型
*/
private String type;
/**
* 办理期限
*/
private Date lastDate;
/**
* 满意度
*/
private String satisficing;
/**
* 页码
*/
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize = 20;
private Boolean isPage = true;
private String customerId;
private String agencyId;
private String staffId;
}

102
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventResultDTO.java

@ -0,0 +1,102 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 即墨灵山项目
*/
@Data
public class EventResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 事件编号
*/
private String code;
/**
* 事件状态
*/
private String status;
/**
* 事件明细ID
*/
private String detailId;
/**
* 上报人员
*/
private String reporter;
/**
* 联系电话
*/
private String phone;
/**
* 上报事件事件
*/
private Date reportDate;
/**
* 紧急程度
*/
private String urgency;
/**
* 所属网格
*/
private String grid;
/**
* 事件类型
*/
private String eventType;
/**
* 即办类型
*/
private String type;
/**
* 办理期限
*/
private Date lastDate;
/**
* 事件地址
*/
private String eventAddr;
/**
* 坐标经度
*/
private String longitude;
/**
* 坐标纬度
*/
private String latitude;
/**
* 音频
*/
private String voice;
/**
* 视频
*/
private String video;
/**
* 满意度
*/
private String satisficing;
/**
* 解决情况
*/
private String remark;
/**
* 事件描述
*/
private String conetnt;
}

88
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java

@ -0,0 +1,88 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.form.EventAddEditFormDTO;
import com.epmet.dto.form.EventFormsDTO;
import com.epmet.dto.result.EventResultDTO;
import com.epmet.service.EventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author yan Lu
* @date 2023-04-14 19:07
* @deprecated 社会治理--事件处理
*/
@Slf4j
@RestController
@RequestMapping("event")
public class EventController {
@Autowired
private EventService eventService;
/**
* 社会治理 事件列表
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("list")
public Result<PageData<EventResultDTO>> getList(@LoginUser TokenDto tokenDto, @RequestBody EventFormsDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<EventResultDTO>>().ok(eventService.getList(formDTO));
}
/**
* @deprecated 根据ID获取事件
* @param id
* @return
*/
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<EventResultDTO> get(@PathVariable("id") String id){
EventResultDTO data = eventService.getById(id);
return new Result<EventResultDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("add")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody EventAddEditFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setApp(tokenDto.getApp());
formDTO.setClient(tokenDto.getClient());
eventService.save(formDTO);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody EventResultDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
eventService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
eventService.delete(ids);
return new Result();
}
}

19
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/EventEntityDao.java

@ -0,0 +1,19 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.EventFormsDTO;
import com.epmet.dto.result.EventResultDTO;
import com.epmet.entity.EventEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 灵山项目
*/
@Mapper
public interface EventEntityDao extends BaseDao<EventEntity> {
List<EventResultDTO> getList(EventFormsDTO formDTO);
}

43
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventDetailEntity.java

@ -0,0 +1,43 @@
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;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("event_detail")
public class EventDetailEntity extends BaseEpmetEntity {
/**
* 事件ID
*/
private String eventId;
/**
* 上报人
*/
private String reporter;
/**
* 接收人
*/
private String recipient;
/**
* 上报事件
*/
private Date reportDate;
/**
* 事件附件地址
*/
private String atts;
/**
* 事件处理耗时
*/
private String timeSpent;
/**
* 反馈内容
*/
private String content;
}

97
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventEntity.java

@ -0,0 +1,97 @@
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;
/**
* 灵山项目事件
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("event_entity")
public class EventEntity extends BaseEpmetEntity {
/**
* 事件编号
*/
private String code;
/**
* 事件状态
*/
private String status;
/**
* 事件明细ID
*/
private String detailId;
/**
* 上报人员
*/
private String reporter;
/**
* 联系电话
*/
private String phone;
/**
* 上报事件事件
*/
private Date reportDate;
/**
* 紧急程度
*/
private String urgency;
/**
* 所属网格
*/
private String grid;
/**
* 事件类型
*/
private String eventType;
/**
* 即办类型
*/
private String type;
/**
* 办理期限
*/
private Date lastDate;
/**
* 事件地址
*/
private String eventAddr;
/**
* 坐标经度
*/
private String longitude;
/**
* 坐标纬度
*/
private String latitude;
/**
* 音频
*/
private String voice;
/**
* 视频
*/
private String video;
/**
* 满意度
*/
private String satisficing;
/**
* 解决情况
*/
private String remark;
/**
* 事件描述
*/
private String conetnt;
}

19
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/EventService.java

@ -0,0 +1,19 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.EventAddEditFormDTO;
import com.epmet.dto.form.EventFormsDTO;
import com.epmet.dto.result.EventResultDTO;
public interface EventService {
PageData<EventResultDTO> getList(EventFormsDTO formDTO);
EventResultDTO getById(String id);
void update(EventResultDTO dto);
void delete(String[] ids);
void save(EventAddEditFormDTO dto);
}

136
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java

@ -0,0 +1,136 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.EventEntityDao;
import com.epmet.dto.form.EventAddEditFormDTO;
import com.epmet.dto.form.EventFormsDTO;
import com.epmet.dto.result.EventResultDTO;
import com.epmet.entity.EventEntity;
import com.epmet.entity.IcEventOperationLogEntity;
import com.epmet.service.EventService;
import com.epmet.service.IcEventOperationLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@Service
public class EventServiceImpl extends BaseServiceImpl<EventEntityDao, EventEntity> implements EventService {
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private IcEventOperationLogService icEventOperationLogService;
/**
* @param formDTO
* @return
* @deprecated 查询事件列表
*/
@Override
public PageData<EventResultDTO> getList(EventFormsDTO formDTO) {
if (StringUtils.isBlank(formDTO.getAgencyId())) {
//获取当前工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId());
}
//分页查询当前组织下网格内事件数据
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<EventResultDTO> list = baseDao.getList(formDTO);
PageInfo<EventResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* @param id
* @return
* @deprecated 获取事件详情
*/
@Override
public EventResultDTO getById(String id) {
EventEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, EventResultDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(EventResultDTO dto) {
EventEntity entity = ConvertUtils.sourceToTarget(dto, EventEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
for (String id : ids) {
EventEntity entity = baseDao.selectById(id);
if (null == entity) {
continue;
}
LambdaUpdateWrapper<EventEntity> wrapper = new LambdaUpdateWrapper();
wrapper.eq(EventEntity::getId, id).set(EventEntity::getUpdatedTime, new Date())
.set(EventEntity::getUpdatedBy, loginUserUtil.getLoginUserId())
.set(EventEntity::getDelFlag, NumConstant.ONE_STR);
baseDao.update(null, wrapper);
// icEventCategoryService.delInsert(id,null);
}
}
@Override
public void save(EventAddEditFormDTO formDTO) {
EventEntity entity = ConvertUtils.sourceToTarget(formDTO, EventEntity.class);
entity.setId(IdWorker.getIdStr());
// List<IcEventOperationLogEntity> logList = new ArrayList<>();
// logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), new Date(), "add", "publish"));
// icEventOperationLogService.insertBatch(logList);
insert(entity);
}
/**
* @param customerId
* @param staffId
* @return
* @deprecated 获取当前登陆人员信息
*/
public CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", staffId));
}
return staffInfo;
}
/**
* 事件管理操作日志记录
*
* @return
*/
private IcEventOperationLogEntity logEntity(String customerId, String icEventId, String userId, Date operateTime, String actionCode, String actionDesc) {
IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity();
logEntity.setCustomerId(customerId);
logEntity.setIcEventId(icEventId);
logEntity.setUserId(userId);
logEntity.setUserIdentity("staff");
logEntity.setActionCode(actionCode);
logEntity.setActionDesc(actionDesc);
logEntity.setOperateTime(operateTime);
return logEntity;
}
}

13
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/EventEntityDao.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.EventEntityDao">
<select id="getList" resultType="com.epmet.dto.result.EventResultDTO">
select * from event_entity
<where>
DEL_FLAG = '0'
</where>
order by REPORT_DATE DESC, CREATED_TIME DESC
</select>
</mapper>

20
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java

@ -1,13 +1,12 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -18,7 +17,7 @@ import java.util.List;
@Data
public class AddOrSaveDraftFormDTO implements Serializable {
public interface AddArticleForm{}
public interface AddArticleForm extends CustomerClientShowGroup {}
public interface AddDraftForm{}
/**
@ -31,7 +30,7 @@ public class AddOrSaveDraftFormDTO implements Serializable {
@Length(max = 50, message = "标题最长为50个字")
private String title;
@NotBlank(message = "栏目分类不能为空",groups = {AddArticleForm.class})
// @NotBlank(message = "所属栏目不能为空",groups = {AddArticleForm.class})
private String category;
/**
@ -84,4 +83,17 @@ public class AddOrSaveDraftFormDTO implements Serializable {
* 封面图地址
*/
private String imgUrl;
/**
* 内容列表
*/
private List<AddOrSaveDraftFormDTO.ContentDTO> fileList;
@Data
public static class ContentDTO {
public ContentDTO() {
}
private String content;
private String fileName;
}
}

10
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java

@ -14,6 +14,16 @@ import java.util.List;
public class ArticleListFormDTO implements Serializable {
private static final long serialVersionUID = 6397877545890473794L;
/**
* 栏目
*/
private String category;
/**
* 子栏目列表
*/
private List<String> subCategories;
/**
* 文章标题
*/

15
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateArticleFormDTO.java

@ -28,7 +28,7 @@ public class UpdateArticleFormDTO {
@NotBlank(message = "articleId不能为空", groups = {AddUserInternalGroup.class})
private String articleId;
@NotBlank(message = "栏目不能为空", groups = {AddUserInternalGroup.class})
// @NotBlank(message = "所属栏目不能为空", groups = {AddUserShowGroup.class})
private String category;
@NotBlank(message = "文章标题不能为空", groups = {AddUserShowGroup.class})
@ -91,5 +91,18 @@ public class UpdateArticleFormDTO {
*/
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
/**
* 内容列表
*/
private List<UpdateArticleFormDTO.ContentDTO> fileList;
@Data
public static class ContentDTO {
public ContentDTO() {
}
private String content;
private String fileName;
}
}

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java

@ -110,6 +110,11 @@ public class DraftPcListResultDTO implements Serializable {
*/
private List<Content> contentList;
/**
* 文章内容
*/
private List<Content> fileList;
@Data
public static class Content {
/**

10
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java

@ -26,6 +26,11 @@ public class PublishedListResultDTO implements Serializable {
* 分类
*/
private String category;
/**
* 栏目名称
*/
private String categoryName;
/**
* 组织Id
*/
@ -112,6 +117,11 @@ public class PublishedListResultDTO implements Serializable {
*/
private List<Content> contentList;
/**
* 附件列表
*/
private List<Content> fileList;
@Data
public static class Content {
/**

83
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/CategoryDictController.java

@ -10,12 +10,20 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CategoryDictDTO;
import com.epmet.service.CategoryDictService;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -31,12 +39,87 @@ public class CategoryDictController {
@Autowired
private CategoryDictService categoryDictService;
@Data
@NoArgsConstructor
public static class TreeNode {
private String pid;
private String id;
private String categoryName;
private List<TreeNode> children = new ArrayList<>();
public TreeNode(String pid, String id, String categoryName) {
this.pid = pid;
this.id = id;
this.categoryName = categoryName;
}
}
@GetMapping("tree")
public Result<List<TreeNode>> tree() {
List<TreeNode> treeNodes = buildTree(categoryDictService.list(1, 100));
return new Result().ok(treeNodes);
}
/**
* 树形结构输出
*/
@RequestMapping("list")
public Result<List<CategoryDictDTO>> list(@RequestParam Integer pageNo, @RequestParam Integer pageSize){
List<CategoryDictDTO> list = categoryDictService.list(pageNo, pageSize);
return new Result<List<CategoryDictDTO>>().ok(list);
}
/**
* @description: 根据父级栏目id查询子栏目列表
* @param parentCategoryId: 父级栏目id
* @return
* @author: WangXianZhang
* @date: 2023/4/25 3:33 PM
*/
@GetMapping("subCategories")
public Result<List<CategoryDictDTO>> listSubCategories(@RequestParam("parentCategoryId") String parentCategoryId) {
List<CategoryDictDTO> list = categoryDictService.listSubCategories(parentCategoryId);
return new Result<List<CategoryDictDTO>>().ok(list);
}
/**
* @description: 构建树状结构
* @param list:
* @return
* @author: WangXianZhang
* @date: 2023/4/25 3:38 PM
*/
private List<TreeNode> buildTree(List<CategoryDictDTO> list) {
//总共2级,直接构建就行了。
List<TreeNode> pNodes = new ArrayList<>();
List<TreeNode> sNodes = new ArrayList<>();
// 过滤出一级和二级节点
for (CategoryDictDTO ele : list) {
if (StringUtils.isBlank(ele.getPid()) || "0".equals(ele.getPid())) {
// 是一级节点
pNodes.add(new TreeNode(ele.getPid(), ele.getId(), ele.getCategoryName()));
} else {
// 二级节点
sNodes.add(new TreeNode(ele.getPid(), ele.getId(), ele.getCategoryName()));
}
}
// 追加二级节点
for (TreeNode sNode : sNodes) {
for (TreeNode pNode : pNodes) {
if (pNode.getId().equals(sNode.getPid())) {
pNode.getChildren().add(sNode);
}
}
}
return pNodes;
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<CategoryDictDTO> get(@PathVariable("id") String id){
CategoryDictDTO data = categoryDictService.get(id);

9
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ArticleContentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 文章内容表
@ -36,4 +37,12 @@ public interface ArticleContentDao extends BaseDao<ArticleContentEntity> {
* @return
*/
ArticleContentEntity selectByArticleId(String articleId);
/**
* 如果是工作端小程序发布的文章在pc编辑后img和text删除
* @param articleId
* @param updatedBy
* @return
*/
int updateWxMpContent(@Param("articleId") String articleId, @Param("updatedBy")String updatedBy);
}

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/CategoryDictService.java

@ -85,4 +85,6 @@ public interface CategoryDictService extends BaseService<CategoryDictEntity> {
* @date: 2023/4/11 7:06 PM
*/
List<CategoryDictDTO> list(Integer pageNo, Integer pageSize);
List<CategoryDictDTO> listSubCategories(String parentCategoryId);
}

90
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -131,6 +131,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
@Autowired
private DraftPublishRangeService draftPublishRangeService;
@Autowired
private CategoryDictDao categoryDictDao;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.imgSyncScan}")
@ -1558,6 +1561,21 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
articleContent.setContentType("rich_text");
articleContent.setOrderNum(NumConstant.ONE);
articleContentDao.insert(articleContent);
// 2.1 附件
if(!CollectionUtils.isEmpty(formDTO.getFileList())){
int orderNum=2;
for(AddOrSaveDraftFormDTO.ContentDTO file:formDTO.getFileList()){
ArticleContentEntity fileDto=new ArticleContentEntity();
fileDto.setCustomerId(formDTO.getCustomerId());
fileDto.setArticleId(article.getId());
fileDto.setContent(file.getContent());
fileDto.setFileName(file.getFileName());
fileDto.setContentType("file");
fileDto.setOrderNum(orderNum);
articleContentDao.insert(fileDto);
orderNum++;
}
}
// 3.操作记录
ArticleOperateRecordEntity articleOperateRecord = new ArticleOperateRecordEntity();
articleOperateRecord.setCustomerId(customerId);
@ -1644,6 +1662,22 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
draftContent.setOrderNum(NumConstant.ZERO);
draftContentDao.insert(draftContent);
}
// 2.1 附件
if(!CollectionUtils.isEmpty(formDTO.getFileList())){
int orderNum=2;
for(AddOrSaveDraftFormDTO.ContentDTO file:formDTO.getFileList()){
DraftContentEntity fileDto=new DraftContentEntity();
fileDto.setCustomerId(formDTO.getCustomerId());
fileDto.setDraftId(draft.getId());
fileDto.setContent(file.getContent());
fileDto.setFileName(file.getFileName());
fileDto.setContentType("file");
fileDto.setOrderNum(orderNum);
draftContentDao.insert(fileDto);
orderNum++;
}
}
// 3.发布范围
if (!CollectionUtils.isEmpty(formDTO.getGridIdList())){
List<DraftPublishRangeEntity> rangeList = new ArrayList<>();
@ -1728,6 +1762,20 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
formDTO.setAgencyId(staffInfo.getAgencyId());
//列表查询
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
// 查询子栏目
String categoryId;
List<String> subCategories;
if (StringUtils.isNotBlank(categoryId = formDTO.getCategory())) {
LambdaQueryWrapper<CategoryDictEntity> cq = new LambdaQueryWrapper<>();
cq.eq(CategoryDictEntity::getPid, categoryId);
List<CategoryDictEntity> subCtgs = categoryDictDao.selectList(cq);
if (! CollectionUtils.isEmpty(subCtgs)) {
subCategories = subCtgs.stream().map(CategoryDictEntity::getId).collect(Collectors.toList());
formDTO.setSubCategories(subCategories);
}
}
List<PublishedListResultDTO> list = baseDao.selectAllArticle(formDTO);
PageInfo<PublishedListResultDTO> pageInfo = new PageInfo<>(list);
@ -1773,12 +1821,25 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
LambdaQueryWrapper<ArticleContentEntity> tWrapper1 = new LambdaQueryWrapper<>();
tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId());
tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR);
tWrapper1.ne(ArticleContentEntity::getContentType,"file");
tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum);
List<ArticleContentEntity> contentEntityList = articleContentDao.selectList(tWrapper1);
resultDTO.setContentList(new ArrayList<>());
if (!CollectionUtils.isEmpty(contentEntityList)) {
List<PublishedListResultDTO.Content> contentList = ConvertUtils.sourceToTarget(contentEntityList, PublishedListResultDTO.Content.class);
resultDTO.setContentList(contentList);
}
// 附件列表
LambdaQueryWrapper<ArticleContentEntity> fileWrapper = new LambdaQueryWrapper<>();
fileWrapper.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId());
fileWrapper.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR);
fileWrapper.eq(ArticleContentEntity::getContentType,"file");
fileWrapper.orderByDesc(ArticleContentEntity::getOrderNum);
List<ArticleContentEntity> fileContentEntityList = articleContentDao.selectList(fileWrapper);
if (!CollectionUtils.isEmpty(fileContentEntityList)) {
List<PublishedListResultDTO.Content> fileList = ConvertUtils.sourceToTarget(fileContentEntityList, PublishedListResultDTO.Content.class);
resultDTO.setFileList(fileList);
}
//标签列表
LambdaQueryWrapper<ArticleTagsEntity> tWrapper2 = new LambdaQueryWrapper<>();
@ -1790,6 +1851,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
resultDTO.setTagIdList(contentList);
}
// 栏目
CategoryDictEntity categoryDict = categoryDictDao.selectById(resultDTO.getCategory());
if (categoryDict != null) {
resultDTO.setCategoryName(categoryDict.getCategoryName());
}
return resultDTO;
}
@ -1871,6 +1938,29 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
articleContent1.setOrderNum(NumConstant.ONE);
articleContentDao.insert(articleContent1);
}
// 2.1 附件
if(!CollectionUtils.isEmpty(formDTO.getFileList())){
//把之前的附件删除,再插入
LambdaQueryWrapper<ArticleContentEntity> del=new LambdaQueryWrapper<>();
del.eq(ArticleContentEntity::getArticleId,formDTO.getArticleId())
.eq(ArticleContentEntity::getContentType,"file");
articleContentDao.delete(del);
int orderNum=2;
for(UpdateArticleFormDTO.ContentDTO file:formDTO.getFileList()){
ArticleContentEntity fileDto=new ArticleContentEntity();
fileDto.setCustomerId(formDTO.getCustomerId());
fileDto.setArticleId(formDTO.getArticleId());
fileDto.setContent(file.getContent());
fileDto.setFileName(file.getFileName());
fileDto.setContentType("file");
fileDto.setOrderNum(orderNum);
articleContentDao.insert(fileDto);
orderNum++;
}
}
//内容类型 图片:img;文字:text;文件:file 富文本:rich_text 如果是工作端小程序发布的文章,在pc编辑后,img和text删除。
articleContentDao.updateWxMpContent(formDTO.getArticleId(),EpmetRequestHolder.getLoginUserId());
// 3.操作记录
ArticleOperateRecordEntity articleOperateRecord = new ArticleOperateRecordEntity();
articleOperateRecord.setCustomerId(formDTO.getCustomerId());

13
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java

@ -143,7 +143,18 @@ public class CategoryDictServiceImpl extends BaseServiceImpl<CategoryDictDao, Ca
@Override
public List<CategoryDictDTO> list(Integer pageNo, Integer pageSize) {
List<CategoryDictEntity> list = baseDao.selectList(null);
LambdaQueryWrapper<CategoryDictEntity> query = new LambdaQueryWrapper<>();
query.eq(CategoryDictEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
List<CategoryDictEntity> list = baseDao.selectList(query);
return ConvertUtils.sourceToTarget(list, CategoryDictDTO.class);
}
@Override
public List<CategoryDictDTO> listSubCategories(String parentCategoryId) {
LambdaQueryWrapper<CategoryDictEntity> query = new LambdaQueryWrapper<>();
query.eq(CategoryDictEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
query.eq(CategoryDictEntity::getPid, parentCategoryId);
List<CategoryDictEntity> list = baseDao.selectList(query);
return ConvertUtils.sourceToTarget(list, CategoryDictDTO.class);
}
}

13
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java

@ -266,7 +266,8 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
//查询文章内容
LambdaQueryWrapper<DraftContentEntity> tWrapper1 = new LambdaQueryWrapper<>();
tWrapper1.eq(DraftContentEntity::getDraftId, formDTO.getDraftId());
tWrapper1.eq(DraftContentEntity::getDelFlag, NumConstant.ZERO_STR);
tWrapper1.eq(DraftContentEntity::getDelFlag, NumConstant.ZERO_STR)
.ne(DraftContentEntity::getContentType,"file");
tWrapper1.orderByDesc(DraftContentEntity::getOrderNum);
List<DraftContentEntity> contentEntityList = draftContentDao.selectList(tWrapper1);
if (!CollectionUtils.isEmpty(contentEntityList)) {
@ -274,6 +275,16 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
resultDTO.setContentList(contentList);
}
LambdaQueryWrapper<DraftContentEntity> fileWrapper = new LambdaQueryWrapper<>();
fileWrapper.eq(DraftContentEntity::getDraftId, formDTO.getDraftId());
fileWrapper.eq(DraftContentEntity::getDelFlag, NumConstant.ZERO_STR)
.eq(DraftContentEntity::getContentType,"file");
fileWrapper.orderByDesc(DraftContentEntity::getOrderNum);
List<DraftContentEntity> fileContentEntityList = draftContentDao.selectList(fileWrapper);
if (!CollectionUtils.isEmpty(fileContentEntityList)) {
List<DraftPcListResultDTO.Content> fileContentList = ConvertUtils.sourceToTarget(fileContentEntityList, DraftPcListResultDTO.Content.class);
resultDTO.setFileList(fileContentList);
}
//标签列表
if(!CollectionUtils.isEmpty(resultDTO.getTagNameList())){
LambdaQueryWrapper<TagCustomerEntity> tWrapper2 = new LambdaQueryWrapper<>();

14
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml

@ -11,7 +11,17 @@
article_content ac
WHERE
ac.DEL_FLAG = '0'
AND ac.ID = #{articleId}
AND ac.ARTICLE_ID = #{articleId}
and ac.CONTENT_TYPE ='rich_text'
</select>
</mapper>
<update id="updateWxMpContent" parameterType="map">
update article_content ac
set ac.del_flag='1',
ac.UPDATED_BY=#{updatedBy},
ac.UPDATED_TIME=now()
where ac.id = #{articleId}
and ac.CONTENT_TYPE in ('img','text')
and ac.del_flag='0'
</update>
</mapper>

17
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

@ -437,6 +437,7 @@
a.org_id AS "agencyId",
a.title AS "title",
a.category AS "category",
cd.CATEGORY_NAME,
IFNULL(a.preview_content, "") AS "previewContent",
a.publish_range_desc AS "publishRangeDesc",
a.publisher_id AS "publisher",
@ -453,9 +454,25 @@
ac.img_url AS "imgUrl"
FROM
article a
LEFT JOIN category_dict cd on (cd.DEL_FLAG = 0 and a.CATEGORY = cd.ID)
LEFT JOIN article_cover ac ON a.id = ac.article_id AND ac.del_flag = '0'
WHERE
a.del_flag = '0'
<!-- 栏目 -->
<if test="(subCategories != null and subCategories.size() > 0) or (category != null and category != '')">
and (
<if test="subCategories != null and subCategories.size() > 0">
a.CATEGORY in (
<foreach collection="subCategories" item="ctg" separator=",">
#{ctg}
</foreach>
) or
</if>
<if test="category != null and category != ''">
a.CATEGORY = #{category}
</if>
)
</if>
<if test="articleId != null and articleId != '' ">
AND a.id = #{articleId}
</if>

294
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/lingshan/LingShanSpecialTypeSaveFormDTO.java

@ -0,0 +1,294 @@
package com.epmet.dto.form.lingshan;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
public class LingShanSpecialTypeSaveFormDTO {
private String name;
private String idCard;
private String headPhoto;
private SpecialCrowdDetails specialCrowdDetails;
@Data
public static class SpecialCrowdDetails {
private SpecialCrowdAzbj anzhibangjiao ;
private SpecialCrowdJdry jiedurenyuan ;
private SpecialCrowdJzhz jingzhanghuanzhe ;
private SpecialCrowdSqjz shequjiaozheng ;
private SpecialCrowdXfry xinfangrenyuan ;
}
/**
* 安置帮教
*/
@Data
public static class SpecialCrowdAzbj {
@NotBlank(message = "原罪名不能为空")
private String originalCharge;
/**
* 释放日期
*/
@NotNull(message = "释放日期不能为空")
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date releaseDate;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date originPrisonTerm;
/**
* 是否累犯0否1是
*/
private Integer recidivismFlag;
/**
* 是否安置0否1是
*/
private Integer emplacementFlag;
/**
* 安置日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date emplacementDate;
/**
* 安置帮教情况
*/
private String emplacementInfo;
/**
* 是否注销
*/
private Integer canceledFlag;
/**
* 注销原因
*/
private String canceledReason;
}
/**
* 戒毒人员
*/
@Data
public static class SpecialCrowdJdry {
/**
* 有无犯罪史
*/
@NotNull(message = "有无犯罪史不能为空")
private Integer criminalHistoryFlag;
/**
* 有无复吸史
*/
@NotNull(message = "有无复吸史不能为空")
private Integer drugRepetitionFlag;
/**
* 初次发现日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date firstDiscoveryDate;
/**
* 管控人姓名
*/
private String controllerName;
/**
* 管控人联系方式
*/
private String controllerContact;
/**
* 帮扶人姓名
*/
private String helperName;
/**
* 帮扶人联系方式
*/
private String helperContact;
/**
* 是否脱管
*/
private Integer detachedFlag;
/**
* 脱管原因
*/
private String detachedReason;
}
@Data
public static class SpecialCrowdJzhz {
@NotNull(message = "有无肇事肇祸史不能为空")
private Integer causeTroubleHistoryFlag;
/**
* 肇事肇祸次数
*/
@NotNull(message = "肇事肇祸次数不能为空")
private Integer causeTroubleTimes;
/**
* 目前诊断类型1精神分裂症2分裂情感性障碍3持久的妄想性障碍偏执性精神病4双相情感障碍5癫痫所致精神障碍6精神发育迟滞伴发精神障碍7重度抑郁发作8精神活性物质所致精神障碍9其他
*/
private Integer currentDiagnosis;
/**
* 危险性评估等级012345
*/
private Integer dangerousClass;
/**
* 是否具备外出能力
*/
private Integer canGoOutFlag;
/**
* 是否有暴力倾向
*/
private Integer violenceFlag;
/**
* 是否落实监管补助
*/
private Integer allowanceFlag;
/**
* 是否纳入低保
*/
private Integer subsistenceFlag;
/**
* 监护人姓名
*/
private String guardianName;
/**
* 监护人联系方式
*/
private String guardianContact;
}
@Data
public static class SpecialCrowdSqjz {
@NotNull(message = "矫正类型不能为空")
private Integer rectificateType;
/**
* 矫正开始日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date rectificateStartDate;
/**
* 矫正结束日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
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;
}
@Data
public static class SpecialCrowdXfry {
@NotBlank(message = "反映问题不能为空")
private String problem;
/**
* 稳控措施
*/
@NotBlank(message = "稳控措施不能为空")
private String stableControlMeasurement;
/**
* 是否多次上访
*/
private Integer multipleFlag;
/**
* 是否在当地
*/
private Integer localFlag;
/**
* 分管领导
*/
private String branchLeader;
/**
* 分管领导联系方式
*/
private String branchLeaderContact;
/**
* 负责人
*/
private String principal;
/**
* 负责人联系方式
*/
private String principalContact;
/**
* 稳控人员名单
*/
private String stableControlerList;
}
}

295
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/lingshan/LingShanSpecialTypeSaveResultDTO.java

@ -0,0 +1,295 @@
package com.epmet.dto.form.lingshan;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
public class LingShanSpecialTypeSaveResultDTO {
private String gender;
private String genderZh;
private String nation;
private String birthday;
private String domicilePlace;
private String name;
private String mobile;
private String headPhoto;
private String address;
private String idCard;
private SpecialCrowdDetails specialCrowdDetails = new SpecialCrowdDetails();
@Data
public static class SpecialCrowdDetails {
private SpecialCrowdAzbj anzhibangjiao ;
private SpecialCrowdJdry jiedurenyuan ;
private SpecialCrowdJzhz jingzhanghuanzhe ;
private SpecialCrowdSqjz shequjiaozheng ;
private SpecialCrowdXfry xinfangrenyuan ;
}
/**
* 安置帮教
*/
@Data
public static class SpecialCrowdAzbj {
@NotBlank(message = "原罪名不能为空")
private String originalCharge;
/**
* 释放日期
*/
@NotNull(message = "释放日期不能为空")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date releaseDate;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date originPrisonTerm;
/**
* 是否累犯0否1是
*/
private Integer recidivismFlag;
/**
* 是否安置0否1是
*/
private Integer emplacementFlag;
/**
* 安置日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date emplacementDate;
/**
* 安置帮教情况
*/
private String emplacementInfo;
/**
* 是否注销
*/
private Integer canceledFlag;
/**
* 注销原因
*/
private String canceledReason;
}
/**
* 戒毒人员
*/
@Data
public static class SpecialCrowdJdry {
/**
* 有无犯罪史
*/
@NotNull(message = "有无犯罪史不能为空")
private Integer criminalHistoryFlag;
/**
* 有无复吸史
*/
@NotNull(message = "有无复吸史不能为空")
private Integer drugRepetitionFlag;
/**
* 初次发现日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date firstDiscoveryDate;
/**
* 管控人姓名
*/
private String controllerName;
/**
* 管控人联系方式
*/
private String controllerContact;
/**
* 帮扶人姓名
*/
private String helperName;
/**
* 帮扶人联系方式
*/
private String helperContact;
/**
* 是否脱管
*/
private Integer detachedFlag;
/**
* 脱管原因
*/
private String detachedReason;
}
@Data
public static class SpecialCrowdJzhz {
@NotNull(message = "有无肇事肇祸史不能为空")
private Integer causeTroubleHistoryFlag;
/**
* 肇事肇祸次数
*/
@NotNull(message = "肇事肇祸次数不能为空")
private Integer causeTroubleTimes;
/**
* 目前诊断类型1精神分裂症2分裂情感性障碍3持久的妄想性障碍偏执性精神病4双相情感障碍5癫痫所致精神障碍6精神发育迟滞伴发精神障碍7重度抑郁发作8精神活性物质所致精神障碍9其他
*/
private Integer currentDiagnosis;
/**
* 危险性评估等级012345
*/
private Integer dangerousClass;
/**
* 是否具备外出能力
*/
private Integer canGoOutFlag;
/**
* 是否有暴力倾向
*/
private Integer violenceFlag;
/**
* 是否落实监管补助
*/
private Integer allowanceFlag;
/**
* 是否纳入低保
*/
private Integer subsistenceFlag;
/**
* 监护人姓名
*/
private String guardianName;
/**
* 监护人联系方式
*/
private String guardianContact;
}
@Data
public static class SpecialCrowdSqjz {
@NotNull(message = "矫正类型不能为空")
private Integer rectificateType;
/**
* 矫正开始日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date rectificateStartDate;
/**
* 矫正结束日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
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;
}
@Data
public static class SpecialCrowdXfry {
@NotBlank(message = "反映问题不能为空")
private String problem;
/**
* 稳控措施
*/
@NotBlank(message = "稳控措施不能为空")
private String stableControlMeasurement;
/**
* 是否多次上访
*/
private Integer multipleFlag;
/**
* 是否在当地
*/
private Integer localFlag;
/**
* 分管领导
*/
private String branchLeader;
/**
* 分管领导联系方式
*/
private String branchLeaderContact;
/**
* 负责人
*/
private String principal;
/**
* 负责人联系方式
*/
private String principalContact;
/**
* 稳控人员名单
*/
private String stableControlerList;
}
}

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LingShanSpecialCrowdListResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class LingShanSpecialCrowdListResultDTO {
private String resiId;
private String orgNamePath;
private String specialTypesStr;
private String specialTypeDisplay;
private String name;
private String mobile;
private String idCard;
private String address;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date createdTime;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date updatedTime;
}

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/lingshan/LingShanSpecialCrowdStatsByOrgResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
@Data
public class LingShanSpecialCrowdStatsByOrgResultDTO {
private String orgId;
private String orgIdPath;
/**
* 组织层级agency:行政组织grid:网格
*/
private String orgType;
/**
* 组织名称
*/
private String orgName;
/**
* 数量
*/
private Integer quantity = 0;
}

16
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/lingshan/LingShanSpecialCrowdStatsBySpecialTypeResultDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.result.lingshan;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class LingShanSpecialCrowdStatsBySpecialTypeResultDTO {
private String specialType;
private String specialTypeName;
private Integer quantity;
}

53
epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java

@ -0,0 +1,53 @@
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("jiedurenyuan", "戒毒人员", 1),
JZHZ("jingzhanghuanzhe", "精障患者", 1),
XFRY("xinfangrenyuan", "信访人员", 1);
/**
* 类型anzhibangjiao,
*/
public final String type;
public final 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;
}
public static LingShanSpecialCrowdTypeEnums getByType(String type) {
for (LingShanSpecialCrowdTypeEnums e : LingShanSpecialCrowdTypeEnums.values()) {
if (e.getType().equals(type)) {
return e;
}
}
return null;
}
}

15
epmet-user/epmet-user-server/src/main/java/com/epmet/bean/PersonSpecialTypeBean.java

@ -0,0 +1,15 @@
package com.epmet.bean;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PersonSpecialTypeBean {
private String resiId;
private String idCard;
private String specialType;
}

53
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanScreenController.java

@ -0,0 +1,53 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsBySpecialTypeResultDTO;
import com.epmet.service.LingShanScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 灵山大屏
*/
@RestController
@RequestMapping("lingshanScreen")
public class LingShanScreenController {
@Autowired
private LingShanScreenService lingShanScreenService;
/**
* @description: 特殊人群-按组织分组统计数量
* @param parentAgencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/27 10:20 AM
*/
@GetMapping("specialCrowdStats/qtyOfSubOrg")
public Result specialCrowdStatsCountBySubOrg(@RequestParam("parentAgencyId") String parentAgencyId,
@RequestParam(value = "specialType", required = false) String specialType) {
List<LingShanSpecialCrowdStatsByOrgResultDTO> l = lingShanScreenService.specialCrowdStatsCountBySubOrg(parentAgencyId, specialType);
return new Result().ok(l);
}
/**
* @description: 组织下每一类人群数量
* @param parentAgencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/27 12:16 PM
*/
@GetMapping("specialCrowdStats/qtyOfSpecialType")
public Result specialCrowdStatsCountBySpecialType(@RequestParam("parentAgencyId") String parentAgencyId) {
List<LingShanSpecialCrowdStatsBySpecialTypeResultDTO> l = lingShanScreenService.specialCrowdStatsCountBySpecialType(parentAgencyId);
return new Result().ok(l);
}
}

218
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java

@ -0,0 +1,218 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.MaskResponse;
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.page.PageData;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveFormDTO;
import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveResultDTO;
import com.epmet.dto.result.LingShanSpecialCrowdListResultDTO;
import com.epmet.enums.LingShanSpecialCrowdTypeEnums;
import com.epmet.excel.data.*;
import com.epmet.service.LingShanSpecialCrowdService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @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 specialType:
* @return
* @author: WangXianZhang
* @date: 2023/4/21 10:16 AM
*/
@GetMapping("downloadTemplate")
public void downloadTemplate(@RequestParam("specialType") String specialType, HttpServletResponse response) {
InputStream is = null;
LingShanSpecialCrowdTypeEnums st = LingShanSpecialCrowdTypeEnums.getByType(specialType);
if (st == null) {
log.error("【灵山街道-下载特殊人群导入模板】传入的特殊人群类型错误:{}", specialType);
return;
}
try (ServletOutputStream os = response.getOutputStream()) {
is = this.getClass().getClassLoader().getResourceAsStream("excel/lingshan/special_crowd_" + specialType + "_import.xlsx");
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(st.getName(), "UTF-8"));
IOUtils.copy(is, os);
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
org.apache.poi.util.IOUtils.closeQuietly(is);
}
}
/**
* @description: 特殊人群导入
* @param file:
* @param crowdCategory: 人群类别
* anzhibangjiao
* buliangqingshaonian
* shequjiaozheng
* jiedurenyuan
* xiejiaorenyuan
* zhaoshizhaohuojingshenbing
* @return
* @author: WangXianZhang
* @date: 2023/4/18 9:12 AM
*/
@PostMapping("import")
public Result importSpecialCowd(MultipartFile file, @RequestParam("crowdCategory") String crowdCategory) {
String originalFilename = file.getOriginalFilename();
String suffix = originalFilename.substring(originalFilename.lastIndexOf("."));
// 1.存文件
Path fileSavePath = saveSpecialCrowdTempFile(file, suffix);
// 2.执行业务导入
try {
String taskId = lingShanSpecialCrowdService.importSpecialCrowd(crowdCategory, fileSavePath.toString(), originalFilename);
return new Result().ok(taskId);
} catch (Exception e) {
// 3.出错的话,删除文件。不能在finally中删除,因为正常执行的话,是在异步线程中执行导入,这里删除了,那子线程就获取不到文件了,所以子线程中有单独的删除逻辑
FileUtils.deleteFileIfExists(fileSavePath);
throw e;
}
}
/**
* @description: 保存特殊人群临时文件
* @param file:
* @return
* @author: WangXianZhang
* @date: 2023/4/18 9:46 AM
*/
public Path saveSpecialCrowdTempFile(@RequestParam("file") MultipartFile file, String suffix) {
Path fileSavePath;
FileOutputStream os = null;
try {
Path fileSaveDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("special_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);
}
}
/**
* @description: 保存
* @param input:
* @return
* @author: WangXianZhang
* @date: 2023/4/23 10:58 AM
*/
@PostMapping("save")
public Result saveSpecialCrowd(@RequestBody LingShanSpecialTypeSaveFormDTO input) {
ValidatorUtils.validateEntity(input);
lingShanSpecialCrowdService.saveSpecialCrowd(input);
return new Result();
}
/**
* @description: 特殊人群详情
* @return
* @author: WangXianZhang
* @date: 2023/4/20 3:44 PM
*/
@GetMapping("getPersonSpecialTypeDetail")
public Result<LingShanSpecialTypeSaveResultDTO> getPersonSpecialTypeDetail(@RequestParam("resiId") String resiId) {
LingShanSpecialTypeSaveResultDTO r = lingShanSpecialCrowdService.getPersonSpecialTypeDetail(resiId);
return new Result<LingShanSpecialTypeSaveResultDTO>().ok(r);
}
/**
* @description: 列表查询
* @param orgId:
* @param orgType:
* @param specialType:
* @param name:
* @param mobile:
* @param idCard:
* @return
* @author: WangXianZhang
* @date: 2023/4/20 5:42 PM
*/
@GetMapping("listSpecialCrowd")
@MaskResponse(fieldNames = {"name", "mobile", "idCard"},
fieldsMaskType = { MaskResponse.MASK_TYPE_CHINESE_NAME, MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD })
public Result<PageData<LingShanSpecialCrowdListResultDTO>> listSpecialCrowds(@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType,
@RequestParam(value = "specialType", required = false) String specialType,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "mobile", required = false) String mobile,
@RequestParam(value = "idCard", required = false) String idCard,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "20") Integer pageSize) {
PageData<LingShanSpecialCrowdListResultDTO> pd = lingShanSpecialCrowdService.listSpecialCrowds(orgId, orgType, specialType, name, mobile,
idCard, pageNo, pageSize);
return new Result<PageData<LingShanSpecialCrowdListResultDTO>>().ok(pd);
}
/**
* @description: 删除
* @param params:
* @return
* @author: WangXianZhang
* @date: 2023/4/21 9:40 AM
*/
@PostMapping("deleteByResi")
public Result deleteByType(@RequestBody Map<String, String> params) {
String resiId = params.get("resiId");
if (StringUtils.isAnyBlank(resiId, resiId)) {
throw new ValidateException("特殊人群类型或身份证不能为空");
}
lingShanSpecialCrowdService.deleteByResi(resiId);
return new Result();
}
}

23
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSpecialDao.java

@ -0,0 +1,23 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.LingShanSpecialCrowdListResultDTO;
import com.epmet.entity.IcSpecialEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface IcSpecialDao extends BaseDao<IcSpecialEntity> {
public IcSpecialEntity selectByResiId(@Param("resiId") String resiId);
List<LingShanSpecialCrowdListResultDTO> listSpecialCrowd(@Param("orgIdPath") String orgIdPath,
@Param("orgId") String orgId,
@Param("orgType") String orgType,
@Param("specialType") String specialType,
@Param("name") String name,
@Param("mobile") String mobile,
@Param("idCard") String idCard);
}

25
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java

@ -0,0 +1,25 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO;
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<LingshanSpecialCrowdDetailAzbjEntity> {
void saveBatchManually(@Param("asbjList") List<LingshanSpecialCrowdDetailAzbjEntity> l);
void deletePhysical(@Param("idCard") String idCard);
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths);
}

24
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java

@ -0,0 +1,24 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO;
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<LingshanSpecialCrowdDetailJdryEntity> {
void saveBatchManually(@Param("list") List<LingshanSpecialCrowdDetailJdryEntity> l);
void deletePhysical(@Param("idCard") String idCard);
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths);
}

24
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java

@ -0,0 +1,24 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO;
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<LingshanSpecialCrowdDetailJzhzEntity> {
void saveBatchManually(@Param("list") List<LingshanSpecialCrowdDetailJzhzEntity> l);
void deletePhysical(@Param("idCard") String idCard);
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths);
}

24
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java

@ -0,0 +1,24 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO;
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<LingshanSpecialCrowdDetailSqjzEntity> {
void saveBatchManually(@Param("list") List<LingshanSpecialCrowdDetailSqjzEntity> l);
void deletePhysical(@Param("idCard") String idCard);
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths);
}

24
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java

@ -0,0 +1,24 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO;
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<LingshanSpecialCrowdDetailXfryEntity> {
void saveBatchManually(@Param("list") List<LingshanSpecialCrowdDetailXfryEntity> l);
void deletePhysical(@Param("idCard") String idCard);
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths);
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java

@ -96,6 +96,11 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String gender;
/**
* 头像
*/
private String headPhoto;
/**
* 证件号
*/

3
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSpecialEntity.java

@ -17,7 +17,7 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -38,6 +38,7 @@ public class IcSpecialEntity extends BaseEpmetEntity {
/**
* 客户Id customer.id
*/
@TableField(fill = FieldFill.INSERT)
private String customerId;
/**

69
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;
}

22
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;
}

69
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;
}

74
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;
/**
* 危险性评估等级012345
*/
private Integer dangerousClass;
/**
* 是否具备外出能力
*/
private Integer canGoOutFlag;
/**
* 是否有暴力倾向
*/
private Integer violenceFlag;
/**
* 是否落实监管补助
*/
private Integer allowanceFlag;
/**
* 是否纳入低保
*/
private Integer subsistenceFlag;
/**
* 监护人姓名
*/
private String guardianName;
/**
* 监护人联系方式
*/
private String guardianContact;
}

79
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;
}

70
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;
}

129
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java

@ -0,0 +1,129 @@
package com.epmet.excel.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.ReadConverterContext;
import com.alibaba.excel.converters.WriteConverterContext;
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.excel.data.LingshanSpecialCrowdDetailJzhzExcelData;
/**
* 灵山-诊断类型转换器
*/
public class LingShanSpecialCrowdJzhzConverter implements Converter<Integer> {
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
@Override
public Class<?> supportJavaTypeKey() {
return Integer.class;
}
@Override
public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
String fieldName = contentProperty.getField().getName();
String value = cellData.getStringValue();
if (fieldName.equals("currentDiagnosis")) {
return Diagnosis.getByName(value).code;
} else if (fieldName.equals("dangerousClass")) {
return DangerousClass.getByName(value).code;
}
return Converter.super.convertToJavaData(cellData, contentProperty, globalConfiguration);
}
@Override
public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
String fieldName = contentProperty.getField().getName();
if (fieldName.equals("currentDiagnosis")) {
return new WriteCellData<>(Diagnosis.getByCode(value).name);
} else if (fieldName.equals("dangerousClass")) {
return new WriteCellData<>(DangerousClass.getByCode(value).name);
}
return Converter.super.convertToExcelData(value, contentProperty, globalConfiguration);
}
/**
* 诊断
*/
public enum Diagnosis {
JSFLZ(1, "精神分裂症"),
FLQGXZA(2, "分裂情感性障碍"),
CJDWXXZA(3, "持久的妄想性障碍(偏执性精神病)"),
SXZA(4, "双相(情感)障碍"),
DXSZJSZA(5, "癫痫所致精神障碍"),
JSFYCZBFJSZA(6, "精神发育迟滞伴发精神障碍"),
ZDYYFZ(7, "重度抑郁发作"),
JSHXWZ(8, "精神活性物质所致精神障碍"),
OTHERS(9, "其他");
private Integer code;
private String name;
Diagnosis(Integer code, String name) {
this.code = code;
this.name = name;
}
static Diagnosis getByCode(Integer code) {
for (Diagnosis d : Diagnosis.values()) {
if (d.code.equals(code)) {
return d;
}
}
return null;
}
static Diagnosis getByName(String name) {
for (Diagnosis d : Diagnosis.values()) {
if (d.name.equals(name)) {
return d;
}
}
return null;
}
}
public enum DangerousClass {
ZERO(0, "0级"),
ONE(1, "1级"),
TOW(2, "2级(偏执性精神病)"),
THREE(3, "3级(情感)障碍"),
FOUR(4, "4级"),
FIVE(5, "5级");
private Integer code;
private String name;
DangerousClass(Integer code, String name) {
this.code = code;
this.name = name;
}
static DangerousClass getByCode(Integer code) {
for (DangerousClass d : DangerousClass.values()) {
if (d.code.equals(code)) {
return d;
}
}
return null;
}
static DangerousClass getByName(String name) {
for (DangerousClass d : DangerousClass.values()) {
if (d.name.equals(name)) {
return d;
}
}
return null;
}
}
}

126
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java

@ -0,0 +1,126 @@
package com.epmet.excel.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.ReadConverterContext;
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 org.omg.CORBA.PRIVATE_MEMBER;
/**
* 灵山-社区矫正转换器
*/
public class LingShanSpecialCrowdSqjzConverter implements Converter<Integer> {
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
@Override
public Class<?> supportJavaTypeKey() {
return Integer.class;
}
@Override
public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
String fieldName = contentProperty.getField().getName();
String value = cellData.getStringValue();
if (fieldName.equals("rectificateType")) {
return RectificateType.getByName(value).code;
} else if (fieldName.equals("receiveWay")) {
return ReceiveWay.getByName(value).code;
}
return Converter.super.convertToJavaData(cellData, contentProperty, globalConfiguration);
}
@Override
public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
String fieldName = contentProperty.getField().getName();
if (fieldName.equals("rectificateType")) {
return new WriteCellData(RectificateType.getByCode(value).name);
} else if (fieldName.equals("receiveWay")) {
return new WriteCellData(ReceiveWay.getByCode(value).name);
}
return Converter.super.convertToExcelData(value, contentProperty, globalConfiguration);
}
/**
* 矫正类型
*/
public enum RectificateType {
GUANZHI(1,"管制"),
HUANXING(2,"缓刑"),
JIASHI(3,"假释"),
ZYJWZX(4,"暂予监外执行"),
BDZZQL(5,"剥夺政治权利");
private Integer code;
private String name;
RectificateType(Integer code, String name) {
this.code = code;
this.name = name;
}
static RectificateType getByCode(Integer code) {
for (RectificateType d : RectificateType.values()) {
if (d.code.equals(code)) {
return d;
}
}
return null;
}
static RectificateType getByName(String name) {
for (RectificateType d : RectificateType.values()) {
if (d.name.equals(name)) {
return d;
}
}
return null;
}
}
/**
* 接受方式1.自行报到2狱所押送3当庭交接4其他
*/
public enum ReceiveWay {
ZXBD(1,"自行报到"),
YSYS(2,"狱所押送"),
DTJJ(3,"当庭交接"),
OTHERS(4,"其他");
private Integer code;
private String name;
ReceiveWay(Integer code, String name) {
this.code = code;
this.name = name;
}
static ReceiveWay getByCode(Integer code) {
for (ReceiveWay d : ReceiveWay.values()) {
if (d.code.equals(code)) {
return d;
}
}
return null;
}
static ReceiveWay getByName(String name) {
for (ReceiveWay d : ReceiveWay.values()) {
if (d.name.equals(name)) {
return d;
}
}
return null;
}
}
}

78
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdYesOrNoConverter.java

@ -0,0 +1,78 @@
package com.epmet.excel.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.ReadConverterContext;
import com.alibaba.excel.converters.WriteConverterContext;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.data.WriteCellData;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.List;
/**
* 灵山-是否转换器
*/
public class LingShanSpecialCrowdYesOrNoConverter implements Converter<Integer> {
List<String> group1 = Arrays.asList("localFlag", "multipleFlag", "recidivismFlag", "emplacementFlag", "canceledFlag",
"detachedFlag", "canGoOutFlag", "violenceFlag", "allowanceFlag", "subsistenceFlag");
List<String> group2 = Arrays.asList("criminalHistoryFlag", "drugRepetitionFlag", "causeTroubleHistoryFlag");
@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);
}
@Override
public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) throws Exception {
String fieldName = context.getContentProperty().getField().getName();
Integer value = context.getValue();
if (group1.contains(fieldName)) {
return convertYesOrNoFlag(value);
} else if (group2.contains(fieldName)) {
return convertHaveOrNotFlag(value);
}
return Converter.super.convertToExcelData(context);
}
WriteCellData<?> convertHaveOrNotFlag(Integer value) {
if (value.equals(1)) {
return new WriteCellData("有");
} else if (value.equals(0)) {
return new WriteCellData("无");
} else {
return new WriteCellData("未知");
}
}
WriteCellData<?> convertYesOrNoFlag(Integer value) {
if (value.equals(1)) {
return new WriteCellData("是");
} else if (value.equals(0)) {
return new WriteCellData("否");
} else {
return new WriteCellData("未知");
}
}
}

77
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java

@ -0,0 +1,77 @@
package com.epmet.excel.data;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter;
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 = "释放日期不能为空")
@DateTimeFormat("yyyy/MM/dd")
private Date releaseDate;
/**
* 原判刑期单位
*/
@ExcelProperty(value = "原判刑期(单位:月)")
@DateTimeFormat("yyyy/MM/dd")
private Date originPrisonTerm;
/**
* 是否累犯0否1是
*/
@ExcelProperty(value = "是否累犯", converter = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer recidivismFlag;
/**
* 是否安置0否1是
*/
@ExcelProperty(value = "是否安置", converter = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer emplacementFlag;
/**
* 安置日期
*/
@ExcelProperty(value = "安置日期")
@DateTimeFormat("yyyy/MM/dd")
private Date emplacementDate;
/**
* 安置帮教情况
*/
@ExcelProperty(value = "安置帮教情况")
private String emplacementInfo;
/**
* 是否注销
*/
@ExcelProperty(value = "是否注销", converter = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer canceledFlag;
/**
* 注销原因
*/
@ExcelProperty(value = "注销原因")
private String canceledReason;
}

43
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java

@ -0,0 +1,43 @@
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 LingShanSpecialCrowdDetailBaseExcelData extends LingShanSpecialCrowdDetailResultExtraInfo {
/**
* 姓名
*/
@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
*/
private String resiGridId;
}

32
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailResultExtraInfo.java

@ -0,0 +1,32 @@
package com.epmet.excel.data;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* @description: 灵山特殊人群扩展字段
* @param null:
* @return
* @author: WangXianZhang
* @date: 2023/4/20 4:21 PM
*/
@Data
public class LingShanSpecialCrowdDetailResultExtraInfo {
private String gender;
private String genderZh;
private String nation;
private String birthday;
/**
* 户籍地
*/
private String domicilePlace;
private String mobile;
/**
* 住址
*/
private String address;
}

77
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java

@ -0,0 +1,77 @@
package com.epmet.excel.data;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter;
import lombok.Data;
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 = LingShanSpecialCrowdYesOrNoConverter.class)
@NotNull(message = "有无犯罪史不能为空")
private Integer criminalHistoryFlag;
/**
* 有无复吸史
*/
@ExcelProperty(value = "*有无复吸史", converter = LingShanSpecialCrowdYesOrNoConverter.class)
@NotNull(message = "有无复吸史不能为空")
private Integer drugRepetitionFlag;
/**
* 初次发现日期
*/
@ExcelProperty(value = "初次发现日期")
@DateTimeFormat("yyyy/MM/dd")
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 = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer detachedFlag;
/**
* 脱管原因
*/
@ExcelProperty(value = "脱管原因")
private String detachedReason;
}

83
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java

@ -0,0 +1,83 @@
package com.epmet.excel.data;
import com.alibaba.excel.annotation.ExcelProperty;
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter;
import com.epmet.excel.converter.LingShanSpecialCrowdJzhzConverter;
import lombok.Data;
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 = LingShanSpecialCrowdYesOrNoConverter.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;
/**
* 危险性评估等级012345
*/
@ExcelProperty(value = "危险性评估等级", converter = LingShanSpecialCrowdJzhzConverter.class)
private Integer dangerousClass;
/**
* 是否具备外出能力
*/
@ExcelProperty(value = "是否具备外出能力", converter = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer canGoOutFlag;
/**
* 是否有暴力倾向
*/
@ExcelProperty(value = "是否有暴力倾向", converter = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer violenceFlag;
/**
* 是否落实监管补助
*/
@ExcelProperty(value = "是否落实监管补助", converter = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer allowanceFlag;
/**
* 是否纳入低保
*/
@ExcelProperty(value = "是否纳入低保", converter = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer subsistenceFlag;
/**
* 监护人姓名
*/
@ExcelProperty(value = "监护人姓名")
private String guardianName;
/**
* 监护人联系方式
*/
@ExcelProperty(value = "监护人联系方式")
private String guardianContact;
}

91
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java

@ -0,0 +1,91 @@
package com.epmet.excel.data;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter;
import com.epmet.excel.converter.LingShanSpecialCrowdSqjzConverter;
import lombok.Data;
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 = "矫正开始日期")
@DateTimeFormat("yyyy/MM/dd")
private Date rectificateStartDate;
/**
* 矫正结束日期
*/
@ExcelProperty(value = "矫正结束日期")
@DateTimeFormat("yyyy/MM/dd")
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 = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer detachedFlag;
/**
* 脱管原因
*/
@ExcelProperty(value = "脱管原因")
private String detachedReason;
/**
* 是否注销
*/
@ExcelProperty(value = "是否注销" , converter = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer canceledFlag;
/**
* 注销原因
*/
@ExcelProperty(value = "注销原因")
private String canceledReason;
}

74
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java

@ -0,0 +1,74 @@
package com.epmet.excel.data;
import com.alibaba.excel.annotation.ExcelProperty;
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter;
import lombok.Data;
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 = LingShanSpecialCrowdYesOrNoConverter.class)
private Integer multipleFlag;
/**
* 是否在当地
*/
@ExcelProperty(value = "是否在当地", converter = LingShanSpecialCrowdYesOrNoConverter.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;
}

409
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.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.LingshanSpecialCrowdDetailBaseEntity;
import com.epmet.enums.LingShanSpecialCrowdTypeEnums;
import com.epmet.excel.data.LingShanSpecialCrowdDetailBaseExcelData;
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 AbstractLingShanSpecialCrowdExcelImportListener<T extends LingShanSpecialCrowdDetailBaseExcelData, E extends LingshanSpecialCrowdDetailBaseEntity>
extends AnalysisEventListener<T> {
/**
* @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<String> headerZhList;
/**
* @description: 是否只校验表头
* @param null:
* @return
* @author: WangXianZhang
* @date: 2023/4/19 5:16 PM
*/
private Boolean validateHeaderOnly = false;
/**
* 当前表头读到了第几行
*/
private Integer currentHeadRowNum = 0;
/**
* 原始数据列表
*/
private List<T> originDatas = new ArrayList<>();
/**
* 错误数据列表
*/
private List<T> errorDatas = new ArrayList<>();
/**
* 正确数据
*/
private List<E> correctDatas = new ArrayList<>();
private AtomicInteger correctDatasQty = new AtomicInteger();
// 为什么去掉了?因为需求改成了:直接用type根居民基础信息关联
// private List<LingshanSpecialCrowdPersonEntity> persons = new ArrayList<>();
// private List<LingshanSpecialCrowdPersonTypeEntity> personTypes = new ArrayList<>();
private List<PersonSpecialTypeBean> specialTypes = new ArrayList<>();
protected LingShanSpecialCrowdService lingShanSpecialCrowdService;
private Class<E> 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();
templateFileName = setTemplateFileName();
}
/**
* @param headMap:
* @param context:
* @return
* @description: 表头回调函数此处做统一表头校验确认文件内容与当前要导入的数据的字段一致防止导错类型.
* @author: WangXianZhang
* @date: 2023/4/18 10:42 AM
*/
@Override
public void invokeHeadMap(Map<Integer, String> 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<String> redundentHeaders = new ArrayList<>();
List<String> lackHeaders = new ArrayList<>();
Collection<String> 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<T> 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<PersonSpecialTypeBean> 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<T> getOriginDatas() {
return originDatas;
}
/**
* @description: 获取错误数据行
* @param :
* @return
* @author: WangXianZhang
* @date: 2023/4/18 11:22 PM
*/
public List<T> 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<E> getCorrectDatas() {
return correctDatas;
}
/**
* @param :
* @return
* @description: 批量保存子类实现
* @author: WangXianZhang
* @date: 2023/4/18 4:32 PM
*/
abstract void saveBatchCallback(List<E> 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<String> 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<E> getEntityClass();
/**
* @description: 指定特殊人群类型
* @param :
* @return
* @author: WangXianZhang
* @date: 2023/4/19 11:00 AM
*/
abstract LingShanSpecialCrowdTypeEnums getSpecialCrowdType();
/**
* 人员类别信息bean用于导入临时存储数据
*/
}

54
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java

@ -0,0 +1,54 @@
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<LingShanSpecialCrowdDetailAzbjExcelData, LingshanSpecialCrowdDetailAzbjEntity> {
@Override
Integer setMaxHeadRowNum() {
return 1;
}
@Override
List<String> setHeaderZhList() {
return Arrays.asList("*姓名", "*身份证号", "*原罪名", "*释放日期", "原判刑期(单位:月)", "是否累犯", "是否安置", "安置日期", "安置帮教情况", "是否注销", "注销原因");
}
@Override
Class<LingshanSpecialCrowdDetailAzbjEntity> getEntityClass() {
return LingshanSpecialCrowdDetailAzbjEntity.class;
}
@Override
void saveBatchCallback(List<LingshanSpecialCrowdDetailAzbjEntity> entities) {
lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailAzbjEntity());
}
@Override
LingShanSpecialCrowdTypeEnums getSpecialCrowdType() {
return LingShanSpecialCrowdTypeEnums.AZBJ;
}
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_special_crowd_azbj_export.xlsx";
}
}

50
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java

@ -0,0 +1,50 @@
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<LingshanSpecialCrowdDetailJdryExcelData, LingshanSpecialCrowdDetailJdryEntity> {
@Override
Integer setMaxHeadRowNum() {
return 1;
}
@Override
List<String> setHeaderZhList() {
return Arrays.asList("*姓名", "*身份证号", "*有无犯罪史", "*有无复吸史", "初次发现日期", "管控人姓名", "管控人联系方式", "帮扶人姓名", "帮扶人联系方式", "是否脱管", "脱管原因");
}
@Override
Class<LingshanSpecialCrowdDetailJdryEntity> getEntityClass() {
return LingshanSpecialCrowdDetailJdryEntity.class;
}
@Override
void saveBatchCallback(List<LingshanSpecialCrowdDetailJdryEntity> entities) {
lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailJdryEntity());
}
@Override
LingShanSpecialCrowdTypeEnums getSpecialCrowdType() {
return LingShanSpecialCrowdTypeEnums.JDRY;
}
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_special_crowd_jdry_export.xlsx";
}
}

51
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java

@ -0,0 +1,51 @@
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<LingshanSpecialCrowdDetailJzhzExcelData, LingshanSpecialCrowdDetailJzhzEntity> {
@Override
void saveBatchCallback(List<LingshanSpecialCrowdDetailJzhzEntity> entities) {
lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailJzhzEntity());
}
@Override
Integer setMaxHeadRowNum() {
return 1;
}
@Override
List<String> setHeaderZhList() {
return Arrays.asList("*姓名", "*身份证号", "*有无肇事肇祸史", "*肇事肇祸次数", "目前诊断类型", "危险性评估等级", "是否具备外出能力", "是否有暴力倾向", "是否落实监管补助", "是否纳入低保", "监护人姓名", "监护人联系方式");
}
@Override
Class<LingshanSpecialCrowdDetailJzhzEntity> getEntityClass() {
return LingshanSpecialCrowdDetailJzhzEntity.class;
}
@Override
LingShanSpecialCrowdTypeEnums getSpecialCrowdType() {
return LingShanSpecialCrowdTypeEnums.JZHZ;
}
@Override
String setTemplateFileName() {
return "excel/lingshan/lingshan_special_crowd_jzhz_export.xlsx";
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save