Browse Source

Merge branch 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into 主线测试

feature/evaluate
jianjun 4 years ago
parent
commit
ea43f3b641
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java
  2. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java
  3. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  4. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  5. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java
  6. 9
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/excel/ExportMultiView.java
  7. 3
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java
  8. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java
  9. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java
  10. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java
  11. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  12. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  13. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java
  14. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  15. 27
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  16. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  17. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml
  18. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  19. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  20. 7
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java
  21. 9
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java
  22. 11
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java
  23. 12
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java
  24. 12
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java
  25. 4
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java
  26. 31
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  27. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java
  28. 81
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml
  29. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java
  30. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java
  31. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  32. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java
  33. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  34. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  35. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java
  36. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  37. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  38. 29
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java
  39. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  40. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java
  41. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java
  42. 55
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java
  43. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java
  44. 82
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatRelationDTO.java
  45. 71
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java
  46. 12
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java
  47. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java
  48. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java
  49. 87
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java
  50. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java
  51. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java
  52. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java
  53. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java
  54. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java
  55. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java
  56. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java
  57. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java
  58. 27
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListCommonExcelResultDTO.java
  59. 19
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java
  60. 46
      epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java
  61. 44
      epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java
  62. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java
  63. 81
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
  64. 93
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java
  65. 48
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  66. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java
  67. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java
  68. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
  69. 216
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
  70. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
  71. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
  72. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  73. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java
  74. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  75. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java
  76. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java
  77. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java
  78. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java
  79. 52
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java
  80. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java
  81. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java
  82. 66
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java
  83. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java
  84. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java
  85. 75
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcTripReportExcelData.java
  86. 29
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java
  87. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java
  88. 116
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcTripReportExcelImportListener.java
  89. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java
  90. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java
  91. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatRelationService.java
  92. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  93. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java
  94. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  95. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java
  96. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java
  97. 279
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  98. 36
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java
  99. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatRelationServiceImpl.java
  100. 141
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java

@ -33,7 +33,7 @@ public class PageFormDTO implements Serializable {
*/ */
private Integer offset; private Integer offset;
private boolean isPage = true; private Boolean isPage = true;
public Integer getOffset() { public Integer getOffset() {
return (pageNo-1)*pageSize; return (pageNo-1)*pageSize;

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java

@ -1,6 +1,6 @@
package com.epmet.commons.tools.enums; package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.exception.EpmetErrorCode; import java.util.Objects;
/** /**
* @author Administrator * @author Administrator
@ -22,11 +22,11 @@ public enum ChannelEnum {
public static String getName(String code) { public static String getName(String code) {
ChannelEnum[] houseTypeEnums = values(); ChannelEnum[] houseTypeEnums = values();
for (ChannelEnum houseTypeEnum : houseTypeEnums) { for (ChannelEnum houseTypeEnum : houseTypeEnums) {
if (houseTypeEnum.getCode() == code) { if (Objects.equals(houseTypeEnum.getCode(), code)) {
return houseTypeEnum.getName(); return houseTypeEnum.getName();
} }
} }
return EpmetErrorCode.SERVER_ERROR.getMsg(); return null;
} }
public static String getCode(String name) { public static String getCode(String name) {

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -251,6 +251,7 @@ public enum EpmetErrorCode {
ORG_EDIT_FAILED(8920,"编辑失败"), ORG_EDIT_FAILED(8920,"编辑失败"),
ORG_DEL_FAILED(8921,"删除失败"), ORG_DEL_FAILED(8921,"删除失败"),
NEIGHBORHOOD_DEL_FAILED(8922,""), NEIGHBORHOOD_DEL_FAILED(8922,""),
IC_NAT_IDCARD_NATTIME(8923,"已存在相同记录"),
//通用错误码 start //通用错误码 start

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -60,7 +60,7 @@ public class DateUtils {
public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM"; public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM";
public static final String WEEK_TYPE_ENGLISH = "english"; public static final String WEEK_TYPE_ENGLISH = "english";
public static final String WEEK_TYPE_CHINESE = "chinese"; public static final String WEEK_TYPE_CHINESE = "chinese";
public static final String DATE_PATTERN_MMDD = "MMdd";
/** /**
* 日期格式化 日期格式为yyyy-MM-dd * 日期格式化 日期格式为yyyy-MM-dd
* @param date 日期 * @param date 日期

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java

@ -132,14 +132,20 @@ public class ExcelUtils {
return response.getOutputStream(); return response.getOutputStream();
} }
/**
* desc:easypoi导出多个sheet
* @param fileName
* @param list
* @param response
* @throws Exception
*/
public static void exportMultiSheetExcel(String fileName, List<ExportMultiView> list, HttpServletResponse response) throws Exception { public static void exportMultiSheetExcel(String fileName, List<ExportMultiView> list, HttpServletResponse response) throws Exception {
List<Map<String,Object>> excel = new ArrayList<>(); List<Map<String,Object>> excel = new ArrayList<>();
for(ExportMultiView view :list){ for(ExportMultiView view :list){
Map<String,Object> sheet = new HashMap<>(); Map<String,Object> sheet = new HashMap<>();
sheet.put("title",view.getExportParams()); sheet.put("title",view.getExportParams());
sheet.put("entity",view.getCls()); sheet.put("entity",view.getCls());
List<?> dataList = view.getDataList(); sheet.put("data", view.getDataList());
sheet.put("data", dataList);
excel.add(sheet); excel.add(sheet);
} }
Workbook workbook = ExcelExportUtil.exportExcel(excel, ExcelType.XSSF); Workbook workbook = ExcelExportUtil.exportExcel(excel, ExcelType.XSSF);

9
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/excel/ExportMultiView.java

@ -16,8 +16,17 @@ import java.util.List;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public class ExportMultiView { public class ExportMultiView {
/**
* 导出的参数 比如设置表头
*/
private ExportParams exportParams; private ExportParams exportParams;
/**
* 要导出的数据列
*/
private List<?> dataList; private List<?> dataList;
/**
* excel对应的类
*/
private Class<?> cls; private Class<?> cls;
} }

3
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java

@ -3,6 +3,7 @@ package com.epmet.dataaggre.dto.evaluationindex;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -19,7 +20,7 @@ public class ScreenAgencyOrGridListDTO implements Serializable {
/** /**
* 所有下级网格列表 * 所有下级网格列表
*/ */
private List<AgencyGrid> allGridList; private List<AgencyGrid> allGridList = new ArrayList<>();
@Data @Data
public static class AgencyGrid { public static class AgencyGrid {

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java

@ -54,6 +54,8 @@ public class CategoryProjectResultDTO implements Serializable {
//二级分类code //二级分类code
@JsonIgnore @JsonIgnore
private String categoryCode; private String categoryCode;
private String topicId;
} }
} }

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java

@ -39,15 +39,15 @@ import java.util.List;
public interface IssueDao extends BaseDao<IssueEntity> { public interface IssueDao extends BaseDao<IssueEntity> {
/** /**
* @Description 查询议题表决中已关闭 * @Description 查询议题表决中已关闭
* @Param gridIds * @Param gridIds
* @author zxc * @author zxc
* @date 2020/12/25 下午2:19 * @date 2020/12/25 下午2:19
*/ */
List<IssueListResultDTO> issueStatusClosedOrVoting(@Param("gridIds") List<String> gridIds, @Param("issueStatus")String issueStatus); List<IssueListResultDTO> issueStatusClosedOrVoting(@Param("gridIds") List<String> gridIds, @Param("issueStatus") String issueStatus);
/** /**
* @Description 查询已转项目议题 * @Description 查询已转项目议题
* @Param gridIds * @Param gridIds
* @author zxc * @author zxc
* @date 2020/12/25 下午5:27 * @date 2020/12/25 下午5:27
@ -72,7 +72,7 @@ public interface IssueDao extends BaseDao<IssueEntity> {
**/ **/
List<ClosedIssueListResultDTO> selectClosedListGov(ClosedIssueListFormDTO fromDTO); List<ClosedIssueListResultDTO> selectClosedListGov(ClosedIssueListFormDTO fromDTO);
Integer selectIssueCount(@Param("gridIds") List<String> gridIds,@Param("issueType")String issueType); Integer selectIssueCount(@Param("gridIds") List<String> gridIds, @Param("issueType") String issueType);
List<IssueInfoDTO> selectShiftProjectIssueList(@Param("customerId") String customerId, @Param("gridId") String gridId); List<IssueInfoDTO> selectShiftProjectIssueList(@Param("customerId") String customerId, @Param("gridId") String gridId);
@ -81,4 +81,12 @@ public interface IssueDao extends BaseDao<IssueEntity> {
* @author sun * @author sun
**/ **/
List<IssueProjectCategoryDictDTO> getCategoryList(@Param("customerId") String customerId, @Param("level") String level, @Param("isDisable") String isDisable); List<IssueProjectCategoryDictDTO> getCategoryList(@Param("customerId") String customerId, @Param("level") String level, @Param("isDisable") String isDisable);
}
/**
* desc:根据议题id获取对应的话题id
*
* @param ids
* @return
*/
List<IssueInfoDTO> selectIssueTopicIdType(@Param("ids") List<String> ids);
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java

@ -11,7 +11,7 @@ import lombok.Data;
@Data @Data
public class CustomerDataManageExcel { public class CustomerDataManageExcel {
@Excel(name = "组织",width = 20) @Excel(name = "组织",width = 25)
private String orgName; private String orgName;
@Excel(name = "用户数",width = 10) @Excel(name = "用户数",width = 10)
@ -35,7 +35,7 @@ public class CustomerDataManageExcel {
@Excel(name = "项目数",width = 10) @Excel(name = "项目数",width = 10)
private Integer projectCount; private Integer projectCount;
@Excel(name = "结案项目数",width = 10) @Excel(name = "结案项目数",width = 12)
private Integer closedProjectCount; private Integer closedProjectCount;
@Excel(name = "巡查人数",width = 10) @Excel(name = "巡查人数",width = 10)

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -1887,20 +1887,16 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
String fileName = excelName(formDTO); String fileName = excelName(formDTO);
ExportParams exportParams = new ExportParams(fileName,fileName); ExportParams exportParams = new ExportParams(fileName,fileName);
//exportParams.setAutoSize(true);
List<ExportMultiView> exportList = new ArrayList<>(); List<ExportMultiView> exportList = new ArrayList<>();
List<CustomerDataManageExcel> excelList = ConvertUtils.sourceToTarget(result, CustomerDataManageExcel.class); List<CustomerDataManageExcel> excelList = ConvertUtils.sourceToTarget(result, CustomerDataManageExcel.class);
exportList.add(new ExportMultiView(exportParams,excelList,CustomerDataManageExcel.class)); exportList.add(new ExportMultiView(exportParams,excelList,CustomerDataManageExcel.class));
if (formDTO.isExport()){ if (CollectionUtils.isNotEmpty(operateExport.getAllGridList())){
List<CustomerDataManageResultDTO.CustomerDataManage> gridResult = operateExport.getAllGridList(); List<CustomerDataManageResultDTO.CustomerDataManage> gridResult = operateExport.getAllGridList();
setTotal(gridResult); setTotal(gridResult);
ExportParams exportParams2 = new ExportParams(fileName,"网格数据"); ExportParams exportParams2 = new ExportParams(fileName,"网格数据");
//exportParams2.setAutoSize(true);
List<CustomerDataManageExcel> excelList2 = ConvertUtils.sourceToTarget(gridResult, CustomerDataManageExcel.class); List<CustomerDataManageExcel> excelList2 = ConvertUtils.sourceToTarget(gridResult, CustomerDataManageExcel.class);
exportList.add(new ExportMultiView(exportParams2,excelList2,CustomerDataManageExcel.class)); exportList.add(new ExportMultiView(exportParams2,excelList2,CustomerDataManageExcel.class));
} }
//ExcelUtils.exportExcelToTargetDisposeAll(response,fileName,result, CustomerDataManageExcel.class);
ExcelUtils.exportMultiSheetExcel(fileName, exportList, response); ExcelUtils.exportMultiSheetExcel(fileName, exportList, response);
} }
@ -2008,7 +2004,8 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
//获取组织级别数据 //获取组织级别数据
CustomerDataManageResultDTO resultDTO = getDataManageResultDTO(formDTO, startTimeForm, agencyGrid.getAgencyGridList(),agencyGrid.getLevel()); CustomerDataManageResultDTO resultDTO = getDataManageResultDTO(formDTO, startTimeForm, agencyGrid.getAgencyGridList(),agencyGrid.getLevel());
resultDTO.setTotal(idList.size()); resultDTO.setTotal(idList.size());
if (formDTO.isExport()){ //网格List不为空则 查询网格数据 (仅限查询组织id为街道级别时)
if (CollectionUtils.isNotEmpty(agencyGrid.getAllGridList())){
formDTO.setDataType(OrgTypeEnum.GRID.getCode()); formDTO.setDataType(OrgTypeEnum.GRID.getCode());
idList = agencyGrid.getAllGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList()); idList = agencyGrid.getAllGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList());
formDTO.setIdList(idList); formDTO.setIdList(idList);

13
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.dataaggre.service.evaluationindex.impl; package com.epmet.dataaggre.service.evaluationindex.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum; import com.epmet.commons.tools.enums.OrgLevelEnum;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.DataSourceConstant;
@ -187,9 +186,9 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
//2.根据组织级别判断查询直属组织或网格列表 //2.根据组织级别判断查询直属组织或网格列表
List<ScreenCustomerAgencyDTO> agencyList = new ArrayList<>(); List<ScreenCustomerAgencyDTO> agencyList = new ArrayList<>();
List<ScreenCustomerGridDTO> gridList = new ArrayList<>(); List<ScreenCustomerGridDTO> gridList = new ArrayList<>();
List<ScreenAgencyOrGridListDTO.AgencyGrid> finalAgencyGridList = agencyGridList; //孔村和组织级别为街道的查询下级所有网格
if (isGetSubAllGrid && OrgLevelEnum.STREET.getCode().equals(dto.getLevel())){ if (isGetSubAllGrid && (OrgLevelEnum.STREET.getCode().equals(dto.getLevel()) || "1234085031077498881".equals(agencyId))){
gridList = evaluationIndexDao.getSubAllGridByAgencyPath(dto.getPids().concat(StrConstant.COLON).concat(dto.getAgencyId())); gridList = evaluationIndexDao.getSubAllGridByAgencyPath(dto.getAgencyId());
List<ScreenAgencyOrGridListDTO.AgencyGrid> allGridList = new ArrayList<>(); List<ScreenAgencyOrGridListDTO.AgencyGrid> allGridList = new ArrayList<>();
gridList.forEach(gr->{ gridList.forEach(gr->{
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
@ -203,7 +202,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
//2-1.直属下级组织列表 //2-1.直属下级组织列表
//2.判断客户是否存在子客户 //2.判断客户是否存在子客户
List<String> list = customerRelation.haveSubCustomer(dto.getCustomerId()); List<String> list = customerRelation.haveSubCustomer(dto.getCustomerId());
if (!CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
agencyList = evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null); agencyList = evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null);
} else { } else {
list.add(dto.getCustomerId()); list.add(dto.getCustomerId());
@ -213,7 +212,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getAgencyId()); org.setOrgId(gr.getAgencyId());
org.setOrgName(gr.getAgencyName()); org.setOrgName(gr.getAgencyName());
finalAgencyGridList.add(org); agencyGridList.add(org);
}); });
} else { } else {
//2-2.直属下级网格列表 //2-2.直属下级网格列表
@ -222,7 +221,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getGridId()); org.setOrgId(gr.getGridId());
org.setOrgName(gr.getGridName()); org.setOrgName(gr.getGridName());
finalAgencyGridList.add(org); agencyGridList.add(org);
}); });
} }

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java

@ -52,4 +52,11 @@ public interface GovIssueService {
* @author sun * @author sun
**/ **/
List<IssueProjectCategoryDictDTO> categoryList(String customerId, String level, String isDisable); List<IssueProjectCategoryDictDTO> categoryList(String customerId, String level, String isDisable);
/**
* desc:根据id 获取议题的话题的话题Id
* @param collect
* @return
*/
List<IssueInfoDTO> selectIssueTopicIdType(List<String> collect);
} }

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java

@ -333,4 +333,13 @@ public class GovIssueServiceImpl implements GovIssueService {
return issueDao.getCategoryList(customerId, level, isDisable); return issueDao.getCategoryList(customerId, level, isDisable);
} }
@Override
public List<IssueInfoDTO> selectIssueTopicIdType(List<String> ids) {
List<IssueInfoDTO> dtoList = issueDao.selectIssueTopicIdType(ids);
if (CollectionUtils.isEmpty(dtoList)){
return new ArrayList<>();
}
return dtoList;
}
} }

27
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -14,6 +14,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -24,7 +25,6 @@ import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO; import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO; import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO;
import com.epmet.dataaggre.dto.govproject.ProjectDTO; import com.epmet.dataaggre.dto.govproject.ProjectDTO;
import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO; import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO;
import com.epmet.dataaggre.dto.govproject.ResiEventDTO; import com.epmet.dataaggre.dto.govproject.ResiEventDTO;
@ -81,6 +81,8 @@ public class GovProjectServiceImpl implements GovProjectService {
private EvaluationIndexService evaluationIndexService; private EvaluationIndexService evaluationIndexService;
@Autowired @Autowired
private EpmetUserService epmetUserService; private EpmetUserService epmetUserService;
@Autowired
private LoginUserUtil loginUserUtil;
/** /**
* @Description 查询项目信息 * @Description 查询项目信息
@ -416,13 +418,13 @@ public class GovProjectServiceImpl implements GovProjectService {
formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1)); formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1));
//1.查询客户下分类信息 //1.查询客户下分类信息
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null); List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null);
List<String> categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(m -> m.getCategoryCode()).collect(Collectors.toList()); List<String> categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(IssueProjectCategoryDictDTO::getCategoryCode).collect(Collectors.toList());
formDTO.setCategoreCodeList(categoreCodeList); formDTO.setCategoreCodeList(categoreCodeList);
//2.查询组织及下级截止某一天的某个一级分类下的项目列表 //2.查询组织及下级截止某一天的某个一级分类下的项目列表
PageInfo<CategoryProjectResultDTO.Project> result = PageInfo<CategoryProjectResultDTO.Project> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> projectDao.categoryProjectList(formDTO)); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> projectDao.categoryProjectList(formDTO));
if (org.springframework.util.CollectionUtils.isEmpty(result.getList())) { if (CollectionUtils.isEmpty(result.getList())) {
return resultDTO; return resultDTO;
} }
resultDTO.setTotal((int) result.getTotal()); resultDTO.setTotal((int) result.getTotal());
@ -432,7 +434,7 @@ public class GovProjectServiceImpl implements GovProjectService {
List<CategoryProjectResultDTO.Project> list = projectDao.getCategoryList(projectIds); List<CategoryProjectResultDTO.Project> list = projectDao.getCategoryList(projectIds);
//4.查询来源事件的项目上报的组织信息 //4.查询来源事件的项目上报的组织信息
List<String> eventIds = result.getList().stream().filter(re -> "resi_event".equals(re.getOrigin())).map(m -> m.getOriginId()).collect(Collectors.toList()); List<String> eventIds = result.getList().stream().filter(re -> "resi_event".equals(re.getOrigin())).map(CategoryProjectResultDTO.Project::getOriginId).collect(Collectors.toList());
List<ResiEventReportOrgDTO> eventOrgList = projectDao.getEventOrgList(eventIds); List<ResiEventReportOrgDTO> eventOrgList = projectDao.getEventOrgList(eventIds);
Map<String, ResiEventReportOrgDTO> eventMap = eventOrgList.stream().collect(Collectors.toMap(ResiEventReportOrgDTO::getResiEventId, Function.identity())); Map<String, ResiEventReportOrgDTO> eventMap = eventOrgList.stream().collect(Collectors.toMap(ResiEventReportOrgDTO::getResiEventId, Function.identity()));
@ -440,11 +442,19 @@ public class GovProjectServiceImpl implements GovProjectService {
List<ResiEventDTO> eventUser = projectDao.getEventList(projectIds); List<ResiEventDTO> eventUser = projectDao.getEventList(projectIds);
List<ProjectRelatedPersonnelDTO> topicUser = projectDao.getTopicUser(projectIds); List<ProjectRelatedPersonnelDTO> topicUser = projectDao.getTopicUser(projectIds);
//市北客户查询 下议题区分下来源 设置topicId
Map<String, String> issueTopicSourceMap = new HashMap<>();
if (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(loginUserUtil.getLoginUserCustomerId())){
issueTopicSourceMap = govIssueService.selectIssueTopicIdType(result.getList().stream()
.filter(re -> "issue".equals(re.getOrigin()))
.map(CategoryProjectResultDTO.Project::getOriginId)
.collect(Collectors.toList())).stream().collect(Collectors.toMap(IssueInfoDTO::getIssueId,IssueInfoDTO::getTopicId));
}
//5.封装数据 //5.封装数据
//组织或网格id->组织或网格名称 //组织或网格id->组织或网格名称
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
result.getList().forEach(re -> { for (CategoryProjectResultDTO.Project re : result.getList()) {//所属组织
//所属组织
if ("issue".equals(re.getOrigin())) { if ("issue".equals(re.getOrigin())) {
if (map.containsKey(re.getGridId())) { if (map.containsKey(re.getGridId())) {
re.setOrgName(map.get(re.getGridId())); re.setOrgName(map.get(re.getGridId()));
@ -455,6 +465,9 @@ public class GovProjectServiceImpl implements GovProjectService {
map.put(re.getGridId(), gridInfo.getGridName()); map.put(re.getGridId(), gridInfo.getGridName());
} }
} }
//市北议题来源的设置话题Id
re.setTopicId(issueTopicSourceMap.get(re.getOriginId()));
} else if ("agency".equals(re.getOrigin())) { } else if ("agency".equals(re.getOrigin())) {
if (map.containsKey(re.getAgencyId())) { if (map.containsKey(re.getAgencyId())) {
re.setOrgName(map.get(re.getAgencyId())); re.setOrgName(map.get(re.getAgencyId()));
@ -519,7 +532,7 @@ public class GovProjectServiceImpl implements GovProjectService {
re.setUserId(to.getUserId()); re.setUserId(to.getUserId());
} }
}); });
}); }
resultDTO.setList(result.getList()); resultDTO.setList(result.getList());
return resultDTO; return resultDTO;

7
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

@ -165,6 +165,11 @@
<when test="areaCode != null and areaCode.trim() != ''"> <when test="areaCode != null and areaCode.trim() != ''">
AND parent_area_code = #{areaCode} AND parent_area_code = #{areaCode}
</when> </when>
<!--要孔村的党支部有啥用 还要导出排掉-->
<when test="agencyId == '1234085031077498881'">
AND PIDS like concat(#{agencyId},'%')
AND LEVEL = 'community'
</when>
<otherwise> <otherwise>
AND pid = #{agencyId} AND pid = #{agencyId}
</otherwise> </otherwise>
@ -227,7 +232,7 @@
screen_customer_grid screen_customer_grid
WHERE WHERE
del_flag = '0' del_flag = '0'
AND all_parent_ids LIKE concat(#{fullAgencyPath},'%') AND all_parent_ids LIKE concat('%',#{fullAgencyPath},'%')
order by parentAgencyId,gridName order by parentAgencyId,gridName
</select> </select>

17
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml

@ -139,5 +139,20 @@
</if> </if>
ORDER BY category_code ORDER BY category_code
</select> </select>
<select id="selectIssueTopicIdType" resultType="com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO">
SELECT
i.ID as issueId,
i.GRID_ID as gridId,
i.SOURCE_ID as topicId
FROM
issue i
WHERE
i.id IN
<foreach collection="ids" separator="," item="item" close=")" open="(" >
#{item}
</foreach>
and i.DEL_FLAG = '0'
and i.SOURCE_TYPE='resi_topic'
</select>
</mapper> </mapper>

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -561,6 +561,8 @@ public class AgencyServiceImpl implements AgencyService {
return nodes.get(0); return nodes.get(0);
} }
private void convertOrgTreeNode(List<OrgTreeNode> nodeList, ScreenCustomerAgencyDTO currentAgency) { private void convertOrgTreeNode(List<OrgTreeNode> nodeList, ScreenCustomerAgencyDTO currentAgency) {
OrgTreeNode orgTreeNode = ConvertUtils.sourceToTarget(currentAgency, OrgTreeNode.class); OrgTreeNode orgTreeNode = ConvertUtils.sourceToTarget(currentAgency, OrgTreeNode.class);
orgTreeNode.setOrgId(currentAgency.getAgencyId()); orgTreeNode.setOrgId(currentAgency.getAgencyId());

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java

@ -137,11 +137,14 @@ public class DataReportingServiceImpl implements DataReportingService {
public List<EventInfoResultDTO> getEventInfo(EventInfoFormDTO formDTO) { public List<EventInfoResultDTO> getEventInfo(EventInfoFormDTO formDTO) {
List<EventInfoResultDTO> list; List<EventInfoResultDTO> list;
//根据入参,获取项目 //根据入参,获取项目
long start = System.currentTimeMillis();
List<ScreenProjectDataDTO> projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize()); List<ScreenProjectDataDTO> projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize());
log.error("事件上报-查询项目列表耗时:{}ms",System.currentTimeMillis()-start);
//项目列表为空,返回空数组 //项目列表为空,返回空数组
if(CollectionUtils.isEmpty(projectList)) { if(CollectionUtils.isEmpty(projectList)) {
return Collections.emptyList(); return Collections.emptyList();
} }
start = System.currentTimeMillis();
Map<String, CustomerProjectCategoryDictEntity> epmetCodeMap = new HashMap<>(); Map<String, CustomerProjectCategoryDictEntity> epmetCodeMap = new HashMap<>();
Result<String> parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(formDTO.getCustomerId()); Result<String> parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(formDTO.getCustomerId());
if (StringUtils.isNotBlank(parentCustomer.getData())) { if (StringUtils.isNotBlank(parentCustomer.getData())) {
@ -194,6 +197,7 @@ public class DataReportingServiceImpl implements DataReportingService {
return dto; return dto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
log.error("事件上报-组装数据耗时:{}ms",System.currentTimeMillis()-start);
return list.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EventInfoResultDTO::getId))), ArrayList::new)); return list.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EventInfoResultDTO::getId))), ArrayList::new));
} }

7
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java

@ -15,10 +15,17 @@ public interface ImportTaskConstants {
String BIZ_TYPE_COMMUNITY_SELF_ORG = "community_self_org"; String BIZ_TYPE_COMMUNITY_SELF_ORG = "community_self_org";
String BIZ_TYPE_PARTY_UNIT = "party_unit"; String BIZ_TYPE_PARTY_UNIT = "party_unit";
String BIZ_TYPE_PARTY_ACTIVITY = "party_activity"; String BIZ_TYPE_PARTY_ACTIVITY = "party_activity";
String BIZ_TYPE_ATTENTION_NAT = "attention_nat";
String BIZ_TYPE_ATTENTION_VACCINATION = "attention_vaccination";
String BIZ_TYPE_ATTENTION_TRIP_REPORT = "attention_vaccination";
/** /**
* 核酸检测 * 核酸检测
*/ */
String BIZ_TYPE_IC_NAT = "ic_nat"; String BIZ_TYPE_IC_NAT = "ic_nat";
/**
* 行程上报
*/
String BIZ_TYPE_IC_TRIP_REPORT = "ic_trip_report";
/** /**
* 处理状态处理中 * 处理状态处理中

9
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java

@ -0,0 +1,9 @@
package com.epmet.dto.form;
import lombok.Data;
@Data
public class AreaCodeFormDTO {
private String parentAreaCode;
private String parentLevel;
}

11
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java

@ -0,0 +1,11 @@
package com.epmet.dto.result;
import lombok.Data;
@Data
public class AreaCodeResultDTO {
private String areaCode;
private String parentCode;
private String areaName;
private String level;
}

12
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java

@ -28,7 +28,9 @@ import com.epmet.dto.AreaCodeDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.AreaCodeResultDTO;
import com.epmet.service.AreaCodeService; import com.epmet.service.AreaCodeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -121,4 +123,14 @@ public class AreaCodeController {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
return new Result<String>().ok(areaCodeService.addAreaCode(formDTO)); return new Result<String>().ok(areaCodeService.addAreaCode(formDTO));
} }
/**
* 行政地区编码逐级查询
* @param formDTO
* @return
*/
@PostMapping(value = "nextarea")
public Result<List<AreaCodeResultDTO>> nextArea(@RequestBody AreaCodeFormDTO formDTO){
return new Result<List<AreaCodeResultDTO>>().ok(areaCodeService.nextArea(formDTO));
}
} }

12
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java

@ -19,8 +19,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.AreaCodeDTO; import com.epmet.dto.AreaCodeDTO;
import com.epmet.dto.result.AreaCodeResultDTO;
import com.epmet.entity.AreaCodeEntity; import com.epmet.entity.AreaCodeEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -40,4 +42,14 @@ public interface AreaCodeDao extends BaseDao<AreaCodeEntity> {
AreaCodeDTO selectByCityCode(String cityCode); AreaCodeDTO selectByCityCode(String cityCode);
AreaCodeDTO selectMaxCounty(String cityCode); AreaCodeDTO selectMaxCounty(String cityCode);
List<AreaCodeResultDTO> selectProvince();
List<AreaCodeResultDTO> selectCity(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectDistrict(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectStreet(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectCommunity(@Param("pCode")String pCode);
} }

4
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java

@ -23,7 +23,9 @@ import com.epmet.dto.AreaCodeDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.AreaCodeResultDTO;
import com.epmet.entity.AreaCodeEntity; import com.epmet.entity.AreaCodeEntity;
import java.util.List; import java.util.List;
@ -123,4 +125,6 @@ public interface AreaCodeService extends BaseService<AreaCodeEntity> {
* @Date 2021/4/13 14:40 * @Date 2021/4/13 14:40
**/ **/
String addAreaCode(AddAreaCodeFormDTO formDTO); String addAreaCode(AddAreaCodeFormDTO formDTO);
List<AreaCodeResultDTO> nextArea(AreaCodeFormDTO formDTO);
} }

31
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -38,7 +38,9 @@ import com.epmet.dto.AreaCodeDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.AreaCodeResultDTO;
import com.epmet.entity.AreaCodeEntity; import com.epmet.entity.AreaCodeEntity;
import com.epmet.redis.AreaCodeRedis; import com.epmet.redis.AreaCodeRedis;
import com.epmet.service.AreaCodeChildService; import com.epmet.service.AreaCodeChildService;
@ -688,6 +690,35 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
return areaCode; return areaCode;
} }
@Override
public List<AreaCodeResultDTO> nextArea(AreaCodeFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getParentAreaCode())&&StringUtils.isBlank(formDTO.getParentLevel())){
return baseDao.selectProvince();
}
List<AreaCodeResultDTO> list=new ArrayList<>();
switch (formDTO.getParentLevel()) {
case AreaCodeConstant.PROVINCE:
list = baseDao.selectCity(formDTO.getParentAreaCode());
break;
case AreaCodeConstant.CITY:
list = baseDao.selectDistrict(formDTO.getParentAreaCode());
break;
case AreaCodeConstant.DISTRICT:
list = baseDao.selectStreet(formDTO.getParentAreaCode());
break;
case AreaCodeConstant.STREET:
list = baseDao.selectCommunity(formDTO.getParentAreaCode());
break;
case AreaCodeConstant.COMMUNITY:
log.info("社区无下级");
list=null;
break;
default:
log.warn("parentLevel错误:"+formDTO.getParentLevel());
}
return list;
}
private String addDistrictAreaCode(String cityCode, String countyName) { private String addDistrictAreaCode(String cityCode, String countyName) {
AreaCodeDTO city = baseDao.selectByCityCode(cityCode); AreaCodeDTO city = baseDao.selectByCityCode(cityCode);

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

@ -98,7 +98,7 @@ public class ImportTaskServiceImpl implements ImportTaskService {
LambdaQueryWrapper<ImportTaskEntity> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ImportTaskEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ImportTaskEntity::getOperatorId,param.getOperatorId()) queryWrapper.eq(ImportTaskEntity::getOperatorId,param.getOperatorId())
.orderByDesc(ImportTaskEntity::getStartTime); .orderByDesc(ImportTaskEntity::getStartTime);
Page<ImportTaskEntity> page = PageHelper.startPage(param.getPageNo(), param.getPageSize(), param.isPage()).doSelectPage(() -> { Page<ImportTaskEntity> page = PageHelper.startPage(param.getPageNo(), param.getPageSize(), param.getIsPage()).doSelectPage(() -> {
importRecordDao.selectList(queryWrapper); importRecordDao.selectList(queryWrapper);
}); });
List<ImportTaskCommonResultDTO> list = new ArrayList<>(); List<ImportTaskCommonResultDTO> list = new ArrayList<>();

81
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml

@ -27,4 +27,85 @@
order by ac.COUNTY_CODE desc order by ac.COUNTY_CODE desc
limit 1 limit 1
</select> </select>
<select id="selectProvince" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT DISTINCT
ac.province_code AS areaCode,
ac.province_name AS areaName,
'' AS parentCode,
'province' AS LEVEL
FROM
area_code ac
WHERE
ac.DEL_FLAG = '0'
ORDER BY
ac.province_code ASC
</select>
<select id="selectCity" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT DISTINCT
ac.city_code AS areaCode,
ac.city_name AS areaName,
ac.province_code AS parentCode,
'city' AS LEVEL
FROM
area_code ac
WHERE
ac.DEL_FLAG = '0'
<if test='null != pCode and "" != pCode'>
and ac.province_code=#{pCode}
</if>
ORDER BY
ac.city_code ASC
</select>
<select id="selectDistrict" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT DISTINCT
ac.county_code AS areaCode,
ac.county_name AS areaName,
ac.city_code AS parentCode,
'district' AS LEVEL
FROM
area_code ac
WHERE
ac.DEL_FLAG = '0'
<if test='null != pCode and "" != pCode'>
and ac.city_code=#{pCode}
</if>
ORDER BY
ac.county_code ASC
</select>
<select id="selectStreet" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT
ac.`code` AS areaCode,
ac.`name` AS areaName,
ac.p_code AS parentCode,
'street' AS LEVEL
FROM
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.USER_DEFINED = '0'
<if test='null != pCode and "" != pCode'>
AND ac.p_code=#{pCode}
</if>
ORDER BY
ac.`code` ASC
</select>
<select id="selectCommunity" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT
ac.`code` AS areaCode,
ac.`name` AS areaName,
ac.p_code AS parentCode,
'community' AS LEVEL
FROM
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.USER_DEFINED = '0'
<if test='null != pCode and "" != pCode'>
AND ac.p_code=#{pCode}
</if>
ORDER BY
ac.`code` ASC
</select>
</mapper> </mapper>

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java

@ -122,6 +122,9 @@ public class AddPlacePatrolRecordFormDTO implements Serializable {
//token中userId //token中userId
private String staffId; private String staffId;
public interface Add {} @NotBlank(message = "placePatrolRecordId不能为空", groups = {Update.class})
private String placePatrolRecordId;
public interface Add {}
public interface Update {}
} }

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java

@ -78,4 +78,17 @@ public class HouseInfoDTO implements Serializable {
private String allName; private String allName;
private String customerId; private String customerId;
/**
* 小区所在的组织id
*/
private String agencyId;
/**
* eg市北区-阜新路街道-南宁社区
*/
private String agencyPathName;
/**
* 组织的area_code
*/
private String areaCode;
} }

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -291,4 +291,16 @@ public class HouseController implements ResultDataResolver {
return new Result(); return new Result();
} }
/**
* 获取房屋信息
* @param houseId
* @return
*/
@PostMapping("gethouseinfo/{houseId}")
public Result<HouseInfoDTO> getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){
if(StringUtils.isBlank(houseId)){
return new Result<>();
}
return new Result<HouseInfoDTO>().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId));
}
} }

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

@ -60,6 +60,19 @@ public class IcPlacePatrolRecordController {
return new Result(); return new Result();
} }
/**
* @Author sun
* @Description 新增场所巡查记录
**/
@PostMapping("update")
public Result update(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolRecordFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddPlacePatrolRecordFormDTO.Add.class,AddPlacePatrolRecordFormDTO.Update.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
placePatrolRecordService.update(formDTO);
return new Result();
}
/** /**
* @Author sun * @Author sun
* @Description 删除场所巡查记录 * @Description 删除场所巡查记录

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -139,10 +139,11 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
} }
/** /**
* 2022-03-29 需求改动单元号修改 eg 1 改为 1单元 * 2022-03-29 需求改动单元号修改 eg 1 改为 1单元
* 做限制此字段中必须带有 "单元"2字不存在就不给导入
*/ */
if(StringUtils.isBlank(data.getBuildingUnit())){ if(StringUtils.isBlank(data.getBuildingUnit()) || !data.getBuildingUnit().contains("单元")){
nums.add(num); nums.add(num);
disposeErrorMsg(info, "单元号的值未填写"); disposeErrorMsg(info, "单元号的值未填写或者格式不正确");
return; return;
} }
// 应产品要求 // 应产品要求

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

@ -26,7 +26,6 @@ import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcHouseExcel; import com.epmet.excel.IcHouseExcel;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
@ -79,4 +78,6 @@ public interface HouseService {
*/ */
void allDelete(NeighborHoodManageDelFormDTO formDTO); void allDelete(NeighborHoodManageDelFormDTO formDTO);
HouseInfoDTO getHouseInfoDTO(String customerId,String houseId);
} }

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

@ -38,6 +38,8 @@ public interface IcPlacePatrolRecordService extends BaseService<IcPlacePatrolRec
**/ **/
void add(AddPlacePatrolRecordFormDTO formDTO); void add(AddPlacePatrolRecordFormDTO formDTO);
void update(AddPlacePatrolRecordFormDTO formDTO);
/** /**
* @Author sun * @Author sun
* @Description 删除场所巡查记录 * @Description 删除场所巡查记录

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -13,7 +13,9 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant; import com.epmet.constant.CustomerGridConstant;
@ -457,4 +459,18 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
} }
} }
} }
@Override
public HouseInfoDTO getHouseInfoDTO(String customerId, String houseId) {
HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(houseId, customerId);
if (null != houseInfo && StringUtils.isNotBlank(houseInfo.getAgencyId())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId());
houseInfo.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName())?agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()):agencyInfoCache.getOrganizationName());
houseInfo.setAreaCode(StringUtils.isNotBlank(agencyInfoCache.getAreaCode())?agencyInfoCache.getAreaCode():StrConstant.EPMETY_STR);
} else {
houseInfo.setAgencyPathName(StrConstant.EPMETY_STR);
houseInfo.setAreaCode(StrConstant.EPMETY_STR);
}
return houseInfo;
}
} }

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

@ -694,7 +694,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId()); wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId());
PageData<IcNeighborHoodDTO> result = null; PageData<IcNeighborHoodDTO> result = null;
List<IcNeighborHoodDTO> list = null; List<IcNeighborHoodDTO> list = null;
if (params.isPage()){ if (params.getIsPage()){
Page<IcNeighborHoodEntity> objects = PageHelper.startPage(params.getPageNo(), params.getPageSize()).doSelectPage(() -> { Page<IcNeighborHoodEntity> objects = PageHelper.startPage(params.getPageNo(), params.getPageSize()).doSelectPage(() -> {
baseDao.selectList(wrapper); baseDao.selectList(wrapper);
}); });

29
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java

@ -17,7 +17,6 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -28,24 +27,17 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcPlacePatrolRecordDao; import com.epmet.dao.IcPlacePatrolRecordDao;
import com.epmet.dao.IcPlacePatrolTeamStaffDao; import com.epmet.dao.IcPlacePatrolTeamStaffDao;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcPlacePatrolTeamStaffDTO; import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
import com.epmet.dto.form.AddPlacePatrolRecordFormDTO; import com.epmet.dto.form.AddPlacePatrolRecordFormDTO;
import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcPlacePatrolRecordEntity; import com.epmet.entity.IcPlacePatrolRecordEntity;
import com.epmet.entity.IcPlacePatrolTeamEntity;
import com.epmet.entity.IcPlacePatrolTeamStaffEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.IcPlacePatrolRecordService; import com.epmet.service.IcPlacePatrolRecordService;
import com.epmet.service.IcPlacePatrolReviewRecordService; import com.epmet.service.IcPlacePatrolReviewRecordService;
import com.epmet.service.IcPlacePatrolTeamService;
import com.epmet.service.IcPlacePatrolTeamStaffService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -90,6 +82,23 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl<IcPlacePatro
insert(entity); insert(entity);
} }
/**
* @Author sun
* @Description 修改场所巡查记录
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void update(AddPlacePatrolRecordFormDTO formDTO) {
IcPlacePatrolRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolRecordEntity.class);
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
entity.setAgencyId(staffInfoCache.getAgencyId());
entity.setPids(staffInfoCache.getAgencyPIds());
entity.setFinalResult(entity.getFirstResult());
entity.setFinalTime(entity.getFirstTime());
entity.setId(formDTO.getPlacePatrolRecordId());
updateById(entity);
}
/** /**
* @Author sun * @Author sun
* @Description 删除场所巡查记录 * @Description 删除场所巡查记录

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -368,7 +368,8 @@
IFNULL(ib.LONGITUDE,'') as buildingLongitude, IFNULL(ib.LONGITUDE,'') as buildingLongitude,
IFNULL(ib.LATITUDE,'') as buildingLatitude, IFNULL(ib.LATITUDE,'') as buildingLatitude,
ih.CUSTOMER_ID AS customerId, ih.CUSTOMER_ID AS customerId,
concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.DOOR_NAME,'')) AS allName,
n.AGENCY_ID as agencyId
FROM ic_house ih FROM ic_house ih
left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0') left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0')
left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0') left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0')

4
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java

@ -9,8 +9,10 @@ public interface IcResiUserConstant {
String IC_RESI_USER = "ic_resi_user"; String IC_RESI_USER = "ic_resi_user";
/** /**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other * 居民端小程序的人resi;数字社区的居民icresi;单独录入input; 导入import
*/ */
String USER_TYPE_RESI="resi"; String USER_TYPE_RESI="resi";
String USER_TYPE_IC_RESI="icresi"; String USER_TYPE_IC_RESI="icresi";
String USER_TYPE_INPUT="input";
String USER_TYPE_IMPORT="import";
} }

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java

@ -55,7 +55,7 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable {
private Integer isAttention; private Integer isAttention;
/** /**
* 关注类型核酸检测2疫苗接种1 * 关注类型核酸检测2疫苗接种1行程上报0
*/ */
@NotNull(message = "attentionType不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class}) @NotNull(message = "attentionType不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class})
private Integer attentionType; private Integer attentionType;

55
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java

@ -1,8 +1,20 @@
package com.epmet.dto; package com.epmet.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
@ -11,79 +23,120 @@ import lombok.Data;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25 * @since v1.0.0 2022-03-25
*/ */
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44)
@Data @Data
public class IcFollowUpRecordDTO implements Serializable { public class IcFollowUpRecordDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public interface AddInternalGroup {
}
public interface AddUserRequired extends CustomerClientShowGroup {
}
/** /**
* 主键ID * 主键ID
*/ */
@ExcelIgnore
private String id; private String id;
/** /**
* 客户Id * 客户Id
*/ */
@ExcelIgnore
private String customerId; private String customerId;
/** /**
* 姓名 * 姓名
*/ */
@ColumnWidth(20)
@ExcelProperty("姓名")
@NotBlank(message = "姓名不能为空", groups = {AddUserRequired.class})
private String name; private String name;
/** /**
* 手机号 * 手机号
*/ */
@ColumnWidth(20)
@ExcelProperty("手机号")
@NotBlank(message = "手机号不能为空", groups = {AddUserRequired.class})
private String mobile; private String mobile;
/** /**
* 身份证号 * 身份证号
*/ */
@ColumnWidth(25)
@ExcelProperty("身份证号")
@NotBlank(message = "身份证号不能为空", groups = {AddUserRequired.class})
private String idCard; private String idCard;
/** /**
* 0行程上报1疫苗接种2核酸检测 * 0行程上报1疫苗接种2核酸检测
*/ */
@ColumnWidth(25)
@ExcelProperty("来源")
@NotBlank(message = "origin不能为空:0行程上报,1疫苗接种,2核酸检测", groups = {AddInternalGroup.class})
private String origin; private String origin;
/** /**
* 随访时间 * 随访时间
*/ */
@ColumnWidth(25)
@ExcelProperty("随访时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@NotNull(message = "随访时间不能为空", groups = {AddUserRequired.class})
private Date visitTime; private Date visitTime;
/** /**
* 随访内容 * 随访内容
*/ */
@ColumnWidth(200)
@ExcelProperty("随访内容")
@NotBlank(message = "随访内容不能为空", groups = {AddUserRequired.class})
@Length(message = "随访内容最多输入1000字", groups = {AddUserRequired.class})
private String content; private String content;
/**
* 工作人员所属组织id
*/
@ExcelIgnore
private String agencyId;
/** /**
* 删除标识 1删除0未删除 * 删除标识 1删除0未删除
*/ */
@ExcelIgnore
private String delFlag; private String delFlag;
/** /**
* 乐观锁 * 乐观锁
*/ */
@ExcelIgnore
private Integer revision; private Integer revision;
/** /**
* 创建人 * 创建人
*/ */
@ExcelIgnore
private String createdBy; private String createdBy;
/** /**
* 创建时间 * 创建时间
*/ */
@ExcelIgnore
private Date createdTime; private Date createdTime;
/** /**
* 更新人 * 更新人
*/ */
@ExcelIgnore
private String updatedBy; private String updatedBy;
/** /**
* 更新时间 * 更新时间
*/ */
@ExcelIgnore
private Date updatedTime; private Date updatedTime;
} }

15
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java

@ -1,13 +1,13 @@
package com.epmet.dto; package com.epmet.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/** /**
* 核酸上报记录 * 核酸上报记录
@ -32,14 +32,9 @@ public class IcNatDTO implements Serializable {
private String customerId; private String customerId;
/** /**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id * 是否客户下居民(0: 1:)
*/
private String agencyId;
/**
* 组织pids
*/ */
private String pids; private String isResiUser;
/** /**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值 * 居民端小程序的用户id数字社区的icResiUserId其他情况无值

82
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatRelationDTO.java

@ -0,0 +1,82 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@Data
public class IcNatRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id
*/
private String agencyId;
/**
* 组织pids,包含当前agencyId值
*/
private String pids;
/**
* 核酸记录表Id(ic_nat.id)
*/
private String icNatId;
/**
* 关系数据的绑定途径居民端录入resi;
数字社区录入icresi;
导入的import;
同步的synchro
*/
private String userType;
/**
* 删除标识
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

71
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java

@ -1,5 +1,10 @@
package com.epmet.dto; package com.epmet.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
@ -13,6 +18,7 @@ import java.util.Date;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25 * @since v1.0.0 2022-03-25
*/ */
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44)
@Data @Data
public class IcTripReportRecordDTO implements Serializable { public class IcTripReportRecordDTO implements Serializable {
@ -21,137 +27,192 @@ public class IcTripReportRecordDTO implements Serializable {
/** /**
* 主键ID * 主键ID
*/ */
@ExcelIgnore
private String id; private String id;
/** /**
* 居民端用户所在网格id,数字社区居民所属网格id * 居民端用户所在网格id,数字社区居民所属网格id
*/ */
@ExcelIgnore
private String gridId; private String gridId;
/** /**
* 居民端上报的存储用户所在网格的组织id; * 居民端上报的存储用户所在网格的组织id;
*/ */
@ExcelIgnore
private String agencyId; private String agencyId;
/** /**
* agency_id的所有上级 * agency_id的所有上级
*/ */
@ExcelIgnore
private String pids; private String pids;
/** /**
* 客户Id * 客户Id
*/ */
@ExcelIgnore
private String customerId; private String customerId;
/** /**
* 姓名 * 姓名
*/ */
@ColumnWidth(15)
@ExcelProperty("姓名")
private String name; private String name;
/** /**
* 手机号 * 手机号
*/ */
@ColumnWidth(15)
@ExcelProperty("手机号")
private String mobile; private String mobile;
/** /**
* 身份证号 * 身份证号
*/ */
@ColumnWidth(22)
@ExcelProperty("身份证号")
private String idCard; private String idCard;
/** /**
* 用户id * 用户id
*/ */
@ExcelIgnore
private String userId; private String userId;
/** /**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other * 居民端小程序的人resi;数字社区的居民icresi;单独录入input; 导入import
*/ */
@ExcelIgnore
private String userType; private String userType;
/** /**
* 现居地编码 * 现居地编码
*/ */
@ExcelIgnore
private String presentAddressCode; private String presentAddressCode;
/**
* 现居地编码路径"presentAddressPathCode":"37,3702,370203,370203026,370203026002"
*/
@ExcelIgnore
private String presentAddressPathCode;
/** /**
* 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区
*/ */
@ColumnWidth(50)
@ExcelProperty("现居地")
private String presentAddress; private String presentAddress;
/** /**
* 详细地址 * 详细地址
*/ */
@ColumnWidth(35)
@ExcelProperty("详细地址")
private String detailAddress; private String detailAddress;
/** /**
* 来源地区编码 * 来源地区编码
*/ */
@ExcelIgnore
private String sourceAddressCode; private String sourceAddressCode;
/**
* 来源地编码路径 "sourceAddressPathCode": "37,3702,370203,370203026,370203026002"
*/
@ExcelIgnore
private String sourceAddressPathCode;
/** /**
* 来源地区地址 * 来源地区地址
*/ */
@ColumnWidth(50)
@ExcelProperty("来自地区")
private String sourceAddress; private String sourceAddress;
/** /**
* 到达日期 * 到达日期
*/ */
@ColumnWidth(25)
@ExcelProperty("来到本地时间")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date arriveDate; private Date arriveDate;
/** /**
* 离开日期 * 离开日期
*/ */
@ColumnWidth(25)
@ExcelProperty("离开本地时间")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date leaveDate; private Date leaveDate;
/**
* pc行程上报-列表返参最近一次通知时间
*/
@ColumnWidth(25)
@ExcelProperty("最近一次通知时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date latestNoticeTime;
/** /**
* 备注信息 * 备注信息
*/ */
@ColumnWidth(100)
@ExcelProperty("备注")
private String remark; private String remark;
/** /**
* 删除标识 1删除0未删除 * 删除标识 1删除0未删除
*/ */
@ExcelIgnore
private String delFlag; private String delFlag;
/** /**
* 乐观锁 * 乐观锁
*/ */
@ExcelIgnore
private Integer revision; private Integer revision;
/** /**
* 创建人 * 创建人
*/ */
@ExcelIgnore
private String createdBy; private String createdBy;
/** /**
* 创建时间 * 创建时间
*/ */
@ExcelIgnore
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdTime; private Date createdTime;
/** /**
* 更新人 * 更新人
*/ */
@ExcelIgnore
private String updatedBy; private String updatedBy;
/** /**
* 更新时间 * 更新时间
*/ */
@ExcelIgnore
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedTime; private Date updatedTime;
@ExcelIgnore
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private Date reportTime; private Date reportTime;
/**
* pc行程上报-列表返参最近一次通知时间
*/
private Date latestNoticeTime;
/** /**
* pc行程上报-列表返参是否加入核酸检测关注名单true已加入false未加入 * pc行程上报-列表返参是否加入核酸检测关注名单true已加入false未加入
*/ */
@ExcelIgnore
private Boolean heSuanCheck; private Boolean heSuanCheck;
@ColumnWidth(20)
@ExcelProperty("核算检测关注名单")
private String heSuanCheckDesc;
} }

12
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java

@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -20,10 +21,13 @@ public class AddIcNatFormDTO implements Serializable {
public interface Nat extends CustomerClientShowGroup { public interface Nat extends CustomerClientShowGroup {
} }
public interface Edit extends CustomerClientShowGroup {
}
/** /**
* 核酸记录Id,修改时使用 * 核酸记录Id,修改时使用
*/ */
@NotBlank(message = "组织Id不能为空", groups = Edit.class)
private String icNatId; private String icNatId;
/** /**
* 当前网格所属组织Id * 当前网格所属组织Id
@ -57,7 +61,7 @@ public class AddIcNatFormDTO implements Serializable {
/** /**
* 检测时间 * 检测时间
*/ */
//@NotBlank(message = "检测时间不能为空", groups = Nat.class) @NotNull(message = "检测时间不能为空", groups = Nat.class)
@JsonFormat(pattern="yyyy-MM-dd HH:mm") @JsonFormat(pattern="yyyy-MM-dd HH:mm")
private Date natTime; private Date natTime;
/** /**
@ -76,11 +80,14 @@ public class AddIcNatFormDTO implements Serializable {
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc * 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/ */
private String attachmentType; private String attachmentType;
/** /**
* 附件地址 * 附件地址
*/ */
private String attachmentUrl; private String attachmentUrl;
/**
* 是否客户下居民(0: 1:)
*/
private String isResiUser = "0";
/** /**
* 通知渠道 0小程序通知1短信通知多选是数组 * 通知渠道 0小程序通知1短信通知多选是数组
*/ */
@ -92,6 +99,7 @@ public class AddIcNatFormDTO implements Serializable {
//token中信息 //token中信息
private String customerId; private String customerId;
private String staffId;
} }

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java

@ -28,7 +28,7 @@ public class CancelAttentionPackageFormDTO implements Serializable {
private List<String> idCards; private List<String> idCards;
/** /**
* 关注类型核酸检测2疫苗接种1 * 关注类型核酸检测2疫苗接种1行程上报0
*/ */
@NotNull(message = "attentionType不能为空",groups = CancelAttentionPackageForm.class) @NotNull(message = "attentionType不能为空",groups = CancelAttentionPackageForm.class)
private Integer attentionType ; private Integer attentionType ;

15
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java

@ -56,6 +56,16 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab
* 身份证 * 身份证
*/ */
private String idCard; private String idCard;
/**
* 开始日期
*/
private String startDate;
/**
* 结束日期
*/
private String endDate;
/** /**
* 疫苗接种次数 * 疫苗接种次数
*/ */
@ -64,4 +74,9 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab
* 核酸检测次数 * 核酸检测次数
*/ */
private Integer natCount; private Integer natCount;
/**
* 关注类型核酸检测2疫苗接种1
*/
private Integer attentionType;
} }

87
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java

@ -9,7 +9,9 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 行程上报居民端入参 * 行程上报居民端入参
@ -22,6 +24,19 @@ public class IcTripReportFormDTO implements Serializable {
public interface ResiUserRequired extends CustomerClientShowGroup { public interface ResiUserRequired extends CustomerClientShowGroup {
} }
public interface PcAddOrUpdateInternalGroup {
}
public interface PcAddRequired extends CustomerClientShowGroup {
}
public interface IcResiInternalGroup {
}
public interface PcUpdateRequired extends CustomerClientShowGroup {
}
@NotBlank(message = "主键不能为空", groups = {PcUpdateRequired.class})
private String id;
/** /**
* 客户Id * 客户Id
*/ */
@ -30,37 +45,48 @@ public class IcTripReportFormDTO implements Serializable {
/** /**
* 姓名 * 姓名
*/ */
@NotBlank(message = "姓名不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "姓名不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String name; private String name;
/** /**
* 手机号 * 手机号
*/ */
@NotBlank(message = "手机号不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "手机号不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String mobile; private String mobile;
/** /**
* 身份证号 * 身份证号
*/ */
@NotBlank(message = "身份证号不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "身份证号不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String idCard; private String idCard;
/**
* 是否添加到核算检测关注名单,true加入默认false不加入
*/
@NotNull(message = "是否添加到核算检测关注名单", groups = {PcAddRequired.class,PcUpdateRequired.class})
private Boolean heSuanCheck;
/** /**
* 现居地编码 * 现居地编码
*/ */
@NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class})
private String presentAddressCode; private String presentAddressCode;
/**
* 现居地编码路径"presentAddressPathCode":"37,3702,370203,370203026,370203026002"
*/
@NotBlank(message = "现居地编码路径不能为空", groups = {ResiUserRequired.class})
private String presentAddressPathCode;
/** /**
* 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区
*/ */
@NotBlank(message = "现居地名称不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "现居地名称不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String presentAddress; private String presentAddress;
/** /**
* 详细地址 * 详细地址
*/ */
@NotBlank(message = "详细地址不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "详细地址不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String detailAddress; private String detailAddress;
/** /**
@ -69,10 +95,16 @@ public class IcTripReportFormDTO implements Serializable {
@NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class})
private String sourceAddressCode; private String sourceAddressCode;
/**
* 来源地编码路径 "sourceAddressPathCode": "37,3702,370203,370203026,370203026002"
*/
@NotBlank(message = "来自地编码路径不能为空", groups = {ResiUserRequired.class})
private String sourceAddressPathCode;
/** /**
* 来源地区地址 * 来源地区地址
*/ */
@NotBlank(message = "来自地区名称不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "来自地区名称不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String sourceAddress; private String sourceAddress;
/** /**
@ -80,7 +112,7 @@ public class IcTripReportFormDTO implements Serializable {
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "来到本地时间不能为空", groups = {ResiUserRequired.class}) @NotNull(message = "来到本地时间不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private Date arriveDate; private Date arriveDate;
/** /**
@ -93,23 +125,56 @@ public class IcTripReportFormDTO implements Serializable {
/** /**
* 备注信息 * 备注信息
*/ */
@Length(max = 500, message = "备注最多可输入500字", groups = {ResiUserRequired.class}) @Length(max = 500, message = "备注最多可输入500字", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String remark; private String remark;
@NotBlank(message = "网格不能为空", groups = {ResiUserInternalGroup.class}) /**
* userType=icresi时必填,取值居民所属的网格ID
* 居民端小程序上报前端赋值当前用户所在的网格id
*/
@NotBlank(message = "网格不能为空", groups = {ResiUserInternalGroup.class,IcResiInternalGroup.class})
private String gridId; private String gridId;
//后端自己赋值
/** /**
* 用户id * 用户id
* 居民端上报时后端自己赋值
* pc录入如果是从居民信息选择此列有值
*/ */
@NotBlank(message = "userId不能为空", groups = {IcResiInternalGroup.class})
private String userId; private String userId;
/** /**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other * 居民端小程序的人resi;数字社区的居民icresi;单独录入input; 导入import
* 居民端上报是后端赋值导入后端赋值
* pc录入是前端赋值
*/ */
@NotBlank(message = "数字社区的居民:icresi;其他:other", groups = {PcAddOrUpdateInternalGroup.class})
private String userType; private String userType;
/**
* userType=icresi时必填
* 居民所属的组织id
*/
@NotBlank(message = "agencyId不能为空", groups = {IcResiInternalGroup.class})
private String agencyId;
/**
* pc录入时用
*/
private String currentStaffId;
/**
* pc录入时用
* 通知渠道 0小程序通知1短信通知
*/
private List<String> channel = new ArrayList<>();
/**
* pc录入时用
* 通知内容
*/
private String content = "";
} }

7
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java

@ -14,8 +14,6 @@ import javax.validation.constraints.NotBlank;
public class MyNatListFormDTO extends PageFormDTO { public class MyNatListFormDTO extends PageFormDTO {
private static final long serialVersionUID = 9156247659994638103L; private static final long serialVersionUID = 9156247659994638103L;
public interface MyNat extends CustomerClientShowGroup {
}
public interface Detail extends CustomerClientShowGroup { public interface Detail extends CustomerClientShowGroup {
} }
public interface Del extends CustomerClientShowGroup { public interface Del extends CustomerClientShowGroup {
@ -26,7 +24,6 @@ public class MyNatListFormDTO extends PageFormDTO {
/** /**
* 身份证号 * 身份证号
*/ */
@NotBlank(message = "身份证号不能为空", groups = MyNat.class)
private String idCard; private String idCard;
/** /**
* 当前组织:current 根组织all * 当前组织:current 根组织all
@ -41,6 +38,10 @@ public class MyNatListFormDTO extends PageFormDTO {
* 手机号 * 手机号
*/ */
private String mobile; private String mobile;
/**
* 是否客户下居民(0: 1:)
*/
private String isResiUser;
/** /**
* 检测开始时间yyyy-MM-dd HH:mm * 检测开始时间yyyy-MM-dd HH:mm
*/ */

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class PageFollowUpFormDTO extends PageFormDTO {
/**
* 身份证号
*/
@NotBlank(message = "身份证号不能为空", groups = {AddUserShowGroup.class})
private String idCard;
@NotBlank(message = "身份证号不能为空", groups = {AddUserShowGroup.class})
private String name;
/**
* 0行程上报1疫苗接种2核酸检测
*/
@NotBlank(message = "origin不能为空:0行程上报,1疫苗接种,2核酸检测", groups = {AddUserInternalGroup.class})
private String origin;
private String customerId;
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java

@ -28,7 +28,10 @@ public class PageTripReportFormDTO extends PageFormDTO implements Serializable {
* 来源地区编码 * 来源地区编码
*/ */
private String sourceAddressCode; private String sourceAddressCode;
/**
* 来源地区名称
*/
private String sourceAddress;
/** /**
* 来到本地时间 * 来到本地时间
*/ */

9
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java

@ -52,24 +52,32 @@ public class ResiCollectFormDTO implements Serializable {
*/ */
@NotBlank(message = "小区不能为空", groups = InternalShowGroup.class) @NotBlank(message = "小区不能为空", groups = InternalShowGroup.class)
private String villageId; private String villageId;
@NotBlank(message = "小区名不能为空", groups = InternalShowGroup.class)
private String villageName;
/** /**
* 所属楼宇Id * 所属楼宇Id
*/ */
@NotBlank(message = "楼栋不能为空", groups = InternalShowGroup.class) @NotBlank(message = "楼栋不能为空", groups = InternalShowGroup.class)
private String buildId; private String buildId;
@NotBlank(message = "楼栋名不能为空",groups = InternalShowGroup.class)
private String buildName;
/** /**
* 单元id * 单元id
*/ */
@NotBlank(message = "单元不能为空", groups = InternalShowGroup.class) @NotBlank(message = "单元不能为空", groups = InternalShowGroup.class)
private String unitId; private String unitId;
@NotBlank(message = "单元名不能为空",groups = InternalShowGroup.class)
private String unitName;
/** /**
* 所属家庭Id * 所属家庭Id
*/ */
@NotBlank(message = "家庭不能为空", groups = InternalShowGroup.class) @NotBlank(message = "家庭不能为空", groups = InternalShowGroup.class)
private String homeId; private String homeId;
@NotBlank(message = "家庭名不能为空",groups = InternalShowGroup.class)
private String homeName;
/** /**
* 详细地址 * 详细地址
@ -102,4 +110,5 @@ public class ResiCollectFormDTO implements Serializable {
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId; private String userId;
} }

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java

@ -18,6 +18,7 @@ import java.util.List;
public class SendNoticeFormDTO implements Serializable { public class SendNoticeFormDTO implements Serializable {
private static final long serialVersionUID = 4800907725063604885L; private static final long serialVersionUID = 4800907725063604885L;
private String customerId; private String customerId;
private String staffId;
/** /**
* 用户列表 * 用户列表
*/ */
@ -41,7 +42,6 @@ public class SendNoticeFormDTO implements Serializable {
/** /**
* 组织名 * 组织名
*/ */
@NotNull(message = "组织名不能为空", groups = DefaultGroup.class)
private String orgName; private String orgName;
@NoArgsConstructor @NoArgsConstructor

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java

@ -20,7 +20,7 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable
public interface VaccinationListForm{} public interface VaccinationListForm{}
/** /**
* 关注类型核酸检测2疫苗接种1 * 关注类型核酸检测2疫苗接种1行程上报0
*/ */
@NotNull(message = "attentionType不能为空",groups = VaccinationListForm.class) @NotNull(message = "attentionType不能为空",groups = VaccinationListForm.class)
private Integer attentionType; private Integer attentionType;

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java

@ -13,4 +13,5 @@ public class DemandUserResDTO implements Serializable {
private String gridId; private String gridId;
private String idCard; private String idCard;
private String agencyId; private String agencyId;
private String houseId;
} }

9
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java

@ -59,6 +59,11 @@ public class LatestCollectResDTO implements Serializable {
*/ */
private Integer totalResi; private Integer totalResi;
private String villageName;
private String buildName;
private String unitName;
private String homeName;
@Valid @Valid
private List<IcResiCollectMemFormDTO> memberList; private List<IcResiCollectMemFormDTO> memberList;
@ -78,5 +83,9 @@ public class LatestCollectResDTO implements Serializable {
this.houseHolderName=""; this.houseHolderName="";
this.totalResi=0; this.totalResi=0;
this.memberList=new ArrayList<>(); this.memberList=new ArrayList<>();
this.villageName="";
this.buildName="";
this.unitName="";
this.homeName="";
} }
} }

27
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListCommonExcelResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.result;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import lombok.Data;
/**
* @Description 核酸检测-我的上报记录
* @Author sun
*/
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44)
@Data
public class NatListCommonExcelResultDTO extends NatListResultDTO{
private static final long serialVersionUID = 1L;
/**
* 是否客户下居民(0: 1:)
*/
@ColumnWidth(20)
@ExcelProperty(value = "本辖区居民",order = 6)
private String isResiUser;
}

19
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java

@ -35,6 +35,7 @@ public class NatListResultDTO implements Serializable {
*/ */
@ExcelIgnore @ExcelIgnore
private String userId; private String userId;
/** /**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other * 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
*/ */
@ -45,21 +46,21 @@ public class NatListResultDTO implements Serializable {
* 姓名 * 姓名
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("姓名") @ExcelProperty(value = "姓名",order = 1)
private String name; private String name;
/** /**
* 手机号 * 手机号
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("手机号") @ExcelProperty(value = "手机号",order = 2)
private String mobile; private String mobile;
/** /**
* 身份证号 * 身份证号
*/ */
@ColumnWidth(25) @ColumnWidth(25)
@ExcelProperty("身份证号") @ExcelProperty(value = "身份证号",order = 3)
private String idCard; private String idCard;
/** /**
@ -67,21 +68,27 @@ public class NatListResultDTO implements Serializable {
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
@ColumnWidth(25) @ColumnWidth(25)
@ExcelProperty("检测时间") @ExcelProperty(value = "检测时间",order = 4)
private Date natTime; private Date natTime;
/** /**
* 检测结果 * 检测结果
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("检测结果") @ExcelProperty(value = "检测结果",order = 5)
private String natResult; private String natResult;
/**
* 是否客户下居民(0: 1:)
*/
@ExcelIgnore
private String isResiUser;
/** /**
* 检测地点 * 检测地点
*/ */
@ColumnWidth(30) @ColumnWidth(30)
@ExcelProperty("检测地点") @ExcelProperty(value = "检测地点",order = 7)
private String natAddress; private String natAddress;

46
epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java

@ -0,0 +1,46 @@
package com.epmet.enums;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
/**
* @Author zxc
* @DateTime 2022/3/29 16:17
* @DESC
*/
public enum AttentionTypeEnum {
XCSB(0,"行程上报"),
YMJZ(1,"疫苗接种"),
NAT(2,"核酸检测")
;
private Integer key;
private String value;
AttentionTypeEnum(Integer key, String value) {
this.key = key;
this.value = value;
}
public static Integer getKeyByValue(String value){
if (StringUtils.isBlank(value)){
return NumConstant.ZERO;
}
for (AttentionTypeEnum a : AttentionTypeEnum.values()) {
if (a.getValue().equals(value)){
return a.getKey();
}
}
return NumConstant.ZERO;
}
public Integer getKey() {
return key;
}
public String getValue() {
return value;
}
}

44
epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java

@ -0,0 +1,44 @@
package com.epmet.enums;
import com.epmet.commons.tools.constant.NumConstant;
import org.apache.commons.lang3.StringUtils;
/**
* @Author zxc
* @DateTime 2022/3/29 16:35
* @DESC
*/
public enum ChannelEnum {
MINI("0","小程序"),
MSG("1","短信")
;
private String key;
private String value;
ChannelEnum(String key, String value) {
this.key = key;
this.value = value;
}
public static String getKeyByValue(String value){
if (StringUtils.isBlank(value)){
return NumConstant.ONE_STR;
}
for (ChannelEnum a : ChannelEnum.values()) {
if (a.getValue().equals(value)){
return a.getKey();
}
}
return NumConstant.ONE_STR;
}
public String getKey() {
return key;
}
public String getValue() {
return value;
}
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java

@ -64,6 +64,13 @@ public class IcEpidemicPreventionController{
return new Result<PageData<EpidemicPreventionResultDTO>>().ok(result); return new Result<PageData<EpidemicPreventionResultDTO>>().ok(result);
} }
@PostMapping("user-list")
public Result<PageData<EpidemicPreventionResultDTO>> userList(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
PageData<EpidemicPreventionResultDTO> result = icResiUserService.userList(formDTO);
return new Result<PageData<EpidemicPreventionResultDTO>>().ok(result);
}
/** /**
* 居民防疫信息详情 * 居民防疫信息详情
* @Param formDTO * @Param formDTO
@ -72,13 +79,15 @@ public class IcEpidemicPreventionController{
* @Date 2022/3/29 16:13 * @Date 2022/3/29 16:13
*/ */
@PostMapping("detail") @PostMapping("detail")
public Result<EpidemicPreventionResultDTO> detail(@RequestBody EpidemicPreventionFormDTO formDTO) { public Result<EpidemicPreventionResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO); EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO);
return new Result<EpidemicPreventionResultDTO>().ok(result); return new Result<EpidemicPreventionResultDTO>().ok(result);
} }
@PostMapping("info") @PostMapping("info")
public Result<EpidemicPreventionInfoDTO> info(@RequestBody EpidemicPreventionFormDTO formDTO) { public Result<EpidemicPreventionInfoDTO> info(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO); EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO);
return new Result<EpidemicPreventionInfoDTO>().ok(result); return new Result<EpidemicPreventionInfoDTO>().ok(result);
} }

81
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java

@ -1,26 +1,38 @@
package com.epmet.controller; package com.epmet.controller;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelPoiUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.NatExportExcel; import com.epmet.excel.NatExportExcel;
import com.epmet.excel.UserResiRegisterVisitExcel; import com.epmet.excel.NatImportExcel;
import com.epmet.excel.VaccinationExportExcel; import com.epmet.excel.VaccinationExportExcel;
import com.epmet.excel.VaccinationImportExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcEpidemicSpecialAttentionService; import com.epmet.service.IcEpidemicSpecialAttentionService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/** /**
@ -31,10 +43,13 @@ import javax.servlet.http.HttpServletResponse;
*/ */
@RestController @RestController
@RequestMapping("icEpidemicSpecialAttention") @RequestMapping("icEpidemicSpecialAttention")
@Slf4j
public class IcEpidemicSpecialAttentionController { public class IcEpidemicSpecialAttentionController {
@Autowired @Autowired
private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService; private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
/** /**
* Desc: 疫苗接种关注名单疫苗接种关注名单列表 * Desc: 疫苗接种关注名单疫苗接种关注名单列表
@ -75,9 +90,9 @@ public class IcEpidemicSpecialAttentionController {
*/ */
@PostMapping("vaccination-update") @PostMapping("vaccination-update")
@NoRepeatSubmit @NoRepeatSubmit
public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO){ public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO,@LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class); ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class);
icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO); icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO,tokenDto);
return new Result(); return new Result();
} }
@ -102,8 +117,42 @@ public class IcEpidemicSpecialAttentionController {
* @date 2022/3/28 13:40 * @date 2022/3/28 13:40
*/ */
@PostMapping("vaccination-import") @PostMapping("vaccination-import")
public Result vaccinationImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file,@RequestParam("attentionType")Integer attentionType){ public Result vaccinationImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file,@RequestParam("attentionType")Integer attentionType){
if (file.isEmpty()) {
throw new EpmetException("请上传文件");
}
// 校验文件类型
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
if (!"xls".equals(extension) && !"xlsx".equals(extension)) {
throw new EpmetException("文件类型不匹配");
}
// 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
importTaskForm.setOriginFileName(file.getOriginalFilename());
importTaskForm.setOperatorId(tokenDto.getUserId());
if (attentionType.equals(NumConstant.ONE)){
importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_VACCINATION);
}else if (attentionType.equals(NumConstant.TWO)){
importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_NAT);
}else if (attentionType.equals(NumConstant.ZERO)){
importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_TRIP_REPORT);
}
Result<ImportTaskCommonResultDTO> result = commonServiceOpenFeignClient.createImportTask(importTaskForm);
if (!result.success()) {
throw new EpmetException(9999,"存在进行中的导入");
}
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
}catch (Exception e){
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(tokenDto.getUserId());
input.setTaskId(result.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
commonServiceOpenFeignClient.finishImportTask(input);
log.error("读取文件失败");
}
icEpidemicSpecialAttentionService.importFile(tokenDto,inputStream,attentionType,result.getData().getTaskId());
return new Result(); return new Result();
} }
@ -120,9 +169,9 @@ public class IcEpidemicSpecialAttentionController {
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
formDTO.setPage(false); formDTO.setIsPage(false);
PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO); PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO);
// 关注类型,核酸检测:2,疫苗接种:1 // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
if (formDTO.getAttentionType().equals(NumConstant.ONE)){ if (formDTO.getAttentionType().equals(NumConstant.ONE)){
ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class); ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class);
}else { }else {
@ -131,4 +180,22 @@ public class IcEpidemicSpecialAttentionController {
} }
@PostMapping("export-template")
public void exportTemplate(HttpServletResponse response, @RequestBody VaccinationListFormDTO formDTO) throws Exception {
TemplateExportParams templatePath = new TemplateExportParams();
String fileName = "";
Map<String,Object> map = new HashMap<>();
// 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
if (formDTO.getAttentionType().equals(NumConstant.ONE)){
templatePath.setTemplateUrl("excel/attention_vaccination_template.xlsx");
fileName = "疫苗接种关注名单导入模板";
map.put("maplist",new ArrayList<VaccinationImportExcel>());
}else if (formDTO.getAttentionType().equals(NumConstant.TWO)){
templatePath.setTemplateUrl("excel/attention_nat_template.xlsx");
fileName = "核酸检测关注名单导入模板";
map.put("maplist",new ArrayList<NatImportExcel>());
}
ExcelPoiUtils.exportExcel(templatePath ,map,fileName,response);
}
} }

93
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java

@ -1,19 +1,31 @@
package com.epmet.controller; package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils; 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.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcFollowUpRecordDTO; import com.epmet.dto.IcFollowUpRecordDTO;
import com.epmet.dto.form.PageFollowUpFormDTO;
import com.epmet.service.IcFollowUpRecordService; import com.epmet.service.IcFollowUpRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Map; import javax.servlet.http.HttpServletResponse;
import java.util.Date;
/** /**
@ -22,6 +34,7 @@ import java.util.Map;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25 * @since v1.0.0 2022-03-25
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("followup") @RequestMapping("followup")
public class IcFollowUpRecordController { public class IcFollowUpRecordController {
@ -29,9 +42,16 @@ public class IcFollowUpRecordController {
@Autowired @Autowired
private IcFollowUpRecordService icFollowUpRecordService; private IcFollowUpRecordService icFollowUpRecordService;
@RequestMapping("page") /**
public Result<PageData<IcFollowUpRecordDTO>> page(@RequestParam Map<String, Object> params){ * 随访记录-列表
PageData<IcFollowUpRecordDTO> page = icFollowUpRecordService.page(params); * @param formDTO
* @return
*/
@PostMapping("page")
public Result<PageData<IcFollowUpRecordDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody PageFollowUpFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserShowGroup.class,PageFormDTO.AddUserInternalGroup.class);
PageData<IcFollowUpRecordDTO> page = icFollowUpRecordService.page(formDTO);
return new Result<PageData<IcFollowUpRecordDTO>>().ok(page); return new Result<PageData<IcFollowUpRecordDTO>>().ok(page);
} }
@ -41,11 +61,17 @@ public class IcFollowUpRecordController {
return new Result<IcFollowUpRecordDTO>().ok(data); return new Result<IcFollowUpRecordDTO>().ok(data);
} }
/**
* 随访记录-新增
* @param dto
* @return
*/
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("save") @PostMapping("save")
public Result save(@RequestBody IcFollowUpRecordDTO dto){ public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcFollowUpRecordDTO dto){
//效验数据 dto.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); dto.setCreatedBy(tokenDto.getUserId());
ValidatorUtils.validateEntity(dto, IcFollowUpRecordDTO.AddUserRequired.class,IcFollowUpRecordDTO.AddInternalGroup.class);
icFollowUpRecordService.save(dto); icFollowUpRecordService.save(dto);
return new Result(); return new Result();
} }
@ -67,6 +93,57 @@ public class IcFollowUpRecordController {
return new Result(); return new Result();
} }
/**
* 随访记录-导出
* 目前是导出个人
* @param tokenDto
* @param formDTO
* @param response
*/
@NoRepeatSubmit
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody PageFollowUpFormDTO formDTO, HttpServletResponse response) {
formDTO.setCustomerId(tokenDto.getCustomerId());
//formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
formDTO.setIsPage(false);
ExcelWriter excelWriter = null;
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
int pageNo = formDTO.getPageNo();
try {
//导出文件名:张三随访记录0330
String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
String fileName = formDTO.getName().concat("随访记录").concat(today).concat(".xlsx");
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcFollowUpRecordDTO.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build();
PageData<IcFollowUpRecordDTO> data = null;
do {
data = icFollowUpRecordService.page(formDTO);
data.getList().forEach(o->{
//0行程上报,1疫苗接种,2核酸检测
switch(o.getOrigin()){
case NumConstant.ZERO_STR:
o.setOrigin("行程上报");
break;
case NumConstant.ONE_STR:
o.setOrigin("疫苗接种");
break;
case NumConstant.TWO_STR:
o.setOrigin("核酸检测");
break;
}
});
formDTO.setPageNo(++pageNo);
excelWriter.write(data.getList(), writeSheet);
} while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size()==formDTO.getPageSize());
}catch (Exception e){
log.error("export exception", e);
}finally {
// 千万别忘记finish 会帮忙关闭流
if (excelWriter != null) {
excelWriter.finish();
}
}
}
} }

48
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java

@ -14,10 +14,7 @@ import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constants.ImportTaskConstants; import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcNatDTO; import com.epmet.dto.IcNatDTO;
@ -26,6 +23,7 @@ import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListCommonExcelResultDTO;
import com.epmet.dto.result.NatListResultDTO; import com.epmet.dto.result.NatListResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcNatService; import com.epmet.service.IcNatService;
@ -75,6 +73,7 @@ public class IcNatController implements ResultDataResolver {
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class); ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
icNucleinService.add(formDTO); icNucleinService.add(formDTO);
return new Result(); return new Result();
} }
@ -86,8 +85,8 @@ public class IcNatController implements ResultDataResolver {
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("mynatlist") @PostMapping("mynatlist")
public Result<List<MyNatListResultDTO>> myNatList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { public Result<List<MyNatListResultDTO>> myNatList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.MyNat.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<MyNatListResultDTO>>().ok(icNucleinService.myNatList(formDTO)); return new Result<List<MyNatListResultDTO>>().ok(icNucleinService.myNatList(formDTO));
} }
@ -121,7 +120,9 @@ public class IcNatController implements ResultDataResolver {
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("edit") @PostMapping("edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { public Result edit(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Edit.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
icNucleinService.edit(formDTO); icNucleinService.edit(formDTO);
return new Result(); return new Result();
} }
@ -152,6 +153,20 @@ public class IcNatController implements ResultDataResolver {
return new Result(); return new Result();
} }
/**
* @Author sun
* @Description 核酸核酸检测信息取消同步
**/
@NoRepeatSubmit
@PostMapping("cancelsynchro")
public Result cancelSynchro(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Synchro.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icNucleinService.cancelSynchro(formDTO);
return new Result<>();
}
/** /**
* 导入excel * 导入excel
* @return * @return
@ -243,7 +258,7 @@ public class IcNatController implements ResultDataResolver {
//formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); //formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
//formDTO.setUserId("73ae6280e46a6653a5605d51d5462725"); //formDTO.setUserId("73ae6280e46a6653a5605d51d5462725");
formDTO.setPage(false); formDTO.setIsPage(false);
ExcelWriter excelWriter = null; ExcelWriter excelWriter = null;
formDTO.setPageSize(NumConstant.TEN_THOUSAND); formDTO.setPageSize(NumConstant.TEN_THOUSAND);
@ -251,15 +266,28 @@ public class IcNatController implements ResultDataResolver {
try { try {
// 这里 需要指定写用哪个class去写 // 这里 需要指定写用哪个class去写
String fileName = "核酸检测信息.xlsx"; String fileName = "核酸检测信息.xlsx";
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response),NatListResultDTO.class).build(); if ("all".equals(formDTO.getOrgType())) {
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), NatListResultDTO.class).build();
}else {
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), NatListCommonExcelResultDTO.class).build();
}
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build();
PageData<NatListResultDTO> data = null; PageData<NatListResultDTO> data = null;
do { do {
data = icNucleinService.natList(formDTO); data = icNucleinService.natList(formDTO);
data.getList().forEach(o->o.setNatResult(NumConstant.ONE_STR.equals(o.getNatResult())?"阳性":"阴性")); data.getList().forEach(o-> {
o.setNatResult(NumConstant.ONE_STR.equals(o.getNatResult()) ? "阳性" : "阴性");
o.setIsResiUser(NumConstant.ONE_STR.equals(o.getNatResult()) ? "是" : "否");
});
formDTO.setPageNo(++pageNo); formDTO.setPageNo(++pageNo);
excelWriter.write(data.getList(), writeSheet); if ("current".equals(formDTO.getOrgType())) {
} while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size()==formDTO.getPageSize()); List<NatListResultDTO> list = ConvertUtils.sourceToTarget(data.getList(), NatListResultDTO.class);
excelWriter.write(list, writeSheet);
}else{
excelWriter.write(data.getList(), writeSheet);
}
} while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
}catch (Exception e){ }catch (Exception e){
log.error("export exception", e); log.error("export exception", e);

24
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java

@ -0,0 +1,24 @@
package com.epmet.controller;
import com.epmet.service.IcNatRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@RestController
@RequestMapping("icNatRelation")
public class IcNatRelationController {
@Autowired
private IcNatRelationService icNatRelationService;
}

1
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java

@ -74,6 +74,7 @@ public class IcNoticeController {
public Result sendNotice(@LoginUser TokenDto tokenDto, @RequestBody SendNoticeFormDTO formDTO) { public Result sendNotice(@LoginUser TokenDto tokenDto, @RequestBody SendNoticeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); ValidatorUtils.validateEntity(formDTO, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
icNoticeService.sendNotice(formDTO); icNoticeService.sendNotice(formDTO);
return new Result(); return new Result();
} }

2
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java

@ -92,7 +92,7 @@ public class IcResiCollectController {
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setPage(false); formDTO.setIsPage(false);
PageData<CollectListResultDTO> collectList = icResiCollectService.getCollectList(formDTO); PageData<CollectListResultDTO> collectList = icResiCollectService.getCollectList(formDTO);
List<CollectListExcelResultDTO> list =new ArrayList<>(); List<CollectListExcelResultDTO> list =new ArrayList<>();

216
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java

@ -1,40 +1,68 @@
package com.epmet.controller; package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils; 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.constant.IcResiUserConstant; import com.epmet.constant.IcResiUserConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcTripReportRecordDTO; import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.dto.form.IcTripReportFormDTO; import com.epmet.dto.form.IcTripReportFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.MyReportedTripFormDTO; import com.epmet.dto.form.MyReportedTripFormDTO;
import com.epmet.dto.form.PageTripReportFormDTO; import com.epmet.dto.form.PageTripReportFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcTripReportRecordService; import com.epmet.service.IcTripReportRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*; 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.Path;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID;
/** /**
* 行程上报信息 * 行程上报信息
* *
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25 * @since v10.0 2022-03-25
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("tripreport") @RequestMapping("tripreport")
public class IcTripReportRecordController { public class IcTripReportRecordController implements ResultDataResolver {
@Autowired @Autowired
private IcTripReportRecordService icTripReportRecordService; private IcTripReportRecordService icTripReportRecordService;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
/** /**
* pc: 行程上报-列表 * pc: 行程上报-列表
@ -42,7 +70,7 @@ public class IcTripReportRecordController {
* @param formDTO * @param formDTO
* @return * @return
*/ */
@RequestMapping("page") @PostMapping("page")
public Result<PageData<IcTripReportRecordDTO>> page(@LoginUser TokenDto tokenDto,@RequestBody PageTripReportFormDTO formDTO){ public Result<PageData<IcTripReportRecordDTO>> page(@LoginUser TokenDto tokenDto,@RequestBody PageTripReportFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
@ -51,40 +79,53 @@ public class IcTripReportRecordController {
return new Result<PageData<IcTripReportRecordDTO>>().ok(page); return new Result<PageData<IcTripReportRecordDTO>>().ok(page);
} }
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcTripReportRecordDTO> get(@PathVariable("id") String id){
IcTripReportRecordDTO data = icTripReportRecordService.get(id);
return new Result<IcTripReportRecordDTO>().ok(data);
}
/** /**
* pc: 行程上报-新增 * pc: 行程上报-新增
* @param dto * @param formDTO
* @return * @return
*/ */
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("save") @PostMapping("save")
public Result save(@RequestBody IcTripReportRecordDTO dto){ public Result save(@LoginUser TokenDto tokenDto,@RequestBody IcTripReportFormDTO formDTO){
//效验数据 formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); formDTO.setCurrentStaffId(tokenDto.getUserId());
icTripReportRecordService.save(dto); ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PcAddRequired.class,IcTripReportFormDTO.PcAddOrUpdateInternalGroup.class);
return new Result(); if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class);
}
String id=icTripReportRecordService.save(formDTO);
return new Result().ok(id);
} }
/**
* pc: 行程上报-修改
* @param formDTO
* @return
*/
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("update") @PostMapping("update")
public Result update(@RequestBody IcTripReportRecordDTO dto){ public Result update(@LoginUser TokenDto tokenDto,@RequestBody IcTripReportFormDTO formDTO){
//效验数据 formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); formDTO.setCurrentStaffId(tokenDto.getUserId());
icTripReportRecordService.update(dto); ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PcUpdateRequired.class,IcTripReportFormDTO.PcAddOrUpdateInternalGroup.class);
return new Result(); if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class);
}
return new Result().ok(icTripReportRecordService.update(formDTO));
} }
/**
* pc:行程上报-删除
*
* @param ids
* @return
*/
@PostMapping("delete") @PostMapping("delete")
public Result delete(@RequestBody String[] ids){ public Result delete(@LoginUser TokenDto tokenDto, @RequestBody String[] ids) {
//效验数据 if (ArrayUtils.isEmpty(ids)) {
AssertUtils.isArrayEmpty(ids, "id"); return new Result();
icTripReportRecordService.delete(ids); }
icTripReportRecordService.delete(tokenDto.getCustomerId(),tokenDto.getUserId(),ids);
return new Result(); return new Result();
} }
@ -116,4 +157,121 @@ public class IcTripReportRecordController {
return new Result<List<IcTripReportRecordDTO>>().ok(icTripReportRecordService.resiList(formDTO)); return new Result<List<IcTripReportRecordDTO>>().ok(icTripReportRecordService.resiList(formDTO));
} }
/**
* pc:行程上报-下载模板
* @param response
* @throws IOException
*/
@RequestMapping(value = "template-download", method = {RequestMethod.GET, RequestMethod.POST})
public void downloadTemplate(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
//response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("行程上报导入模板", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/trip_report_import_template.xlsx");
try {
ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os);
} finally {
if (is != null) {
is.close();
}
}
}
/**
* pc:行程上报-导出
* @param tokenDto
* @param formDTO
* @param response
*/
@NoRepeatSubmit
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody PageTripReportFormDTO formDTO, HttpServletResponse response) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
// formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
// formDTO.setUserId("35005df15fb0f7c791344f0b424870b7");
formDTO.setIsPage(false);
ExcelWriter excelWriter = null;
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
int pageNo = formDTO.getPageNo();
try {
// 这里 需要指定写用哪个class去写
String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
String fileName = "行程上报信息".concat(today);
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcTripReportRecordDTO.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build();
PageData<IcTripReportRecordDTO> data = null;
do {
data = icTripReportRecordService.page(formDTO);
formDTO.setPageNo(++pageNo);
excelWriter.write(data.getList(), writeSheet);
} while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
} catch (Exception e) {
log.error("export exception", e);
} finally {
// 千万别忘记finish 会帮忙关闭流
if (excelWriter != null) {
excelWriter.finish();
}
}
}
/**
* 导入excel
* @return
*/
@PostMapping("import")
public Result importExcel(MultipartFile file) {
String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
// 1.暂存文件
String originalFilename = file.getOriginalFilename();
String extName = originalFilename.substring(originalFilename.lastIndexOf("."));
Path fileSavePath;
try {
Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_trip_preport", "import");
fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName));
} catch (IOException e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【行程上报导入】创建临时存储文件失败:{}", errorMsg);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败");
}
InputStream is = null;
FileOutputStream os = null;
try {
is = file.getInputStream();
os = new FileOutputStream(fileSavePath.toString());
IOUtils.copy(is, os);
} catch (Exception e) {
e.printStackTrace();
} finally {
org.apache.poi.util.IOUtils.closeQuietly(is);
org.apache.poi.util.IOUtils.closeQuietly(os);
}
// 2.生成导入任务记录
ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
importTaskForm.setOperatorId(userId);
importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_IC_TRIP_REPORT);
importTaskForm.setOriginFileName(originalFilename);
ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm),
ServiceConstant.EPMET_COMMON_SERVICE,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"excel行程上报导入错误",
"行程上报导入失败");
// 3.执行导入
icTripReportRecordService.execAsyncExcelImport(fileSavePath, rstData.getTaskId());
return new Result();
}
} }

2
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java

@ -43,7 +43,7 @@ public class PatrolRoutineWorkController {
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("selectList") @PostMapping("selectList")
public Result<List<PatrolRoutineWorkResult>> gridUserWork(@RequestBody PatrolQueryFormDTO formDTO){ public Result<List<PatrolRoutineWorkResult>> gridUserWork(@RequestBody PatrolQueryFormDTO formDTO){
formDTO.setPage(false); formDTO.setIsPage(false);
Page<PatrolRoutineWorkResult> data = gridUserWorkService.listPage(formDTO); Page<PatrolRoutineWorkResult> data = gridUserWorkService.listPage(formDTO);
return new Result().ok(data.getResult()); return new Result().ok(data.getResult());
} }

3
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java

@ -8,7 +8,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* 疫情特别关注 * 疫情特别关注
@ -60,5 +59,5 @@ public interface IcEpidemicSpecialAttentionDao extends BaseDao<IcEpidemicSpecial
* @param attentionType * @param attentionType
* @return * @return
*/ */
List<String> getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") Set<String> idCardSet, @Param("attentionType") Integer attentionType); List<String> getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") List<String> idCardSet, @Param("attentionType") Integer attentionType);
} }

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

@ -1,6 +1,7 @@
package com.epmet.dao; package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO; import com.epmet.dto.result.NatListResultDTO;
@ -27,13 +28,31 @@ public interface IcNatDao extends BaseDao<IcNatEntity> {
/** /**
* @Author sun * @Author sun
* @Description 核酸核酸检测信息列表 * @Description 核酸本辖区核酸检测信息列表
**/ **/
List<NatListResultDTO> getNatList(MyNatListFormDTO formDTO); List<NatListResultDTO> getNatList(MyNatListFormDTO formDTO);
/** /**
* @Author sun * @Author sun
* @Description 删除/取消同步操作--物理删除业务数据 * @Description 核酸客户下核酸检测信息列表
**/
List<NatListResultDTO> getCustomerNatList(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 删除操作--物理删除业务数据
**/ **/
int delById(@Param("icNatId") String icNatId); int delById(@Param("icNatId") String icNatId);
/**
* 插入或者更新
* @param e
*/
void insertOrUpdate(IcNatEntity e);
/**
* @Author sun
* @Description 按条件查询业务数据
**/
IcNatDTO getNatDTO(@Param("customerId") String customerId, @Param("icNatId") String icNatId, @Param("idCard") String idCard, @Param("natTime") String natTime, @Param("natResult") String natResult);
} }

22
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java

@ -0,0 +1,22 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcNatRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@Mapper
public interface IcNatRelationDao extends BaseDao<IcNatRelationEntity> {
/**
* @Author sun
* @Description 关系数据删除--物理删除
**/
int delRelation(@Param("icNatId") String icNatId, @Param("agencyId") String agencyId);
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -281,4 +281,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/ */
List<EpidemicPreventionResultDTO> getEpidemicPreventionList(EpidemicPreventionFormDTO formDTO); List<EpidemicPreventionResultDTO> getEpidemicPreventionList(EpidemicPreventionFormDTO formDTO);
List<EpidemicPreventionResultDTO> natList(EpidemicPreventionFormDTO formDTO);
List<EpidemicPreventionResultDTO> vaccineList(EpidemicPreventionFormDTO formDTO);
} }

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java

@ -33,4 +33,13 @@ public interface IcTripReportRecordDao extends BaseDao<IcTripReportRecordEntity>
* @return * @return
*/ */
List<IcTripReportRecordDTO> pageList(PageTripReportFormDTO formDTO); List<IcTripReportRecordDTO> pageList(PageTripReportFormDTO formDTO);
/**
* pc:行程上报-删除
* @param userId
* @param agencyId
* @param ids
* @return
*/
int batchDel(@Param("userId")String userId,@Param("agencyId")String agencyId, @Param("ids")String[] ids);
} }

2
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java

@ -47,7 +47,7 @@ public class IcEpidemicSpecialAttentionEntity extends BaseEpmetEntity {
private Integer isAttention; private Integer isAttention;
/** /**
* 关注类型核酸检测2疫苗接种1 * 关注类型核酸检测2疫苗接种1行程上报0
*/ */
private Integer attentionType; private Integer attentionType;

4
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java

@ -56,4 +56,8 @@ public class IcFollowUpRecordEntity extends BaseEpmetEntity {
*/ */
private String content; private String content;
/**
* 工作人员所属组织id
*/
private String agencyId;
} }

13
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java

@ -29,15 +29,10 @@ public class IcNatEntity extends BaseEpmetEntity {
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private String customerId; private String customerId;
/** /**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id * 是否客户下居民(0: 1:)
*/ */
private String agencyId; private String isResiUser;
/**
* 组织pids
*/
private String pids;
/** /**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值 * 居民端小程序的用户id数字社区的icResiUserId其他情况无值

52
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java

@ -0,0 +1,52 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_nat_relation")
public class IcNatRelationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id
*/
private String agencyId;
/**
* 组织pids,包含当前agencyId值
*/
private String pids;
/**
* 核酸记录表Id(ic_nat.id)
*/
private String icNatId;
/**
* 关系数据的绑定途径居民端录入resi;
数字社区录入icresi;
导入的import;
同步的synchro
*/
private String userType;
}

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

@ -82,5 +82,8 @@ public class IcResiCollectEntity extends BaseEpmetEntity {
* 居住成员人数 * 居住成员人数
*/ */
private Integer totalResi; private Integer totalResi;
private String villageName;
private String buildName;
private String unitName;
private String homeName;
} }

12
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java

@ -62,7 +62,7 @@ public class IcTripReportRecordEntity extends BaseEpmetEntity {
private String userId; private String userId;
/** /**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other * 居民端小程序的人resi;数字社区的居民icresi;单独录入input; 导入import
*/ */
private String userType; private String userType;
@ -71,6 +71,11 @@ public class IcTripReportRecordEntity extends BaseEpmetEntity {
*/ */
private String presentAddressCode; private String presentAddressCode;
/**
* 现居地编码路径"presentAddressPathCode":"37,3702,370203,370203026,370203026002"
*/
private String presentAddressPathCode;
/** /**
* 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区
*/ */
@ -86,6 +91,11 @@ public class IcTripReportRecordEntity extends BaseEpmetEntity {
*/ */
private String sourceAddressCode; private String sourceAddressCode;
/**
* 来源地编码路径 "sourceAddressPathCode": "37,3702,370203,370203026,370203026002"
*/
private String sourceAddressPathCode;
/** /**
* 来源地区地址 * 来源地区地址
*/ */

66
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java

@ -0,0 +1,66 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import lombok.Data;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/3/29 15:47
* @DESC
*/
@Data
public class ImportEpidemicSpecialAttention extends ExcelVerifyInfo {
/**
* 姓名
*/
@Excel(name = "姓名")
private String name;
/**
* 手机号
*/
@Excel(name = "手机号")
private String mobile;
/**
* 身份证号
*/
@Excel(name = "身份证号")
private String idCard;
/**
* 原因
*/
@Excel(name = "关注原因")
private String reason;
/**
* 备注
*/
@Excel(name = "备注")
private String remark;
@ExcelIgnore
private Integer attentionType;
@Excel(name = "通知内容")
private String content;
@Excel(name = "通知渠道")
private String channelString;
@ExcelIgnore
private List<String> channel;
@ExcelIgnore
private Boolean addStatus = false;
@ExcelIgnore
private Integer num;
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java

@ -0,0 +1,30 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/3/29 10:24
* @DESC
*/
@Data
public class NatImportExcel extends ExcelVerifyInfo {
@Excel(name = "姓名")
private String name;
@Excel(name = "电话")
private String mobile;
@Excel(name = "身份证")
private String idCard;
@Excel(name = "备注")
private String remark;
@Excel(name = "关注原因")
private String reason;
}

27
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java

@ -0,0 +1,27 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/3/29 10:24
* @DESC
*/
@Data
public class VaccinationImportExcel extends ExcelVerifyInfo {
@Excel(name = "姓名")
private String name;
@Excel(name = "电话")
private String mobile;
@Excel(name = "身份证")
private String idCard;
@Excel(name = "备注")
private String remark;
}

75
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcTripReportExcelData.java

@ -0,0 +1,75 @@
package com.epmet.excel.data;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 行程上报excel数据
*/
@Data
public class IcTripReportExcelData {
@NotBlank(message = "姓名为必填项")
@ExcelProperty("姓名")
private String name;
@NotBlank(message = "身份证号为必填项")
@ExcelProperty("身份证号")
private String idCard;
@NotBlank(message = "手机号为必填项")
@ExcelProperty("手机号")
private String mobile;
@NotBlank(message = "现居地为必填项")
@ExcelProperty("现居地(格式:省-市-区-街道-社区)")
private String presentAddress;
@NotBlank(message = "详细地址为必填项")
@ExcelProperty("详细地址")
private String detailAddress;
@NotBlank(message = "来自地区为必填项")
@ExcelProperty("来自地区(格式:省-市-区-街道-社区)")
private String sourceAddress;
@NotNull(message = "来到本地时间为必填项")
@ExcelProperty("来到本地时间(格式:2022-01-01)")
private Date arriveDate;
@ExcelProperty("离开本地时间(格式:2022-01-01)")
private Date leaveDate;
/**
* 备注信息
*/
@Length(max = 500,message = "备注不能超过500字")
@ExcelProperty("备注(500字以内)")
private String remark;
@Data
public static class ErrorRow {
@ExcelProperty("姓名")
@ColumnWidth(20)
private String name;
@ColumnWidth(20)
@ExcelProperty("身份证号")
private String idCard;
@ExcelProperty("手机号")
@ColumnWidth(20)
private String mobile;
@ColumnWidth(60)
@ExcelProperty("错误信息")
private String errorInfo;
}
}

29
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java

@ -0,0 +1,29 @@
package com.epmet.excel.error;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/3/29 16:57
* @DESC
*/
@Data
public class EpidemicSpecialAttentionErrorModel {
@Excel(name = "行号",width = 10)
private Integer num;
@Excel(name = "姓名",width = 20)
private String name;
@Excel(name = "电话",width = 20)
private String mobile;
@Excel(name = "身份证",width = 30)
private String idCard;
@Excel(name = "错误信息", width = 200)
private String errorMsg;
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java

@ -60,17 +60,18 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
// 先校验数据 // 先校验数据
ValidatorUtils.validateEntity(data); ValidatorUtils.validateEntity(data);
String natResult = "0"; // 默认空,没有结果
String natResult = "";
String natResultZh = data.getNatResultZh(); String natResultZh = data.getNatResultZh();
if (StringUtils.isNotBlank(natResultZh)) { if (StringUtils.isNotBlank(natResultZh)) {
natResult = natResultZh.equals("阴性") ? "0" : "1"; natResult = natResultZh.equals("阴性") ? "0" : "1";
} }
IcNatEntity icNatEntity = ConvertUtils.sourceToTarget(data, IcNatEntity.class); IcNatEntity icNatEntity = ConvertUtils.sourceToTarget(data, IcNatEntity.class);
icNatEntity.setAgencyId(currentAgencyId); //icNatEntity.setAgencyId(currentAgencyId);
icNatEntity.setPids(currentAgencyPids); //icNatEntity.setPids(currentAgencyPids);
icNatEntity.setUserId(currentUserId); icNatEntity.setUserId(currentUserId);
icNatEntity.setUserType("other"); icNatEntity.setUserType("import");
icNatEntity.setNatResult(natResult); icNatEntity.setNatResult(natResult);
icNatEntity.setAttachmentType(""); icNatEntity.setAttachmentType("");
icNatEntity.setAttachmentUrl(""); icNatEntity.setAttachmentUrl("");

116
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcTripReportExcelImportListener.java

@ -0,0 +1,116 @@
package com.epmet.excel.handler;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.IcResiUserConstant;
import com.epmet.entity.IcTripReportRecordEntity;
import com.epmet.excel.data.IcTripReportExcelData;
import com.epmet.service.impl.IcTripReportRecordServiceImpl;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.List;
/**
* 行程上报excel导入监听器
*/
@Slf4j
public class IcTripReportExcelImportListener implements ReadListener<IcTripReportExcelData> {
/**
* 最大条数阈值
*/
public static final int MAX_THRESHOLD = 2;
/**
* 当前操作用户
*/
private CustomerStaffInfoCacheResult staffInfo;
private String customerId;
/**
* 数据
*/
private List<IcTripReportRecordEntity> datas = new ArrayList<>();
/**
* 错误项列表
*/
private List<IcTripReportExcelData.ErrorRow> errorRows = new ArrayList<>();
private IcTripReportRecordServiceImpl tripReportRecordService;
public IcTripReportExcelImportListener(String customerId,CustomerStaffInfoCacheResult staffInfo, IcTripReportRecordServiceImpl tripReportRecordService) {
this.customerId=customerId;
this.staffInfo = staffInfo;
this.tripReportRecordService = tripReportRecordService;
}
@Override
public void invoke(IcTripReportExcelData data, AnalysisContext context) {
try {
// 先校验数据
ValidatorUtils.validateEntity(data);
IcTripReportRecordEntity tripReportRecordEntity = ConvertUtils.sourceToTarget(data, IcTripReportRecordEntity.class);
tripReportRecordEntity.setCustomerId(customerId);
tripReportRecordEntity.setAgencyId(staffInfo.getAgencyId());
tripReportRecordEntity.setPids(staffInfo.getAgencyPIds());
tripReportRecordEntity.setUserType(IcResiUserConstant.USER_TYPE_IMPORT);
datas.add(tripReportRecordEntity);
if (datas.size() == MAX_THRESHOLD) {
execPersist();
}
} catch (Exception e) {
String errorMsg = null;
if (e instanceof ValidateException) {
errorMsg = ((ValidateException) e).getMsg();
} else {
errorMsg = "未知错误";
log.error("【行程上报导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
}
IcTripReportExcelData.ErrorRow errorRow = new IcTripReportExcelData.ErrorRow();
errorRow.setName(data.getName());
errorRow.setMobile(data.getMobile());
errorRow.setIdCard(data.getIdCard());
errorRow.setErrorInfo(errorMsg);
errorRows.add(errorRow);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
// 最后几条达不到阈值,这里必须再调用一次
execPersist();
}
/**
* 执行持久化
*/
private void execPersist() {
try {
if (datas != null && datas.size() > 0) {
tripReportRecordService.batchPersist(datas);
}
} finally {
datas.clear();
}
}
/**
* 获取错误行
* @return
*/
public List<IcTripReportExcelData.ErrorRow> getErrorRows() {
return errorRows;
}
}

17
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java

@ -2,15 +2,16 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.CancelAttentionPackageFormDTO; import com.epmet.dto.form.CancelAttentionPackageFormDTO;
import com.epmet.dto.form.VaccinationAddFormDTO; import com.epmet.dto.form.VaccinationAddFormDTO;
import com.epmet.dto.form.VaccinationListFormDTO; import com.epmet.dto.form.VaccinationListFormDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import java.io.InputStream;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* 疫情特别关注 * 疫情特别关注
@ -103,7 +104,7 @@ public interface IcEpidemicSpecialAttentionService extends BaseService<IcEpidemi
* @author zxc * @author zxc
* @date 2022/3/28 13:45 * @date 2022/3/28 13:45
*/ */
void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO); void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO,TokenDto tokenDto);
/** /**
* Desc: 取消关注 * Desc: 取消关注
@ -113,10 +114,20 @@ public interface IcEpidemicSpecialAttentionService extends BaseService<IcEpidemi
*/ */
void cancelAttention(CancelAttentionPackageFormDTO formDTO); void cancelAttention(CancelAttentionPackageFormDTO formDTO);
/**
* Desc: 疫苗接种关注名单核酸检测关注名单导入
* @param tokenDto
* @param inputStream
* @param attentionType
* @author zxc
* @date 2022/3/29 15:35
*/
void importFile(TokenDto tokenDto, InputStream inputStream, Integer attentionType, String taskId);
/** /**
* 传入身份证集合返回已经关注的身份证号列表 * 传入身份证集合返回已经关注的身份证号列表
* @param idCardSet * @param idCardSet
* @return * @return
*/ */
List<String> getHeSuanIdCardList(String customerId,Set<String> idCardSet); List<String> getHeSuanIdCardList(String customerId,List<String> idCardSet);
} }

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java

@ -3,6 +3,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcFollowUpRecordDTO; import com.epmet.dto.IcFollowUpRecordDTO;
import com.epmet.dto.form.PageFollowUpFormDTO;
import com.epmet.entity.IcFollowUpRecordEntity; import com.epmet.entity.IcFollowUpRecordEntity;
import java.util.List; import java.util.List;
@ -17,14 +18,14 @@ import java.util.Map;
public interface IcFollowUpRecordService extends BaseService<IcFollowUpRecordEntity> { public interface IcFollowUpRecordService extends BaseService<IcFollowUpRecordEntity> {
/** /**
* 默认分页 * 随访记录-列表
* *
* @param params * @param formDTO
* @return PageData<IcFollowUpRecordDTO> * @return PageData<IcFollowUpRecordDTO>
* @author generator * @author generator
* @date 2022-03-25 * @date 2022-03-25
*/ */
PageData<IcFollowUpRecordDTO> page(Map<String, Object> params); PageData<IcFollowUpRecordDTO> page(PageFollowUpFormDTO formDTO);
/** /**
* 默认查询 * 默认查询
@ -47,7 +48,7 @@ public interface IcFollowUpRecordService extends BaseService<IcFollowUpRecordEnt
IcFollowUpRecordDTO get(String id); IcFollowUpRecordDTO get(String id);
/** /**
* 默认保存 * 随访记录-新增
* *
* @param dto * @param dto
* @return void * @return void

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatRelationService.java

@ -0,0 +1,14 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.IcNatRelationEntity;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
public interface IcNatRelationService extends BaseService<IcNatRelationEntity> {
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java

@ -64,6 +64,12 @@ public interface IcNatService extends BaseService<IcNatEntity> {
**/ **/
void synchro(MyNatListFormDTO formDTO); void synchro(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息取消同步
**/
void cancelSynchro(MyNatListFormDTO formDTO);
/** /**
* 执行Excel导入 * 执行Excel导入
* @param filePath * @param filePath
@ -77,5 +83,5 @@ public interface IcNatService extends BaseService<IcNatEntity> {
* @Author zhaoqifeng * @Author zhaoqifeng
* @Date 2022/3/29 16:29 * @Date 2022/3/29 16:29
*/ */
List<NatListDTO> getNatList(String idCard); List<NatListDTO> getNatList(String customerId, String idCard);
} }

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java

@ -10,7 +10,6 @@ import com.epmet.entity.IcNoticeEntity;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* 防疫通知 * 防疫通知
@ -104,5 +103,5 @@ public interface IcNoticeService extends BaseService<IcNoticeEntity> {
* @param idCardSet * @param idCardSet
* @return * @return
*/ */
Map<String, Date> getUserLatestNoticeTime(String customerId,Set<String> idCardSet); Map<String, Date> getUserLatestNoticeTime(String customerId,List<String> idCardSet);
} }

1
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -226,6 +226,7 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @Date 2022/3/29 14:27 * @Date 2022/3/29 14:27
*/ */
PageData<EpidemicPreventionResultDTO> epidemicPreventionList(EpidemicPreventionFormDTO formDTO); PageData<EpidemicPreventionResultDTO> epidemicPreventionList(EpidemicPreventionFormDTO formDTO);
PageData<EpidemicPreventionResultDTO> userList(EpidemicPreventionFormDTO formDTO);
/** /**
* 居民防疫信息详情 * 居民防疫信息详情

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java

@ -3,6 +3,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiVaccineDTO; import com.epmet.dto.IcResiVaccineDTO;
import com.epmet.dto.result.VaccineListDTO;
import com.epmet.entity.IcResiVaccineEntity; import com.epmet.entity.IcResiVaccineEntity;
import java.util.List; import java.util.List;
@ -75,4 +76,14 @@ public interface IcResiVaccineService extends BaseService<IcResiVaccineEntity> {
* @date 2022-03-28 * @date 2022-03-28
*/ */
void delete(String[] ids); void delete(String[] ids);
/**
* 获取居民疫苗接种信息
*
* @Param idCard
* @Return {@link List< VaccineListDTO>}
* @Author zhaoqifeng
* @Date 2022/3/30 10:24
*/
List<VaccineListDTO> getVaccineList(String customerId, String idCard);
} }

38
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java

@ -6,8 +6,10 @@ import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.dto.form.IcTripReportFormDTO; import com.epmet.dto.form.IcTripReportFormDTO;
import com.epmet.dto.form.MyReportedTripFormDTO; import com.epmet.dto.form.MyReportedTripFormDTO;
import com.epmet.dto.form.PageTripReportFormDTO; import com.epmet.dto.form.PageTripReportFormDTO;
import com.epmet.dto.result.TripListDTO;
import com.epmet.entity.IcTripReportRecordEntity; import com.epmet.entity.IcTripReportRecordEntity;
import java.nio.file.Path;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -40,24 +42,14 @@ public interface IcTripReportRecordService extends BaseService<IcTripReportRecor
List<IcTripReportRecordDTO> list(Map<String, Object> params); List<IcTripReportRecordDTO> list(Map<String, Object> params);
/** /**
* 单条查询 * pc: 行程上报-新增
*
* @param id
* @return IcTripReportRecordDTO
* @author generator
* @date 2022-03-25
*/
IcTripReportRecordDTO get(String id);
/**
* 默认保存
* *
* @param dto * @param dto
* @return void * @return void
* @author generator * @author generator
* @date 2022-03-25 * @date 2022-03-25
*/ */
void save(IcTripReportRecordDTO dto); String save(IcTripReportFormDTO dto);
/** /**
* 默认更新 * 默认更新
@ -67,17 +59,17 @@ public interface IcTripReportRecordService extends BaseService<IcTripReportRecor
* @author generator * @author generator
* @date 2022-03-25 * @date 2022-03-25
*/ */
void update(IcTripReportRecordDTO dto); String update(IcTripReportFormDTO dto);
/** /**
* 批量删除 * pc:行程上报-删除
* *
* @param ids * @param ids
* @return void * @return void
* @author generator * @author generator
* @date 2022-03-25 * @date 2022-03-25
*/ */
void delete(String[] ids); void delete(String customerId,String userId,String[] ids);
/** /**
* 居民端小程序上报行程 * 居民端小程序上报行程
@ -92,4 +84,20 @@ public interface IcTripReportRecordService extends BaseService<IcTripReportRecor
* @return * @return
*/ */
List<IcTripReportRecordDTO> resiList(MyReportedTripFormDTO formDTO); List<IcTripReportRecordDTO> resiList(MyReportedTripFormDTO formDTO);
/**
* 获取居民行程信息
*
* @Param idCard
* @Return {@link List< TripListDTO>}
* @Author zhaoqifeng
* @Date 2022/3/30 10:31
*/
List<TripListDTO> tripList(String customerId, String idCard);
/**
* 执行Excel导入
* @param filePath
*/
void execAsyncExcelImport(Path filePath, String importTaskId);
} }

279
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java

@ -1,5 +1,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -8,26 +10,48 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException; 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.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; 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.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcEpidemicSpecialAttentionDao; import com.epmet.dao.IcEpidemicSpecialAttentionDao;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.CancelAttentionPackageFormDTO; import com.epmet.dto.form.*;
import com.epmet.dto.form.VaccinationAddFormDTO; import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.form.VaccinationListFormDTO;
import com.epmet.dto.result.VaccinationListResultDTO; import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import com.epmet.enums.ChannelEnum;
import com.epmet.excel.ImportEpidemicSpecialAttention;
import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.IcEpidemicSpecialAttentionService; import com.epmet.service.IcEpidemicSpecialAttentionService;
import com.epmet.service.IcNoticeService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -38,8 +62,16 @@ import java.util.stream.Collectors;
* @since v1.0.0 2022-03-28 * @since v1.0.0 2022-03-28
*/ */
@Service @Service
@Slf4j
public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpidemicSpecialAttentionDao, IcEpidemicSpecialAttentionEntity> implements IcEpidemicSpecialAttentionService { public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpidemicSpecialAttentionDao, IcEpidemicSpecialAttentionEntity> implements IcEpidemicSpecialAttentionService {
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private IcNoticeService noticeService;
@Override @Override
public PageData<IcEpidemicSpecialAttentionDTO> page(Map<String, Object> params) { public PageData<IcEpidemicSpecialAttentionDTO> page(Map<String, Object> params) {
IPage<IcEpidemicSpecialAttentionEntity> page = baseDao.selectPage( IPage<IcEpidemicSpecialAttentionEntity> page = baseDao.selectPage(
@ -106,9 +138,9 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
throw new EpmetException("未查询到工作人员信息"+formDTO.getUserId()); throw new EpmetException("未查询到工作人员信息"+formDTO.getUserId());
} }
formDTO.setOrgId(staffInfo.getAgencyId()); formDTO.setOrgId(staffInfo.getAgencyId());
// 关注类型,核酸检测:2,疫苗接种:1 // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
if (formDTO.getAttentionType().equals(NumConstant.ONE)){ if (formDTO.getAttentionType().equals(NumConstant.ONE)){
if (formDTO.isPage()){ if (formDTO.getIsPage()){
PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.vaccinationList(formDTO)); PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.vaccinationList(formDTO));
result.setList(pageInfo.getList()); result.setList(pageInfo.getList());
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
@ -118,7 +150,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
result.setTotal(list.size()); result.setTotal(list.size());
} }
}else if (formDTO.getAttentionType().equals(NumConstant.TWO)){ }else if (formDTO.getAttentionType().equals(NumConstant.TWO)){
if (formDTO.isPage()){ if (formDTO.getIsPage()){
PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.natList(formDTO)); PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.natList(formDTO));
result.setList(pageInfo.getList()); result.setList(pageInfo.getList());
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
@ -175,7 +207,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
e.setCustomerId(formDTO.getCustomerId()); e.setCustomerId(formDTO.getCustomerId());
}); });
insertBatch(entities); insertBatch(entities);
//TODO 发送通知 //新增通知表信息
List<IcEpidemicSpecialAttentionDTO> needSedNotice = formDTO.getList().stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(needSedNotice)) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> userListBeans = ConvertUtils.sourceToTarget(needSedNotice, SendNoticeFormDTO.UserListBean.class);
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserList(userListBeans);
dto.setChannel(needSedNotice.get(NumConstant.ZERO).getChannel());
dto.setOrigin(needSedNotice.get(NumConstant.ZERO).getAttentionType().toString());
dto.setContent(needSedNotice.get(NumConstant.ZERO).getContent());
dto.setStaffId(formDTO.getUserId());
noticeService.sendNotice(dto);
}
} }
/** /**
@ -188,7 +232,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO) { public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO,TokenDto tokenDto) {
LambdaQueryWrapper<IcEpidemicSpecialAttentionEntity> w = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcEpidemicSpecialAttentionEntity> w = new LambdaQueryWrapper<>();
IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity(); IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity();
w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard()) w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard())
@ -197,7 +241,17 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
e.setReason(formDTO.getReason()); e.setReason(formDTO.getReason());
e.setRemark(formDTO.getRemark()); e.setRemark(formDTO.getRemark());
update(e,w); update(e,w);
//TODO 通知 if (CollectionUtils.isNotEmpty(formDTO.getChannel())){
SendNoticeFormDTO dto = new SendNoticeFormDTO();
SendNoticeFormDTO.UserListBean userListBean = ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserList(Arrays.asList(userListBean));
dto.setChannel(formDTO.getChannel());
dto.setOrigin(formDTO.getAttentionType().toString());
dto.setContent(formDTO.getContent());
dto.setStaffId(tokenDto.getUserId());
noticeService.sendNotice(dto);
}
} }
/** /**
@ -214,6 +268,163 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
} }
} }
/**
* Desc: 疫苗接种关注名单核酸检测关注名单导入
* @param tokenDto
* @param inputStream
* @param attentionType
* @param taskId
* @author zxc
* @date 2022/3/29 15:35
*/
@Override
@Async
public void importFile(TokenDto tokenDto, InputStream inputStream, Integer attentionType, String taskId) {
List<EpidemicSpecialAttentionErrorModel> errorInfo = new ArrayList<>();
try {
List<ImportEpidemicSpecialAttention> list = ExcelPoiUtils.importExcel(inputStream, 0,1,ImportEpidemicSpecialAttention.class);
if (CollectionUtils.isEmpty(list)){
closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,"");
return;
}
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());
}
for (int i = 0; i < list.size(); i++) {
list.get(i).setNum(i+1);
list.get(i).setAttentionType(attentionType);
// list.get(i).setChannel(getChannel(list.get(i).getChannelString()));
if (StringUtils.isBlank(list.get(i).getName()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "姓名不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "身份证号不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getMobile()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "电话不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
}
if (list.size() > errorInfo.size()){
Map<String, Long> groupByIdCard = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting()));
groupByIdCard.forEach((idCard,count) -> {
if (Integer.valueOf(count.toString()).compareTo(1) != 0){
for (ImportEpidemicSpecialAttention i : list) {
if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){
errorInfo.add(getErrorInfo(i,"数据重复",i.getNum()));
i.setAddStatus(true);
}
}
}
});
List<String> idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList());
List<String> existList = baseDao.getExistList(attentionType, idCards);
if (CollectionUtils.isNotEmpty(existList)){
for (String s : existList) {
for (int i = NumConstant.ZERO; i < list.size(); i++) {
if (s.equals(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum()));
list.get(i).setAddStatus(true);
continue;
}
}
}
}
}
Map<Boolean, List<ImportEpidemicSpecialAttention>> groupByStatus = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getAddStatus));
List<ImportEpidemicSpecialAttention> needInsert = groupByStatus.get(false);
if (CollectionUtils.isNotEmpty(needInsert)){
List<IcEpidemicSpecialAttentionEntity> entities = ConvertUtils.sourceToTarget(needInsert, IcEpidemicSpecialAttentionEntity.class);
entities.forEach(e -> {
e.setIsAttention(NumConstant.ONE);
e.setOrgId(agencyInfo.getId());
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setCustomerId(tokenDto.getCustomerId());
});
insertBatch(entities);
// send msg 产品说导入不用发通知
/*List<ImportEpidemicSpecialAttention> needSendList = needInsert.stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(needSendList)) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> userListBeans = ConvertUtils.sourceToTarget(needSendList, SendNoticeFormDTO.UserListBean.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserList(userListBeans);
dto.setChannel(needSendList.get(NumConstant.ZERO).getChannel());
dto.setOrigin(needSendList.get(NumConstant.ZERO).getAttentionType().toString());
dto.setContent(needSendList.get(NumConstant.ZERO).getContent());
dto.setStaffId(tokenDto.getUserId());
noticeService.sendNotice(dto);
}*/
}
if (CollectionUtils.isNotEmpty(errorInfo)){
String url = importOssUpload(errorInfo, EpidemicSpecialAttentionErrorModel.class);
closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,url);
}else {
closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,"");
}
}catch (Exception e){
log.error(e.getMessage());
closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,"");
}
}
public List<String> getChannel(String channelString){
List<String> result = new ArrayList<>();
if (StringUtils.isBlank(channelString)){
return result;
}
String[] split = channelString.split(",");
for (String s : split) {
result.add(ChannelEnum.getKeyByValue(s));
}
return result;
}
/**
* Desc: 关闭任务
* @param taskId
* @param userId
* @param status
* @param url
* @author zxc
* @date 2022/3/30 09:05
*/
public void closeTask(String taskId,String userId,String status,String url){
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(userId);
input.setTaskId(taskId);
input.setProcessStatus(status);
input.setResultDescFilePath(url);
commonServiceOpenFeignClient.finishImportTask(input);
}
/**
* Desc: 构造错误信息
* @param dto
* @param info
* @param num
* @author zxc
* @date 2022/3/29 17:17
*/
public EpidemicSpecialAttentionErrorModel getErrorInfo(ImportEpidemicSpecialAttention dto,String info,Integer num){
EpidemicSpecialAttentionErrorModel result = ConvertUtils.sourceToTarget(dto, EpidemicSpecialAttentionErrorModel.class);
result.setErrorMsg(info);
result.setNum(num);
return result;
}
/** /**
* 传入身份证集合返回已经关注的身份证号列表 * 传入身份证集合返回已经关注的身份证号列表
* *
@ -221,12 +432,58 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
* @return * @return
*/ */
@Override @Override
public List<String> getHeSuanIdCardList(String customerId,Set<String> idCardSet) { public List<String> getHeSuanIdCardList(String customerId,List<String> idCardSet) {
if(CollectionUtils.isEmpty(idCardSet)){ if(CollectionUtils.isEmpty(idCardSet)){
return new ArrayList<>(); return new ArrayList<>();
} }
//关注类型,核酸检测:2,疫苗接种:1 //关注类型,核酸检测:2,疫苗接种:1,行程上报:0
return baseDao.getIdCardList(customerId,idCardSet,NumConstant.TWO); return baseDao.getIdCardList(customerId,idCardSet,NumConstant.TWO);
} }
/**
* Desc: 文件上传并返回url
* @param errorRows
* @param tClass
* @author zxc
* @date 2022/3/30 09:16
*/
public <T> String importOssUpload(Collection<?> errorRows, Class<T> tClass) throws IOException {
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表","导入失败的数据列表"),
tClass, errorRows);
// 文件名
String resultDescFileName = UUID.randomUUID().toString().concat(".xls");
FileItemFactory factory = new DiskFileItemFactory(16, null);
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName);
OutputStream os = fileItem.getOutputStream();
Result<UploadImgResultDTO> uploadResult = null;
try {
workbook.write(os);
uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
} catch (Exception e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传错误描述文件:{}", errormsg);
} finally {
try {
os.close();
} catch (IOException e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传错误描述文件关闭输出流:{}", errormsg);
}
try {
fileItem.delete();
} catch (Exception e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传错误描述文件删除临时文件:{}", errormsg);
}
}
if (uploadResult == null || !uploadResult.success()) {
log.error("调用OSS上传结果描述文件失败");
return null;
}
return uploadResult.getData().getUrl();
}
} }

36
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java

@ -1,15 +1,22 @@
package com.epmet.service.impl; 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.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
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.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcFollowUpRecordDao; import com.epmet.dao.IcFollowUpRecordDao;
import com.epmet.dto.IcFollowUpRecordDTO; import com.epmet.dto.IcFollowUpRecordDTO;
import com.epmet.dto.form.PageFollowUpFormDTO;
import com.epmet.entity.IcFollowUpRecordEntity; import com.epmet.entity.IcFollowUpRecordEntity;
import com.epmet.service.IcFollowUpRecordService; import com.epmet.service.IcFollowUpRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -28,13 +35,23 @@ import java.util.Map;
public class IcFollowUpRecordServiceImpl extends BaseServiceImpl<IcFollowUpRecordDao, IcFollowUpRecordEntity> implements IcFollowUpRecordService { public class IcFollowUpRecordServiceImpl extends BaseServiceImpl<IcFollowUpRecordDao, IcFollowUpRecordEntity> implements IcFollowUpRecordService {
/**
* 随访记录-列表
* @param formDTO
* @return
*/
@Override @Override
public PageData<IcFollowUpRecordDTO> page(Map<String, Object> params) { public PageData<IcFollowUpRecordDTO> page(PageFollowUpFormDTO formDTO) {
IPage<IcFollowUpRecordEntity> page = baseDao.selectPage( LambdaQueryWrapper<IcFollowUpRecordEntity> wrapper = new LambdaQueryWrapper<>();
getPage(params, FieldConstant.CREATED_TIME, false), wrapper.eq(StringUtils.isNotBlank(formDTO.getIdCard()),IcFollowUpRecordEntity::getIdCard,formDTO.getIdCard())
getWrapper(params) .eq(StringUtils.isNotBlank(formDTO.getName()),IcFollowUpRecordEntity::getName,formDTO.getName())
); .eq(IcFollowUpRecordEntity::getOrigin,formDTO.getOrigin())
return getPageData(page, IcFollowUpRecordDTO.class); .eq(IcFollowUpRecordEntity::getCustomerId,formDTO.getCustomerId())
.orderByDesc(IcFollowUpRecordEntity::getVisitTime);
PageInfo<IcFollowUpRecordEntity> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage())
.doSelectPageInfo(() -> baseDao.selectList(wrapper));
List<IcFollowUpRecordDTO> list=ConvertUtils.sourceToTarget(data.getList(),IcFollowUpRecordDTO.class);
return new PageData(list,data.getTotal());
} }
@Override @Override
@ -62,7 +79,12 @@ public class IcFollowUpRecordServiceImpl extends BaseServiceImpl<IcFollowUpRecor
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(IcFollowUpRecordDTO dto) { public void save(IcFollowUpRecordDTO dto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), dto.getCreatedBy());
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
IcFollowUpRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcFollowUpRecordEntity.class); IcFollowUpRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcFollowUpRecordEntity.class);
entity.setAgencyId(staffInfo.getAgencyId());
insert(entity); insert(entity);
} }

19
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatRelationServiceImpl.java

@ -0,0 +1,19 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.IcNatRelationDao;
import com.epmet.entity.IcNatRelationEntity;
import com.epmet.service.IcNatRelationService;
import org.springframework.stereotype.Service;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@Service
public class IcNatRelationServiceImpl extends BaseServiceImpl<IcNatRelationDao, IcNatRelationEntity> implements IcNatRelationService {
}

141
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

@ -2,6 +2,8 @@ package com.epmet.service.impl;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
@ -19,11 +21,14 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants; import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcNatDao; import com.epmet.dao.IcNatDao;
import com.epmet.dao.IcNatRelationDao;
import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dto.IcNatDTO; import com.epmet.dto.IcNatDTO;
import com.epmet.dto.IcNoticeDTO; import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.IcNatEntity; import com.epmet.entity.IcNatEntity;
import com.epmet.entity.IcNatRelationEntity;
import com.epmet.excel.data.IcNatImportExcelData; import com.epmet.excel.data.IcNatImportExcelData;
import com.epmet.excel.handler.IcNatExcelImportListener; import com.epmet.excel.handler.IcNatExcelImportListener;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -67,15 +72,16 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Autowired @Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired @Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired @Autowired
private IcNoticeService icNoticeService; private IcNoticeService icNoticeService;
@Autowired @Autowired
private OssFeignClient ossFeignClient; private OssFeignClient ossFeignClient;
@Autowired
private UserBaseInfoDao userBaseInfoDao;
@Autowired
private IcNatRelationDao icNatRelationDao;
/** /**
* @Author sun * @Author sun
@ -84,15 +90,27 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void add(AddIcNatFormDTO formDTO) { public void add(AddIcNatFormDTO formDTO) {
//0.先根据身份证号和检查时间以及检测结果校验数据是否存在
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult());
if (null != icNatDTO) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
}
//1.获取所填居民所属组织缓存信息 //1.获取所填居民所属组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
if (null == agencyInfo) { if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId())); throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
} }
//2.新增核酸记录表数据 //2.新增核酸基础信息数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
entity.setPids(agencyInfo.getPids()); if (StringUtils.isNotBlank(formDTO.getUserId())) {
entity.setIsResiUser("1");
}
insert(entity); insert(entity);
//3.核酸记录关系表新增与组织的关系数据
IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class);
relationEntity.setIcNatId(entity.getId());
relationEntity.setPids(StringUtils.isNotBlank(agencyInfo.getPids()) ? agencyInfo.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId());
icNatRelationDao.insert(relationEntity);
//3.新增通知表信息 //3.新增通知表信息
if (formDTO.getChannel().size() > NumConstant.ZERO) { if (formDTO.getChannel().size() > NumConstant.ZERO) {
@ -104,7 +122,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
dto.setChannel(formDTO.getChannel()); dto.setChannel(formDTO.getChannel());
dto.setOrigin("2"); dto.setOrigin("2");
dto.setContent(formDTO.getContent()); dto.setContent(formDTO.getContent());
dto.setOrgName(agencyInfo.getOrganizationName()); dto.setStaffId(formDTO.getStaffId());
icNoticeService.sendNotice(dto); icNoticeService.sendNotice(dto);
} }
@ -116,32 +134,44 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
**/ **/
@Override @Override
public List<MyNatListResultDTO> myNatList(MyNatListFormDTO formDTO) { public List<MyNatListResultDTO> myNatList(MyNatListFormDTO formDTO) {
//1.根据身份证号查询该人员所有核酸记录(居民端录入、数字平台录入、数字平台导入) //1.根据token信息查询居民身份证号
UserBaseInfoResultDTO dto = userBaseInfoDao.selectListByUserIdList(formDTO.getUserId());
if (null != dto) {
formDTO.setIdCard(dto.getIdNum());
}
//2.查询当前人员创建的或该身份证号录入的核算检测数据(居民端录入、数字平台录入、数字平台导入、数字平台同步的)
List<MyNatListResultDTO> resultList = baseDao.getMyNatList(formDTO); List<MyNatListResultDTO> resultList = baseDao.getMyNatList(formDTO);
return resultList; return resultList;
} }
/** /**
* @Author sun * @Author sun
* @Description 核酸核酸检测信息列表 * @Description 核酸本组织及下级核酸检测信息列表
* *
* @return*/ * @return*/
@Override @Override
public PageData<NatListResultDTO> natList(MyNatListFormDTO formDTO) { public PageData<NatListResultDTO> natList(MyNatListFormDTO formDTO) {
//1.根据orgType值判断是查询当前组织下还是整个客户下数据 //1.根据是查询客户数据还是本辖区数据走不同逻辑
if ("current".equals(formDTO.getOrgType())) { if ("current".equals(formDTO.getOrgType())) {
//获取工作人员缓存信息 //本辖区数据
//2.获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) { if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
} }
formDTO.setAgencyId(staffInfo.getAgencyId()); formDTO.setAgencyId(staffInfo.getAgencyId());
//3.按条件查询业务数据
PageInfo<NatListResultDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage())
.doSelectPageInfo(() -> baseDao.getNatList(formDTO));
return new PageData(data.getList(), data.getTotal());
} else if ("all".equals(formDTO.getOrgType())) {
//客户下数据
PageInfo<NatListResultDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage())
.doSelectPageInfo(() -> baseDao.getCustomerNatList(formDTO));
return new PageData(data.getList(), data.getTotal());
} }
//2.按条件查询业务数据 return new PageData(new ArrayList(), 0);
PageInfo<NatListResultDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.doSelectPageInfo(() -> baseDao.getNatList(formDTO));
return new PageData(data.getList(),data.getTotal());
} }
/** /**
@ -175,22 +205,22 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void edit(AddIcNatFormDTO formDTO) { public void edit(AddIcNatFormDTO formDTO) {
//1.更新核酸记录表数据 //0.先根据身份证号和检测时间以及检测结果校验除当前数据是否还存在相同数据
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult());
if (null != icNatDTO) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
}
//1.更新核酸记录基础信息表数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
entity.setId(formDTO.getIcNatId()); entity.setId(formDTO.getIcNatId());
if (!updateById(entity)) { if (!updateById(entity)) {
log.error(String.format("数据修改失败,核酸记录Id->%s", formDTO.getIcNatId())); log.error(String.format("数据修改失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "核酸记录修改失败"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "核酸记录修改失败");
} }
//修改只涉及到基础信息的修改 不会修改关系数据 关系表不涉及更新
//3.新增通知表信息 //3.新增通知表信息
if (CollectionUtils.isNotEmpty(formDTO.getChannel())) { if (CollectionUtils.isNotEmpty(formDTO.getChannel())) {
IcNatEntity icNatEntity = baseDao.selectById(formDTO.getIcNatId());
//1.获取所填居民所属组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(icNatEntity.getAgencyId());
if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", icNatEntity.getAgencyId()));
}
SendNoticeFormDTO dto = new SendNoticeFormDTO(); SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> userList = new ArrayList<>(); List<SendNoticeFormDTO.UserListBean> userList = new ArrayList<>();
userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class));
@ -199,7 +229,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
dto.setChannel(formDTO.getChannel()); dto.setChannel(formDTO.getChannel());
dto.setOrigin("2"); dto.setOrigin("2");
dto.setContent(formDTO.getContent()); dto.setContent(formDTO.getContent());
dto.setOrgName(agencyInfo.getOrganizationName()); dto.setStaffId(formDTO.getStaffId());
icNoticeService.sendNotice(dto); icNoticeService.sendNotice(dto);
} }
} }
@ -211,11 +241,13 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void del(MyNatListFormDTO formDTO) { public void del(MyNatListFormDTO formDTO) {
//1.物理删除业务数据 //1.确定删除则需要删除基础数据以及所有可能存在的关系数据,物理删除业务数据
if (baseDao.delById(formDTO.getIcNatId()) < NumConstant.ONE) { if (baseDao.delById(formDTO.getIcNatId()) < NumConstant.ONE) {
log.error(String.format("数据删除/取消同步失败,核酸记录Id->%s", formDTO.getIcNatId())); log.error(String.format("数据删除失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据操作失败"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据删除失败");
} }
//关系数据删除
icNatRelationDao.delRelation(formDTO.getIcNatId(), null);
} }
/** /**
@ -225,25 +257,46 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void synchro(MyNatListFormDTO formDTO) { public void synchro(MyNatListFormDTO formDTO) {
//1.检验核酸基础信息是否存在
IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId());
if (null == entity) {
log.error(String.format("核酸记录数据不存在同步失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,核酸记录数据不存在");
}
//获取工作人员缓存数据
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
//2.不管是否已存在关系数据都是先删后增
icNatRelationDao.delRelation(formDTO.getIcNatId(), staffInfo.getAgencyId());
//3.新增关系数据
IcNatRelationEntity relationEntity = new IcNatRelationEntity();
relationEntity.setCustomerId(formDTO.getCustomerId());
relationEntity.setIcNatId(formDTO.getIcNatId());
relationEntity.setAgencyId(staffInfo.getAgencyId());
relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds())?staffInfo.getAgencyPIds()+":"+formDTO.getAgencyId():staffInfo.getAgencyId());
relationEntity.setUserType("synchro");
icNatRelationDao.insert(relationEntity);
}
/**
* @Author sun
* @Description 核酸核酸检测信息取消同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void cancelSynchro(MyNatListFormDTO formDTO) {
//1.获取工作人员缓存数据 //1.获取工作人员缓存数据
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) { if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
} }
//1.根据核酸记录Id查询业务数据并进行必要校验 //1.物理删除关系数据
IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId()); if (icNatRelationDao.delRelation(formDTO.getIcNatId(), staffInfo.getAgencyId()) < NumConstant.ONE) {
if (null == entity || staffInfo.getAgencyId().equals(entity.getAgencyId()) log.error(String.format("数据取消同步失败,核酸记录Id->%s", formDTO.getIcNatId()));
|| (!"import".equals(entity.getUserType()) && !"synchro".equals(entity.getUserType()))) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消同步操作失败");
log.error(String.format("数据同步失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,不是导入数据或非本组织数据");
} }
//3.待同步组织新增业务数据
entity.setId("");
entity.setAgencyId(staffInfo.getAgencyId());
entity.setPids(staffInfo.getAgencyPIds());
entity.setUserType("synchro");
insert(entity);
} }
@Async @Async
@ -340,8 +393,9 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
* @Date 2022/3/29 16:29 * @Date 2022/3/29 16:29
*/ */
@Override @Override
public List<NatListDTO> getNatList(String idCard) { public List<NatListDTO> getNatList(String customerId, String idCard) {
LambdaQueryWrapper<IcNatEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcNatEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNatEntity::getCustomerId, customerId);
wrapper.eq(IcNatEntity::getIdCard, idCard); wrapper.eq(IcNatEntity::getIdCard, idCard);
wrapper.orderByDesc(IcNatEntity::getNatTime); wrapper.orderByDesc(IcNatEntity::getNatTime);
List<IcNatEntity> list = baseDao.selectList(wrapper); List<IcNatEntity> list = baseDao.selectList(wrapper);
@ -372,6 +426,13 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
* @param entities * @param entities
*/ */
public void batchPersist(List<IcNatEntity> entities) { public void batchPersist(List<IcNatEntity> entities) {
insertBatch(entities); //insertBatch(entities);
String currentUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
entities.forEach(e -> {
String id = IdWorker.getIdStr(e);
e.setId(id);
e.setUpdatedBy(currentUserId);
baseDao.insertOrUpdate(e);
});
} }
} }

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

Loading…
Cancel
Save