Browse Source

Merge branch 'develop' into release_temp

master
sunyuchao 3 years ago
parent
commit
f2ec772b8d
  1. 27
      epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java
  2. 20
      epmet-commons/epmet-commons-tools/pom.xml
  3. 57
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java
  4. 87
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java
  5. 41
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java
  6. 6
      epmet-module/data-report/data-report-server/pom.xml
  7. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java
  8. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  9. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  10. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  11. 4
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java
  12. 4
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java
  13. 4
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  14. 9
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java
  15. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java
  16. 13
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java
  17. 8
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java
  18. 6
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java
  19. 131
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java
  20. 89
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java
  21. 139
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java
  22. 109
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java
  23. 109
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiVaccineDTO.java
  24. 125
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java
  25. 97
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java
  26. 35
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java
  27. 21
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java
  28. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java
  29. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java
  30. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LatestSubmitCollectFormDTO.java
  31. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java
  32. 65
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java
  33. 52
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java
  34. 105
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java
  35. 63
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java
  36. 30
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java
  37. 66
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java
  38. 82
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java
  39. 70
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyNatListResultDTO.java
  40. 88
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java
  41. 67
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java
  42. 1
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  43. 1
      epmet-user/epmet-user-server/deploy/docker-compose-prod.yml
  44. 1
      epmet-user/epmet-user-server/deploy/docker-compose-test.yml
  45. 19
      epmet-user/epmet-user-server/pom.xml
  46. 134
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
  47. 72
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java
  48. 281
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  49. 81
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java
  50. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
  51. 73
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java
  52. 72
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
  53. 55
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
  54. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java
  55. 39
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  56. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java
  57. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java
  58. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java
  59. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiVaccineDao.java
  60. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java
  61. 79
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java
  62. 59
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java
  63. 97
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java
  64. 60
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java
  65. 79
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiVaccineEntity.java
  66. 94
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java
  67. 60
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcFollowUpRecordExcel.java
  68. 81
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java
  69. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java
  70. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java
  71. 61
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java
  72. 126
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java
  73. 114
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java
  74. 78
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java
  75. 71
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  76. 99
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java
  77. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java
  78. 78
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java
  79. 78
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java
  80. 219
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  81. 83
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java
  82. 354
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  83. 205
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java
  84. 93
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
  85. 83
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java
  86. 83
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java
  87. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
  88. 214
      epmet-user/epmet-user-server/src/main/java/com/epmet/util/MySequence.java
  89. 3
      epmet-user/epmet-user-server/src/main/resources/bootstrap.yml
  90. 47
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.27__ic_nat.sql
  91. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx
  92. 95
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml
  93. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml
  94. 70
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml
  95. 23
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml
  96. 32
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml
  97. 17
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml
  98. 28
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml
  99. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml
  100. 17
      epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java

27
epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java

@ -1,29 +1,38 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* <p>
* https://www.renren.io
*
* <p>
* 版权所有侵权必究
*/
package com.epmet.commons.mybatis.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.epmet.commons.mybatis.interceptor.DataFilterInterceptor;
import com.epmet.commons.tools.redis.RedisUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import java.util.Random;
/**
* mybatis-plus配置
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Slf4j
@Configuration
public class MybatisPlusConfig {
@Autowired
private RedisUtils redisUtils;
/**
* 配置数据权限
@ -45,4 +54,18 @@ public class MybatisPlusConfig {
return interceptor;
}
/**
* id生成器指定2个参数 防止id重复
*/
@Bean
@Order(0)
public DefaultIdentifierGenerator myIdentifierGenerator() {
Random random = new Random();
int workerId = random.nextInt(30) + 1;
int dataCenterId = random.nextInt(30) + 1;
DefaultIdentifierGenerator interceptor = new DefaultIdentifierGenerator(workerId, dataCenterId);
log.info("workerId:{},dataCenterId:{}", workerId, dataCenterId);
return interceptor;
}
}

20
epmet-commons/epmet-commons-tools/pom.xml

@ -24,6 +24,7 @@
<gson.version>2.8.6</gson.version>
<jsoup.version>1.11.3</jsoup.version>
<lombok.version>1.18.4</lombok.version>
<easyexcel.version>3.0.3</easyexcel.version>
</properties>
<dependencies>
@ -177,6 +178,25 @@
<artifactId>javase</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>${easyexcel.version}</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>

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

@ -0,0 +1,57 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.exception.EpmetErrorCode;
/**
* @author Administrator
*/
public enum ChannelEnum {
//通知渠道 0小程序通知,1短信通知
APP("0", "小程序通知"),
MESSAGE("1", "短信通知"),
ALL("2", "小程序通知,短信通知");
private String code;
private String name;
ChannelEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
ChannelEnum[] houseTypeEnums = values();
for (ChannelEnum houseTypeEnum : houseTypeEnums) {
if (houseTypeEnum.getCode() == code) {
return houseTypeEnum.getName();
}
}
return EpmetErrorCode.SERVER_ERROR.getMsg();
}
public static String getCode(String name) {
ChannelEnum[] houseTypeEnums = values();
for (ChannelEnum houseTypeEnum : houseTypeEnums) {
if (houseTypeEnum.getName().equals(name)) {
return houseTypeEnum.getCode();
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

87
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java

@ -1,11 +1,9 @@
package com.epmet.commons.tools.security.user;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.utils.HttpContextUtils;
import org.apache.commons.lang3.StringUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
@ -14,24 +12,21 @@ import java.util.List;
@Component
public class LoginUserUtil {
//@Autowired
//private
/**
* 查询登录用户的id
* @return
*/
public String getLoginUserId() {
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
if (request == null) {
return null;
}
String userId = request.getHeader(AppClientConstant.USER_ID);
if (StringUtils.isBlank(userId)) {
return null;
}
return userId;
//HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
//if (request == null) {
// return null;
//}
//
//String userId = request.getHeader(AppClientConstant.USER_ID);
//if (StringUtils.isBlank(userId)) {
// return null;
//}
return EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
}
/**
@ -39,16 +34,16 @@ public class LoginUserUtil {
* @return
*/
public String getLoginUserApp() {
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
if (request == null) {
return null;
}
String app = request.getHeader(AppClientConstant.APP);
if (StringUtils.isBlank(app)) {
return null;
}
return app;
//HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
//if (request == null) {
// return null;
//}
//
//String app = request.getHeader(AppClientConstant.APP);
//if (StringUtils.isBlank(app)) {
// return null;
//}
return EpmetRequestHolder.getHeader(AppClientConstant.APP);
}
/**
@ -56,16 +51,16 @@ public class LoginUserUtil {
* @return
*/
public String getLoginUserClient() {
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
if (request == null) {
return null;
}
String client = request.getHeader(AppClientConstant.CLIENT);
if (StringUtils.isBlank(client)) {
return null;
}
return client;
//HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
//if (request == null) {
// return null;
//}
//
//String client = request.getHeader(AppClientConstant.CLIENT);
//if (StringUtils.isBlank(client)) {
// return null;
//}
return EpmetRequestHolder.getHeader(AppClientConstant.CLIENT);
}
/**
@ -73,16 +68,16 @@ public class LoginUserUtil {
* @return
*/
public String getLoginUserCustomerId() {
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
if (request == null) {
return null;
}
String client = request.getHeader(AppClientConstant.CUSTOMER_ID);
if (StringUtils.isBlank(client)) {
return null;
}
return client;
//HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
//if (request == null) {
// return null;
//}
//
//String client = request.getHeader(AppClientConstant.CUSTOMER_ID);
//if (StringUtils.isBlank(client)) {
// return null;
//}
return EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID);
}
/**

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

@ -15,6 +15,47 @@ import java.nio.file.Paths;
@Slf4j
public class FileUtils {
/**
* epmet文件根路径
*/
private static Path epmetFilePath;
static {
// linux || mac
epmetFilePath = Paths.get("/opt/epmet_files");
// windows
}
/**
* 获取在epmetfiles下的文件路径,输入相对路径即可获取完整绝对路径
* @param pathParts 目录片段可以是文件夹或者文件名
* @return
*/
public static Path getPathUnderEpmetFilesDir(String... pathParts) {
Path path;
if (pathParts == null || pathParts.length == 0) {
path = epmetFilePath.resolve("temp");
} else {
path = Paths.get(epmetFilePath.toString(), pathParts);
}
return path;
}
/**
* 创建并且返回epmet_files下的文件夹
* @param dirParts 文件夹列表
* @return
* @throws IOException
*/
public static Path getAndCreateDirUnderEpmetFilesDir(String... dirParts) throws IOException {
Path pathUnderEpmetFilesDir = getPathUnderEpmetFilesDir(dirParts);
if (Files.notExists(pathUnderEpmetFilesDir)) {
Files.createDirectories(pathUnderEpmetFilesDir);
}
return pathUnderEpmetFilesDir;
}
/**
* 创建临时文件
*

6
epmet-module/data-report/data-report-server/pom.xml

@ -100,12 +100,6 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java

@ -39,15 +39,15 @@ public class ScreenExtractDailyController {
*/
@PostMapping("extractdailyall")
public Result screenExtractDaily(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
executorService.submit(() -> {
log.info("screenExtractDaily start,param:{}", JSON.toJSONString(extractOriginFormDTO));
try {
screenExtractService.extractDailyAll(extractOriginFormDTO);
log.info("screenExtractDaily end");
} catch (Exception e) {
log.error("screenExtractDaily exception", e);
}
});
log.info("screenExtractDaily start,param:{}", JSON.toJSONString(extractOriginFormDTO));
try {
screenExtractService.extractDailyAll(extractOriginFormDTO);
log.info("screenExtractDaily end");
} catch (Exception e) {
log.error("screenExtractDaily exception", e);
}
return new Result();
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -342,7 +342,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
}
log.info("===== extractDaily method end customerId:{}======",customerId);
} catch (Exception e) {
log.error("extractDaily exception msg:{}", e);
log.error("extractDaily exception msg", e);
} finally {
distributedLock.unLock(lock);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java

@ -306,7 +306,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
*/
@Override
public List<ScreenProjectDataDTO> getProjectList(String customerId, List<String> projectId, Integer pageNo, Integer pageSize) {
PageHelper.startPage(pageNo, pageSize);
PageHelper.startPage(pageNo, pageSize, false);
return baseDao.selectProjectList(customerId, projectId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

@ -28,6 +28,7 @@ spring:
url: @datasource.druid.stats.url@
username: @datasource.druid.stats.username@
password: @datasource.druid.stats.password@
max-active: 100
cloud:
nacos:
discovery:
@ -173,6 +174,7 @@ dynamic:
url: @datasource.druid.evaluationIndex.url@
username: @datasource.druid.evaluationIndex.username@
password: @datasource.druid.evaluationIndex.password@
max-active: 100
partyMember:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.partyMember.url@

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

@ -15,6 +15,10 @@ public interface ImportTaskConstants {
String BIZ_TYPE_COMMUNITY_SELF_ORG = "community_self_org";
String BIZ_TYPE_PARTY_UNIT = "party_unit";
String BIZ_TYPE_PARTY_ACTIVITY = "party_activity";
/**
* 核酸检测
*/
String BIZ_TYPE_IC_NAT = "ic_nat";
/**
* 处理状态处理中

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

@ -2,10 +2,14 @@ package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.validator.group.QueryGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ImportTaskCommonFormDTO extends PageFormDTO {

4
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java

@ -164,6 +164,10 @@ public interface UserMessageTypeConstant {
*/
String PROJECT_REMIND="project_remind";
/**
* 防疫通知
*/
String ANTIEPIDEMIC="antiepidemic";
/**

9
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java

@ -6,6 +6,8 @@ import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
@ -77,10 +79,6 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr
if (!StrConstant.PY_CUSTOMER.equals(msgObj.getCustomerId())) {
return;
}
if (msgObj == null) {
log.warn("consumeMessage msg body is blank");
return;
}
RLock lock = null;
try {
lock = distributedLock.getLock(String.format("lock:open_data_patrol:%s:%s",tags, msgObj.getObjectId()),
@ -104,6 +102,9 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr
log.error("错误的消息类型:{}", tags);
}
if (aBoolean == null || !aBoolean){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"消费失败!");
}
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试

2
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java

@ -72,8 +72,10 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
@Override
public void getEventinfo(EventInfoFormDTO formDTO) {
formDTO.setPageSize(1000);
long start = System.currentTimeMillis();
Result<List<EventInfoResultDTO>> result = dataStatisticalOpenFeignClient.getEventInfo(formDTO);
if (!result.success()) {
log.error("getEventinfo cost:{}ms",System.currentTimeMillis()-start);
throw new RenException(result.getInternalMsg());
}
Map<String, Integer> deptMap = exDeptService.getDeptDTOMap();

13
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java

@ -71,12 +71,8 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl<UserPatrolRecor
}
List<MidPatrolRecordResult> data = record.getData();
if (CollectionUtils.isEmpty(data)) {
//数据已被删除了
//暂时设置error 用于排错
log.error("insertPatrolRecord获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
int effectRow = baseDao.deleteById(patrolRecordForm.getId());
log.warn("del effectRow:{}", effectRow);
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
//数据还未被插入
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"获取巡查记录返回为空,param:"+ JSON.toJSONString(midPatrolFormDTO));
}
List<UserPatrolRecordEntity> insertList = new ArrayList<>();
data.forEach(o-> insertList.add(buildEntity(o)));
@ -103,10 +99,7 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl<UserPatrolRecor
if (CollectionUtils.isEmpty(data)) {
//数据已被删除了
//暂时设置error 用于排错
log.error("updatePatrolRecord 获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
int effectRow = baseDao.deleteById(patrolRecordForm.getId());
log.warn("del effectRow:{}", effectRow);
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"获取巡查记录返回为空,param:"+ JSON.toJSONString(midPatrolFormDTO));
}
data.forEach(o->{
UserPatrolRecordEntity recordEntity = buildEntity(o);

8
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java

@ -45,4 +45,12 @@ public class InitInfoResultDTO implements Serializable {
* 身份证号
*/
private String idNum;
/**
* 姓名
*/
private String realName;
/**
* 手机号
*/
private String mobile;
}

6
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java

@ -28,8 +28,8 @@ public class PersonalCenterServiceImpl implements PersonalCenterService {
@Override
public InitInfoResultDTO initInfo(TokenDto tokenDto) {
Result<ResiUserBaseInfoResultDTO> baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto);
if (!baseInfoResult.success()) {
Result<ResiUserBaseInfoResultDTO> baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto);
if (!baseInfoResult.success() || null == baseInfoResult.getData()) {
throw new RenException(baseInfoResult.getCode(), baseInfoResult.getMsg());
}
InitInfoResultDTO resultDTO = new InitInfoResultDTO();
@ -41,6 +41,8 @@ public class PersonalCenterServiceImpl implements PersonalCenterService {
resultDTO.setBuildingAddress(baseInfoResult.getData().getBuildingAddress());
resultDTO.setNickname(baseInfoResult.getData().getNickname());
resultDTO.setIdNum(baseInfoResult.getData().getIdNum());
resultDTO.setMobile(baseInfoResult.getData().getMobile());
resultDTO.setRealName(baseInfoResult.getData().getRealName());
return resultDTO;
}

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

@ -0,0 +1,131 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 疫情特别关注
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Data
public class IcEpidemicSpecialAttentionDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface IcEpidemicSpecialAttentionUpdate{}
public interface IcEpidemicSpecialAttentionAdd{}
/**
* ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 当前工作人员所属组织ID
*/
private String orgId;
/**
* 组织ID上级
*/
private String pid;
/**
* 组织ID所有上级
*/
private String pids;
/**
* 是否关注 1关注0取消关注
*/
private Integer isAttention;
/**
* 关注类型核酸检测2疫苗接种1
*/
@NotNull(message = "attentionType不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class})
private Integer attentionType;
/**
* 姓名
*/
@NotBlank(message = "name不能为空",groups = IcEpidemicSpecialAttentionAdd.class)
private String name;
/**
* 手机号
*/
@NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttentionAdd.class)
private String mobile;
/**
* 身份证号
*/
@NotBlank(message = "idCard不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class})
private String idCard;
/**
* 原因
*/
private String reason;
/**
* 备注
*/
private String remark;
/**
*
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 通知渠道 0小程序通知1短信通知
*/
private List<String> channel;
/**
* 通知内容
*/
private String content;
}

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

@ -0,0 +1,89 @@
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-25
*/
@Data
public class IcFollowUpRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 0行程上报1疫苗接种2核酸检测
*/
private String origin;
/**
* 随访时间
*/
private Date visitTime;
/**
* 随访内容
*/
private String content;
/**
* 删除标识 1删除0未删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -0,0 +1,139 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
* 核酸上报记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Data
public class IcNatDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户Id CUSTOMER.id
*/
private String customerId;
/**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id
*/
private String agencyId;
/**
* 组织pids
*/
private String pids;
/**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值
*/
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;导入的import;同步的synchro
*/
private String userType;
/**
* 人员姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 检测时间精确到分钟
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date natTime;
/**
* 检测结果(0:阴性 1:阳性)
*/
private String natResult;
/**
* 检测地点
*/
private String natAddress;
/**
* 文件名
*/
private String fileName;
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
/**
* 删除标识
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 通知渠道 0小程序通知1短信通知多选是数组
*/
private List<String> channel = new ArrayList<>();
/**
* 通知内容
*/
private String content = "";
}

109
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java

@ -0,0 +1,109 @@
package com.epmet.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 防疫通知
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Data
public class IcNoticeDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
@JsonIgnore
private String id;
/**
* 客户Id customer.id
*/
@JsonIgnore
private String customerId;
/**
* 通知渠道 0小程序通知1短信通知
*/
private String channel;
private List<String> channelList;
/**
* 通知来源 0行程上报1疫苗接种2核酸检测
*/
@JsonIgnore
private String origin;
/**
* 用户ID
*/
@JsonIgnore
private String userId;
/**
* 手机号
*/
@JsonIgnore
private String mobile;
/**
* 被通知人身份证号
*/
@JsonIgnore
private String idCard;
/**
* 通知内容
*/
private String content;
/**
* 发送通知的社区
*/
private String orgName;
/**
* 删除标识0.未删除 1.已删除
*/
@JsonIgnore
private Integer delFlag;
/**
* 乐观锁
*/
@JsonIgnore
private Integer revision;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
}

109
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiVaccineDTO.java

@ -0,0 +1,109 @@
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-28
*/
@Data
public class IcResiVaccineDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 接种时间
*/
private Date inoculateTime;
/**
* 接种地点
*/
private String inoculateAddress;
/**
* 疫苗厂家
*/
private String manufacturer;
/**
* 预留字段1
*/
private String field1;
/**
* 预留字段2
*/
private String field2;
/**
* 预留字段3
*/
private String field3;
/**
* 备注
*/
private String remaek;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -0,0 +1,125 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 行程上报信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Data
public class IcTripReportRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 用户id
*/
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
*/
private String userType;
/**
* 现居地编码
*/
private String presentAddressCode;
/**
* 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区
*/
private String presentAddress;
/**
* 详细地址
*/
private String detailAddress;
/**
* 来源地区编码
*/
private String sourceAddressCode;
/**
* 来源地区地址
*/
private String sourceAddress;
/**
* 到达日期
*/
private Date arriveDate;
/**
* 离开日期
*/
private Date leaveDate;
/**
* 备注信息
*/
private String remark;
/**
* 删除标识 1删除0未删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -0,0 +1,97 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @Description 核酸检测-上报核酸记录
* @Author sun
*/
@Data
public class AddIcNatFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
public interface Nat extends CustomerClientShowGroup {
}
/**
* 核酸记录Id,修改时使用
*/
private String icNatId;
/**
* 当前网格所属组织Id
*/
@NotBlank(message = "组织Id不能为空", groups = Nat.class)
private String agencyId;
/**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值
*/
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
*/
@NotBlank(message = "居民来源不能为空", groups = Nat.class)
private String userType;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空", groups = Nat.class)
private String name;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空", groups = Nat.class)
private String mobile;
/**
* 身份证号
*/
@NotBlank(message = "身份证号不能为空", groups = Nat.class)
private String idCard;
/**
* 检测时间
*/
//@NotBlank(message = "检测时间不能为空", groups = Nat.class)
@JsonFormat(pattern="yyyy-MM-dd HH:mm")
private Date natTime;
/**
* 检测结果
*/
private String natResult;
/**
* 检测地点
*/
private String natAddress;
/**
* 文件名
*/
private String fileName;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 通知渠道 0小程序通知1短信通知多选是数组
*/
private List<String> channel = new ArrayList<>();
/**
* 通知内容
*/
private String content = "";
//token中信息
private String customerId;
}

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

@ -0,0 +1,35 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/3/28 16:48
* @DESC
*/
@Data
public class CancelAttentionPackageFormDTO implements Serializable {
private static final long serialVersionUID = 2198470055930997870L;
public interface CancelAttentionPackageForm{}
/**
* 身份证
*/
@NotNull(message = "idCard不能为空",groups = CancelAttentionPackageForm.class)
private List<String> idCards;
/**
* 关注类型核酸检测2疫苗接种1
*/
@NotNull(message = "attentionType不能为空",groups = CancelAttentionPackageForm.class)
private Integer attentionType ;
}

21
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/28 16:13
*/
@Data
public class IcNoticeFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 7392894573654015338L;
private String customerId;
@NotBlank(message = "身份证号不能为空", groups = DefaultGroup.class)
private String idCard;
}

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java

@ -82,9 +82,9 @@ public class IcResiCollectFormDTO implements Serializable {
private String address;
/**
* 1自0租住
* 1自0租住
*/
@NotBlank(message = "房子属于自由还是组织?", groups = {InternalShowGroup.class, ExternalShowGroup.class})
@NotBlank(message = "房子属于自有还是租住?", groups = {InternalShowGroup.class, ExternalShowGroup.class})
private String houseType;
/**

10
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java

@ -2,6 +2,7 @@ package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -17,13 +18,13 @@ public class IcResiCollectMemFormDTO implements Serializable {
/**
* 居住成员1姓名
*/
// @NotBlank(message = "姓名不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
@NotBlank(message = "姓名不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String name;
/**
* 居住成员1身份证号
*/
// @NotBlank(message = "身份证号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
@NotBlank(message = "身份证号不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String idNum;
/**
@ -43,4 +44,9 @@ public class IcResiCollectMemFormDTO implements Serializable {
*/
// @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private Integer ymjz;
/**
* 社区居民信息登记-查询返参用
*/
private String id;
}

22
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LatestSubmitCollectFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 社区居民信息登记-查询
*/
@Data
public class LatestSubmitCollectFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
@NotBlank(message = "gridId不能为空", groups = AddUserInternalGroup.class)
private String gridId;
}

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java

@ -1,8 +1,12 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginUserDetailsFormDTO {
private String app;
private String client;

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

@ -0,0 +1,65 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description 核酸检测-我的上报记录
* @Author sun
*/
@Data
public class MyNatListFormDTO extends PageFormDTO {
private static final long serialVersionUID = 9156247659994638103L;
public interface MyNat extends CustomerClientShowGroup {
}
public interface Detail extends CustomerClientShowGroup {
}
public interface Del extends CustomerClientShowGroup {
}
public interface Synchro extends CustomerClientShowGroup {
}
/**
* 身份证号
*/
@NotBlank(message = "身份证号不能为空", groups = MyNat.class)
private String idCard;
/**
* 当前组织:current 根组织all
*/
private String orgType;
private String agencyId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 检测开始时间yyyy-MM-dd HH:mm
*/
private String startTime;
/**
* 检测结束时间yyyy-MM-dd HH:mm间yy-mm-dd
*/
private String endTime;
/**
* 核酸记录Id
*/
@NotBlank(message = "核酸记录Id不能为空", groups = { Detail.class, Del.class, Synchro.class})
private String icNatId;
/**
* token里设置
*/
private String customerId;
private String userId;
}

52
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java

@ -0,0 +1,52 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/28 10:30
* @DESC
*/
@Data
public class NatListFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -498378123902522370L;
/**
* 手机号
*/
private String mobile;
/**
* 名字
*/
private String name;
/**
* 身份证
*/
private String idCard;
/**
* 关注原因
*/
private String reason;
/**
* 备注
*/
private String remark;
private String userId;
private String customerId;
/**
* user所属组织ID
*/
private String orgId;
}

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

@ -0,0 +1,105 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* 社区居民信息登记-提交 入参
*/
@Data
public class ResiCollectFormDTO implements Serializable {
private static final long serialVersionUID = -4026681095438180447L;
public interface AddUserInternalGroup {
}
public interface InternalShowGroup extends CustomerClientShowGroup {
}
/**
* 客户Id customer.id
*/
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
/**
* 网格ID_后端接口赋值
*/
@NotBlank(message = "gridId不能为空", groups = AddUserInternalGroup.class)
private String gridId;
/**
* 组织Id_后端接口赋值
*/
@NotBlank(message = "agencyId不能为空", groups = AddUserInternalGroup.class)
private String agencyId;
/**
* 组织的pid_后端接口赋值
*/
private String pids;
/**
* 所属小区ID
*/
@NotBlank(message = "小区不能为空", groups = InternalShowGroup.class)
private String villageId;
/**
* 所属楼宇Id
*/
@NotBlank(message = "楼栋不能为空", groups = InternalShowGroup.class)
private String buildId;
/**
* 单元id
*/
@NotBlank(message = "单元不能为空", groups = InternalShowGroup.class)
private String unitId;
/**
* 所属家庭Id
*/
@NotBlank(message = "家庭不能为空", groups = InternalShowGroup.class)
private String homeId;
/**
* 详细地址
*/
@NotBlank(message = "家庭地址不能为空", groups = {InternalShowGroup.class})
private String address;
/**
* 1自有0租住
*/
@NotBlank(message = "房子属于自有还是租住?", groups = {InternalShowGroup.class})
private String houseType;
/**
* 户主姓名
*/
@NotBlank(message = "户主姓名不能为空", groups = {InternalShowGroup.class})
private String houseHolderName;
/**
* 居住成员人数
*/
@NotNull(message = "居住成员人数不能为空", groups = {InternalShowGroup.class})
private Integer totalResi;
@Valid
@NotEmpty(message = "成员信息不能为空", groups = {InternalShowGroup.class})
private List<IcResiCollectMemFormDTO> memberList;
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
}

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

@ -0,0 +1,63 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/28 14:14
*/
@NoArgsConstructor
@Data
public class SendNoticeFormDTO implements Serializable {
private static final long serialVersionUID = 4800907725063604885L;
private String customerId;
/**
* 用户列表
*/
@NotNull(message = "用户列表不能为空", groups = DefaultGroup.class)
private List<UserListBean> userList;
/**
* 通知渠道通知渠道 0小程序通知1短信通知
*/
@NotNull(message = "通知渠道不能为空", groups = DefaultGroup.class)
private List<String> channel;
/**
* 通知来源 0 行程上报1 疫苗接种2 核酸检测
*/
@NotNull(message = "通知来源不能为空", groups = DefaultGroup.class)
private String origin;
/**
* 通知内容
*/
@NotNull(message = "通知内容不能为空", groups = DefaultGroup.class)
private String content;
/**
* 组织名
*/
@NotNull(message = "组织名不能为空", groups = DefaultGroup.class)
private String orgName;
@NoArgsConstructor
@Data
public static class UserListBean {
/**
* 用户ID
*/
private String userId;
/**
* 手机号
*/
private String mobile;
/**
* 身份证
*/
private String idCard;
}
}

30
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.form;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/3/28 10:46
* @DESC
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VaccinationAddFormDTO implements Serializable {
private static final long serialVersionUID = -4786942219804246138L;
@Valid
private List<IcEpidemicSpecialAttentionDTO> list;
private String userId;
private String customerId;
}

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

@ -0,0 +1,66 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/28 10:30
* @DESC
*/
@Data
public class VaccinationListFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -498378993902522370L;
public interface VaccinationListForm{}
/**
* 关注类型核酸检测2疫苗接种1
*/
@NotNull(message = "attentionType不能为空",groups = VaccinationListForm.class)
private Integer attentionType;
/**
* 手机号
*/
private String mobile;
/**
* 名字
*/
private String name;
/**
* 身份证
*/
private String idCard;
/**
* 疫苗接种次数疫苗接种关注名单此字段可填可不填
*/
private Integer vaccinationCount;
/**
* 原因核酸检测关注名单此字段可填可不填
*/
private String reason;
/**
* 备注核酸检测关注名单此字段可填可不填
*/
private String remark;
private String userId;
private String customerId;
/**
* user所属组织ID
*/
private String orgId;
}

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

@ -0,0 +1,82 @@
package com.epmet.dto.result;
import com.epmet.dto.form.IcResiCollectMemFormDTO;
import lombok.Data;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 社区居民信息登记-返参
*/
@Data
public class LatestCollectResDTO implements Serializable {
private String resiCollectId;
private String agencyId;
private String agencyName;
private String pids;
private String gridId;
private String customerId;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 详细地址
*/
private String address;
/**
* 1自有0租住
*/
private String houseType;
/**
* 户主姓名
*/
private String houseHolderName;
/**
* 居住成员人数
*/
private Integer totalResi;
@Valid
private List<IcResiCollectMemFormDTO> memberList;
public LatestCollectResDTO() {
this.resiCollectId = "";
this.agencyId = "";
this.agencyName = "";
this.pids = "";
this.gridId = "";
this.customerId = "";
this.villageId = "";
this.buildId = "";
this.unitId="";
this.homeId="";
this.address="";
this.houseType="";
this.houseHolderName="";
this.totalResi=0;
this.memberList=new ArrayList<>();
}
}

70
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyNatListResultDTO.java

@ -0,0 +1,70 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 核酸检测-我的上报记录
* @Author sun
*/
@Data
public class MyNatListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 核酸记录Id
*/
private String icNatId;
/**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值
*/
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
*/
private String userType;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 检测时间,yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date natTime;
/**
* 检测结果
*/
private String natResult;
/**
* 检测地点
*/
private String natAddress;
/**
* 附件名
*/
private String fileName;
/**
* 附件地址
*/
private String attachmentUrl;
}

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

@ -0,0 +1,88 @@
package com.epmet.dto.result;
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 lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 核酸检测-我的上报记录
* @Author sun
*/
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44)
@Data
public class NatListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 核酸记录Id
*/
@ExcelIgnore
private String icNatId;
/**
* 组织Id
*/
@ExcelIgnore
private String agencyId;
/**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值
*/
@ExcelIgnore
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
*/
@ExcelIgnore
private String userType;
/**
* 姓名
*/
@ColumnWidth(20)
@ExcelProperty("姓名")
private String name;
/**
* 手机号
*/
@ColumnWidth(20)
@ExcelProperty("手机号")
private String mobile;
/**
* 身份证号
*/
@ColumnWidth(25)
@ExcelProperty("身份证号")
private String idCard;
/**
* 检测时间,yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
@ColumnWidth(25)
@ExcelProperty("检测时间")
private Date natTime;
/**
* 检测结果
*/
@ColumnWidth(20)
@ExcelProperty("检测结果")
private String natResult;
/**
* 检测地点
*/
@ColumnWidth(30)
@ExcelProperty("检测地点")
private String natAddress;
}

67
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java

@ -0,0 +1,67 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/28 14:14
* @DESC
*/
@Data
public class VaccinationListResultDTO implements Serializable {
private static final long serialVersionUID = -4368151917259903449L;
/**
* 排序
*/
private Integer sort;
/**
* 接种针次
*/
private Integer vaccinationCount;
/**
* 姓名
*/
private String name;
/**
* 电话
*/
private String mobile;
/**
* 身份证
*/
private String idCard;
/**
* 备注
*/
private String remark;
/**
* 原因
*/
private String reason;
/**
* 最后一次通知时间
*/
private String lastInformTime;
public VaccinationListResultDTO() {
this.vaccinationCount = NumConstant.ZERO;
this.name = "";
this.mobile = "";
this.idCard = "";
this.remark = "";
this.lastInformTime = "";
this.reason = "";
}
}

1
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -8,6 +8,7 @@ services:
network_mode: host # 不会创建新的网络
volumes:
- "/opt/epmet-cloud-logs/dev:/logs"
- "/opt/epmet_files/:/opt/epmet_files"
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-user.jar"
restart: "unless-stopped"

1
epmet-user/epmet-user-server/deploy/docker-compose-prod.yml

@ -8,6 +8,7 @@ services:
network_mode: host # 不会创建新的网络
volumes:
- "/opt/epmet-cloud-logs/prod:/logs"
- "/opt/epmet_files/:/opt/epmet_files"
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./epmet-user.jar"
restart: "unless-stopped"

1
epmet-user/epmet-user-server/deploy/docker-compose-test.yml

@ -8,6 +8,7 @@ services:
network_mode: host # 不会创建新的网络
volumes:
- "/opt/epmet-cloud-logs/test:/logs"
- "/opt/epmet_files/:/opt/epmet_files"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./epmet-user.jar"
restart: "unless-stopped"

19
epmet-user/epmet-user-server/pom.xml

@ -18,25 +18,6 @@
<artifactId>epmet-admin-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.3</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>

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

@ -0,0 +1,134 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.*;
import com.epmet.excel.NatExportExcel;
import com.epmet.excel.UserResiRegisterVisitExcel;
import com.epmet.excel.VaccinationExportExcel;
import com.epmet.service.IcEpidemicSpecialAttentionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
/**
* 疫情特别关注
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@RestController
@RequestMapping("icEpidemicSpecialAttention")
public class IcEpidemicSpecialAttentionController {
@Autowired
private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService;
/**
* Desc: 疫苗接种关注名单疫苗接种关注名单列表
* @param formDTO
* @author zxc
* @date 2022/3/28 10:29
*/
@PostMapping("list")
public Result<PageData> vaccinationList(@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class, VaccinationListFormDTO.VaccinationListForm.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData>().ok(icEpidemicSpecialAttentionService.vaccinationList(formDTO));
}
/**
* Desc:疫苗接种关注名单核酸检测关注名单新增
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/3/28 13:35
*/
@PostMapping("vaccination-add")
@NoRepeatSubmit
public Result vaccinationAdd(@RequestBody VaccinationAddFormDTO formDTO,@LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionAdd.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icEpidemicSpecialAttentionService.vaccinationAdd(formDTO);
return new Result();
}
/**
* Desc:疫苗接种关注名单核酸检测关注名单修改
* @param formDTO
* @author zxc
* @date 2022/3/28 13:45
*/
@PostMapping("vaccination-update")
@NoRepeatSubmit
public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO){
ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class);
icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO);
return new Result();
}
/**
* Desc: 取消关注
* @param formDTO
* @author zxc
* @date 2022/3/28 13:51
*/
@PostMapping("cancel-attention")
@NoRepeatSubmit
public Result cancelAttention(@RequestBody CancelAttentionPackageFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, CancelAttentionPackageFormDTO.CancelAttentionPackageForm.class);
icEpidemicSpecialAttentionService.cancelAttention(formDTO);
return new Result();
}
/**
* Desc: 疫苗接种关注名单核酸检测关注名单导入
* @param
* @author zxc
* @date 2022/3/28 13:40
*/
@PostMapping("vaccination-import")
public Result vaccinationImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file,@RequestParam("attentionType")Integer attentionType){
return new Result();
}
/**
* Desc: 疫苗接种关注名单核酸检测关注名单导出
* @param response
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/3/28 13:57
*/
@PostMapping("vaccination-export")
public void vaccinationExport(HttpServletResponse response,@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto) throws Exception {
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setPage(false);
PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO);
// 关注类型,核酸检测:2,疫苗接种:1
if (formDTO.getAttentionType().equals(NumConstant.ONE)){
ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class);
}else {
ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), NatExportExcel.class);
}
}
}

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

@ -0,0 +1,72 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcFollowUpRecordDTO;
import com.epmet.service.IcFollowUpRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 随访记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@RestController
@RequestMapping("followup")
public class IcFollowUpRecordController {
@Autowired
private IcFollowUpRecordService icFollowUpRecordService;
@RequestMapping("page")
public Result<PageData<IcFollowUpRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcFollowUpRecordDTO> page = icFollowUpRecordService.page(params);
return new Result<PageData<IcFollowUpRecordDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcFollowUpRecordDTO> get(@PathVariable("id") String id){
IcFollowUpRecordDTO data = icFollowUpRecordService.get(id);
return new Result<IcFollowUpRecordDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcFollowUpRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icFollowUpRecordService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcFollowUpRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icFollowUpRecordService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icFollowUpRecordService.delete(ids);
return new Result();
}
}

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

@ -0,0 +1,281 @@
package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.form.AddIcNatFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcNatService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* 核酸上报记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Slf4j
@RestController
@RequestMapping("icNat")
public class IcNatController implements ResultDataResolver {
@Autowired
private IcNatService icNucleinService;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
/**
* @Author sun
* @Description 核酸检测-上报核酸记录
**/
//@NoRepeatSubmit
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
icNucleinService.add(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 核酸检测-居民端我的上报
**/
@NoRepeatSubmit
@PostMapping("mynatlist")
public Result<List<MyNatListResultDTO>> myNatList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.MyNat.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<MyNatListResultDTO>>().ok(icNucleinService.myNatList(formDTO));
}
/**
* @Author sun
* @Description 核酸核酸检测信息列表
**/
@NoRepeatSubmit
@PostMapping("natlist")
public Result<PageData<NatListResultDTO>> natList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData<NatListResultDTO>>().ok(icNucleinService.natList(formDTO));
}
/**
* @Author sun
* @Description 核酸核酸检测信息详情
**/
@NoRepeatSubmit
@PostMapping("detail")
public Result<IcNatDTO> detail(@RequestBody MyNatListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Detail.class);
return new Result<IcNatDTO>().ok(icNucleinService.detail(formDTO));
}
/**
* @Author sun
* @Description 核酸核酸检测信息修改
**/
@NoRepeatSubmit
@PostMapping("edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
icNucleinService.edit(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 核酸核酸检测信息删除/取消同步
**/
@NoRepeatSubmit
@PostMapping("del")
public Result del(@RequestBody MyNatListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Del.class);
icNucleinService.del(formDTO);
return new Result<>();
}
/**
* @Author sun
* @Description 核酸核酸检测信息同步
**/
@NoRepeatSubmit
@PostMapping("synchro")
public Result synchro(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Synchro.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icNucleinService.synchro(formDTO);
return new Result();
}
/**
* 导入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_nat", "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_NAT);
importTaskForm.setOriginFileName(originalFilename);
ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm),
ServiceConstant.EPMET_COMMON_SERVICE,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"excel导入核酸检测信息错误",
"导入居民核酸检测信息失败");
// 3.执行导入
icNucleinService.execAsyncExcelImport(fileSavePath, rstData.getTaskId());
return new Result();
}
/**
* @Author sun
* @Description 核酸核酸检测信息下载模板
**/
@RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST})
public void downloadTemplate(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
//response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("社区自组织导入模板", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/ic_nat.xlsx");
try {
ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os);
} finally {
if (is != null) {
is.close();
}
}
}
/**
* @Author sun
* @Description 核酸核酸检测信息列表
**/
@NoRepeatSubmit
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO, HttpServletResponse response) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
//formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
//formDTO.setUserId("73ae6280e46a6653a5605d51d5462725");
formDTO.setPage(false);
ExcelWriter excelWriter = null;
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
int pageNo = formDTO.getPageNo();
try {
// 这里 需要指定写用哪个class去写
String fileName = "核酸检测信息.xlsx";
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response),NatListResultDTO.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build();
PageData<NatListResultDTO> data = null;
do {
data = icNucleinService.natList(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();
}
}
}
}

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

@ -0,0 +1,81 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.IcNoticeFormDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.service.IcNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 防疫通知
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@RestController
@RequestMapping("icNotice")
public class IcNoticeController {
@Autowired
private IcNoticeService icNoticeService;
@RequestMapping("page")
public Result<PageData<IcNoticeDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody IcNoticeFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
PageData<IcNoticeDTO> page = icNoticeService.page(formDTO);
return new Result<PageData<IcNoticeDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcNoticeDTO> get(@PathVariable("id") String id){
IcNoticeDTO data = icNoticeService.get(id);
return new Result<IcNoticeDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcNoticeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icNoticeService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcNoticeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icNoticeService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icNoticeService.delete(ids);
return new Result();
}
@PostMapping("sendNotice")
public Result sendNotice(@LoginUser TokenDto tokenDto, @RequestBody SendNoticeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
icNoticeService.sendNotice(formDTO);
return new Result();
}
}

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

@ -11,9 +11,12 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
import com.epmet.dto.form.LatestSubmitCollectFormDTO;
import com.epmet.dto.form.ResiCollectFormDTO;
import com.epmet.dto.result.CollectListExcelResultDTO;
import com.epmet.dto.result.CollectListMemberExcelResultDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.LatestCollectResDTO;
import com.epmet.service.IcResiCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -108,4 +111,33 @@ public class IcResiCollectController {
ExcelUtils.exportExcelToTarget(response, null, list, CollectListExcelResultDTO.class);
}
/**
* 居民端小程序社区居民信息登记-提交
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("save-resi")
public Result saveResi(@LoginUser TokenDto tokenDto, @RequestBody ResiCollectFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ResiCollectFormDTO.InternalShowGroup.class, ResiCollectFormDTO.AddUserInternalGroup.class);
icResiCollectService.saveResi(formDTO);
return new Result();
}
/**
* 居民端小程序社区居民信息登记-查询
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("latest-submit")
public Result<LatestCollectResDTO> latestSubmit(@LoginUser TokenDto tokenDto, @RequestBody LatestSubmitCollectFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,LatestSubmitCollectFormDTO.AddUserInternalGroup.class);
return new Result<LatestCollectResDTO>().ok(icResiCollectService.latestSubmit(formDTO));
}
}

73
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java

@ -0,0 +1,73 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcResiVaccineDTO;
import com.epmet.service.IcResiVaccineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 居民疫苗情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@RestController
@RequestMapping("icResiVaccine")
public class IcResiVaccineController {
@Autowired
private IcResiVaccineService icResiVaccineService;
@RequestMapping("page")
public Result<PageData<IcResiVaccineDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcResiVaccineDTO> page = icResiVaccineService.page(params);
return new Result<PageData<IcResiVaccineDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcResiVaccineDTO> get(@PathVariable("id") String id){
IcResiVaccineDTO data = icResiVaccineService.get(id);
return new Result<IcResiVaccineDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcResiVaccineDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiVaccineService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcResiVaccineDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiVaccineService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiVaccineService.delete(ids);
return new Result();
}
}

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

@ -0,0 +1,72 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.service.IcTripReportRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 行程上报信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@RestController
@RequestMapping("triprecord")
public class IcTripReportRecordController {
@Autowired
private IcTripReportRecordService icTripReportRecordService;
@RequestMapping("page")
public Result<PageData<IcTripReportRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcTripReportRecordDTO> page = icTripReportRecordService.page(params);
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);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcTripReportRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icTripReportRecordService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcTripReportRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icTripReportRecordService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icTripReportRecordService.delete(ids);
return new Result();
}
}

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

@ -0,0 +1,55 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.VaccinationListFormDTO;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 疫情特别关注
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Mapper
public interface IcEpidemicSpecialAttentionDao extends BaseDao<IcEpidemicSpecialAttentionEntity> {
/**
* Desc: 疫苗接种关注名单
* @param formDTO
* @author zxc
* @date 2022/3/28 14:19
*/
List<VaccinationListResultDTO> vaccinationList(VaccinationListFormDTO formDTO);
/**
* Desc: 核酸检测关注名单
* @param formDTO
* @author zxc
* @date 2022/3/28 15:23
*/
List<VaccinationListResultDTO> natList(VaccinationListFormDTO formDTO);
/**
* Desc: 取消关注
* @param list
* @param attentionType
* @author zxc
* @date 2022/3/28 16:59
*/
void cancelAttention(@Param("list")List<String> list,@Param("attentionType")Integer attentionType);
/**
* Desc: 查询已经存在的关注
* @param attentionType
* @param list
* @author zxc
* @date 2022/3/28 17:29
*/
List<String> getExistList(@Param("attentionType")Integer attentionType,@Param("list")List<String> list);
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcFollowUpRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 随访记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Mapper
public interface IcFollowUpRecordDao extends BaseDao<IcFollowUpRecordEntity> {
}

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

@ -0,0 +1,39 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.entity.IcNatEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 核酸上报记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Mapper
public interface IcNatDao extends BaseDao<IcNatEntity> {
/**
* @Author sun
* @Description 核酸检测-按条件查询核酸记录
**/
List<MyNatListResultDTO> getMyNatList(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息列表
**/
List<NatListResultDTO> getNatList(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 删除/取消同步操作--物理删除业务数据
**/
int delById(@Param("icNatId") String icNatId);
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcNoticeEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 防疫通知
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Mapper
public interface IcNoticeDao extends BaseDao<IcNoticeEntity> {
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java

@ -23,7 +23,8 @@ public interface IcResiCollectDao extends BaseDao<IcResiCollectEntity> {
int updateRec(@Param("id") String id,
@Param("houseType") String houseType,
@Param("houseHolderName") String houseHolderName,
@Param("totalResi") Integer totalResi);
@Param("totalResi") Integer totalResi,
@Param("updatedBy") String updatedBy);
/**
* Desc: 查询采集居民信息
@ -33,4 +34,11 @@ public interface IcResiCollectDao extends BaseDao<IcResiCollectEntity> {
*/
List<CollectListResultDTO> getCollectList(CollectListFormDTO formDTO);
/**
* 我上次提交的主表记录
* @param customerId
* @param userId
* @return
*/
String selectLastSubmitId(@Param("customerId") String customerId, @Param("userId") String userId);
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java

@ -1,8 +1,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcResiCollectMemFormDTO;
import com.epmet.entity.IcResiMemberEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 居民信息成员表
@ -12,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcResiMemberDao extends BaseDao<IcResiMemberEntity> {
List<IcResiCollectMemFormDTO> selectMySubmit(@Param("latestResiCollectId") String latestResiCollectId, @Param("userId")String userId);
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiVaccineDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcResiVaccineEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 居民疫苗情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Mapper
public interface IcResiVaccineDao extends BaseDao<IcResiVaccineEntity> {
}

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

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcTripReportRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 行程上报信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Mapper
public interface IcTripReportRecordDao extends BaseDao<IcTripReportRecordEntity> {
}

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

@ -0,0 +1,79 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 疫情特别关注
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_epidemic_special_attention")
public class IcEpidemicSpecialAttentionEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 当前工作人员所属组织ID
*/
private String orgId;
/**
* 组织ID上级
*/
private String pid;
/**
* 组织ID所有上级
*/
private String pids;
/**
* 是否关注 1关注0取消关注
*/
private Integer isAttention;
/**
* 关注类型核酸检测2疫苗接种1
*/
private Integer attentionType;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 原因
*/
private String reason;
/**
* 备注
*/
private String remark;
}

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

@ -0,0 +1,59 @@
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-25
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_follow_up_record")
public class IcFollowUpRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 0行程上报1疫苗接种2核酸检测
*/
private String origin;
/**
* 随访时间
*/
private Date visitTime;
/**
* 随访内容
*/
private String content;
}

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

@ -0,0 +1,97 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 核酸上报记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_nat")
public class IcNatEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id CUSTOMER.id
*/
@TableField(fill = FieldFill.INSERT)
private String customerId;
/**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id
*/
private String agencyId;
/**
* 组织pids
*/
private String pids;
/**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值
*/
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;导入的import;同步的synchro
*/
private String userType;
/**
* 人员姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 检测时间精确到分钟
*/
private Date natTime;
/**
* 检测结果(0:阴性 1:阳性)
*/
private String natResult;
/**
* 检测地点
*/
private String natAddress;
/**
* 文件名
*/
private String fileName;
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
}

60
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java

@ -0,0 +1,60 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 防疫通知
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_notice")
public class IcNoticeEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 通知渠道 0小程序通知1短信通知
*/
private String channel;
/**
* 通知来源 0行程上报1疫苗接种2核酸检测
*/
private String origin;
/**
* 用户ID
*/
private String userId;
/**
* 手机号
*/
private String mobile;
/**
* 被通知人身份证号
*/
private String idCard;
/**
* 通知内容
*/
private String content;
/**
* 发送通知的社区
*/
private String orgName;
}

79
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiVaccineEntity.java

@ -0,0 +1,79 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 居民疫苗情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_vaccine")
public class IcResiVaccineEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 接种时间
*/
private Date inoculateTime;
/**
* 接种地点
*/
private String inoculateAddress;
/**
* 疫苗厂家
*/
private String manufacturer;
/**
* 预留字段1
*/
private String field1;
/**
* 预留字段2
*/
private String field2;
/**
* 预留字段3
*/
private String field3;
/**
* 备注
*/
private String remaek;
}

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

@ -0,0 +1,94 @@
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-25
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_trip_report_record")
public class IcTripReportRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 用户id
*/
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
*/
private String userType;
/**
* 现居地编码
*/
private String presentAddressCode;
/**
* 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区
*/
private String presentAddress;
/**
* 详细地址
*/
private String detailAddress;
/**
* 来源地区编码
*/
private String sourceAddressCode;
/**
* 来源地区地址
*/
private String sourceAddress;
/**
* 到达日期
*/
private Date arriveDate;
/**
* 离开日期
*/
private Date leaveDate;
/**
* 备注信息
*/
private String remark;
}

60
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcFollowUpRecordExcel.java

@ -0,0 +1,60 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 随访记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Data
public class IcFollowUpRecordExcel {
@Excel(name = "主键ID")
private String id;
@Excel(name = "客户Id")
private String customerId;
@Excel(name = "姓名")
private String name;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "身份证号")
private String idCard;
@Excel(name = "0行程上报,1疫苗接种,2核酸检测")
private String origin;
@Excel(name = "随访时间")
private Date visitTime;
@Excel(name = "随访内容")
private String content;
@Excel(name = "删除标识 1删除;0未删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

81
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java

@ -0,0 +1,81 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 行程上报信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Data
public class IcTripReportRecordExcel {
@Excel(name = "主键ID")
private String id;
@Excel(name = "客户Id")
private String customerId;
@Excel(name = "姓名")
private String name;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "身份证号")
private String idCard;
@Excel(name = "用户id")
private String userId;
@Excel(name = "居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other")
private String userType;
@Excel(name = "现居地编码")
private String presentAddressCode;
@Excel(name = "现居地名称eg:山东省青岛市黄岛区玫瑰山路社区")
private String presentAddress;
@Excel(name = "详细地址")
private String detailAddress;
@Excel(name = "来源地区编码")
private String sourceAddressCode;
@Excel(name = "来源地区地址")
private String sourceAddress;
@Excel(name = "到达日期")
private Date arriveDate;
@Excel(name = "离开日期")
private Date leaveDate;
@Excel(name = "备注信息")
private String remark;
@Excel(name = "删除标识 1删除;0未删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

35
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java

@ -0,0 +1,35 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/3/29 10:24
* @DESC
*/
@Data
public class NatExportExcel {
@Excel(name = "排序",width = 10)
private Integer sort;
@Excel(name = "姓名",width = 20)
private String name;
@Excel(name = "电话",width = 20)
private String mobile;
@Excel(name = "身份证",width = 30)
private String idCard;
@Excel(name = "备注",width = 40)
private String remark;
@Excel(name = "关注原因",width = 40)
private String reason;
@Excel(name = "最近一次通知时间",width = 20)
private String lastInformTime;
}

35
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java

@ -0,0 +1,35 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/3/29 10:24
* @DESC
*/
@Data
public class VaccinationExportExcel {
@Excel(name = "排序",width = 10)
private Integer sort;
@Excel(name = "姓名",width = 20)
private String name;
@Excel(name = "电话",width = 20)
private String mobile;
@Excel(name = "身份证",width = 30)
private String idCard;
@Excel(name = "备注",width = 40)
private String remark;
@Excel(name = "接种针次",width = 10)
private Integer vaccinationCount;
@Excel(name = "最近一次通知时间",width = 20)
private String lastInformTime;
}

61
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java

@ -0,0 +1,61 @@
package com.epmet.excel.data;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.epmet.dto.form.AddIcNatFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 核酸检测信息导入excel数据
*/
@Data
public class IcNatImportExcelData {
@NotBlank(message = "姓名为必填项")
@ExcelProperty("姓名")
private String name;
@NotBlank(message = "手机号为必填项")
@ExcelProperty("手机号")
private String mobile;
@NotBlank(message = "身份证号为必填项")
@ExcelProperty("身份证号")
private String idCard;
@NotNull(message = "检测时间为必填项")
@ExcelProperty("检测时间")
private Date natTime;
@NotBlank(message = "检测地点为必填项")
@ExcelProperty("检测地点")
private String natAddress;
@NotBlank(message = "检测结果为必填项")
@ExcelProperty("检测结果")
private String natResultZh;
@Data
public static class ErrorRow {
@ExcelProperty("姓名")
@ColumnWidth(20)
private String name;
@ExcelProperty("手机号")
@ColumnWidth(20)
private String mobile;
@ColumnWidth(20)
@ExcelProperty("身份证号")
private String idCard;
@ColumnWidth(60)
@ExcelProperty("错误信息")
private String errorInfo;
}
}

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

@ -0,0 +1,126 @@
package com.epmet.excel.handler;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.entity.IcNatEntity;
import com.epmet.excel.data.IcNatImportExcelData;
import com.epmet.service.impl.IcNatServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* 核酸检测excel导入监听器
*/
@Slf4j
public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelData> {
/**
* 最大条数阈值
*/
public static final int MAX_THRESHOLD = 2;
private String currentUserId;
/**
* 当前组织ID
*/
private String currentAgencyId;
private String currentAgencyPids;
/**
* 数据
*/
private List<IcNatEntity> datas = new ArrayList<>();
/**
* 错误项列表
*/
private List<IcNatImportExcelData.ErrorRow> errorRows = new ArrayList<>();
private IcNatServiceImpl icNatService;
public IcNatExcelImportListener(String currentUserId, String currentAgencyId, String currentAgencyPids, IcNatServiceImpl icNatService) {
this.currentUserId = currentUserId;
this.currentAgencyId = currentAgencyId;
this.currentAgencyPids = currentAgencyPids;
this.icNatService = icNatService;
}
@Override
public void invoke(IcNatImportExcelData data, AnalysisContext context) {
try {
// 先校验数据
ValidatorUtils.validateEntity(data);
String natResult = "0";
String natResultZh = data.getNatResultZh();
if (StringUtils.isNotBlank(natResultZh)) {
natResult = natResultZh.equals("阴性") ? "0" : "1";
}
IcNatEntity icNatEntity = ConvertUtils.sourceToTarget(data, IcNatEntity.class);
icNatEntity.setAgencyId(currentAgencyId);
icNatEntity.setPids(currentAgencyPids);
icNatEntity.setUserId(currentUserId);
icNatEntity.setUserType("other");
icNatEntity.setNatResult(natResult);
icNatEntity.setAttachmentType("");
icNatEntity.setAttachmentUrl("");
datas.add(icNatEntity);
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));
}
IcNatImportExcelData.ErrorRow errorRow = new IcNatImportExcelData.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) {
icNatService.batchPersist(datas);
}
} finally {
datas.clear();
}
}
/**
* 获取错误行
* @return
*/
public List<IcNatImportExcelData.ErrorRow> getErrorRows() {
return errorRows;
}
}

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

@ -0,0 +1,114 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.CancelAttentionPackageFormDTO;
import com.epmet.dto.form.VaccinationAddFormDTO;
import com.epmet.dto.form.VaccinationListFormDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import java.util.List;
import java.util.Map;
/**
* 疫情特别关注
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
public interface IcEpidemicSpecialAttentionService extends BaseService<IcEpidemicSpecialAttentionEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcEpidemicSpecialAttentionDTO>
* @author generator
* @date 2022-03-28
*/
PageData<IcEpidemicSpecialAttentionDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcEpidemicSpecialAttentionDTO>
* @author generator
* @date 2022-03-28
*/
List<IcEpidemicSpecialAttentionDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcEpidemicSpecialAttentionDTO
* @author generator
* @date 2022-03-28
*/
IcEpidemicSpecialAttentionDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-03-28
*/
void save(IcEpidemicSpecialAttentionDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-03-28
*/
void update(IcEpidemicSpecialAttentionDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-03-28
*/
void delete(String[] ids);
/**
* Desc: 疫苗接种关注名单疫苗接种关注名单列表
* @param formDTO
* @author zxc
* @date 2022/3/28 10:29
*/
PageData vaccinationList(VaccinationListFormDTO formDTO);
/**
* Desc:疫苗接种关注名单核酸检测关注名单新增
* @param formDTO
* @author zxc
* @date 2022/3/28 13:35
*/
void vaccinationAdd(VaccinationAddFormDTO formDTO);
/**
* Desc:疫苗接种关注名单核酸检测关注名单修改
* @param formDTO
* @author zxc
* @date 2022/3/28 13:45
*/
void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO);
/**
* Desc: 取消关注
* @param formDTO
* @author zxc
* @date 2022/3/28 13:51
*/
void cancelAttention(CancelAttentionPackageFormDTO formDTO);
}

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

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcFollowUpRecordDTO;
import com.epmet.entity.IcFollowUpRecordEntity;
import java.util.List;
import java.util.Map;
/**
* 随访记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
public interface IcFollowUpRecordService extends BaseService<IcFollowUpRecordEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcFollowUpRecordDTO>
* @author generator
* @date 2022-03-25
*/
PageData<IcFollowUpRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcFollowUpRecordDTO>
* @author generator
* @date 2022-03-25
*/
List<IcFollowUpRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcFollowUpRecordDTO
* @author generator
* @date 2022-03-25
*/
IcFollowUpRecordDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-03-25
*/
void save(IcFollowUpRecordDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-03-25
*/
void update(IcFollowUpRecordDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-03-25
*/
void delete(String[] ids);
}

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

@ -0,0 +1,71 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.form.AddIcNatFormDTO;
import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.entity.IcNatEntity;
import java.nio.file.Path;
import java.util.List;
/**
* 核酸上报记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
public interface IcNatService extends BaseService<IcNatEntity> {
/**
* @Author sun
* @Description 核酸检测-上报核酸记录
**/
void add(AddIcNatFormDTO formDTO);
/**
* @Author sun
* @Description 核酸检测-居民端我的上报
**/
List<MyNatListResultDTO> myNatList(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息列表
*
* @return*/
PageData<NatListResultDTO> natList(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息详情
**/
IcNatDTO detail(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息修改
**/
void edit(AddIcNatFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息删除/取消同步
**/
void del(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息同步
**/
void synchro(MyNatListFormDTO formDTO);
/**
* 执行Excel导入
* @param filePath
*/
void execAsyncExcelImport(Path filePath, String importTaskId);
}

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

@ -0,0 +1,99 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.IcNoticeFormDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.entity.IcNoticeEntity;
import java.util.List;
import java.util.Map;
/**
* 防疫通知
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
public interface IcNoticeService extends BaseService<IcNoticeEntity> {
/**
* 默认分页
*
* @param dto
* @return PageData<IcNoticeDTO>
* @author generator
* @date 2022-03-28
*/
PageData<IcNoticeDTO> page(IcNoticeFormDTO formDTO);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcNoticeDTO>
* @author generator
* @date 2022-03-28
*/
List<IcNoticeDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcNoticeDTO
* @author generator
* @date 2022-03-28
*/
IcNoticeDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-03-28
*/
void save(IcNoticeDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-03-28
*/
void update(IcNoticeDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-03-28
*/
void delete(String[] ids);
/**
* 发送通知
*
* @Param formDTO
* @Return
* @Author zhaoqifeng
* @Date 2022/3/28 14:19
*/
void sendNotice(SendNoticeFormDTO formDTO);
/**
* 获取人员最新一条通知
* @Param idCard
* @Return {@link IcNoticeDTO}
* @Author zhaoqifeng
* @Date 2022/3/28 15:43
*/
IcNoticeDTO getNotice(String customerId, String idCard);
}

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

@ -4,11 +4,12 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
import com.epmet.dto.form.LatestSubmitCollectFormDTO;
import com.epmet.dto.form.ResiCollectFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.LatestCollectResDTO;
import com.epmet.entity.IcResiCollectEntity;
import java.util.List;
/**
* 居民信息采集表
*
@ -36,4 +37,16 @@ public interface IcResiCollectService extends BaseService<IcResiCollectEntity> {
*/
PageData<CollectListResultDTO> getCollectList(CollectListFormDTO formDTO);
/**
* 居民端小程序社区居民信息登记-提交
* @param formDTO
*/
void saveResi(ResiCollectFormDTO formDTO);
/**
* 居民端小程序社区居民信息登记-查询
* @param formDTO
* @return
*/
LatestCollectResDTO latestSubmit(LatestSubmitCollectFormDTO formDTO);
}

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

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiVaccineDTO;
import com.epmet.entity.IcResiVaccineEntity;
import java.util.List;
import java.util.Map;
/**
* 居民疫苗情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
public interface IcResiVaccineService extends BaseService<IcResiVaccineEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcResiVaccineDTO>
* @author generator
* @date 2022-03-28
*/
PageData<IcResiVaccineDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiVaccineDTO>
* @author generator
* @date 2022-03-28
*/
List<IcResiVaccineDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcResiVaccineDTO
* @author generator
* @date 2022-03-28
*/
IcResiVaccineDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-03-28
*/
void save(IcResiVaccineDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-03-28
*/
void update(IcResiVaccineDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-03-28
*/
void delete(String[] ids);
}

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

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.entity.IcTripReportRecordEntity;
import java.util.List;
import java.util.Map;
/**
* 行程上报信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
public interface IcTripReportRecordService extends BaseService<IcTripReportRecordEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcTripReportRecordDTO>
* @author generator
* @date 2022-03-25
*/
PageData<IcTripReportRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcTripReportRecordDTO>
* @author generator
* @date 2022-03-25
*/
List<IcTripReportRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcTripReportRecordDTO
* @author generator
* @date 2022-03-25
*/
IcTripReportRecordDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-03-25
*/
void save(IcTripReportRecordDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-03-25
*/
void update(IcTripReportRecordDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-03-25
*/
void delete(String[] ids);
}

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

@ -0,0 +1,219 @@
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.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
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.constant.FieldConstant;
import com.epmet.dao.IcEpidemicSpecialAttentionDao;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import com.epmet.service.IcEpidemicSpecialAttentionService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 疫情特别关注
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Service
public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpidemicSpecialAttentionDao, IcEpidemicSpecialAttentionEntity> implements IcEpidemicSpecialAttentionService {
@Override
public PageData<IcEpidemicSpecialAttentionDTO> page(Map<String, Object> params) {
IPage<IcEpidemicSpecialAttentionEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcEpidemicSpecialAttentionDTO.class);
}
@Override
public List<IcEpidemicSpecialAttentionDTO> list(Map<String, Object> params) {
List<IcEpidemicSpecialAttentionEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcEpidemicSpecialAttentionDTO.class);
}
private QueryWrapper<IcEpidemicSpecialAttentionEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcEpidemicSpecialAttentionEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcEpidemicSpecialAttentionDTO get(String id) {
IcEpidemicSpecialAttentionEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcEpidemicSpecialAttentionDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcEpidemicSpecialAttentionDTO dto) {
IcEpidemicSpecialAttentionEntity entity = ConvertUtils.sourceToTarget(dto, IcEpidemicSpecialAttentionEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcEpidemicSpecialAttentionDTO dto) {
IcEpidemicSpecialAttentionEntity entity = ConvertUtils.sourceToTarget(dto, IcEpidemicSpecialAttentionEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* Desc: 疫苗接种关注名单疫苗接种关注名单列表
* @param formDTO
* @author zxc
* @date 2022/3/28 10:29
*/
@Override
public PageData vaccinationList(VaccinationListFormDTO formDTO) {
PageData<VaccinationListResultDTO> result = new PageData(new ArrayList(), NumConstant.ZERO_L);
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员信息"+formDTO.getUserId());
}
formDTO.setOrgId(staffInfo.getAgencyId());
// 关注类型,核酸检测:2,疫苗接种:1
if (formDTO.getAttentionType().equals(NumConstant.ONE)){
if (formDTO.isPage()){
PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.vaccinationList(formDTO));
result.setList(pageInfo.getList());
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
}else {
List<VaccinationListResultDTO> list = baseDao.vaccinationList(formDTO);
result.setList(list);
result.setTotal(list.size());
}
}else if (formDTO.getAttentionType().equals(NumConstant.TWO)){
if (formDTO.isPage()){
PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.natList(formDTO));
result.setList(pageInfo.getList());
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
}else {
List<VaccinationListResultDTO> list = baseDao.natList(formDTO);
result.setList(list);
result.setTotal(list.size());
}
}
int i = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
for (VaccinationListResultDTO v : result.getList()) {
i += 1;
v.setSort(i);
}
return result;
}
/**
* Desc:疫苗接种关注名单核酸检测关注名单新增
* @param formDTO
* @author zxc
* @date 2022/3/28 13:35
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void vaccinationAdd(VaccinationAddFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员信息"+formDTO.getUserId());
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
if (null == agencyInfo){
throw new EpmetException("未查询到组织信息"+staffInfo.getAgencyId());
}
List<IcEpidemicSpecialAttentionEntity> entities = ConvertUtils.sourceToTarget(formDTO.getList(), IcEpidemicSpecialAttentionEntity.class);
List<String> idCards = entities.stream().map(m -> m.getIdCard()).collect(Collectors.toList());
Integer attentionType = entities.get(NumConstant.ZERO).getAttentionType();
List<String> existList = baseDao.getExistList(attentionType, idCards);
if (CollectionUtils.isNotEmpty(existList)){
for (String s : existList) {
for (int i = NumConstant.ZERO; i < entities.size(); i++) {
if (s.equals(entities.get(i).getIdCard())){
entities.remove(i);
continue;
}
}
}
}
entities.forEach(e -> {
e.setIsAttention(NumConstant.ONE);
e.setOrgId(agencyInfo.getId());
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setCustomerId(formDTO.getCustomerId());
});
insertBatch(entities);
//TODO 发送通知
}
/**
* Desc:疫苗接种关注名单核酸检测关注名单修改
* 修改的时候通知渠道和通知内容是空的如果他再次写了就是再次发送一条通知 不是修改之前发过的通知
* 除了 姓名 身份证 都能修改
* @param formDTO
* @author zxc
* @date 2022/3/28 13:45
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO) {
LambdaQueryWrapper<IcEpidemicSpecialAttentionEntity> w = new LambdaQueryWrapper<>();
IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity();
w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard())
.eq(IcEpidemicSpecialAttentionEntity::getAttentionType,formDTO.getAttentionType());
e.setMobile(formDTO.getMobile());
e.setReason(formDTO.getReason());
e.setRemark(formDTO.getRemark());
update(e,w);
//TODO 通知
}
/**
* Desc: 取消关注
* @param formDTO
* @author zxc
* @date 2022/3/28 13:51
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void cancelAttention(CancelAttentionPackageFormDTO formDTO) {
if (CollectionUtils.isNotEmpty(formDTO.getIdCards())){
baseDao.cancelAttention(formDTO.getIdCards(), formDTO.getAttentionType());
}
}
}

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

@ -0,0 +1,83 @@
package com.epmet.service.impl;
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.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcFollowUpRecordDao;
import com.epmet.dto.IcFollowUpRecordDTO;
import com.epmet.entity.IcFollowUpRecordEntity;
import com.epmet.service.IcFollowUpRecordService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 随访记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Service
public class IcFollowUpRecordServiceImpl extends BaseServiceImpl<IcFollowUpRecordDao, IcFollowUpRecordEntity> implements IcFollowUpRecordService {
@Override
public PageData<IcFollowUpRecordDTO> page(Map<String, Object> params) {
IPage<IcFollowUpRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcFollowUpRecordDTO.class);
}
@Override
public List<IcFollowUpRecordDTO> list(Map<String, Object> params) {
List<IcFollowUpRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcFollowUpRecordDTO.class);
}
private QueryWrapper<IcFollowUpRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcFollowUpRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcFollowUpRecordDTO get(String id) {
IcFollowUpRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcFollowUpRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcFollowUpRecordDTO dto) {
IcFollowUpRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcFollowUpRecordEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcFollowUpRecordDTO dto) {
IcFollowUpRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcFollowUpRecordEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

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

@ -0,0 +1,354 @@
package com.epmet.service.impl;
import com.alibaba.excel.EasyExcel;
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.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcNatDao;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.AddIcNatFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcNatEntity;
import com.epmet.excel.data.IcNatImportExcelData;
import com.epmet.excel.handler.IcNatExcelImportListener;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.IcNatService;
import com.epmet.service.IcNoticeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
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.http.entity.ContentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.util.ArrayList;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* 核酸上报记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Service
@Slf4j
public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> implements IcNatService, ResultDataResolver {
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private IcNoticeService icNoticeService;
@Autowired
private OssFeignClient ossFeignClient;
/**
* @Author sun
* @Description 核酸检测-上报核酸记录
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void add(AddIcNatFormDTO formDTO) {
//1.获取所填居民所属组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
}
//2.新增核酸记录表数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
entity.setPids(agencyInfo.getPids());
insert(entity);
//3.新增通知表信息
if (formDTO.getChannel().size() > NumConstant.ZERO) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> userList = new ArrayList<>();
userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class));
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserList(userList);
dto.setChannel(formDTO.getChannel());
dto.setOrigin("2");
dto.setContent(formDTO.getContent());
dto.setOrgName(agencyInfo.getOrganizationName());
icNoticeService.sendNotice(dto);
}
}
/**
* @Author sun
* @Description 核酸检测-居民端我的上报
**/
@Override
public List<MyNatListResultDTO> myNatList(MyNatListFormDTO formDTO) {
//1.根据身份证号查询该人员所有核酸记录(居民端录入、数字平台录入、数字平台导入)
List<MyNatListResultDTO> resultList = baseDao.getMyNatList(formDTO);
return resultList;
}
/**
* @Author sun
* @Description 核酸核酸检测信息列表
*
* @return*/
@Override
public PageData<NatListResultDTO> natList(MyNatListFormDTO formDTO) {
//1.根据orgType值判断是查询当前组织下还是整个客户下数据
if ("current".equals(formDTO.getOrgType())) {
//获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
formDTO.setAgencyId(staffInfo.getAgencyId());
}
//2.按条件查询业务数据
PageInfo<NatListResultDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.doSelectPageInfo(() -> baseDao.getNatList(formDTO));
return new PageData(data.getList(),data.getTotal());
}
/**
* @Author sun
* @Description 核酸核酸检测信息详情
**/
@Override
public IcNatDTO detail(MyNatListFormDTO formDTO) {
IcNatDTO resultDTO = new IcNatDTO();
//1.查询核酸记录信息
IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId());
if (null == resultDTO) {
return resultDTO;
}
resultDTO = ConvertUtils.sourceToTarget(entity, IcNatDTO.class);
//2.查询对应的通知记录信息
IcNoticeDTO dto = icNoticeService.getNotice(entity.getCustomerId(), entity.getIdCard());
if (null != dto) {
resultDTO.setChannel(dto.getChannelList());
resultDTO.setContent(dto.getContent());
}
return resultDTO;
}
/**
* @Author sun
* @Description 核酸核酸检测信息修改
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(AddIcNatFormDTO formDTO) {
//1.更新核酸记录表数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
entity.setId(formDTO.getIcNatId());
if (!updateById(entity)) {
log.error(String.format("数据修改失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "核酸记录修改失败");
}
//3.新增通知表信息
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();
List<SendNoticeFormDTO.UserListBean> userList = new ArrayList<>();
userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class));
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserList(userList);
dto.setChannel(formDTO.getChannel());
dto.setOrigin("2");
dto.setContent(formDTO.getContent());
dto.setOrgName(agencyInfo.getOrganizationName());
icNoticeService.sendNotice(dto);
}
}
/**
* @Author sun
* @Description 核酸核酸检测信息删除/取消同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void del(MyNatListFormDTO formDTO) {
//1.物理删除业务数据
if (baseDao.delById(formDTO.getIcNatId()) < NumConstant.ONE) {
log.error(String.format("数据删除/取消同步失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据操作失败");
}
}
/**
* @Author sun
* @Description 核酸核酸检测信息同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void synchro(MyNatListFormDTO formDTO) {
//1.获取工作人员缓存数据
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
//1.根据核酸记录Id查询业务数据并进行必要校验
IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId());
if (null == entity || staffInfo.getAgencyId().equals(entity.getAgencyId())
|| (!"import".equals(entity.getUserType()) && !"synchro".equals(entity.getUserType()))) {
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
@Override
public void execAsyncExcelImport(Path filePath, String importTaskId) {
String userId = null;
try {
userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
String app = EpmetRequestHolder.getHeader(AppClientConstant.APP);
String client = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT);
LoginUserDetailsFormDTO ludf = new LoginUserDetailsFormDTO(app, client, userId);
LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(ludf), ServiceConstant.EPMET_USER_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(), "调用user出错", "");
IcNatExcelImportListener listener = new IcNatExcelImportListener(userId, loginUserDetails.getAgencyId(), loginUserDetails.getOrgIdPath(), this);
EasyExcel.read(filePath.toFile(), IcNatImportExcelData.class, listener).headRowNumber(2).sheet(0).doRead();
Path errorDescFile = null;
String errorDesFileUrl = null;
List<IcNatImportExcelData.ErrorRow> errorRows = listener.getErrorRows();
// 生成并上传错误文件
try {
// 文件生成
Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_nat", "import", "error_des");
String fileName = UUID.randomUUID().toString().concat(".xlsx");
errorDescFile = errorDescDir.resolve(fileName);
FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile());
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName);
OutputStream os = fileItem.getOutputStream();
EasyExcel.write(os, IcNatImportExcelData.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows);
// 文件上传oss
Result<UploadImgResultDTO> errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
if (errorDesFileUploadResult.success()) {
errorDesFileUrl = errorDesFileUploadResult.getData().getUrl();
}
} finally {
if (Files.exists(errorDescFile)) {
Files.delete(errorDescFile);
}
}
ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO();
importFinishTaskForm.setTaskId(importTaskId);
importFinishTaskForm.setProcessStatus(errorRows.size() <= 0 ? ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS : ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importFinishTaskForm.setOperatorId(userId);
importFinishTaskForm.setResultDesc("");
importFinishTaskForm.setResultDescFilePath(errorDesFileUrl);
Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
if (!result.success()) {
log.error("【核酸检测导入】finishImportTask失败");
}
} catch (Exception e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【核酸检测导入】出错:{}", errorMsg);
ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO();
importFinishTaskForm.setTaskId(importTaskId);
importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importFinishTaskForm.setOperatorId(userId);
importFinishTaskForm.setResultDesc("导入失败");
Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
if (!result.success()) {
log.error("【核酸检测导入】导入记录状态修改为'完成'失败");
}
} finally {
// 删除临时文件
if (Files.exists(filePath)) {
try {
Files.delete(filePath);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* 批量持久化
* @param entities
*/
public void batchPersist(List<IcNatEntity> entities) {
insertBatch(entities);
}
}

205
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java

@ -0,0 +1,205 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.enums.ChannelEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IcNoticeDao;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.IcNoticeFormDTO;
import com.epmet.dto.form.ProjectSendMsgFormDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.entity.IcNoticeEntity;
import com.epmet.feign.MessageFeignClient;
import com.epmet.service.IcNoticeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 防疫通知
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Slf4j
@Service
public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEntity> implements IcNoticeService {
@Resource
private MessageFeignClient messageFeignClient;
@Override
public PageData<IcNoticeDTO> page(IcNoticeFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
LambdaQueryWrapper<IcNoticeEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNoticeEntity::getCustomerId, formDTO.getCustomerId());
wrapper.eq(IcNoticeEntity::getIdCard, formDTO.getIdCard());
wrapper.orderByDesc(IcNoticeEntity::getCreatedTime);
List<IcNoticeEntity> list = baseDao.selectList(wrapper);
PageInfo<IcNoticeEntity> pageInfo = new PageInfo<>(list);
List<IcNoticeDTO> dtoList = ConvertUtils.sourceToTarget(list, IcNoticeDTO.class);
if (CollectionUtils.isNotEmpty(dtoList)) {
dtoList.forEach(item -> {
List<String> channelList = Arrays.asList(item.getChannel().split(StrConstant.COMMA));
if (channelList.size() == NumConstant.ONE) {
item.setChannel(ChannelEnum.getName(channelList.get(0)));
} else {
item.setChannel(ChannelEnum.getName(NumConstant.TWO_STR));
}
});
}
return new PageData<>(dtoList, pageInfo.getTotal());
}
@Override
public List<IcNoticeDTO> list(Map<String, Object> params) {
List<IcNoticeEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcNoticeDTO.class);
}
private QueryWrapper<IcNoticeEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcNoticeEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcNoticeDTO get(String id) {
IcNoticeEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcNoticeDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcNoticeDTO dto) {
IcNoticeEntity entity = ConvertUtils.sourceToTarget(dto, IcNoticeEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcNoticeDTO dto) {
IcNoticeEntity entity = ConvertUtils.sourceToTarget(dto, IcNoticeEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 发送通知
*
* @param formDTO
* @Param formDTO
* @Return
* @Author zhaoqifeng
* @Date 2022/3/28 14:19
*/
@Override
public void sendNotice(SendNoticeFormDTO formDTO) {
//保存消息
String channel = StringUtils.join(formDTO.getChannel(), StrConstant.COMMA);
List<IcNoticeEntity> entityList = formDTO.getUserList().stream().map(item -> {
IcNoticeEntity entity = new IcNoticeEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setChannel(channel);
entity.setContent(formDTO.getContent());
entity.setOrigin(formDTO.getOrigin());
entity.setUserId(item.getUserId());
entity.setMobile(item.getMobile());
entity.setIdCard(item.getIdCard());
entity.setOrgName(formDTO.getOrgName());
return entity;
}).collect(Collectors.toList());
insertBatch(entityList);
//通知
List<UserMessageFormDTO> msgList = new ArrayList<>();
//短信消息
List<ProjectSendMsgFormDTO> smsList = new ArrayList<>();
entityList.forEach(item -> {
if (StringUtils.isNotBlank(item.getUserId())) {
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(item.getCustomerId());
messageFormDTO.setApp(AppClientConstant.APP_GOV);
messageFormDTO.setGridId(StrConstant.STAR);
messageFormDTO.setUserId(item.getUserId());
messageFormDTO.setTitle("您有一条通知消息!");
messageFormDTO.setMessageContent(item.getContent());
messageFormDTO.setReadFlag(Constant.UNREAD);
messageFormDTO.setMessageType(UserMessageTypeConstant.ANTIEPIDEMIC);
messageFormDTO.setTargetId(item.getId());
msgList.add(messageFormDTO);
}
//TODO
if (StringUtils.isNotBlank(item.getMobile())) {
ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO();
sms.setCustomerId(item.getCustomerId());
sms.setMobile(item.getMobile());
sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_OVERDUE);
sms.setParameterKey("send_msg");
smsList.add(sms);
}
});
Result result = messageFeignClient.saveUserMessageList(msgList);
if (!result.success()) {
log.error("发送小程序消息失败" + JSON.toJSONString(result));
}
}
/**
* 获取人员最新一条通知
*
* @param idCard
* @Param idCard
* @Return {@link IcNoticeDTO}
* @Author zhaoqifeng
* @Date 2022/3/28 15:43
*/
@Override
public IcNoticeDTO getNotice(String customerId, String idCard) {
IcNoticeDTO result = new IcNoticeDTO();
LambdaQueryWrapper<IcNoticeEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNoticeEntity::getCustomerId, customerId);
wrapper.eq(IcNoticeEntity::getIdCard, idCard);
wrapper.orderByDesc(IcNoticeEntity::getCreatedTime);
List<IcNoticeEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
result = ConvertUtils.sourceToTarget(list.get(NumConstant.ZERO), IcNoticeDTO.class);
result.setChannelList(Arrays.asList(result.getChannel().split(StrConstant.COMMA)));
}
return result;
}
}

93
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java

@ -2,26 +2,30 @@ 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.tools.constant.StrConstant;
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.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiCollectDao;
import com.epmet.dao.IcResiMemberDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.result.LatestCollectResDTO;
import com.epmet.entity.IcResiCollectEntity;
import com.epmet.entity.IcResiMemberEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiCollectService;
import org.apache.commons.collections4.MapUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -71,7 +75,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
});
} else {
//更新主表
baseDao.updateRec(origin.getId(), formDTO.getHouseType(), formDTO.getHouseHolderName(), formDTO.getTotalResi());
baseDao.updateRec(origin.getId(), formDTO.getHouseType(), formDTO.getHouseHolderName(), formDTO.getTotalResi(),null);
List<IcResiMemberEntity> newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class);
//查询之前录入的成员表
Map<String, IcResiMemberEntity> memMap = queryOriginMem(origin.getId());
@ -145,4 +149,85 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
}
}
}
/**
* 社区居民信息登记-提交
*
* @param formDTO
*/
@Override
public void saveResi(ResiCollectFormDTO formDTO) {
IcResiCollectEntity origin = baseDao.selectByAddress(formDTO.getAddress());
if (null == origin) {
//插入主表、成员表
IcResiCollectEntity insert = ConvertUtils.sourceToTarget(formDTO, IcResiCollectEntity.class);
insert.setOrigin("internal");
baseDao.insert(insert);
List<IcResiMemberEntity> memberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class);
memberList.forEach(mem -> {
if (StringUtils.isNotBlank(mem.getName()) || StringUtils.isNotBlank(mem.getIdNum())) {
mem.setCustomerId(formDTO.getCustomerId());
//姓名或份身份证号不为空时插入
mem.setIcResiCollectId(insert.getId());
icResiMemberDao.insert(mem);
}
});
} else {
//更新主表
baseDao.updateRec(origin.getId(), formDTO.getHouseType(), formDTO.getHouseHolderName(), formDTO.getTotalResi(),formDTO.getUserId());
List<IcResiMemberEntity> newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class);
//查询之前录入的成员表
Map<String, IcResiMemberEntity> memMap = queryOriginMem(origin.getId());
saveOrUpdateMem(newMemberList, memMap,origin.getId());
}
}
/**
* 居民端小程序社区居民信息登记-查询
*
* @param formDTO
* @return
*/
@Override
public LatestCollectResDTO latestSubmit(LatestSubmitCollectFormDTO formDTO) {
//张三、李四都住101房间
//张三先登记了填写了2个成员的信息
//李四登记后,会更新这2个成员的信息
//李四下次进入页面,展示这2个成员。
LatestCollectResDTO resDTO = new LatestCollectResDTO();
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfoCache) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询网格信息异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
resDTO.setCustomerId(gridInfoCache.getCustomerId());
resDTO.setGridId(formDTO.getGridId());
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(gridInfoCache.getPid());
resDTO.setAgencyId(gridInfoCache.getPid());
resDTO.setPids(null != agencyInfoCache ? agencyInfoCache.getPids() : StrConstant.EPMETY_STR);
resDTO.setAgencyName(gridInfoCache.getAgencyName());
String latestResiCollectId = baseDao.selectLastSubmitId(formDTO.getCustomerId(), formDTO.getUserId());
if (StringUtils.isNotBlank(latestResiCollectId)) {
resDTO.setResiCollectId(latestResiCollectId);
//之前提交过
IcResiCollectEntity entity = baseDao.selectById(latestResiCollectId);
if (null != entity) {
setCollectValue(resDTO, entity);
}
List<IcResiCollectMemFormDTO> memberList = icResiMemberDao.selectMySubmit(latestResiCollectId, formDTO.getUserId());
resDTO.setMemberList(memberList);
}
return resDTO;
}
private void setCollectValue(LatestCollectResDTO resDTO, IcResiCollectEntity entity) {
resDTO.setVillageId(entity.getVillageId());
resDTO.setBuildId(entity.getBuildId());
resDTO.setUnitId(entity.getUnitId());
resDTO.setHomeId(entity.getHomeId());
resDTO.setAddress(entity.getAddress());
resDTO.setHouseType(entity.getHouseType());
resDTO.setHouseHolderName(entity.getHouseHolderName());
resDTO.setTotalResi(entity.getTotalResi());
}
}

83
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java

@ -0,0 +1,83 @@
package com.epmet.service.impl;
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.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcResiVaccineDao;
import com.epmet.dto.IcResiVaccineDTO;
import com.epmet.entity.IcResiVaccineEntity;
import com.epmet.service.IcResiVaccineService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 居民疫苗情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-28
*/
@Service
public class IcResiVaccineServiceImpl extends BaseServiceImpl<IcResiVaccineDao, IcResiVaccineEntity> implements IcResiVaccineService {
@Override
public PageData<IcResiVaccineDTO> page(Map<String, Object> params) {
IPage<IcResiVaccineEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcResiVaccineDTO.class);
}
@Override
public List<IcResiVaccineDTO> list(Map<String, Object> params) {
List<IcResiVaccineEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiVaccineDTO.class);
}
private QueryWrapper<IcResiVaccineEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiVaccineEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcResiVaccineDTO get(String id) {
IcResiVaccineEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcResiVaccineDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcResiVaccineDTO dto) {
IcResiVaccineEntity entity = ConvertUtils.sourceToTarget(dto, IcResiVaccineEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcResiVaccineDTO dto) {
IcResiVaccineEntity entity = ConvertUtils.sourceToTarget(dto, IcResiVaccineEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

83
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java

@ -0,0 +1,83 @@
package com.epmet.service.impl;
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.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcTripReportRecordDao;
import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.entity.IcTripReportRecordEntity;
import com.epmet.service.IcTripReportRecordService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 行程上报信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Service
public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportRecordDao, IcTripReportRecordEntity> implements IcTripReportRecordService {
@Override
public PageData<IcTripReportRecordDTO> page(Map<String, Object> params) {
IPage<IcTripReportRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcTripReportRecordDTO.class);
}
@Override
public List<IcTripReportRecordDTO> list(Map<String, Object> params) {
List<IcTripReportRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcTripReportRecordDTO.class);
}
private QueryWrapper<IcTripReportRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcTripReportRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcTripReportRecordDTO get(String id) {
IcTripReportRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcTripReportRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcTripReportRecordDTO dto) {
IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcTripReportRecordEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcTripReportRecordDTO dto) {
IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcTripReportRecordEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

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

@ -279,7 +279,8 @@ public class UserBadgeServiceImpl implements UserBadgeService {
userBadgeDao.insertUserBadgeCertificateRecord(form);
//TODO 站内信发送
String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId());
String msg = String.format(BadgeConstant.MESSAGE_CONTENT, userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()), badgeName);
String s = StringUtils.isBlank(userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict()) ? userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName() : userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName());
String msg = String.format(BadgeConstant.MESSAGE_CONTENT, s, badgeName);
// 记录待审核id,和消息类型
sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(),
UserMessageTypeConstant.BADGE_AUTH_APPLY,

214
epmet-user/epmet-user-server/src/main/java/com/epmet/util/MySequence.java

@ -0,0 +1,214 @@
/*
* Copyright (c) 2011-2021, baomidou (jobob@qq.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.epmet.util;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.SystemClock;
import com.epmet.commons.tools.utils.HttpClientManager;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory;
import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.concurrent.ThreadLocalRandom;
/**
* 分布式高效有序 ID 生产黑科技(sequence)
*
* <p>优化开源项目https://gitee.com/yu120/sequence</p>
*
* @author hubin
* @since 2016-08-18
*/
@Slf4j
public class MySequence {
private static final Log logger = LogFactory.getLog(MySequence.class);
/**
* 时间起始标记点作为基准一般取系统的最近时间一旦确定不能变动
*/
private final long twepoch = 1288834974657L;
/**
* 机器标识位数
*/
private final long workerIdBits = 5L;
private final long datacenterIdBits = 5L;
private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
/**
* 毫秒内自增位
*/
private final long sequenceBits = 12L;
private final long workerIdShift = sequenceBits;
private final long datacenterIdShift = sequenceBits + workerIdBits;
/**
* 时间戳左移动位
*/
private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
private final long sequenceMask = -1L ^ (-1L << sequenceBits);
private final long workerId;
/**
* 数据标识 ID 部分
*/
private final long datacenterId;
/**
* 并发控制
*/
private long sequence = 0L;
/**
* 上次生产 ID 时间戳
*/
private long lastTimestamp = -1L;
public MySequence() {
this.datacenterId = getDatacenterId(maxDatacenterId);
this.workerId = getMaxWorkerId(datacenterId, maxWorkerId);
String msg = "MySequence datacenterId:" + this.datacenterId + ";workerId:" + this.workerId;
log.info(msg);
HttpClientManager.getInstance().sendAlarmMsg(msg);
}
/**
* 有参构造器
*
* @param workerId 工作机器 ID
* @param datacenterId 序列号
*/
public MySequence(long workerId, long datacenterId) {
Assert.isFalse(workerId > maxWorkerId || workerId < 0,
String.format("MySequence worker Id can't be greater than %d or less than 0", maxWorkerId));
Assert.isFalse(datacenterId > maxDatacenterId || datacenterId < 0,
String.format("MySequence datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
this.workerId = workerId;
this.datacenterId = datacenterId;
}
/**
* 获取 maxWorkerId
*/
protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) {
StringBuilder mpid = new StringBuilder();
mpid.append(datacenterId);
String name = ManagementFactory.getRuntimeMXBean().getName();
String msg = "MySequence getMaxWorkerId name:" + name;
log.info(msg);
HttpClientManager.getInstance().sendAlarmMsg(msg);
if (StringUtils.isNotBlank(name)) {
/*
* GET jvmPid
*/
mpid.append(name.split(StringPool.AT)[0]);
}
/*
* MAC + PID hashcode 获取16个低位
*/
return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1);
}
/**
* 数据标识id部分
*/
protected static long getDatacenterId(long maxDatacenterId) {
long id = 0L;
try {
InetAddress ip = InetAddress.getLocalHost();
NetworkInterface network = NetworkInterface.getByInetAddress(ip);
String msg = "MySequence ip:" + JSON.toJSONString(ip) + ";network: " + JSON.toJSONString(network);
log.info(msg);
HttpClientManager.getInstance().sendAlarmMsg(msg);
if (network == null) {
id = 1L;
log.info("MySequen cenetwork ==null ");
} else {
byte[] mac = network.getHardwareAddress();
if (null != mac) {
id = ((0x000000FF & (long) mac[mac.length - 2]) | (0x0000FF00 & (((long) mac[mac.length - 1]) << 8))) >> 6;
id = id % (maxDatacenterId + 1);
}
}
} catch (Exception e) {
logger.warn(" getDatacenterId: " + e.getMessage());
}
return id;
}
/**
* 获取下一个 ID
*
* @return 下一个 ID
*/
public synchronized long nextId() {
long timestamp = timeGen();
//闰秒
if (timestamp < lastTimestamp) {
long offset = lastTimestamp - timestamp;
if (offset <= 5) {
try {
wait(offset << 1);
timestamp = timeGen();
if (timestamp < lastTimestamp) {
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", offset));
}
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", offset));
}
}
if (lastTimestamp == timestamp) {
// 相同毫秒内,序列号自增
sequence = (sequence + 1) & sequenceMask;
if (sequence == 0) {
// 同一毫秒的序列数已经达到最大
timestamp = tilNextMillis(lastTimestamp);
}
} else {
// 不同毫秒内,序列号置为 1 - 3 随机数
sequence = ThreadLocalRandom.current().nextLong(1, 3);
}
lastTimestamp = timestamp;
// 时间戳部分 | 数据中心部分 | 机器标识部分 | 序列号部分
return ((timestamp - twepoch) << timestampLeftShift)
| (datacenterId << datacenterIdShift)
| (workerId << workerIdShift)
| sequence;
}
protected long tilNextMillis(long lastTimestamp) {
long timestamp = timeGen();
while (timestamp <= lastTimestamp) {
timestamp = timeGen();
}
return timestamp;
}
protected long timeGen() {
return SystemClock.now();
}
}

3
epmet-user/epmet-user-server/src/main/resources/bootstrap.yml

@ -106,6 +106,9 @@ mybatis-plus:
field-strategy: NOT_NULL
#驼峰下划线转换
column-underline: true
worker-id: ${random.int(1,31)}
datacenter-id: ${random.int(1,31)}
banner: false
#原生配置
configuration:

47
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.27__ic_nat.sql

@ -0,0 +1,47 @@
CREATE TABLE `ic_nat` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id',
`PIDS` varchar(255) NOT NULL COMMENT '组织pids',
`USER_ID` varchar(64) DEFAULT NULL COMMENT '居民端小程序的用户id、数字社区的icResiUserId、其他情况无值',
`USER_TYPE` varchar(32) NOT NULL COMMENT '居民端小程序的人:resi;数字社区的居民:icresi;导入的:import;同步的:synchro',
`NAME` varchar(64) NOT NULL COMMENT '人员姓名',
`MOBILE` varchar(11) NOT NULL COMMENT '手机号',
`ID_CARD` varchar(18) NOT NULL COMMENT '身份证号',
`NAT_TIME` datetime NOT NULL COMMENT '检测时间,精确到分钟',
`NAT_RESULT` varchar(1) DEFAULT NULL COMMENT '检测结果(0:阴性 1:阳性)',
`NAT_ADDRESS` varchar(128) DEFAULT NULL COMMENT '检测地点',
`FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名',
`ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))',
`ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='核酸上报记录';
-- ----------------------------
-- Table structure for ic_notice
-- ----------------------------
CREATE TABLE `ic_notice` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id',
`CHANNEL` varchar(10) NOT NULL COMMENT '通知渠道 0小程序通知,1短信通知',
`ORIGIN` varchar(64) NOT NULL COMMENT '通知来源 0行程上报,1疫苗接种,2核酸检测',
`USER_ID` varchar(64) DEFAULT NULL COMMENT '用户ID 居民端用户时有值',
`MOBILE` varchar(11) NOT NULL COMMENT '手机号',
`ID_CARD` varchar(64) NOT NULL COMMENT '被通知人身份证号',
`CONTENT` varchar(500) NOT NULL COMMENT '通知内容',
`ORG_NAME` varchar(64) DEFAULT NULL COMMENT '发送通知的社区',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='防疫通知';

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx

Binary file not shown.

95
epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcEpidemicSpecialAttentionDao">
<!-- 取消关注 -->
<update id="cancelAttention">
UPDATE ic_epidemic_special_attention
SET UPDATED_TIME = NOW(),
IS_ATTENTION = 0
WHERE del_flag = 0
AND attention_type = #{attentionType}
AND id_card IN (
<foreach collection="list" item="l" separator=",">
#{l}
</foreach>
)
</update>
<!-- 疫苗接种关注名单 -->
<select id="vaccinationList" resultType="com.epmet.dto.result.VaccinationListResultDTO">
SELECT
a.`NAME`,
a.MOBILE,
a.ID_CARD,
a.REMARK,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = '1' AND ID_CARD = #{idCard} ORDER BY CREATED_TIME LIMIT 1),'') AS lastInformTime,
COUNT(v.ID) AS vaccinationCount
FROM ic_epidemic_special_attention a
LEFT JOIN ic_resi_vaccine v ON (v.ID_CARD = a.ID_CARD AND v.DEL_FLAG = '0')
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'>
AND a.`NAME` = #{name}
</if>
<if test='null != mobile and "" != mobile'>
AND a.MOBILE = #{mobile}
</if>
<if test='null != mobile and "" != mobile'>
AND a.ID_CARD = #{idCard}
</if>
<if test=' null != vaccinationCount'>
HAVING vaccinationCount = #{vaccinationCount}
</if>
ORDER BY a.CREATED_TIME DESC
</select>
<!-- 核酸检测关注名单 -->
<select id="natList" resultType="com.epmet.dto.result.VaccinationListResultDTO">
SELECT
a.`NAME`,
a.MOBILE,
a.ID_CARD,
a.REMARK,
a.REASON,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = '1' AND ID_CARD = #{idCard} ORDER BY CREATED_TIME LIMIT 1),'') AS lastInformTime
FROM ic_epidemic_special_attention a
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'>
AND a.`NAME` = #{name}
</if>
<if test='null != mobile and "" != mobile'>
AND a.MOBILE = #{mobile}
</if>
<if test='null != mobile and "" != mobile'>
AND a.ID_CARD = #{idCard}
</if>
<if test='null != reason and "" != reason'>
AND a.REASON LIKE CONCAT('%',#{reason},'%')
</if>
<if test='null != remark and "" != remark'>
AND a.REMARK LIKE CONCAT('%',#{remark},'%')
</if>
ORDER BY a.CREATED_TIME DESC
</select>
<!-- 查询已经存在的关注 -->
<select id="getExistList" resultType="java.lang.String">
SELECT
ID_CARD
FROM ic_epidemic_special_attention
WHERE DEL_FLAG = 0
AND ATTENTION_TYPE = #{attentionType}
AND ID_CARD IN (
<foreach collection="list" item="l" separator=",">
#{l}
</foreach>
)
</select>
</mapper>

8
epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcFollowUpRecordDao">
</mapper>

70
epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcNatDao">
<select id="getMyNatList" resultType="com.epmet.dto.result.MyNatListResultDTO">
SELECT
id icNatId,
user_id userId,
user_type userType,
`name` `name`,
mobile mobile,
id_card idCard,
nat_time natTime,
nat_result natResult,
nat_address natAddress,
file_name fileName,
attachment_url attachmentUrl
FROM
ic_nat
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND id_card = #{idCard}
ORDER BY nat_time DESC
</select>
<select id="getNatList" resultType="com.epmet.dto.result.NatListResultDTO">
SELECT
id icNatId,
agency_id agencyId,
user_id userId,
user_type userType,
`name` `name`,
mobile mobile,
id_card idCard,
nat_time natTime,
nat_result natResult,
nat_address natAddress
FROM
ic_nat
WHERE
del_flag = '0'
AND customer_id = #{customerId}
<if test='null != agencyId and "" != agencyId'>
AND (agency_id = #{agencyId} OR pids like concat('%', #{agencyId}, '%'))
</if>
<if test='null != name and "" != name'>
AND name like concat('%', #{name}, '%')
</if>
<if test='null != mobile and "" != mobile'>
AND mobile = #{mobile}
</if>
<if test='null != idCard and "" != idCard'>
AND id_card = #{idCard}
</if>
<if test='null != startTime and "" != startTime'>
AND nat_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test='null != endTime and "" != endTime'>
AND nat_time <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY nat_time, id_card DESC
</select>
<delete id="delById">
DELETE FROM ic_nat WHERE id = #{icNatId}
</delete>
</mapper>

23
epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcNoticeDao">
<resultMap type="com.epmet.entity.IcNoticeEntity" id="icNoticeMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="channel" column="CHANNEL"/>
<result property="origin" column="ORIGIN"/>
<result property="idCard" column="ID_CARD"/>
<result property="content" column="CONTENT"/>
<result property="orgName" column="ORG_NAME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

32
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml

@ -55,11 +55,35 @@
<update id="updateRec" parameterType="map">
UPDATE ic_resi_collect
SET UPDATED_TIME = NOW(),
HOUSE_TYPE = #{houseType},
HOUSE_HOLDER_NAME = #{houseHolderName},
TOTAL_RESI = #{totalResi}
SET
<if test="houseType != null and houseType !=''">
HOUSE_TYPE = #{houseType},
</if>
<if test="houseHolderName != null and houseHolderName !=''">
HOUSE_HOLDER_NAME = #{houseHolderName},
</if>
<if test="totalResi != null and totalResi !=''">
TOTAL_RESI = #{totalResi},
</if>
<if test="updatedBy != null and updatedBy !=''">
UPDATED_BY = #{updatedBy},
</if>
UPDATED_TIME = NOW()
WHERE
id = #{id}
</update>
<select id="selectLastSubmitId" parameterType="map" resultType="java.lang.String">
SELECT
m.IC_RESI_COLLECT_ID
FROM
ic_resi_member m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND ( m.CREATED_BY = #{userId} OR m.UPDATED_BY = #{userId} )
ORDER BY
m.UPDATED_TIME DESC
LIMIT 1
</select>
</mapper>

17
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml

@ -4,5 +4,20 @@
<mapper namespace="com.epmet.dao.IcResiMemberDao">
<select id="selectMySubmit" parameterType="map" resultType="com.epmet.dto.form.IcResiCollectMemFormDTO">
SELECT
m.id,
m.CUSTOMER_ID,
m.`NAME`,
m.ID_NUM,
m.MOBILE,
m.HE_SUAN_COUNT,
m.YMJZ
FROM
ic_resi_member m
WHERE
m.IC_RESI_COLLECT_ID = #{latestResiCollectId}
AND m.DEL_FLAG = '0'
AND ( m.CREATED_BY = #{userId} OR m.UPDATED_BY = #{userId} )
</select>
</mapper>

28
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcResiVaccineDao">
<resultMap type="com.epmet.entity.IcResiVaccineEntity" id="icResiVaccineMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="name" column="NAME"/>
<result property="mobile" column="MOBILE"/>
<result property="idCard" column="ID_CARD"/>
<result property="inoculateTime" column="INOCULATE_TIME"/>
<result property="inoculateAddress" column="INOCULATE_ADDRESS"/>
<result property="manufacturer" column="MANUFACTURER"/>
<result property="field1" column="FIELD1"/>
<result property="field2" column="FIELD2"/>
<result property="field3" column="FIELD3"/>
<result property="remaek" column="REMAEK"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

8
epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcTripReportRecordDao">
</mapper>

17
epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java

@ -1,7 +1,10 @@
package com.epmet.epmetuser.test;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.dao.UserDao;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.entity.UserEntity;
import com.epmet.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -15,11 +18,25 @@ public class UserControllerTest {
@Autowired
private UserService userService;
@Autowired
private UserDao userDao;
@Test
public void getLoginUserDetails() {
LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, "4aaab913d9f11d90a2cb4dd21b075259");
System.out.println(loginUserDetails);
}
@Test
public void insertUser() {
UserEntity entity = new UserEntity();
entity.setCustomerId("test_ljj");
String idStr = IdWorker.getIdStr();
System.out.println(idStr);
//int insert = userDao.insert(entity);
//System.out.println(insert);
}
}

Loading…
Cancel
Save