diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 7f1fb8e728..e516c5fba7 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -24,6 +24,7 @@ 2.8.6 1.11.3 1.18.4 + 3.0.3 @@ -177,6 +178,25 @@ javase 3.4.1 + + com.alibaba + easyexcel + ${easyexcel.version} + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java index fe22284567..723f5d062c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java @@ -33,7 +33,7 @@ public class PageFormDTO implements Serializable { */ private Integer offset; - private boolean isPage = true; + private Boolean isPage = true; public Integer getOffset() { return (pageNo-1)*pageSize; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java new file mode 100644 index 0000000000..c1305d0e5a --- /dev/null +++ b/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 java.util.Objects; + +/** + * @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 (Objects.equals(houseTypeEnum.getCode(), code)) { + return houseTypeEnum.getName(); + } + } + return null; + } + + 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; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 4614beb5ba..a059504d2e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -251,6 +251,8 @@ public enum EpmetErrorCode { ORG_EDIT_FAILED(8920,"编辑失败"), ORG_DEL_FAILED(8921,"删除失败"), NEIGHBORHOOD_DEL_FAILED(8922,""), + IC_NAT_IDCARD_NATTIME(8923,"已存在相同记录"), + IC_NAT(8924,"平台已存在记录,请去修改原有记录"), //通用错误码 start diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 7bc68a4842..04db67cfed 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -753,4 +753,14 @@ public class RedisKeys { public static String getCustomerMenuListPrefix() { return rootPrefix.concat("oper:access:nav:customerId:"); } + + /** + * 如果是省列表:epmet:areacode:parentCode:0 + * 山东省的下一级:epmet:areacode:parentCode:37 + * @param areaCode + * @return + */ + public static String getNextAreaCodeKey(String areaCode) { + return rootPrefix.concat("areaCode:parentCode:").concat(areaCode); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java index 70307f6551..ce92400ae0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java +++ b/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); } /** diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index f956423f3a..a28a038f7b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -60,7 +60,7 @@ public class DateUtils { public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM"; public static final String WEEK_TYPE_ENGLISH = "english"; public static final String WEEK_TYPE_CHINESE = "chinese"; - + public static final String DATE_PATTERN_MMDD = "MMdd"; /** * 日期格式化 日期格式为:yyyy-MM-dd * @param date 日期 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java index b8a12015bb..00784bc7db 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java +++ b/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; + } + /** * 创建临时文件 * diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 9e324de434..bf0b867aca 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -100,12 +100,6 @@ 2.0.0 compile - - com.alibaba - easyexcel - 3.0.3 - compile - diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java index 6212a35cb6..e15f7f5057 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java @@ -15,6 +15,17 @@ 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_ATTENTION_NAT = "attention_nat"; + String BIZ_TYPE_ATTENTION_VACCINATION = "attention_vaccination"; + String BIZ_TYPE_ATTENTION_TRIP_REPORT = "attention_vaccination"; + /** + * 核酸检测 + */ + String BIZ_TYPE_IC_NAT = "ic_nat"; + /** + * 行程上报 + */ + String BIZ_TYPE_IC_TRIP_REPORT = "ic_trip_report"; /** * 处理状态:处理中 diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java new file mode 100644 index 0000000000..bc88cf3a28 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java @@ -0,0 +1,9 @@ +package com.epmet.dto.form; + +import lombok.Data; + +@Data +public class AreaCodeFormDTO { + private String parentAreaCode; + private String parentLevel; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java index 9eea1fe6c2..08fc2f0995 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java +++ b/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 { diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java new file mode 100644 index 0000000000..7b09f4f020 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class AreaCodeResultDTO { + private String areaCode; + private String parentCode; + private String areaName; + private String level; +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java index df821f7410..7bf4e537f8 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java @@ -28,7 +28,9 @@ import com.epmet.dto.AreaCodeDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.AreaCodeResultDTO; import com.epmet.service.AreaCodeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -121,4 +123,14 @@ public class AreaCodeController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(areaCodeService.addAreaCode(formDTO)); } + + /** + * 行政地区编码逐级查询 + * @param formDTO + * @return + */ + @PostMapping(value = "nextarea") + public Result> nextArea(@RequestBody AreaCodeFormDTO formDTO){ + return new Result>().ok(areaCodeService.nextArea(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java index 54b89ee82f..bfe5c8139e 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java @@ -19,8 +19,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AreaCodeDTO; +import com.epmet.dto.result.AreaCodeResultDTO; import com.epmet.entity.AreaCodeEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -40,4 +42,14 @@ public interface AreaCodeDao extends BaseDao { AreaCodeDTO selectByCityCode(String cityCode); AreaCodeDTO selectMaxCounty(String cityCode); + + List selectProvince(); + + List selectCity(@Param("pCode")String pCode); + + List selectDistrict(@Param("pCode")String pCode); + + List selectStreet(@Param("pCode")String pCode); + + List selectCommunity(@Param("pCode")String pCode); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java index d1c6218ea0..1743dcb3d4 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java @@ -19,9 +19,12 @@ package com.epmet.redis; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.AreaCodeResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.List; + /** * 大陆省市区地区码 * @@ -49,4 +52,12 @@ public class AreaCodeRedis { return null; } + public List getNextAreaCodeKey(String key) { + List list = (List) redisUtils.get(key); + return list; + } + + public void setNextAreaCodeKey(String key, List list) { + redisUtils.set(key, list); + } } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java index 99c25ab2f2..e452332fea 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java @@ -23,7 +23,9 @@ import com.epmet.dto.AreaCodeDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.AreaCodeResultDTO; import com.epmet.entity.AreaCodeEntity; import java.util.List; @@ -123,4 +125,6 @@ public interface AreaCodeService extends BaseService { * @Date 2021/4/13 14:40 **/ String addAreaCode(AddAreaCodeFormDTO formDTO); + + List nextArea(AreaCodeFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java index 0de5ddac2b..6f4ad9f000 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.AreaCodeConstant; import com.epmet.dao.AreaCodeChildDao; @@ -38,7 +39,9 @@ import com.epmet.dto.AreaCodeDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.AreaCodeResultDTO; import com.epmet.entity.AreaCodeEntity; import com.epmet.redis.AreaCodeRedis; import com.epmet.service.AreaCodeChildService; @@ -688,6 +691,49 @@ public class AreaCodeServiceImpl extends BaseServiceImpl nextArea(AreaCodeFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getParentAreaCode())&&StringUtils.isBlank(formDTO.getParentLevel())){ + String pKey=RedisKeys.getNextAreaCodeKey(NumConstant.ZERO_STR); + List list=areaCodeRedis.getNextAreaCodeKey(pKey); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){ + return list; + } + List pList=baseDao.selectProvince(); + areaCodeRedis.setNextAreaCodeKey(pKey,pList); + return pList; + } + String key=RedisKeys.getNextAreaCodeKey(formDTO.getParentAreaCode()); + List list=areaCodeRedis.getNextAreaCodeKey(key); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){ + return list; + } + switch (formDTO.getParentLevel()) { + case AreaCodeConstant.PROVINCE: + list = baseDao.selectCity(formDTO.getParentAreaCode()); + break; + case AreaCodeConstant.CITY: + list = baseDao.selectDistrict(formDTO.getParentAreaCode()); + break; + case AreaCodeConstant.DISTRICT: + list = baseDao.selectStreet(formDTO.getParentAreaCode()); + break; + case AreaCodeConstant.STREET: + list = baseDao.selectCommunity(formDTO.getParentAreaCode()); + break; + case AreaCodeConstant.COMMUNITY: + log.info("社区无下级"); + list=null; + break; + default: + log.warn("parentLevel错误:"+formDTO.getParentLevel()); + } + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){ + areaCodeRedis.setNextAreaCodeKey(key,list); + } + return list; + } + private String addDistrictAreaCode(String cityCode, String countyName) { AreaCodeDTO city = baseDao.selectByCityCode(cityCode); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java index cb28fecad8..795f553af5 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java @@ -98,7 +98,7 @@ public class ImportTaskServiceImpl implements ImportTaskService { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ImportTaskEntity::getOperatorId,param.getOperatorId()) .orderByDesc(ImportTaskEntity::getStartTime); - Page page = PageHelper.startPage(param.getPageNo(), param.getPageSize(), param.isPage()).doSelectPage(() -> { + Page page = PageHelper.startPage(param.getPageNo(), param.getPageSize(), param.getIsPage()).doSelectPage(() -> { importRecordDao.selectList(queryWrapper); }); List list = new ArrayList<>(); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.14__add_areacode_flag.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.14__add_areacode_flag.sql new file mode 100644 index 0000000000..59b930701d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.14__add_areacode_flag.sql @@ -0,0 +1,20 @@ +#添加 是否自定义字段 +ALTER TABLE `epmet_common_service`.`area_code_child` + ADD COLUMN `USER_DEFINED` tinyint(1) NULL DEFAULT 0 COMMENT '是否自定义 1:是0否' AFTER `CATAGORY`; +#更新 字段值 +UPDATE area_code_child SET USER_DEFINED = 1 WHERE code like '%_UD%'; +#清空数据 +DELETE FROM area_code_child WHERE USER_DEFINED = 0; +#插入数据 +INSERT INTO `epmet_common_service`.`area_code_child` (`ID`, `CODE`, `NAME`, `P_CODE`, `LEVEL`, `CATAGORY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) +SELECT ID, `CODE`, `NAME`, `P_CODE`, `LEVEL`, `CATAGORY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` FROM area_code_child_new; + + +SELECT * FROM area_code_new WHERE county_code = '441900'; + +#清空数据 +DELETE FROM area_code where 1=1; +#插入数据 +INSERT INTO `epmet_common_service`.`area_code` +SELECT * FROM area_code_new; +SELECT COUNT(1) FROM area_code; diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml index 9eaffba75a..eca90f2415 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml @@ -27,4 +27,85 @@ order by ac.COUNTY_CODE desc limit 1 + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java index c4f703049c..57ac759211 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java +++ b/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"; /** diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java index cb8b6b2724..4a861062c2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java @@ -122,6 +122,9 @@ public class AddPlacePatrolRecordFormDTO implements Serializable { //token中userId private String staffId; - public interface Add {} + @NotBlank(message = "placePatrolRecordId不能为空", groups = {Update.class}) + private String placePatrolRecordId; + public interface Add {} + public interface Update {} } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java index 3a3ca19096..ae5a6d07ba 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -78,4 +78,17 @@ public class HouseInfoDTO implements Serializable { private String allName; private String customerId; + + /** + * 小区所在的组织id + */ + private String agencyId; + /** + * eg:市北区-阜新路街道-南宁社区 + */ + private String agencyPathName; + /** + * 组织的area_code + */ + private String areaCode; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index ab86eb425b..09f29f5330 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -170,8 +170,13 @@ public class HouseController implements ResultDataResolver { return new Result(); } + /** + * lzh + * @param formDTO + * @return 单独删除房屋内部调用/gov/org/house/delete + */ @PostMapping("housedel") - public Result houseDel(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + public Result houseDel(@RequestBody IcHouseFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); houseService.delHouse(formDTO.getHouseId()); @@ -291,4 +296,16 @@ public class HouseController implements ResultDataResolver { return new Result(); } + /** + * 获取房屋信息 + * @param houseId + * @return + */ + @PostMapping("gethouseinfo/{houseId}") + public Result getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){ + if(StringUtils.isBlank(houseId)){ + return new Result<>(); + } + return new Result().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java index 0d2c02a3d6..bd232e2ca7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java @@ -60,6 +60,19 @@ public class IcPlacePatrolRecordController { return new Result(); } + /** + * @Author sun + * @Description 新增场所巡查记录 + **/ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlacePatrolRecordFormDTO.Add.class,AddPlacePatrolRecordFormDTO.Update.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + placePatrolRecordService.update(formDTO); + return new Result(); + } + /** * @Author sun * @Description 删除场所巡查记录 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index 74d38894e4..a651ed1615 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -26,7 +26,6 @@ import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.excel.IcHouseExcel; -import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; @@ -78,4 +77,6 @@ public interface HouseService { * @date 2022/3/1 4:57 下午 */ void allDelete(NeighborHoodManageDelFormDTO formDTO); + + HouseInfoDTO getHouseInfoDTO(String customerId,String houseId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java index 3b0c2c6e12..464059ac3d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java @@ -38,6 +38,8 @@ public interface IcPlacePatrolRecordService extends BaseService ids=new ArrayList<>(); + ids.add(houseId); + formDTO.setIds(ids); + allDelete(formDTO); } @Override @@ -455,4 +462,18 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { } } } + + @Override + public HouseInfoDTO getHouseInfoDTO(String customerId, String houseId) { + HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(houseId, customerId); + if (null != houseInfo && StringUtils.isNotBlank(houseInfo.getAgencyId())) { + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId()); + houseInfo.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName())?agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()):agencyInfoCache.getOrganizationName()); + houseInfo.setAreaCode(StringUtils.isNotBlank(agencyInfoCache.getAreaCode())?agencyInfoCache.getAreaCode():StrConstant.EPMETY_STR); + } else { + houseInfo.setAgencyPathName(StrConstant.EPMETY_STR); + houseInfo.setAreaCode(StrConstant.EPMETY_STR); + } + return houseInfo; + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java index 791f2beb4e..b094f0c226 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java @@ -692,7 +692,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl result = null; List list = null; - if (params.isPage()){ + if (params.getIsPage()){ Page objects = PageHelper.startPage(params.getPageNo(), params.getPageSize()).doSelectPage(() -> { baseDao.selectList(wrapper); }); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java index 5535988941..5ca0e8f74f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java @@ -17,7 +17,6 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; @@ -28,24 +27,17 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcPlacePatrolRecordDao; import com.epmet.dao.IcPlacePatrolTeamStaffDao; -import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.IcPlacePatrolTeamStaffDTO; import com.epmet.dto.form.AddPlacePatrolRecordFormDTO; import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; -import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; -import com.epmet.dto.result.*; -import com.epmet.entity.IcHouseEntity; +import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; import com.epmet.entity.IcPlacePatrolRecordEntity; -import com.epmet.entity.IcPlacePatrolTeamEntity; -import com.epmet.entity.IcPlacePatrolTeamStaffEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPlacePatrolRecordService; import com.epmet.service.IcPlacePatrolReviewRecordService; -import com.epmet.service.IcPlacePatrolTeamService; -import com.epmet.service.IcPlacePatrolTeamStaffService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -90,6 +82,23 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl userInfoResult = epmetUserFeignClient.getUserInfoAndRoles(userInfoParams); + //获取网格缓存信息 + if(userInfoResult.success()){ + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(userInfoResult.getData().getCurrentGridId()); + if (null == gridInfo) { + log.error(String.format("居民端进网格接口获取网格缓存信息失败,网格Id->%s",userInfoResult.getData().getCurrentGridId())); + return userInfoResult; + } + userInfoResult.getData().setAgencyId(gridInfo.getPid()); + userInfoResult.getData().setAgencyName(gridInfo.getAgencyName()); + } return userInfoResult; } } diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java index 6ee30a91e4..36b860a3e9 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java +++ b/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; } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java index d3ba9d2b22..a508fffe31 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java +++ b/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 baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); - if (!baseInfoResult.success()) { + Result 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; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java index 6b32f663fc..84a00be746 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java @@ -8,4 +8,11 @@ package com.epmet.constant; public interface IcResiUserConstant { String IC_RESI_USER = "ic_resi_user"; + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;单独录入:input; 导入:import + */ + String USER_TYPE_RESI="resi"; + String USER_TYPE_IC_RESI="icresi"; + String USER_TYPE_INPUT="input"; + String USER_TYPE_IMPORT="import"; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java new file mode 100644 index 0000000000..8234693f38 --- /dev/null +++ b/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,行程上报:0 + */ + @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 channel; + + /** + * 通知内容 + */ + private String content; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java new file mode 100644 index 0000000000..aba428a576 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java @@ -0,0 +1,142 @@ +package com.epmet.dto; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) +@Data +public class IcFollowUpRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface AddInternalGroup { + } + public interface AddUserRequired extends CustomerClientShowGroup { + } + + + /** + * 主键ID + */ + @ExcelIgnore + private String id; + + /** + * 客户Id + */ + @ExcelIgnore + private String customerId; + + /** + * 姓名 + */ + @ColumnWidth(20) + @ExcelProperty("姓名") + @NotBlank(message = "姓名不能为空", groups = {AddUserRequired.class}) + private String name; + + /** + * 手机号 + */ + @ColumnWidth(20) + @ExcelProperty("手机号") + @NotBlank(message = "手机号不能为空", groups = {AddUserRequired.class}) + private String mobile; + + /** + * 身份证号 + */ + @ColumnWidth(25) + @ExcelProperty("身份证号") + @NotBlank(message = "身份证号不能为空", groups = {AddUserRequired.class}) + private String idCard; + + /** + * 0行程上报,1疫苗接种,2核酸检测 + */ + @ColumnWidth(25) + @ExcelProperty("来源") + @NotBlank(message = "origin不能为空:0行程上报,1疫苗接种,2核酸检测", groups = {AddInternalGroup.class}) + private String origin; + + /** + * 随访时间 + */ + @ColumnWidth(25) + @ExcelProperty("随访时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "随访时间不能为空", groups = {AddUserRequired.class}) + private Date visitTime; + + /** + * 随访内容 + */ + @ColumnWidth(200) + @ExcelProperty("随访内容") + @NotBlank(message = "随访内容不能为空", groups = {AddUserRequired.class}) + @Length(message = "随访内容最多输入1000字", groups = {AddUserRequired.class}) + private String content; + + /** + * 工作人员所属组织id + */ + @ExcelIgnore + private String agencyId; + + /** + * 删除标识 1删除;0未删除 + */ + @ExcelIgnore + private String delFlag; + + /** + * 乐观锁 + */ + @ExcelIgnore + private Integer revision; + + /** + * 创建人 + */ + @ExcelIgnore + private String createdBy; + + /** + * 创建时间 + */ + @ExcelIgnore + private Date createdTime; + + /** + * 更新人 + */ + @ExcelIgnore + private String updatedBy; + + /** + * 更新时间 + */ + @ExcelIgnore + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java new file mode 100644 index 0000000000..dbd32f4463 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java @@ -0,0 +1,134 @@ +package com.epmet.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +/** + * 核酸上报记录 + + * + * @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; + + /** + * 是否客户下居民(0:否 1:是) + */ + private String isResiUser; + + /** + * 居民端小程序的用户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 channel = new ArrayList<>(); + /** + * 通知内容 + */ + private String content = ""; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatRelationDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatRelationDTO.java new file mode 100644 index 0000000000..eade3aac7b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatRelationDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 核酸记录关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-31 + */ +@Data +public class IcNatRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id + */ + private String agencyId; + + /** + * 组织pids,包含当前agencyId值 + */ + private String pids; + + /** + * 核酸记录表Id(ic_nat.id) + */ + private String icNatId; + + /** + * 关系数据的绑定途径【居民端录入:resi; +数字社区录入:icresi; +导入的:import; +同步的:synchro】 + */ + private String userType; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java new file mode 100644 index 0000000000..72520ef800 --- /dev/null +++ b/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 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; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiVaccineDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiVaccineDTO.java new file mode 100644 index 0000000000..57ea1109e3 --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java new file mode 100644 index 0000000000..47d23549da --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java @@ -0,0 +1,218 @@ +package com.epmet.dto; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) +@Data +public class IcTripReportRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelIgnore + private String id; + + /** + * 居民端用户所在网格id,数字社区居民所属网格id + */ + @ExcelIgnore + private String gridId; + + /** + * 居民端上报的:存储用户所在网格的组织id; + */ + @ExcelIgnore + private String agencyId; + + /** + * agency_id的所有上级 + */ + @ExcelIgnore + private String pids; + + /** + * 客户Id + */ + @ExcelIgnore + private String customerId; + + /** + * 姓名 + */ + @ColumnWidth(15) + @ExcelProperty("姓名") + private String name; + + /** + * 手机号 + */ + @ColumnWidth(15) + @ExcelProperty("手机号") + private String mobile; + + /** + * 身份证号 + */ + @ColumnWidth(22) + @ExcelProperty("身份证号") + private String idCard; + + /** + * 用户id + */ + @ExcelIgnore + private String userId; + + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;单独录入:input; 导入:import + */ + @ExcelIgnore + private String userType; + + /** + * 现居地编码 + */ + @ExcelIgnore + private String presentAddressCode; + + /** + * 现居地编码路径:"presentAddressPathCode":"37,3702,370203,370203026,370203026002" + */ + @ExcelIgnore + private String presentAddressPathCode; + + /** + * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 + */ + @ColumnWidth(50) + @ExcelProperty("现居地") + private String presentAddress; + + /** + * 详细地址 + */ + @ColumnWidth(35) + @ExcelProperty("详细地址") + private String detailAddress; + + /** + * 来源地区编码 + */ + @ExcelIgnore + private String sourceAddressCode; + + /** + * 来源地编码路径: "sourceAddressPathCode": "37,3702,370203,370203026,370203026002" + */ + @ExcelIgnore + private String sourceAddressPathCode; + + /** + * 来源地区地址 + */ + @ColumnWidth(50) + @ExcelProperty("来自地区") + private String sourceAddress; + + /** + * 到达日期 + */ + @ColumnWidth(25) + @ExcelProperty("来到本地时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date arriveDate; + + /** + * 离开日期 + */ + @ColumnWidth(25) + @ExcelProperty("离开本地时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date leaveDate; + + /** + * pc行程上报-列表返参:最近一次通知时间 + */ + @ColumnWidth(25) + @ExcelProperty("最近一次通知时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date latestNoticeTime; + + /** + * 备注信息 + */ + @ColumnWidth(100) + @ExcelProperty("备注") + private String remark; + + /** + * 删除标识 1删除;0未删除 + */ + @ExcelIgnore + private String delFlag; + + /** + * 乐观锁 + */ + @ExcelIgnore + private Integer revision; + + /** + * 创建人 + */ + @ExcelIgnore + private String createdBy; + + /** + * 创建时间 + */ + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + + /** + * 更新人 + */ + @ExcelIgnore + private String updatedBy; + + /** + * 更新时间 + */ + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updatedTime; + + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private Date reportTime; + + + /** + * pc行程上报-列表返参:是否加入核酸检测关注名单:true:已加入;false:未加入 + */ + @ExcelIgnore + private Boolean heSuanCheck; + + @ColumnWidth(20) + @ExcelProperty("核算检测关注名单") + private String heSuanCheckDesc; +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java new file mode 100644 index 0000000000..9472ea4314 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -0,0 +1,105 @@ +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 javax.validation.constraints.NotNull; +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 { + } + public interface Edit extends CustomerClientShowGroup { + } + + /** + * 核酸记录Id,修改时使用 + */ + @NotBlank(message = "组织Id不能为空", groups = Edit.class) + 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; + /** + * 检测时间 + */ + @NotNull(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 String isResiUser = "0"; + /** + * 通知渠道 0小程序通知,1短信通知,多选是数组 + */ + private List channel = new ArrayList<>(); + /** + * 通知内容 + */ + private String content = ""; + + //token中信息 + private String customerId; + private String staffId; + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java new file mode 100644 index 0000000000..183c59195f --- /dev/null +++ b/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 idCards; + + /** + * 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + */ + @NotNull(message = "attentionType不能为空",groups = CancelAttentionPackageForm.class) + private Integer attentionType ; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java new file mode 100644 index 0000000000..83d22c6a13 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/29 14:17 + */ +@NoArgsConstructor +@Data +public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = 3610567618492110219L; + private String id; + /** + * 客户ID + */ + private String customerId; + /** + * 组织ID + */ + private String agencyId; + /** + * 网格ID + */ + private String gridId; + /** + * 小区ID + */ + private String neighborId; + /** + * 楼栋ID + */ + private String buildingId; + /** + * 单元ID + */ + private String unitId; + /** + * 房屋ID + */ + private String houseId; + /** + * 姓名 + */ + private String name; + /** + * 手机 + */ + private String mobile; + /** + * 身份证 + */ + private String idCard; + + /** + * 开始日期 + */ + private String startDate; + + /** + * 结束日期 + */ + private String endDate; + /** + * 疫苗接种次数 + */ + private Integer vaccineCount; + /** + * 核酸检测次数 + */ + private Integer natCount; + + /** + * 关注类型,核酸检测:2,疫苗接种:1 + */ + private Integer attentionType; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java new file mode 100644 index 0000000000..09919051b9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java @@ -0,0 +1,22 @@ +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; + private String noticeId; + @NotBlank(message = "身份证号不能为空", groups = DefaultGroup.class) + private String idCard; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java index 21f2244129..9acd851ab3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java +++ b/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; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 2dccf23b59..a3fca9b02b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/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; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java new file mode 100644 index 0000000000..d9a7f4d565 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java @@ -0,0 +1,180 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 行程上报居民端入参 + */ +@Data +public class IcTripReportFormDTO implements Serializable { + public interface ResiUserInternalGroup { + } + + public interface ResiUserRequired extends CustomerClientShowGroup { + } + + public interface PcAddOrUpdateInternalGroup { + } + public interface PcAddRequired extends CustomerClientShowGroup { + } + public interface IcResiInternalGroup { + } + + public interface PcUpdateRequired extends CustomerClientShowGroup { + } + + @NotBlank(message = "主键不能为空", groups = {PcUpdateRequired.class}) + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + private String name; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + private String mobile; + + /** + * 身份证号 + */ + @NotBlank(message = "身份证号不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + private String idCard; + + /** + * 是否添加到核算检测关注名单,true加入;默认false不加入 + */ + @NotNull(message = "是否添加到核算检测关注名单", groups = {PcAddRequired.class,PcUpdateRequired.class}) + private Boolean heSuanCheck; + /** + * 现居地编码 + */ + @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class}) + private String presentAddressCode; + + /** + * 现居地编码路径:"presentAddressPathCode":"37,3702,370203,370203026,370203026002" + */ + @NotBlank(message = "现居地编码路径不能为空", groups = {ResiUserRequired.class}) + private String presentAddressPathCode; + + /** + * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 + */ + @NotBlank(message = "现居地名称不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + private String presentAddress; + + /** + * 详细地址 + */ + @NotBlank(message = "详细地址不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + private String detailAddress; + + /** + * 来源地区编码 + */ + @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class}) + private String sourceAddressCode; + + /** + * 来源地编码路径: "sourceAddressPathCode": "37,3702,370203,370203026,370203026002" + */ + @NotBlank(message = "来自地编码路径不能为空", groups = {ResiUserRequired.class}) + private String sourceAddressPathCode; + + /** + * 来源地区地址 + */ + @NotBlank(message = "来自地区名称不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + private String sourceAddress; + + /** + * 到达日期 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + @NotNull(message = "来到本地时间不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + private Date arriveDate; + + /** + * 离开日期 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date leaveDate; + + /** + * 备注信息 + */ + @Length(max = 500, message = "备注最多可输入500字", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + private String remark; + + + /** + * userType=icresi时,必填,取值居民所属的网格ID; + * 居民端小程序上报前端赋值当前用户所在的网格id + */ + @NotBlank(message = "网格不能为空", groups = {ResiUserInternalGroup.class,IcResiInternalGroup.class}) + private String gridId; + + + /** + * 用户id + * 居民端上报时后端自己赋值 + * pc录入如果是从居民信息选择,此列有值 + */ + @NotBlank(message = "userId不能为空", groups = {IcResiInternalGroup.class}) + private String userId; + + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;单独录入:input; 导入:import + * 居民端上报是后端赋值;导入后端赋值 + * pc录入是前端赋值 + */ + @NotBlank(message = "数字社区的居民:icresi;其他:other", groups = {PcAddOrUpdateInternalGroup.class}) + private String userType; + + /** + * userType=icresi时,必填。 + * 居民所属的组织id + */ + @NotBlank(message = "agencyId不能为空", groups = {IcResiInternalGroup.class}) + private String agencyId; + + /** + * pc录入时用 + */ + private String currentStaffId; + + /** + * pc录入时用 + * 通知渠道 0小程序通知,1短信通知 + */ + private List channel = new ArrayList<>(); + /** + * pc录入时用 + * 通知内容 + */ + private String content = ""; + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LatestSubmitCollectFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LatestSubmitCollectFormDTO.java new file mode 100644 index 0000000000..547e469085 --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java index 7c1af89a00..76e5c31d4d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java +++ b/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; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java new file mode 100644 index 0000000000..0272a30799 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java @@ -0,0 +1,66 @@ +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 Detail extends CustomerClientShowGroup { + } + public interface Del extends CustomerClientShowGroup { + } + public interface Synchro extends CustomerClientShowGroup { + } + + /** + * 身份证号 + */ + private String idCard; + /** + * 当前组织:current 根组织:all + */ + private String orgType; + private String agencyId; + /** + * 姓名 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 是否客户下居民(0:否 1:是) + */ + private String isResiUser; + /** + * 检测开始时间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; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyReportedTripFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyReportedTripFormDTO.java new file mode 100644 index 0000000000..f97ad3c6c7 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyReportedTripFormDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * 居民端小程序:我的上报 + */ +@Data +public class MyReportedTripFormDTO extends PageFormDTO { + private String userId; + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java new file mode 100644 index 0000000000..85b56ecb29 --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java new file mode 100644 index 0000000000..ab4a416d9e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + + +@Data +public class PageFollowUpFormDTO extends PageFormDTO { + + /** + * 身份证号 + */ + @NotBlank(message = "身份证号不能为空", groups = {AddUserShowGroup.class}) + private String idCard; + + @NotBlank(message = "身份证号不能为空", groups = {AddUserShowGroup.class}) + private String name; + + /** + * 0行程上报,1疫苗接种,2核酸检测 + */ + @NotBlank(message = "origin不能为空:0行程上报,1疫苗接种,2核酸检测", groups = {AddUserInternalGroup.class}) + private String origin; + + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java new file mode 100644 index 0000000000..af23243c03 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +@Data +public class PageTripReportFormDTO extends PageFormDTO implements Serializable { + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 来源地区编码 + */ + private String sourceAddressCode; + /** + * 来源地区名称 + */ + private String sourceAddress; + /** + * 来到本地时间 + */ + private Date startDate; + private Date endDate; + + /** + * token里设置 + */ + private String customerId; + private String userId; + + /** + * 工作人员所属组织id + */ + private String agencyId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java new file mode 100644 index 0000000000..9778cb6a17 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java @@ -0,0 +1,114 @@ +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; + @NotBlank(message = "小区名不能为空", groups = InternalShowGroup.class) + private String villageName; + + /** + * 所属楼宇Id + */ + @NotBlank(message = "楼栋不能为空", groups = InternalShowGroup.class) + private String buildId; + @NotBlank(message = "楼栋名不能为空",groups = InternalShowGroup.class) + private String buildName; + + /** + * 单元id + */ + @NotBlank(message = "单元不能为空", groups = InternalShowGroup.class) + private String unitId; + @NotBlank(message = "单元名不能为空",groups = InternalShowGroup.class) + private String unitName; + + /** + * 所属家庭Id + */ + @NotBlank(message = "家庭不能为空", groups = InternalShowGroup.class) + private String homeId; + @NotBlank(message = "家庭名不能为空",groups = InternalShowGroup.class) + private String homeName; + + /** + * 详细地址 + */ + @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 memberList; + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java new file mode 100644 index 0000000000..bd24801531 --- /dev/null +++ b/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; + private String staffId; + /** + * 用户列表 + */ + @NotNull(message = "用户列表不能为空", groups = DefaultGroup.class) + private List userList; + /** + * 通知渠道通知渠道 0小程序通知,1短信通知 + */ + @NotNull(message = "通知渠道不能为空", groups = DefaultGroup.class) + private List channel; + /** + * 通知来源 0 行程上报,1 疫苗接种,2 核酸检测 + */ + @NotNull(message = "通知来源不能为空", groups = DefaultGroup.class) + private String origin; + /** + * 通知内容 + */ + @NotNull(message = "通知内容不能为空", groups = DefaultGroup.class) + private String content; + /** + * 组织名 + */ + private String orgName; + + @NoArgsConstructor + @Data + public static class UserListBean { + /** + * 用户ID + */ + private String userId; + /** + * 手机号 + */ + private String mobile; + /** + * 身份证 + */ + private String idCard; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java new file mode 100644 index 0000000000..9206dbac24 --- /dev/null +++ b/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 list; + + private String userId; + + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java new file mode 100644 index 0000000000..fc69f5da84 --- /dev/null +++ b/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,行程上报:0 + */ + @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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java index da8e6cfd07..73b7d77ca6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java @@ -12,4 +12,6 @@ public class DemandUserResDTO implements Serializable { private String label; private String gridId; private String idCard; + private String agencyId; + private String houseId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionInfoDTO.java new file mode 100644 index 0000000000..9e74f6e2fa --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionInfoDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/29 16:19 + */ +@NoArgsConstructor +@Data +public class EpidemicPreventionInfoDTO implements Serializable { + private static final long serialVersionUID = -1845197091484928L; + private List natList; + private List vaccineList; + private List tripList; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java new file mode 100644 index 0000000000..0639371186 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/29 14:22 + */ +@NoArgsConstructor +@Data +public class EpidemicPreventionResultDTO implements Serializable { + private static final long serialVersionUID = -1901847880985531089L; + private String id; + /** + * 姓名 + */ + private String name; + /** + * 所属网格 + */ + private String gridId; + private String gridName; + /** + * 所属家庭 + */ + private String homeId; + private String houseName; + /** + * 手机号 + */ + private String mobile; + /** + * 身份证 + */ + private String idCard; + /** + * 疫苗接种次数 + */ + private Integer vaccineCount; + /** + * 核酸检测次数 + */ + private Integer natCount; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java new file mode 100644 index 0000000000..70247e24cd --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java @@ -0,0 +1,91 @@ +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; + + private String villageName; + private String buildName; + private String unitName; + private String homeName; + + @Valid + private List 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<>(); + this.villageName=""; + this.buildName=""; + this.unitName=""; + this.homeName=""; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyNatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyNatListResultDTO.java new file mode 100644 index 0000000000..feb97d97f5 --- /dev/null +++ b/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; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListCommonExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListCommonExcelResultDTO.java new file mode 100644 index 0000000000..15452546c4 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListCommonExcelResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; +import lombok.Data; + +/** + * @Description 核酸检测-我的上报记录 + * @Author sun + */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) +@Data +public class NatListCommonExcelResultDTO extends NatListResultDTO{ + private static final long serialVersionUID = 1L; + + /** + * 是否客户下居民(0:否 1:是) + */ + @ColumnWidth(20) + @ExcelProperty(value = "本辖区居民",order = 6) + private String isResiUser; + + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java new file mode 100644 index 0000000000..279a66393b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/29 16:19 + */ +@NoArgsConstructor +@Data +public class NatListDTO implements Serializable { + private static final long serialVersionUID = 6294272007213038642L; + private String testTime; + private String address; + private String result; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java new file mode 100644 index 0000000000..cbeb66e482 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java @@ -0,0 +1,95 @@ +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(value = "姓名",order = 1) + private String name; + + /** + * 手机号 + */ + @ColumnWidth(20) + @ExcelProperty(value = "手机号",order = 2) + private String mobile; + + /** + * 身份证号 + */ + @ColumnWidth(25) + @ExcelProperty(value = "身份证号",order = 3) + private String idCard; + + /** + * 检测时间,yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + @ColumnWidth(25) + @ExcelProperty(value = "检测时间",order = 4) + private Date natTime; + + /** + * 检测结果 + */ + @ColumnWidth(20) + @ExcelProperty(value = "检测结果",order = 5) + private String natResult; + + /** + * 是否客户下居民(0:否 1:是) + */ + @ExcelIgnore + private String isResiUser; + + /** + * 检测地点 + */ + @ColumnWidth(30) + @ExcelProperty(value = "检测地点",order = 7) + private String natAddress; + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TripListDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TripListDTO.java new file mode 100644 index 0000000000..09e33e55bc --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TripListDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/29 16:22 + */ +@NoArgsConstructor +@Data +public class TripListDTO implements Serializable { + private String fromRegion; + private String arrivalTime; + private String leaveTime; + private String noticeTime; + private String remark; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java index e8bff9cd33..1f24b52c86 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java @@ -77,4 +77,8 @@ public class UserInfoOnEnterGridResultDTO implements Serializable{ private String orgName = ""; //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) private String orgType = ""; + + //进入的网格所属组织 + private String agencyId; + private String agencyName; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java new file mode 100644 index 0000000000..a0b10a13d3 --- /dev/null +++ b/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 = ""; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccineListDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccineListDTO.java new file mode 100644 index 0000000000..294b6a10da --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccineListDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/29 16:20 + */ +@NoArgsConstructor +@Data +public class VaccineListDTO implements Serializable { + private static final long serialVersionUID = 182173953023413061L; + private String vaccinateTime; + private String manufactor; + private String address; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java new file mode 100644 index 0000000000..3e40404466 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java @@ -0,0 +1,46 @@ +package com.epmet.enums; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +/** + * @Author zxc + * @DateTime 2022/3/29 16:17 + * @DESC + */ +public enum AttentionTypeEnum { + + XCSB(0,"行程上报"), + YMJZ(1,"疫苗接种"), + NAT(2,"核酸检测") + ; + + private Integer key; + private String value; + + AttentionTypeEnum(Integer key, String value) { + this.key = key; + this.value = value; + } + + public static Integer getKeyByValue(String value){ + if (StringUtils.isBlank(value)){ + return NumConstant.ZERO; + } + for (AttentionTypeEnum a : AttentionTypeEnum.values()) { + if (a.getValue().equals(value)){ + return a.getKey(); + } + } + return NumConstant.ZERO; + } + + public Integer getKey() { + return key; + } + + public String getValue() { + return value; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java new file mode 100644 index 0000000000..d0df62c66f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java @@ -0,0 +1,44 @@ +package com.epmet.enums; + +import com.epmet.commons.tools.constant.NumConstant; +import org.apache.commons.lang3.StringUtils; + +/** + * @Author zxc + * @DateTime 2022/3/29 16:35 + * @DESC + */ +public enum ChannelEnum { + + MINI("0","小程序"), + MSG("1","短信") + ; + + private String key; + private String value; + + ChannelEnum(String key, String value) { + this.key = key; + this.value = value; + } + + public static String getKeyByValue(String value){ + if (StringUtils.isBlank(value)){ + return NumConstant.ONE_STR; + } + for (ChannelEnum a : ChannelEnum.values()) { + if (a.getValue().equals(value)){ + return a.getKey(); + } + } + return NumConstant.ONE_STR; + } + + public String getKey() { + return key; + } + + public String getValue() { + return value; + } +} diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index b5421e4e4e..154960f1db 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/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 -Xms32m -Xmx512m -jar ./epmet-user.jar" restart: "unless-stopped" diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index 03e2684534..7426c50aea 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/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" diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml index 5537d14081..c880913294 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml +++ b/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" diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index ebb7323aee..ce2571c4e0 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -18,25 +18,6 @@ epmet-admin-client 2.0.0 - - com.alibaba - easyexcel - 3.0.3 - - - poi - org.apache.poi - - - poi-ooxml - org.apache.poi - - - poi-ooxml-schemas - org.apache.poi - - - com.epmet epmet-user-client diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java new file mode 100644 index 0000000000..de3612756d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.EpidemicPreventionFormDTO; +import com.epmet.dto.result.EpidemicPreventionInfoDTO; +import com.epmet.dto.result.EpidemicPreventionResultDTO; +import com.epmet.service.IcResiUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Slf4j +@RestController +@RequestMapping("epidemicPrevention") +public class IcEpidemicPreventionController{ + + @Resource + private IcResiUserService icResiUserService; + + + /** + * 居民防疫信息查询 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< PageData>} + * @Author zhaoqifeng + * @Date 2022/3/29 14:25 + */ + @PostMapping("page") + public Result> search(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + PageData result = icResiUserService.epidemicPreventionList(formDTO); + return new Result>().ok(result); + } + + @PostMapping("user-list") + public Result> userList(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + PageData result = icResiUserService.userList(formDTO); + return new Result>().ok(result); + } + + /** + * 居民防疫信息详情 + * @Param formDTO + * @Return {@link Result< EpidemicPreventionResultDTO>} + * @Author zhaoqifeng + * @Date 2022/3/29 16:13 + */ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO); + return new Result().ok(result); + } + + @PostMapping("info") + public Result info(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO); + return new Result().ok(result); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java new file mode 100644 index 0000000000..b2d1ea6249 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -0,0 +1,201 @@ +package com.epmet.controller; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +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.exception.EpmetException; +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.constants.ImportTaskConstants; +import com.epmet.dto.IcEpidemicSpecialAttentionDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.excel.NatExportExcel; +import com.epmet.excel.NatImportExcel; +import com.epmet.excel.VaccinationExportExcel; +import com.epmet.excel.VaccinationImportExcel; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.service.IcEpidemicSpecialAttentionService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FilenameUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + + +/** + * 疫情特别关注 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@RestController +@RequestMapping("icEpidemicSpecialAttention") +@Slf4j +public class IcEpidemicSpecialAttentionController { + + @Autowired + private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + + /** + * Desc: 【疫苗接种关注名单,疫苗接种关注名单】列表 + * @param formDTO + * @author zxc + * @date 2022/3/28 10:29 + */ + @PostMapping("list") + public Result 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().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,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class); + icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO,tokenDto); + 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){ + if (file.isEmpty()) { + throw new EpmetException("请上传文件"); + } + // 校验文件类型 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (!"xls".equals(extension) && !"xlsx".equals(extension)) { + throw new EpmetException("文件类型不匹配"); + } + // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); + importTaskForm.setOriginFileName(file.getOriginalFilename()); + importTaskForm.setOperatorId(tokenDto.getUserId()); + if (attentionType.equals(NumConstant.ONE)){ + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_VACCINATION); + }else if (attentionType.equals(NumConstant.TWO)){ + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_NAT); + }else if (attentionType.equals(NumConstant.ZERO)){ + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_TRIP_REPORT); + } + Result result = commonServiceOpenFeignClient.createImportTask(importTaskForm); + if (!result.success()) { + throw new EpmetException(9999,"存在进行中的导入"); + } + InputStream inputStream = null; + try { + inputStream = file.getInputStream(); + }catch (Exception e){ + ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); + input.setOperatorId(tokenDto.getUserId()); + input.setTaskId(result.getData().getTaskId()); + input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + commonServiceOpenFeignClient.finishImportTask(input); + log.error("读取文件失败"); + } + icEpidemicSpecialAttentionService.importFile(tokenDto,inputStream,attentionType,result.getData().getTaskId()); + return new Result(); + } + + /** + * 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.setIsPage(false); + PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO); + // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + if (formDTO.getAttentionType().equals(NumConstant.ONE)){ + ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class); + }else { + ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), NatExportExcel.class); + } + + } + + @PostMapping("export-template") + public void exportTemplate(HttpServletResponse response, @RequestBody VaccinationListFormDTO formDTO) throws Exception { + TemplateExportParams templatePath = new TemplateExportParams(); + String fileName = ""; + Map map = new HashMap<>(); + // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + if (formDTO.getAttentionType().equals(NumConstant.ONE)){ + templatePath.setTemplateUrl("excel/attention_vaccination_template.xlsx"); + fileName = "疫苗接种关注名单导入模板"; + map.put("maplist",new ArrayList()); + }else if (formDTO.getAttentionType().equals(NumConstant.TWO)){ + templatePath.setTemplateUrl("excel/attention_nat_template.xlsx"); + fileName = "核酸检测关注名单导入模板"; + map.put("maplist",new ArrayList()); + } + ExcelPoiUtils.exportExcel(templatePath ,map,fileName,response); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java new file mode 100644 index 0000000000..7b0b375207 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java @@ -0,0 +1,149 @@ +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.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.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcFollowUpRecordDTO; +import com.epmet.dto.form.PageFollowUpFormDTO; +import com.epmet.service.IcFollowUpRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.Date; + + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Slf4j +@RestController +@RequestMapping("followup") +public class IcFollowUpRecordController { + + @Autowired + private IcFollowUpRecordService icFollowUpRecordService; + + /** + * 随访记录-列表 + * @param formDTO + * @return + */ + @PostMapping("page") + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody PageFollowUpFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserShowGroup.class,PageFormDTO.AddUserInternalGroup.class); + PageData page = icFollowUpRecordService.page(formDTO); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcFollowUpRecordDTO data = icFollowUpRecordService.get(id); + return new Result().ok(data); + } + + /** + * 随访记录-新增 + * @param dto + * @return + */ + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcFollowUpRecordDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setCreatedBy(tokenDto.getUserId()); + ValidatorUtils.validateEntity(dto, IcFollowUpRecordDTO.AddUserRequired.class,IcFollowUpRecordDTO.AddInternalGroup.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(); + } + + /** + * 随访记录-导出 + * 目前是导出个人 + * @param tokenDto + * @param formDTO + * @param response + */ + @NoRepeatSubmit + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody PageFollowUpFormDTO formDTO, HttpServletResponse response) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + //formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + formDTO.setIsPage(false); + + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + //导出文件名:张三随访记录0330 + String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD); + String fileName = formDTO.getName().concat("随访记录").concat(today).concat(".xlsx"); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcFollowUpRecordDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); + PageData data = null; + do { + data = icFollowUpRecordService.page(formDTO); + data.getList().forEach(o->{ + //0行程上报,1疫苗接种,2核酸检测 + switch(o.getOrigin()){ + case NumConstant.ZERO_STR: + o.setOrigin("行程上报"); + break; + case NumConstant.ONE_STR: + o.setOrigin("疫苗接种"); + break; + case NumConstant.TWO_STR: + o.setOrigin("核酸检测"); + break; + } + }); + formDTO.setPageNo(++pageNo); + excelWriter.write(data.getList(), writeSheet); + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size()==formDTO.getPageSize()); + + }catch (Exception e){ + log.error("export exception", e); + }finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } + } + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java new file mode 100644 index 0000000000..e2d6b7344f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -0,0 +1,318 @@ +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.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.validator.ValidatorUtils; +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.NatListCommonExcelResultDTO; +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.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 javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.file.Path; +import java.util.List; +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; + + /** + * 记录一下核酸记录模块的业务程序逻辑,防止后续理不清 ic_nat:基础信息表 ic_nat_relation:关系表 + * 1.数字平台导入时,按身份证检测时间查询数据,查到数据不是导入的状态则记录下并跳过,是导入数据更新结果,未查到直接新增 + * 是否居民以及userId值查询数据平台居民,能查到就相应的赋值; + * 2.居民端录入可以录自己的或别人的,但是数据属于当前录入的组织; + * 3.数据平台录入可以为已有居民录入也可以录新数据,新数据则是否居民和userId无值; + * 4.导入数据不允许修改删除,录入数据可以修改删除,删除时相应的删除基础表和可能存在的所有关心表数据, + * 数据同步可多次重复,只是修改对应的关系表数据,基础信息表数据公用; + * 5.同一条数据被A街道和A社区都同步了,街道在看本辖区数据时会看到两条,但是只有A街道的那一条才能看到取消同步按钮; + * 6.数据库一个人一个检测时间只存在一条记录,以导入数据结果为准,已导入的各项值都不能修改,即使错误也只能通过导入修改; + * 7.新增、删除居民时会相应的修改基础信息表是否居民以及userId的值; + * 注:1.导入数据不允许修改是觉得导入数据是官方提供的且没有问题的数据,不需要在平台有维护操作,只要看就可以了; + * 2.是否居民的查询条件以及是否居民的列标题在看整个客户列表数据时这两个都隐藏 + * + */ + + /** + * @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()); + formDTO.setStaffId(tokenDto.getUserId()); + icNucleinService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 核酸检测-居民端我的上报 + **/ + @NoRepeatSubmit + @PostMapping("mynatlist") + public Result> myNatList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(icNucleinService.myNatList(formDTO)); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + @NoRepeatSubmit + @PostMapping("natlist") + public Result> natList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(icNucleinService.natList(formDTO)); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息详情 + **/ + @NoRepeatSubmit + @PostMapping("detail") + public Result detail(@RequestBody MyNatListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Detail.class); + return new Result().ok(icNucleinService.detail(formDTO)); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息修改 + **/ + @NoRepeatSubmit + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Edit.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + 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(); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息取消同步 + **/ + @NoRepeatSubmit + @PostMapping("cancelsynchro") + public Result cancelSynchro(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Synchro.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icNucleinService.cancelSynchro(formDTO); + return new Result<>(); + } + + /** + * 导入excel + * @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.setIsPage(false); + + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + // 这里 需要指定写用哪个class去写 + String fileName = "核酸检测信息.xlsx"; + if ("all".equals(formDTO.getOrgType())) { + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), NatListResultDTO.class).build(); + }else { + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), NatListCommonExcelResultDTO.class).build(); + } + + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); + PageData data = null; + do { + data = icNucleinService.natList(formDTO); + data.getList().forEach(o-> { + o.setNatResult(NumConstant.ONE_STR.equals(o.getNatResult()) ? "阳性" : "阴性"); + o.setIsResiUser(NumConstant.ONE_STR.equals(o.getIsResiUser()) ? "是" : "否"); + }); + formDTO.setPageNo(++pageNo); + if ("current".equals(formDTO.getOrgType())) { + List list = ConvertUtils.sourceToTarget(data.getList(), NatListResultDTO.class); + excelWriter.write(list, writeSheet); + }else{ + excelWriter.write(data.getList(), writeSheet); + } + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); + + }catch (Exception e){ + log.error("export exception", e); + }finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java new file mode 100644 index 0000000000..9fb17bbd23 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java @@ -0,0 +1,24 @@ +package com.epmet.controller; + +import com.epmet.service.IcNatRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 核酸记录关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-31 + */ +@RestController +@RequestMapping("icNatRelation") +public class IcNatRelationController { + + @Autowired + private IcNatRelationService icNatRelationService; + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java new file mode 100644 index 0000000000..b0b8a31553 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java @@ -0,0 +1,82 @@ +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> page(@LoginUser TokenDto tokenDto, @RequestBody IcNoticeFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + PageData page = icNoticeService.page(formDTO); + return new Result>().ok(page); + } + + @RequestMapping(method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@RequestBody IcNoticeFormDTO formDTO){ + IcNoticeDTO data = icNoticeService.get(formDTO.getNoticeId()); + return new Result().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()); + formDTO.setStaffId(tokenDto.getUserId()); + icNoticeService.sendNotice(formDTO); + return new Result(); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java index 7b8df6ad1d..c25f04bc2b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java +++ b/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; @@ -89,7 +92,7 @@ public class IcResiCollectController { //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); formDTO.setUserId(tokenDto.getUserId()); formDTO.setCustomerId(tokenDto.getCustomerId()); - formDTO.setPage(false); + formDTO.setIsPage(false); PageData collectList = icResiCollectService.getCollectList(formDTO); List list =new ArrayList<>(); @@ -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 latestSubmit(@LoginUser TokenDto tokenDto, @RequestBody LatestSubmitCollectFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,LatestSubmitCollectFormDTO.AddUserInternalGroup.class); + return new Result().ok(icResiCollectService.latestSubmit(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java new file mode 100644 index 0000000000..722c2966eb --- /dev/null +++ b/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> page(@RequestParam Map params){ + PageData page = icResiVaccineService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcResiVaccineDTO data = icResiVaccineService.get(id); + return new Result().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(); + } + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java new file mode 100644 index 0000000000..e50ed23b70 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java @@ -0,0 +1,277 @@ +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.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.IcResiUserConstant; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dto.IcTripReportRecordDTO; +import com.epmet.dto.form.IcTripReportFormDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.MyReportedTripFormDTO; +import com.epmet.dto.form.PageTripReportFormDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.service.IcTripReportRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.file.Path; +import java.util.Date; +import java.util.List; +import java.util.UUID; + + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v10.0 2022-03-25 + */ +@Slf4j +@RestController +@RequestMapping("tripreport") +public class IcTripReportRecordController implements ResultDataResolver { + + @Autowired + private IcTripReportRecordService icTripReportRecordService; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + + /** + * pc: 行程上报-列表 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("page") + public Result> page(@LoginUser TokenDto tokenDto,@RequestBody PageTripReportFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(PageFormDTO.AddUserInternalGroup.class); + PageData page = icTripReportRecordService.page(formDTO); + return new Result>().ok(page); + } + + /** + * pc: 行程上报-新增 + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto,@RequestBody IcTripReportFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PcAddRequired.class,IcTripReportFormDTO.PcAddOrUpdateInternalGroup.class); + if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){ + ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class); + } + String id=icTripReportRecordService.save(formDTO); + return new Result().ok(id); + } + + /** + * pc: 行程上报-修改 + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto,@RequestBody IcTripReportFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PcUpdateRequired.class,IcTripReportFormDTO.PcAddOrUpdateInternalGroup.class); + if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){ + ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class); + } + return new Result().ok(icTripReportRecordService.update(formDTO)); + } + + /** + * pc:行程上报-删除 + * + * @param ids + * @return + */ + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody String[] ids) { + if (ArrayUtils.isEmpty(ids)) { + return new Result(); + } + icTripReportRecordService.delete(tokenDto.getCustomerId(),tokenDto.getUserId(),ids); + return new Result(); + } + + /** + * 居民端小程序:上报行程 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("resi-save") + public Result resiSave(@LoginUser TokenDto tokenDto, @RequestBody IcTripReportFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setUserType(IcResiUserConstant.USER_TYPE_RESI); + ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.ResiUserRequired.class,IcTripReportFormDTO.ResiUserInternalGroup.class); + return new Result().ok(icTripReportRecordService.resiSave(formDTO)); + } + + /** + * 居民端小程序:我的上报 + * @param tokenDto + * @return + */ + @PostMapping("resi-list") + public Result> resiList(@LoginUser TokenDto tokenDto,@RequestBody MyReportedTripFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icTripReportRecordService.resiList(formDTO)); + } + + /** + * pc:行程上报-下载模板 + * @param response + * @throws IOException + */ + @RequestMapping(value = "template-download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("行程上报导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/trip_report_import_template.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + /** + * pc:行程上报-导出 + * @param tokenDto + * @param formDTO + * @param response + */ + @NoRepeatSubmit + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody PageTripReportFormDTO formDTO, HttpServletResponse response) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + // formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + // formDTO.setUserId("35005df15fb0f7c791344f0b424870b7"); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + // 这里 需要指定写用哪个class去写 + String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD); + String fileName = "行程上报信息".concat(today); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcTripReportRecordDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); + PageData data = null; + do { + data = icTripReportRecordService.page(formDTO); + formDTO.setPageNo(++pageNo); + excelWriter.write(data.getList(), writeSheet); + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); + + } catch (Exception e) { + log.error("export exception", e); + } finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + + /** + * 导入excel + * @return + */ + @PostMapping("import") + public Result importExcel(MultipartFile file) { + String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_trip_preport", "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【行程上报导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); + } + + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + e.printStackTrace(); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + + // 2.生成导入任务记录 + ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); + importTaskForm.setOperatorId(userId); + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_IC_TRIP_REPORT); + importTaskForm.setOriginFileName(originalFilename); + + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "excel行程上报导入错误", + "行程上报导入失败"); + + // 3.执行导入 + icTripReportRecordService.execAsyncExcelImport(fileSavePath, rstData.getTaskId()); + return new Result(); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java index 41f14362ee..f018a32789 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java @@ -43,7 +43,7 @@ public class PatrolRoutineWorkController { @NoRepeatSubmit @PostMapping("selectList") public Result> gridUserWork(@RequestBody PatrolQueryFormDTO formDTO){ - formDTO.setPage(false); + formDTO.setIsPage(false); Page data = gridUserWorkService.listPage(formDTO); return new Result().ok(data.getResult()); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java new file mode 100644 index 0000000000..ba1564855e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java @@ -0,0 +1,63 @@ +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 { + + /** + * Desc: 疫苗接种关注名单 + * @param formDTO + * @author zxc + * @date 2022/3/28 14:19 + */ + List vaccinationList(VaccinationListFormDTO formDTO); + + /** + * Desc: 核酸检测关注名单 + * @param formDTO + * @author zxc + * @date 2022/3/28 15:23 + */ + List natList(VaccinationListFormDTO formDTO); + + /** + * Desc: 取消关注 + * @param list + * @param attentionType + * @author zxc + * @date 2022/3/28 16:59 + */ + void cancelAttention(@Param("list")List list,@Param("attentionType")Integer attentionType); + + /** + * Desc: 查询已经存在的关注 + * @param attentionType + * @param list + * @author zxc + * @date 2022/3/28 17:29 + */ + List getExistList(@Param("attentionType")Integer attentionType,@Param("list")List list); + + /** + * 返回idCardSet中已经关注的身份证号 + * + * @param idCardSet + * @param attentionType + * @return + */ + List getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") List idCardSet, @Param("attentionType") Integer attentionType); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java new file mode 100644 index 0000000000..0117f48651 --- /dev/null +++ b/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 { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java new file mode 100644 index 0000000000..5496919f3c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -0,0 +1,69 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcNatDTO; +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 { + + /** + * @Author sun + * @Description 核酸检测-按条件查询核酸记录 + **/ + List getMyNatList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】本辖区核酸检测信息列表 + **/ + List getNatList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】客户下核酸检测信息列表 + **/ + List getCustomerNatList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 删除操作--物理删除业务数据 + **/ + int delById(@Param("icNatId") String icNatId); + + /** + * 插入或者更新 + * + * @param e + */ + void insertOrUpdate(IcNatEntity e); + + /** + * @Author sun + * @Description 按条件查询业务数据 + **/ + IcNatDTO getNatDTO(@Param("customerId") String customerId, @Param("icNatId") String icNatId, @Param("idCard") String idCard, @Param("natTime") String natTime, @Param("natResult") String natResult); + + /** + * desc:根据客户id 更新是否居民状态 + * + * @param customerId + * @param icResiUserId 如果为空则更新全部 + * @return + */ + int updateIsResiFlag(@Param("customerId") String customerId, @Param("icResiUserId") String icResiUserId); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java new file mode 100644 index 0000000000..0b37f87121 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java @@ -0,0 +1,22 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcNatRelationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 核酸记录关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-31 + */ +@Mapper +public interface IcNatRelationDao extends BaseDao { + + /** + * @Author sun + * @Description 关系数据删除--物理删除 + **/ + int delRelation(@Param("icNatId") String icNatId, @Param("agencyId") String agencyId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java new file mode 100644 index 0000000000..a5f035887d --- /dev/null +++ b/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 { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java index f70f0e04ff..2602b5858a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java @@ -23,7 +23,8 @@ public interface IcResiCollectDao extends BaseDao { 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 { */ List getCollectList(CollectListFormDTO formDTO); + /** + * 我上次提交的主表记录 + * @param customerId + * @param userId + * @return + */ + String selectLastSubmitId(@Param("customerId") String customerId, @Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java index e4748e01b2..e61539e1da 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java +++ b/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 { - + + List selectMySubmit(@Param("latestResiCollectId") String latestResiCollectId, @Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 596b61446d..f5ebf8ac51 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.EpidemicPreventionFormDTO; import com.epmet.dto.form.ResiUserQueryValueDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; @@ -53,15 +54,16 @@ public interface IcResiUserDao extends BaseDao { **/ void upTable(@Param("tableName") String tableName, @Param("id") String id, @Param("map") Map map); - List> selectListResiMap(@Param("customerId") String customerId, - @Param("formCode") String formCode, - @Param("conditions") List conditions, - @Param("resultColumns") List resultColumns, - @Param("subTables") List subTables, - @Param("currentStaffAgencyId")String currentStaffAgencyId, - @Param("staffOrgPath") String staffOrgPath, - @Param("resultTableName")String resultTableName, - @Param("keyword") String keyword); + List> selectListResiMap(@Param("customerId") String customerId, + @Param("formCode") String formCode, + @Param("conditions") List conditions, + @Param("resultColumns") List resultColumns, + @Param("subTables") List subTables, + @Param("currentStaffAgencyId") String currentStaffAgencyId, + @Param("staffOrgPath") String staffOrgPath, + @Param("resultTableName") String resultTableName, + @Param("keyword") String keyword); + /** * 查询主表 * @@ -237,15 +239,15 @@ public interface IcResiUserDao extends BaseDao { List listIcResiInfosByUserIds(@Param("userIds") List userIds); - Map getCategoryListMap(@Param("columns")List columns, @Param("icUserId") String icUserId); + Map getCategoryListMap(@Param("columns") List columns, @Param("icUserId") String icUserId); Map selectResiInfoMap(@Param("idCard") String idCard, @Param("resiId") String resiId); - List> selectResiUsers(@Param("types")List types,@Param("orgId")String orgId); + List> selectResiUsers(@Param("types") List types, @Param("orgId") String orgId); List icUserCustomerIds(); - List> getIcUserList(@Param("customerId") String customerId, @Param("columns")List columns); + List> getIcUserList(@Param("customerId") String customerId, @Param("columns") List columns); /** * desc: 获取数据分析列中的 各类居民数据 @@ -253,9 +255,9 @@ public interface IcResiUserDao extends BaseDao { * @param customerId * @param tableName * @param columnList - * @param id 非必填 leve有值时 必填 - * @param level 非必填 - * @return java.util.Map 字段名:数量 + * @param id 非必填 leve有值时 必填 + * @param level 非必填 + * @return java.util.Map 字段名:数量 * @author LiuJanJun * @date 2022/2/12 3:03 下午 */ @@ -264,10 +266,26 @@ public interface IcResiUserDao extends BaseDao { /** * Desc: 根据房屋IDs查询房屋下是否有存在居民的 + * * @param ids * @author zxc * @date 2022/3/2 10:32 上午 */ List getExistUserByHouseIds(@Param("ids") List ids); + /** + * 居民防疫信息查询 + * + * @Param formDTO + * @Return {@link List< EpidemicPreventionResultDTO>} + * @Author zhaoqifeng + * @Date 2022/3/29 14:52 + */ + List getEpidemicPreventionList(EpidemicPreventionFormDTO formDTO); + + List natList(EpidemicPreventionFormDTO formDTO); + + List vaccineList(EpidemicPreventionFormDTO formDTO); + + IcResiUserEntity selectResiNoDelFlag(@Param("icResiUserId") String icResiUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiVaccineDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiVaccineDao.java new file mode 100644 index 0000000000..4679c59587 --- /dev/null +++ b/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 { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java new file mode 100644 index 0000000000..6d98de7a80 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java @@ -0,0 +1,45 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcTripReportRecordDTO; +import com.epmet.dto.form.PageTripReportFormDTO; +import com.epmet.entity.IcTripReportRecordEntity; +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 IcTripReportRecordDao extends BaseDao { + + /** + * 居民端小程序:我的上报 + * @param userId + * @param customerId + * @param idCard + * @return + */ + List selectMyReported(@Param("userId") String userId, @Param("customerId") String customerId, @Param("idCard") String idCard); + + /** + * pc: 行程上报-列表 + * @param formDTO + * @return + */ + List pageList(PageTripReportFormDTO formDTO); + + /** + * pc:行程上报-删除 + * @param userId + * @param agencyId + * @param ids + * @return + */ + int batchDel(@Param("userId")String userId,@Param("agencyId")String agencyId, @Param("ids")String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java index 3cd4c5ffe2..ab4ca3ec5c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java @@ -90,4 +90,6 @@ public interface UserBaseInfoDao extends BaseDao { Integer selectCountIdNum(@Param("idNum") String idNum, @Param("customerId")String customerId, @Param("excludeUserId")String excludeUserId); + + String selectIdCard(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java new file mode 100644 index 0000000000..52e6ff132f --- /dev/null +++ b/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,行程上报:0 + */ + private Integer attentionType; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 原因 + */ + private String reason; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java new file mode 100644 index 0000000000..8f976d02b2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java @@ -0,0 +1,63 @@ +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; + + /** + * 工作人员所属组织id + */ + private String agencyId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java new file mode 100644 index 0000000000..7744ce67c6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java @@ -0,0 +1,92 @@ +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; + + /** + * 是否客户下居民(0:否 1:是) + */ + private String isResiUser; + + /** + * 居民端小程序的用户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; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java new file mode 100644 index 0000000000..ce74babe94 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java @@ -0,0 +1,55 @@ +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-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_nat_relation") +public class IcNatRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id + */ + private String agencyId; + + /** + * 组织pids,包含当前agencyId值 + */ + private String pids; + + /** + * 核酸记录表Id(ic_nat.id) + */ + private String icNatId; + + /** + * 关系数据的绑定途径【居民端录入:resi; + 数字社区录入:icresi; + 导入的:import; + 同步的:synchro】 + */ + private String userType; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java new file mode 100644 index 0000000000..133d56dfcd --- /dev/null +++ b/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; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java index 1123bca8b8..8b6a20d87b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java @@ -82,5 +82,8 @@ public class IcResiCollectEntity extends BaseEpmetEntity { * 居住成员人数 */ private Integer totalResi; - + private String villageName; + private String buildName; + private String unitName; + private String homeName; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiVaccineEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiVaccineEntity.java new file mode 100644 index 0000000000..f26abbe525 --- /dev/null +++ b/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; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java new file mode 100644 index 0000000000..f14eb97013 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java @@ -0,0 +1,119 @@ +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,数字社区居民所属网格id + */ + private String gridId; + + /** + * 居民端上报的:存储用户所在网格的组织id; + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 用户id + */ + private String userId; + + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;单独录入:input; 导入:import + */ + private String userType; + + /** + * 现居地编码 + */ + private String presentAddressCode; + + /** + * 现居地编码路径:"presentAddressPathCode":"37,3702,370203,370203026,370203026002" + */ + private String presentAddressPathCode; + + /** + * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 + */ + private String presentAddress; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 来源地区编码 + */ + private String sourceAddressCode; + + /** + * 来源地编码路径: "sourceAddressPathCode": "37,3702,370203,370203026,370203026002" + */ + private String sourceAddressPathCode; + + /** + * 来源地区地址 + */ + private String sourceAddress; + + /** + * 到达日期 + */ + private Date arriveDate; + + /** + * 离开日期 + */ + private Date leaveDate; + + /** + * 备注信息 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcFollowUpRecordExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcFollowUpRecordExcel.java new file mode 100644 index 0000000000..8f3eb1ecc0 --- /dev/null +++ b/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; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java new file mode 100644 index 0000000000..446ba0075a --- /dev/null +++ b/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; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java new file mode 100644 index 0000000000..2f690d2d7c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java @@ -0,0 +1,66 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelIgnore; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/3/29 15:47 + * @DESC + */ +@Data +public class ImportEpidemicSpecialAttention extends ExcelVerifyInfo { + + /** + * 姓名 + */ + @Excel(name = "姓名") + private String name; + + /** + * 手机号 + */ + @Excel(name = "手机号") + private String mobile; + + /** + * 身份证号 + */ + @Excel(name = "身份证号") + private String idCard; + + /** + * 原因 + */ + @Excel(name = "关注原因") + private String reason; + + /** + * 备注 + */ + @Excel(name = "备注") + private String remark; + + @ExcelIgnore + private Integer attentionType; + + @Excel(name = "通知内容") + private String content; + + @Excel(name = "通知渠道") + private String channelString; + + @ExcelIgnore + private List channel; + + @ExcelIgnore + private Boolean addStatus = false; + + @ExcelIgnore + private Integer num; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java new file mode 100644 index 0000000000..cc3d827af0 --- /dev/null +++ b/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; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java new file mode 100644 index 0000000000..e332fe88df --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java @@ -0,0 +1,30 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class NatImportExcel extends ExcelVerifyInfo { + + @Excel(name = "姓名") + private String name; + + @Excel(name = "电话") + private String mobile; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "关注原因") + private String reason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java new file mode 100644 index 0000000000..65534756cd --- /dev/null +++ b/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; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java new file mode 100644 index 0000000000..b7349e4d03 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java @@ -0,0 +1,27 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class VaccinationImportExcel extends ExcelVerifyInfo { + + @Excel(name = "姓名") + private String name; + + @Excel(name = "电话") + private String mobile; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "备注") + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java new file mode 100644 index 0000000000..385d02b171 --- /dev/null +++ b/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 lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 核酸检测信息导入excel数据 + */ +@Data +public class IcNatImportExcelData { + + @NotBlank(message = "姓名为必填项") + @ExcelProperty("姓名") + private String name; + + @NotBlank(message = "手机号为必填项") + @ExcelProperty("手机号") + private String mobile; + + @NotBlank(message = "身份证号为必填项") + @ExcelProperty("身份证号") + @Length(max = 18, message = "身份证号长度不正确,应小于18位") + private String idCard; + + @NotNull(message = "检测时间为必填项") + @ExcelProperty("检测时间") + private Date natTime; + + @ExcelProperty("检测地点") + private String natAddress; + + @NotBlank(message = "检测结果为必填项") + @ExcelProperty("检测结果") + private String natResultZh; + + @Data + public static class RowRemarkMessage { + + @ExcelProperty("姓名") + @ColumnWidth(20) + private String name; + + @ExcelProperty("手机号") + @ColumnWidth(20) + private String mobile; + + @ColumnWidth(20) + @ExcelProperty("身份证号") + private String idCard; + + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcTripReportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcTripReportExcelData.java new file mode 100644 index 0000000000..f6f2a86e42 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcTripReportExcelData.java @@ -0,0 +1,75 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + + +/** + * 行程上报excel数据 + */ +@Data +public class IcTripReportExcelData { + @NotBlank(message = "姓名为必填项") + @ExcelProperty("姓名") + private String name; + + @NotBlank(message = "身份证号为必填项") + @ExcelProperty("身份证号") + private String idCard; + + @NotBlank(message = "手机号为必填项") + @ExcelProperty("手机号") + private String mobile; + + @NotBlank(message = "现居地为必填项") + @ExcelProperty("现居地(格式:省-市-区-街道-社区)") + private String presentAddress; + + @NotBlank(message = "详细地址为必填项") + @ExcelProperty("详细地址") + private String detailAddress; + + @NotBlank(message = "来自地区为必填项") + @ExcelProperty("来自地区(格式:省-市-区-街道-社区)") + private String sourceAddress; + + @NotNull(message = "来到本地时间为必填项") + @ExcelProperty("来到本地时间(格式:2022-01-01)") + private Date arriveDate; + + @ExcelProperty("离开本地时间(格式:2022-01-01)") + private Date leaveDate; + + /** + * 备注信息 + */ + @Length(max = 500,message = "备注不能超过500字") + @ExcelProperty("备注(500字以内)") + private String remark; + + @Data + public static class ErrorRow { + + @ExcelProperty("姓名") + @ColumnWidth(20) + private String name; + + @ColumnWidth(20) + @ExcelProperty("身份证号") + private String idCard; + + @ExcelProperty("手机号") + @ColumnWidth(20) + private String mobile; + + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java new file mode 100644 index 0000000000..ef007cfa4c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java @@ -0,0 +1,29 @@ +package com.epmet.excel.error; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 16:57 + * @DESC + */ +@Data +public class EpidemicSpecialAttentionErrorModel { + + @Excel(name = "行号",width = 10) + private Integer num; + + @Excel(name = "姓名",width = 20) + private String name; + + @Excel(name = "电话",width = 20) + private String mobile; + + @Excel(name = "身份证",width = 30) + private String idCard; + + @Excel(name = "错误信息", width = 200) + private String errorMsg; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java new file mode 100644 index 0000000000..1f09a5142f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java @@ -0,0 +1,146 @@ +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.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 核酸检测excel导入监听器 + */ +@Data +@Slf4j +public class IcNatExcelImportListener implements ReadListener { + + /** + * 最大条数阈值 + */ + public static final int MAX_THRESHOLD = 200; + + private String currentUserId; + /** + * 当前组织ID + */ + private String currentAgencyId; + + private String currentAgencyPids; + + /** + * 数据 + */ + private List datas = new ArrayList<>(); + + /** + * 错误项列表 + */ + private List errorRows = new ArrayList<>(); + /** + * 其他被标记出来的列表列表 + */ + private List otherRows = 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); + + if (StringUtils.isNotBlank(data.getName())) { + data.setName(data.getName().trim()); + } + if (StringUtils.isNotBlank(data.getMobile())) { + data.setMobile(data.getMobile().trim()); + } + if (StringUtils.isNotBlank(data.getNatAddress())) { + data.setNatAddress(data.getNatAddress().trim()); + } + if (StringUtils.isNotBlank(data.getIdCard())) { + data.setIdCard(data.getIdCard().trim()); + } + + // 默认空,没有结果 + String natResult = ""; + 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("import"); + 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.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage(); + 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, this); + } + } finally { + datas.clear(); + } + } + + /** + * 获取错误行 + * @return + */ + public List getErrorRows() { + return errorRows; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcTripReportExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcTripReportExcelImportListener.java new file mode 100644 index 0000000000..20e9ed3dc5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcTripReportExcelImportListener.java @@ -0,0 +1,116 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.IcResiUserConstant; +import com.epmet.entity.IcTripReportRecordEntity; +import com.epmet.excel.data.IcTripReportExcelData; +import com.epmet.service.impl.IcTripReportRecordServiceImpl; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 行程上报excel导入监听器 + */ +@Slf4j +public class IcTripReportExcelImportListener implements ReadListener { + + + /** + * 最大条数阈值 + */ + public static final int MAX_THRESHOLD = 2; + /** + * 当前操作用户 + */ + private CustomerStaffInfoCacheResult staffInfo; + private String customerId; + + /** + * 数据 + */ + private List datas = new ArrayList<>(); + + /** + * 错误项列表 + */ + private List errorRows = new ArrayList<>(); + + private IcTripReportRecordServiceImpl tripReportRecordService; + + public IcTripReportExcelImportListener(String customerId,CustomerStaffInfoCacheResult staffInfo, IcTripReportRecordServiceImpl tripReportRecordService) { + this.customerId=customerId; + this.staffInfo = staffInfo; + this.tripReportRecordService = tripReportRecordService; + } + + @Override + public void invoke(IcTripReportExcelData data, AnalysisContext context) { + + try { + // 先校验数据 + ValidatorUtils.validateEntity(data); + + IcTripReportRecordEntity tripReportRecordEntity = ConvertUtils.sourceToTarget(data, IcTripReportRecordEntity.class); + tripReportRecordEntity.setCustomerId(customerId); + tripReportRecordEntity.setAgencyId(staffInfo.getAgencyId()); + tripReportRecordEntity.setPids(staffInfo.getAgencyPIds()); + tripReportRecordEntity.setUserType(IcResiUserConstant.USER_TYPE_IMPORT); + datas.add(tripReportRecordEntity); + + if (datas.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else { + errorMsg = "未知错误"; + log.error("【行程上报导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + IcTripReportExcelData.ErrorRow errorRow = new IcTripReportExcelData.ErrorRow(); + errorRow.setName(data.getName()); + errorRow.setMobile(data.getMobile()); + errorRow.setIdCard(data.getIdCard()); + errorRow.setErrorInfo(errorMsg); + errorRows.add(errorRow); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 最后几条达不到阈值,这里必须再调用一次 + execPersist(); + } + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (datas != null && datas.size() > 0) { + tripReportRecordService.batchPersist(datas); + } + } finally { + datas.clear(); + } + } + + /** + * 获取错误行 + * @return + */ + public List getErrorRows() { + return errorRows; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java index 9901fe8215..ee9c4e47b3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java @@ -9,6 +9,8 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.constant.SystemMessageType; +import com.epmet.service.IcNatService; import com.epmet.service.StatsResiWarnService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; @@ -71,6 +73,9 @@ public class ICWarnStatsEventListener implements MessageListenerConcurrently { 30L, 30L, TimeUnit.SECONDS); //待执行方法 SpringContextUtils.getBean(StatsResiWarnService.class).resiWarn(obj.getCustomerId()); + //根据居民Id更新 核酸检测的是否居民状态 + updateIcNatResiFlag(tags, obj); + } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【开放数据事件监听器】-客户居民信息变动MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); @@ -91,6 +96,26 @@ public class ICWarnStatsEventListener implements MessageListenerConcurrently { } } + /** + * desc:根据居民Id更新 核酸检测的是否居民状态(只有新增和删除时调用) + * @param tags + * @param obj + */ + private void updateIcNatResiFlag(String tags, IcResiUserAddMQMsg obj) { + try { + if (StringUtils.isBlank(obj.getCustomerId())||StringUtils.isBlank(obj.getIcResiUser())){ + log.warn("updateIcNatResiFlag param is error"); + return; + } + if (SystemMessageType.IC_RESI_USER_ADD.equals(tags) || SystemMessageType.IC_RESI_USER_DEL.equals(tags)) { + Integer effectRow = SpringContextUtils.getBean(IcNatService.class).updateIsResiFlag(obj.getCustomerId(), obj.getIcResiUser()); + log.debug("updateIcNatResiFlag effectRow:{},param customerId & icResiUserId:{}", effectRow, JSON.toJSONString(obj)); + } + } catch (Exception e) { + log.error("updateIcNatResiFlag exception", e); + } + } + /** * @description * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java new file mode 100644 index 0000000000..8a6eb03f04 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java @@ -0,0 +1,133 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +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.io.InputStream; +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-03-28 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-28 + */ + List list(Map 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,TokenDto tokenDto); + + /** + * Desc: 取消关注 + * @param formDTO + * @author zxc + * @date 2022/3/28 13:51 + */ + void cancelAttention(CancelAttentionPackageFormDTO formDTO); + + /** + * Desc: 【疫苗接种关注名单,核酸检测关注名单】导入 + * @param tokenDto + * @param inputStream + * @param attentionType + * @author zxc + * @date 2022/3/29 15:35 + */ + void importFile(TokenDto tokenDto, InputStream inputStream, Integer attentionType, String taskId); + + /** + * 传入身份证集合,返回已经关注的身份证号列表 + * @param idCardSet + * @return + */ + List getHeSuanIdCardList(String customerId,List idCardSet); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java new file mode 100644 index 0000000000..7bdc1a1da5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java @@ -0,0 +1,79 @@ +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.dto.form.PageFollowUpFormDTO; +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 { + + /** + * 随访记录-列表 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2022-03-25 + */ + PageData page(PageFollowUpFormDTO formDTO); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-25 + */ + List list(Map 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); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatRelationService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatRelationService.java new file mode 100644 index 0000000000..4d918aaea3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatRelationService.java @@ -0,0 +1,14 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.IcNatRelationEntity; + +/** + * 核酸记录关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-31 + */ +public interface IcNatRelationService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java new file mode 100644 index 0000000000..ea75c911e4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -0,0 +1,95 @@ +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.NatListDTO; +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 { + + /** + * @Author sun + * @Description 核酸检测-上报核酸记录 + **/ + void add(AddIcNatFormDTO formDTO); + + /** + * @Author sun + * @Description 核酸检测-居民端我的上报 + **/ + List myNatList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + * + * @return*/ + PageData 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); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息取消同步 + **/ + void cancelSynchro(MyNatListFormDTO formDTO); + + /** + * 执行Excel导入 + * @param filePath + */ + void execAsyncExcelImport(Path filePath, String importTaskId); + + /** + * 核酸检测信息 + * @Param idCard + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/3/29 16:29 + */ + List getNatList(String customerId, String idCard); + + /** + * desc:根据用户id 更新核酸中是否居民状态 + * @param customerId + * @param icResiUserId 如果为空则更新全部 + * @return + */ + Integer updateIsResiFlag(String customerId, String icResiUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java new file mode 100644 index 0000000000..3f72855558 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java @@ -0,0 +1,107 @@ +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.Date; +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 { + + /** + * 默认分页 + * + * @param dto + * @return PageData + * @author generator + * @date 2022-03-28 + */ + PageData page(IcNoticeFormDTO formDTO); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-28 + */ + List list(Map 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); + + /** + * 根据身份证号查询最近一次通知时间 + * @param idCardSet + * @return + */ + Map getUserLatestNoticeTime(String customerId,List idCardSet); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java index 4c0bca4fa5..9129b34675 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java +++ b/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 { */ PageData getCollectList(CollectListFormDTO formDTO); + /** + * 居民端小程序:社区居民信息登记-提交 + * @param formDTO + */ + void saveResi(ResiCollectFormDTO formDTO); + + /** + * 居民端小程序:社区居民信息登记-查询 + * @param formDTO + * @return + */ + LatestCollectResDTO latestSubmit(LatestSubmitCollectFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 59ec56519b..fd3e49415d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -216,4 +216,33 @@ public interface IcResiUserService extends BaseService { * @date 2022/3/2 10:32 上午 */ List getExistUserByHouseIds(List ids); + + /** + * 居民防疫信息查询 + * + * @Param formDTO + * @Return {@link PageData< EpidemicPreventionResultDTO>} + * @Author zhaoqifeng + * @Date 2022/3/29 14:27 + */ + PageData epidemicPreventionList(EpidemicPreventionFormDTO formDTO); + PageData userList(EpidemicPreventionFormDTO formDTO); + + /** + * 居民防疫信息详情 + * @Param formDTO + * @Return {@link EpidemicPreventionResultDTO} + * @Author zhaoqifeng + * @Date 2022/3/29 15:16 + */ + EpidemicPreventionResultDTO getEpidemicPreventionDetail(EpidemicPreventionFormDTO formDTO); + + /** + * 居民防疫信息详情:核酸,疫苗,行程 + * @Param formDTO + * @Return {@link EpidemicPreventionInfoDTO} + * @Author zhaoqifeng + * @Date 2022/3/29 16:25 + */ + EpidemicPreventionInfoDTO getEpidemicPreventionInfo(EpidemicPreventionFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java new file mode 100644 index 0000000000..c1b2ea0655 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java @@ -0,0 +1,89 @@ +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.dto.result.VaccineListDTO; +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-03-28 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-28 + */ + List list(Map 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); + + /** + * 获取居民疫苗接种信息 + * + * @Param idCard + * @Return {@link List< VaccineListDTO>} + * @Author zhaoqifeng + * @Date 2022/3/30 10:24 + */ + List getVaccineList(String customerId, String idCard); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java new file mode 100644 index 0000000000..66ec0d9f9e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java @@ -0,0 +1,103 @@ +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.dto.form.IcTripReportFormDTO; +import com.epmet.dto.form.MyReportedTripFormDTO; +import com.epmet.dto.form.PageTripReportFormDTO; +import com.epmet.dto.result.TripListDTO; +import com.epmet.entity.IcTripReportRecordEntity; + +import java.nio.file.Path; +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 { + + /** + * pc行程上报-列表 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2022-03-25 + */ + PageData page(PageTripReportFormDTO formDTO); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-25 + */ + List list(Map params); + + /** + * pc: 行程上报-新增 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-25 + */ + String save(IcTripReportFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-25 + */ + String update(IcTripReportFormDTO dto); + + /** + * pc:行程上报-删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-03-25 + */ + void delete(String customerId,String userId,String[] ids); + + /** + * 居民端小程序:上报行程 + * @param formDTO + * @return + */ + String resiSave(IcTripReportFormDTO formDTO); + + /** + * 居民端小程序:我的上报 + * @param formDTO + * @return + */ + List resiList(MyReportedTripFormDTO formDTO); + + /** + * 获取居民行程信息 + * + * @Param idCard + * @Return {@link List< TripListDTO>} + * @Author zhaoqifeng + * @Date 2022/3/30 10:31 + */ + List tripList(String customerId, String idCard); + + /** + * 执行Excel导入 + * @param filePath + */ + void execAsyncExcelImport(Path filePath, String importTaskId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java new file mode 100644 index 0000000000..bd9faff62b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -0,0 +1,489 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.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.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dao.IcEpidemicSpecialAttentionDao; +import com.epmet.dto.IcEpidemicSpecialAttentionDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.dto.result.VaccinationListResultDTO; +import com.epmet.entity.IcEpidemicSpecialAttentionEntity; +import com.epmet.enums.ChannelEnum; +import com.epmet.excel.ImportEpidemicSpecialAttention; +import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.OssFeignClient; +import com.epmet.service.IcEpidemicSpecialAttentionService; +import com.epmet.service.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.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.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.commons.CommonsMultipartFile; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 疫情特别关注 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Service +@Slf4j +public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl implements IcEpidemicSpecialAttentionService { + + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private OssFeignClient ossFeignClient; + @Autowired + private IcNoticeService noticeService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEpidemicSpecialAttentionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEpidemicSpecialAttentionDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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 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,行程上报:0 + if (formDTO.getAttentionType().equals(NumConstant.ONE)){ + if (formDTO.getIsPage()){ + PageInfo 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 list = baseDao.vaccinationList(formDTO); + result.setList(list); + result.setTotal(list.size()); + } + }else if (formDTO.getAttentionType().equals(NumConstant.TWO)){ + if (formDTO.getIsPage()){ + PageInfo 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 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 entities = ConvertUtils.sourceToTarget(formDTO.getList(), IcEpidemicSpecialAttentionEntity.class); + List idCards = entities.stream().map(m -> m.getIdCard()).collect(Collectors.toList()); + Integer attentionType = entities.get(NumConstant.ZERO).getAttentionType(); + List 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); + //新增通知表信息 + List needSedNotice = formDTO.getList().stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(needSedNotice)) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userListBeans = ConvertUtils.sourceToTarget(needSedNotice, SendNoticeFormDTO.UserListBean.class); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setUserList(userListBeans); + dto.setChannel(needSedNotice.get(NumConstant.ZERO).getChannel()); + dto.setOrigin(needSedNotice.get(NumConstant.ZERO).getAttentionType().toString()); + dto.setContent(needSedNotice.get(NumConstant.ZERO).getContent()); + dto.setStaffId(formDTO.getUserId()); + noticeService.sendNotice(dto); + } + } + + /** + * Desc:【疫苗接种关注名单,核酸检测关注名单】修改 + * 修改的时候通知渠道和通知内容是空的,如果他再次写了就是再次发送一条通知 不是修改之前发过的通知 + * 除了 姓名 身份证 都能修改 + * @param formDTO + * @author zxc + * @date 2022/3/28 13:45 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO,TokenDto tokenDto) { + LambdaQueryWrapper 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); + if (CollectionUtils.isNotEmpty(formDTO.getChannel())){ + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + SendNoticeFormDTO.UserListBean userListBean = ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserList(Arrays.asList(userListBean)); + dto.setChannel(formDTO.getChannel()); + dto.setOrigin(formDTO.getAttentionType().toString()); + dto.setContent(formDTO.getContent()); + dto.setStaffId(tokenDto.getUserId()); + noticeService.sendNotice(dto); + } + } + + /** + * 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()); + } + } + + /** + * Desc: 【疫苗接种关注名单,核酸检测关注名单】导入 + * @param tokenDto + * @param inputStream + * @param attentionType + * @param taskId + * @author zxc + * @date 2022/3/29 15:35 + */ + @Override + @Async + public void importFile(TokenDto tokenDto, InputStream inputStream, Integer attentionType, String taskId) { + List errorInfo = new ArrayList<>(); + + try { + List list = ExcelPoiUtils.importExcel(inputStream, 0,1,ImportEpidemicSpecialAttention.class); + if (CollectionUtils.isEmpty(list)){ + closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,""); + return; + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息"+tokenDto.getUserId()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("未查询到组织信息"+staffInfo.getAgencyId()); + } + for (int i = 0; i < list.size(); i++) { + list.get(i).setNum(i+1); + list.get(i).setAttentionType(attentionType); +// list.get(i).setChannel(getChannel(list.get(i).getChannelString())); + if (StringUtils.isBlank(list.get(i).getName()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "姓名不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "身份证号不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getMobile()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "电话不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + } + if (list.size() > errorInfo.size()){ + Map groupByIdCard = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting())); + groupByIdCard.forEach((idCard,count) -> { + if (Integer.valueOf(count.toString()).compareTo(1) != 0){ + for (ImportEpidemicSpecialAttention i : list) { + if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){ + errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); + i.setAddStatus(true); + } + } + } + }); + List idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList()); + List existList = baseDao.getExistList(attentionType, idCards); + if (CollectionUtils.isNotEmpty(existList)){ + for (String s : existList) { + for (int i = NumConstant.ZERO; i < list.size(); i++) { + if (s.equals(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum())); + list.get(i).setAddStatus(true); + continue; + } + } + } + } + } + Map> groupByStatus = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getAddStatus)); + List needInsert = groupByStatus.get(false); + if (CollectionUtils.isNotEmpty(needInsert)){ + List entities = ConvertUtils.sourceToTarget(needInsert, IcEpidemicSpecialAttentionEntity.class); + entities.forEach(e -> { + e.setIsAttention(NumConstant.ONE); + e.setOrgId(agencyInfo.getId()); + e.setPid(agencyInfo.getPid()); + e.setPids(agencyInfo.getPids()); + e.setCustomerId(tokenDto.getCustomerId()); + }); + insertBatch(entities); + // send msg 产品说导入不用发通知 + /*List needSendList = needInsert.stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(needSendList)) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userListBeans = ConvertUtils.sourceToTarget(needSendList, SendNoticeFormDTO.UserListBean.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserList(userListBeans); + dto.setChannel(needSendList.get(NumConstant.ZERO).getChannel()); + dto.setOrigin(needSendList.get(NumConstant.ZERO).getAttentionType().toString()); + dto.setContent(needSendList.get(NumConstant.ZERO).getContent()); + dto.setStaffId(tokenDto.getUserId()); + noticeService.sendNotice(dto); + }*/ + } + if (CollectionUtils.isNotEmpty(errorInfo)){ + String url = importOssUpload(errorInfo, EpidemicSpecialAttentionErrorModel.class); + closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,url); + }else { + closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,""); + } + }catch (Exception e){ + log.error(e.getMessage()); + closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,""); + } + } + + public List getChannel(String channelString){ + List result = new ArrayList<>(); + if (StringUtils.isBlank(channelString)){ + return result; + } + String[] split = channelString.split(","); + for (String s : split) { + result.add(ChannelEnum.getKeyByValue(s)); + } + return result; + } + + /** + * Desc: 关闭任务 + * @param taskId + * @param userId + * @param status + * @param url + * @author zxc + * @date 2022/3/30 09:05 + */ + public void closeTask(String taskId,String userId,String status,String url){ + ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); + input.setOperatorId(userId); + input.setTaskId(taskId); + input.setProcessStatus(status); + input.setResultDescFilePath(url); + commonServiceOpenFeignClient.finishImportTask(input); + } + + /** + * Desc: 构造错误信息 + * @param dto + * @param info + * @param num + * @author zxc + * @date 2022/3/29 17:17 + */ + public EpidemicSpecialAttentionErrorModel getErrorInfo(ImportEpidemicSpecialAttention dto,String info,Integer num){ + EpidemicSpecialAttentionErrorModel result = ConvertUtils.sourceToTarget(dto, EpidemicSpecialAttentionErrorModel.class); + result.setErrorMsg(info); + result.setNum(num); + return result; + } + + /** + * 传入身份证集合,返回已经关注的身份证号列表 + * + * @param idCardSet + * @return + */ + @Override + public List getHeSuanIdCardList(String customerId,List idCardSet) { + if(CollectionUtils.isEmpty(idCardSet)){ + return new ArrayList<>(); + } + //关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + return baseDao.getIdCardList(customerId,idCardSet,NumConstant.TWO); + } + + /** + * Desc: 文件上传并返回url + * @param errorRows + * @param tClass + * @author zxc + * @date 2022/3/30 09:16 + */ + public String importOssUpload(Collection errorRows, Class tClass) throws IOException { + Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表","导入失败的数据列表"), + tClass, errorRows); + + // 文件名 + String resultDescFileName = UUID.randomUUID().toString().concat(".xls"); + + FileItemFactory factory = new DiskFileItemFactory(16, null); + FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName); + OutputStream os = fileItem.getOutputStream(); + Result uploadResult = null; + try { + workbook.write(os); + uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + } catch (Exception e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传错误描述文件:{}", errormsg); + } finally { + try { + os.close(); + } catch (IOException e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传错误描述文件关闭输出流:{}", errormsg); + } + try { + fileItem.delete(); + } catch (Exception e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传错误描述文件删除临时文件:{}", errormsg); + } + } + + if (uploadResult == null || !uploadResult.success()) { + log.error("调用OSS上传结果描述文件失败"); + return null; + } + return uploadResult.getData().getUrl(); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java new file mode 100644 index 0000000000..1e3c46f9f1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java @@ -0,0 +1,105 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.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.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFollowUpRecordDao; +import com.epmet.dto.IcFollowUpRecordDTO; +import com.epmet.dto.form.PageFollowUpFormDTO; +import com.epmet.entity.IcFollowUpRecordEntity; +import com.epmet.service.IcFollowUpRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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 implements IcFollowUpRecordService { + + + /** + * 随访记录-列表 + * @param formDTO + * @return + */ + @Override + public PageData page(PageFollowUpFormDTO formDTO) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(formDTO.getIdCard()),IcFollowUpRecordEntity::getIdCard,formDTO.getIdCard()) + .eq(StringUtils.isNotBlank(formDTO.getName()),IcFollowUpRecordEntity::getName,formDTO.getName()) + .eq(IcFollowUpRecordEntity::getOrigin,formDTO.getOrigin()) + .eq(IcFollowUpRecordEntity::getCustomerId,formDTO.getCustomerId()) + .orderByDesc(IcFollowUpRecordEntity::getVisitTime); + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> baseDao.selectList(wrapper)); + List list=ConvertUtils.sourceToTarget(data.getList(),IcFollowUpRecordDTO.class); + return new PageData(list,data.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcFollowUpRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), dto.getCreatedBy()); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + IcFollowUpRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcFollowUpRecordEntity.class); + entity.setAgencyId(staffInfo.getAgencyId()); + 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)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatRelationServiceImpl.java new file mode 100644 index 0000000000..91e27f25a4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatRelationServiceImpl.java @@ -0,0 +1,19 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcNatRelationDao; +import com.epmet.entity.IcNatRelationEntity; +import com.epmet.service.IcNatRelationService; +import org.springframework.stereotype.Service; + +/** + * 核酸记录关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-31 + */ +@Service +public class IcNatRelationServiceImpl extends BaseServiceImpl implements IcNatRelationService { + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java new file mode 100644 index 0000000000..abb8f6184c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -0,0 +1,624 @@ +package com.epmet.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.NumConstant; +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.*; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dao.IcNatDao; +import com.epmet.dao.IcNatRelationDao; +import com.epmet.dao.IcResiUserDao; +import com.epmet.dao.UserBaseInfoDao; +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.MyNatListFormDTO; +import com.epmet.dto.form.SendNoticeFormDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.IcNatEntity; +import com.epmet.entity.IcNatRelationEntity; +import com.epmet.entity.IcResiUserEntity; +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.epmet.service.UserService; +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.fileupload.FileItem; +import org.apache.commons.fileupload.FileItemFactory; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +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.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 核酸上报记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Service +@Slf4j +public class IcNatServiceImpl extends BaseServiceImpl implements IcNatService, ResultDataResolver { + + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private IcNoticeService icNoticeService; + @Autowired + private OssFeignClient ossFeignClient; + @Autowired + private UserBaseInfoDao userBaseInfoDao; + @Autowired + private IcNatRelationDao icNatRelationDao; + @Autowired + private IcResiUserDao icResiUserDao; + @Autowired + private UserService userService; + + /** + * @Author sun + * @Description 核酸检测-上报核酸记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddIcNatFormDTO formDTO) { + //0.先根据身份证号和检查时间以及检测结果校验数据是否存在 + IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), null); + //按身份证号核酸时间存在记录的 核酸结果相同的提示已存在相同记录核酸结果不同的提示已存在去修改【业务要求的】 + if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) { + throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); + } else if (null != icNatDTO && !icNatDTO.getNatResult().equals(formDTO.getNatResult())) { + throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); + } + //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); + if (StringUtils.isNotBlank(formDTO.getUserId())) { + entity.setIsResiUser("1"); + } + insert(entity); + //3.核酸记录关系表新增与组织的关系数据 + IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class); + relationEntity.setIcNatId(entity.getId()); + relationEntity.setPids(StringUtils.isNotBlank(agencyInfo.getPids()) ? agencyInfo.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId()); + icNatRelationDao.insert(relationEntity); + + //3.新增通知表信息 + if (formDTO.getChannel().size() > NumConstant.ZERO) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List 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.setStaffId(formDTO.getStaffId()); + icNoticeService.sendNotice(dto); + } + + } + + /** + * @Author sun + * @Description 核酸检测-居民端我的上报 + **/ + @Override + public List myNatList(MyNatListFormDTO formDTO) { + //1.根据token信息查询居民身份证号 + UserBaseInfoResultDTO dto = userBaseInfoDao.selectListByUserIdList(formDTO.getUserId()); + if (null != dto) { + formDTO.setIdCard(dto.getIdNum()); + } + //2.查询当前人员创建的或该身份证号录入的核算检测数据(居民端录入、数字平台录入、数字平台导入、数字平台同步的) + List resultList = baseDao.getMyNatList(formDTO); + return resultList; + } + + /** + * @Author sun + * @Description 【核酸】本组织及下级核酸检测信息列表 + * + * @return*/ + @Override + public PageData natList(MyNatListFormDTO formDTO) { + //1.根据是查询客户数据还是本辖区数据走不同逻辑 + if ("current".equals(formDTO.getOrgType())) { + //本辖区数据 + //2.获取工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + //3.按条件查询业务数据 + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> baseDao.getNatList(formDTO)); + return new PageData(data.getList(), data.getTotal()); + } else if ("all".equals(formDTO.getOrgType())) { + //客户下数据 + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> baseDao.getCustomerNatList(formDTO)); + return new PageData(data.getList(), data.getTotal()); + } + + return new PageData(new ArrayList(), 0); + } + + /** + * @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) { + //0.先根据身份证号和检测时间以及检测结果校验除当前数据是否还存在相同数据 + IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult()); + if (null != icNatDTO) { + throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); + } + //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())) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List 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.setStaffId(formDTO.getStaffId()); + 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(), "数据删除失败"); + } + //关系数据删除 + icNatRelationDao.delRelation(formDTO.getIcNatId(), null); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void synchro(MyNatListFormDTO formDTO) { + //1.检验核酸基础信息是否存在 + IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId()); + if (null == entity) { + log.error(String.format("核酸记录数据不存在同步失败,核酸记录Id->%s", formDTO.getIcNatId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,核酸记录数据不存在"); + } + //获取工作人员缓存数据 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.不管是否已存在关系数据都是先删后增 + icNatRelationDao.delRelation(formDTO.getIcNatId(), staffInfo.getAgencyId()); + //3.新增关系数据 + IcNatRelationEntity relationEntity = new IcNatRelationEntity(); + relationEntity.setCustomerId(formDTO.getCustomerId()); + relationEntity.setIcNatId(formDTO.getIcNatId()); + relationEntity.setAgencyId(staffInfo.getAgencyId()); + relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds())?staffInfo.getAgencyPIds()+":"+staffInfo.getAgencyId():staffInfo.getAgencyId()); + relationEntity.setUserType("synchro"); + icNatRelationDao.insert(relationEntity); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息取消同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void cancelSynchro(MyNatListFormDTO formDTO) { + //1.获取工作人员缓存数据 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //1.物理删除关系数据 + if (icNatRelationDao.delRelation(formDTO.getIcNatId(), staffInfo.getAgencyId()) < NumConstant.ONE) { + log.error(String.format("数据取消同步失败,核酸记录Id->%s", formDTO.getIcNatId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消同步操作失败"); + } + } + + @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); + + LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(app, client, userId); + + String agencyId = loginUserDetails.getAgencyId(); + + IcNatExcelImportListener listener = new IcNatExcelImportListener(userId, agencyId, loginUserDetails.getOrgIdPath().replace(":".concat(agencyId), ""), this); + + EasyExcel.read(filePath.toFile(), IcNatImportExcelData.class, listener).headRowNumber(2).sheet(0).doRead(); + + Path errorDescFile = null; + String errorDesFileUrl = null; + + List errorRows = listener.getErrorRows(); + List otherRows = listener.getOtherRows(); + + boolean failed = errorRows.size() > 0; + + // 合并到一起写入 + errorRows.addAll(otherRows); + + // 生成并上传描述文件 + if (errorRows.size() > 0) { + 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.RowRemarkMessage.class).sheet("信息列表").doWrite(errorRows); + // 文件上传oss + Result 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(failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS); + 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 idCard + * @Param idCard + * @Return {@link List< NatListDTO >} + * @Author zhaoqifeng + * @Date 2022/3/29 16:29 + */ + @Override + public List getNatList(String customerId, String idCard) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcNatEntity::getCustomerId, customerId); + wrapper.eq(IcNatEntity::getIdCard, idCard); + wrapper.orderByDesc(IcNatEntity::getNatTime); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + NatListDTO dto = new NatListDTO(); + dto.setAddress(item.getNatAddress()); + dto.setTestTime(DateUtils.format(item.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + switch (item.getNatResult()) + { + case NumConstant.ZERO_STR: + dto.setResult("阴性"); + break; + case NumConstant.ONE_STR: + dto.setResult("阳性"); + break; + default: + dto.setResult("未知"); + } + return dto; + }).collect(Collectors.toList()); + } + + @Override + public Integer updateIsResiFlag(String customerId, String icResiUserId) { + return baseDao.updateIsResiFlag(customerId,icResiUserId); + } + + /** + * 批量持久化 + * @param entities + */ + public void batchPersist(List entities, IcNatExcelImportListener listener) { + String customerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID); + String currentUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + + entities.forEach(e -> { + try { + persisNat(e, customerId, currentUserId, listener); + } catch (Exception exception) { + String errorMsg = ExceptionUtils.getErrorStackTrace(exception); + log.error(errorMsg); + + IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage(); + errorRow.setName(e.getName()); + errorRow.setMobile(e.getMobile()); + errorRow.setIdCard(e.getIdCard()); + errorRow.setErrorInfo("未知系统错误"); + listener.getErrorRows().add(errorRow); + } + }); + } + + /** + * 单条持久化 + * @param e + * @param customerId + * @param currentUserId + * @param listener + */ + @Transactional(rollbackFor = Exception.class) + public void persisNat(IcNatEntity e, String customerId, String currentUserId, IcNatExcelImportListener listener) { + List otherRows = listener.getOtherRows(); + + Date natTime = e.getNatTime(); + String idCard = e.getIdCard(); + String name = e.getName(); + String mobile = e.getMobile(); + String natResult = e.getNatResult(); + String natAddress = e.getNatAddress(); + + //1.先看客户下有没有这个人 + IcNatEntity resiNat = getResiNat(customerId, idCard, natTime); + if (resiNat != null && !"import".equals(resiNat.getUserType())) { + // 有这个人,并且不是导入的 + String message = "已存在该次核酸检测录入记录,请到系统中修改"; + + IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage(); + errorRow.setName(name); + errorRow.setMobile(mobile); + errorRow.setIdCard(idCard); + errorRow.setErrorInfo(message); + otherRows.add(errorRow); + return; + } + + if (resiNat != null) { + boolean needUpdate = false; + // 有这个人,也是导入的,那就要更新le + ArrayList changedFieldNames = new ArrayList<>(); + if (!name.equals(resiNat.getName())) { + changedFieldNames.add("姓名"); + resiNat.setName(name); + needUpdate = true; + } + + if (!natResult.equals(resiNat.getNatResult())) { + changedFieldNames.add("检测结果"); + resiNat.setNatResult(natResult); + needUpdate = true; + } + + // 检测地点和手机号先不提示,说需要提示再提示。需要考虑两个都不为空&&不相等 || 两个中一个为空一个不为空 + if ((StringUtils.isBlank(natAddress) && StringUtils.isNotBlank(resiNat.getNatAddress())) + || (StringUtils.isNotBlank(natAddress) && StringUtils.isBlank(resiNat.getNatAddress())) + || (StringUtils.isNotBlank(natAddress) && StringUtils.isNotBlank(resiNat.getNatAddress()) && !natAddress.equals(resiNat.getNatAddress()))) { + resiNat.setNatAddress(natAddress); + needUpdate = true; + } + + if (!mobile.equals(resiNat.getMobile())) { + resiNat.setMobile(mobile); + needUpdate = true; + } + + if (changedFieldNames.size() > 0) { + String fieldsStr = String.join(",", changedFieldNames); + String message = "该次核酸检测记录已存在,执行更新动作," + fieldsStr + "已成功更新"; + IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage(); + errorRow.setName(name); + errorRow.setMobile(mobile); + errorRow.setIdCard(idCard); + errorRow.setErrorInfo(message); + otherRows.add(errorRow); + } + + if (needUpdate) { + resiNat.setUpdatedBy(currentUserId); + resiNat.setUpdatedTime(new Date()); + + IcResiUserEntity resi = getResi(customerId, idCard); + resiNat.setIsResiUser(resi != null ? "1" : "0"); + resiNat.setUserId(resi != null ? resi.getId() : ""); + + baseDao.updateById(resiNat); + } + + // 还要创建关系 + createNatRelation(resiNat.getId(), listener.getCurrentAgencyId(), listener.getCurrentAgencyPids()); + + return; + } + + // 执行新增操作 + IcResiUserEntity resi = getResi(customerId, idCard); + e.setIsResiUser(resi != null ? "1" : "0"); + e.setUserId(resi != null ? resi.getId() : ""); + e.setUserType("import"); + + baseDao.insert(e); + + // 还要创建关系 + createNatRelation(e.getId(), listener.getCurrentAgencyId(), listener.getCurrentAgencyPids()); + } + + /** + * 是否是客户下的居民; + * 0:否 + * 1:是 + * @param customerId + * @param idCard + * @return + */ + public IcResiUserEntity getResi(String customerId, String idCard) { + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(IcResiUserEntity::getCustomerId, customerId); + query.eq(IcResiUserEntity::getIdCard, idCard); + return icResiUserDao.selectOne(query); + } + + /** + * + * @param customerId + * @param idCard + * @return + */ + public IcNatEntity getResiNat(String customerId, String idCard, Date natTime) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcNatEntity::getCustomerId, customerId); + query.eq(IcNatEntity::getIdCard, idCard); + query.eq(IcNatEntity::getNatTime, natTime); + return baseDao.selectOne(query); + } + + /** + * 创建nat关系 + * @param natId + * @param currentUserAgencyId + */ + private void createNatRelation(String natId, String currentUserAgencyId, String agencyPids) { + + // 没有关系创建关系,有关系就跳过 + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcNatRelationEntity::getIcNatId, natId); + query.eq(IcNatRelationEntity::getAgencyId, currentUserAgencyId); + if (icNatRelationDao.selectCount(query) > 0) { + return; + } + + IcNatRelationEntity relation = new IcNatRelationEntity(); + relation.setAgencyId(currentUserAgencyId); + relation.setPids(String.join(":", Arrays.asList(agencyPids, currentUserAgencyId))); + relation.setIcNatId(natId); + relation.setUserType("import"); + icNatRelationDao.insert(relation); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java new file mode 100644 index 0000000000..c306bec8aa --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java @@ -0,0 +1,244 @@ +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.ChannelEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.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.UserBaseInfoDTO; +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.epmet.service.UserBaseInfoService; +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.*; +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 implements IcNoticeService { + + @Resource + private MessageFeignClient messageFeignClient; + @Resource + private UserBaseInfoService userBaseInfoService; + + @Override + public PageData page(IcNoticeFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcNoticeEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(IcNoticeEntity::getIdCard, formDTO.getIdCard()); + wrapper.orderByDesc(IcNoticeEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); + List dtoList = ConvertUtils.sourceToTarget(list, IcNoticeDTO.class); + + if (CollectionUtils.isNotEmpty(dtoList)) { + dtoList.forEach(item -> { + List 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 list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNoticeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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 orgName = ""; + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null != staffInfo) { + orgName = staffInfo.getAgencyName(); + } + //保存消息 + String channel = StringUtils.join(formDTO.getChannel(), StrConstant.COMMA); + String finalOrgName = orgName; + List 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(finalOrgName); + return entity; + }).collect(Collectors.toList()); + insertBatch(entityList); + + //通知 + List msgList = new ArrayList<>(); + //短信消息 + List smsList = new ArrayList<>(); + + entityList.forEach(item -> { + if (StringUtils.isNotBlank(item.getIdCard())) { + //根据身份证获取居民ID + List userList = userBaseInfoService.getCommonIdNumUser(item.getCustomerId(), item.getIdCard()); + if (CollectionUtils.isNotEmpty(userList)) { + userList.forEach(user -> { + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(item.getCustomerId()); + messageFormDTO.setApp(AppClientConstant.APP_GOV); + messageFormDTO.setGridId(StrConstant.STAR); + messageFormDTO.setUserId(user.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)); + } + //TODO 发送短信 + } + + /** + * 获取人员最新一条通知 + * + * @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 wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcNoticeEntity::getCustomerId, customerId); + wrapper.eq(IcNoticeEntity::getIdCard, idCard); + wrapper.orderByDesc(IcNoticeEntity::getCreatedTime); + List 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; + } + + /** + * 根据身份证号查询最近一次通知时间 + * + * @param idCardSet + * @return + */ + @Override + public Map getUserLatestNoticeTime(String customerId,List idCardSet) { + Map map=new HashMap<>(); + for(String idCard:idCardSet) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcNoticeEntity::getCustomerId, customerId); + wrapper.eq(IcNoticeEntity::getIdCard, idCard); + wrapper.orderByDesc(IcNoticeEntity::getCreatedTime); + wrapper.last("limit 1"); + IcNoticeEntity entity = baseDao.selectOne(wrapper); + if(null!=entity){ + map.put(idCard,entity.getCreatedTime()); + } + } + return map; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java index b1895b608a..b0befce180 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java +++ b/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 newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); //查询之前录入的成员表 Map memMap = queryOriginMem(origin.getId()); @@ -98,7 +102,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl pageList = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getCollectList(formDTO)); result.setList(pageList.getList()); result.setTotal(Integer.parseInt(String.valueOf(pageList.getTotal()))); @@ -145,4 +149,91 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl 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()); + mem.setId(null); + icResiMemberDao.insert(mem); + } + }); + } else { + //更新主表 + baseDao.updateRec(origin.getId(), formDTO.getHouseType(), formDTO.getHouseHolderName(), formDTO.getTotalResi(),formDTO.getUserId()); + List newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); + //查询之前录入的成员表 + Map 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 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()); + resDTO.setVillageName(StringUtils.isBlank(entity.getVillageName()) ? StrConstant.EPMETY_STR : entity.getVillageName()); + resDTO.setBuildName(StringUtils.isBlank(entity.getBuildName()) ? StrConstant.EPMETY_STR : entity.getBuildName()); + resDTO.setUnitName(StringUtils.isBlank(entity.getUnitName()) ? StrConstant.EPMETY_STR : entity.getUnitName()); + resDTO.setHomeName(StringUtils.isBlank(entity.getHomeName()) ? StrConstant.EPMETY_STR : entity.getHomeName()); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 341932bd52..5817f5a5c2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -71,6 +71,7 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; import java.sql.Date; @@ -78,6 +79,7 @@ import java.sql.Timestamp; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; @@ -117,6 +119,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -859,11 +867,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl buildMap = buildResult.getData().stream().collect(Collectors.toMap(BuildingResultDTO::getBuildingId, BuildingResultDTO::getBuildingName)); - + AtomicInteger i = new AtomicInteger(NumConstant.ONE); result.forEach(item -> { item.setGridName(gridMap.get(item.getGridId())); item.setNeighborHoodName(neighborHoodMap.get(item.getNeighborHoodId())); item.setBuildNum(buildMap.get(item.getBuildId())); + item.setSort(i.getAndIncrement()); }); return new PageData<>(result, pageInfo.getTotal()); @@ -1230,6 +1239,124 @@ public class IcResiUserServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2022/3/29 14:27 + */ + @Override + public PageData epidemicPreventionList(EpidemicPreventionFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getEpidemicPreventionList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + //查询网格名称 + List gridIds = list.stream().map(EpidemicPreventionResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); + + //查询房子名称 + Set houseIds = new HashSet<>(); + List houseIdList = list.stream().map(EpidemicPreventionResultDTO::getHomeId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + houseIds.addAll(houseIdList); + Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,formDTO.getCustomerId()); + List houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); + Map houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); + list.forEach(item -> { + if (gridInfoMap.containsKey(item.getGridId()) && null != gridInfoMap.get(item.getGridId())) { + item.setGridName(gridInfoMap.get(item.getGridId()).getGridName()); + } + if (houseInfoMap.containsKey(item.getHomeId()) && null != houseInfoMap.get(item.getHomeId())) { + HouseInfoDTO houseInfoDTO = houseInfoMap.get(item.getHomeId()); + item.setHouseName(houseInfoDTO.getAllName()); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + + @Override + public PageData userList(EpidemicPreventionFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = new ArrayList<>(); + if (formDTO.getAttentionType().equals(NumConstant.TWO)){ + list = baseDao.natList(formDTO); + }else if (formDTO.getAttentionType().equals(NumConstant.ONE)){ + list = baseDao.vaccineList(formDTO); + } + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 居民防疫信息详情 + * + * @param formDTO + * @Param formDTO + * @Return {@link EpidemicPreventionResultDTO} + * @Author zhaoqifeng + * @Date 2022/3/29 15:16 + */ + @Override + public EpidemicPreventionResultDTO getEpidemicPreventionDetail(EpidemicPreventionFormDTO formDTO) { + EpidemicPreventionResultDTO result = new EpidemicPreventionResultDTO(); + if (StringUtils.isBlank(formDTO.getId())) { + return result; + } + List list = baseDao.getEpidemicPreventionList(formDTO); + if (CollectionUtils.isNotEmpty(list)) { + result = list.get(NumConstant.ZERO); + //查询网格名称 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(result.getGridId()); + if (null != gridInfo) { + result.setGridName(gridInfo.getGridName()); + } + //查询房子名称 + Set houseIds = new HashSet<>(); + houseIds.add(result.getHomeId()); + Result> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId()); + List houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); + Map houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); + if (houseInfoMap.containsKey(result.getHomeId()) && null != houseInfoMap.get(result.getHomeId())) { + HouseInfoDTO houseInfoDTO = houseInfoMap.get(result.getHomeId()); + result.setHouseName(houseInfoDTO.getAllName()); + } + } + return result; + } + + /** + * 居民防疫信息详情:核酸,疫苗,行程 + * + * @param formDTO + * @Param formDTO + * @Return {@link EpidemicPreventionInfoDTO} + * @Author zhaoqifeng + * @Date 2022/3/29 16:25 + */ + @Override + public EpidemicPreventionInfoDTO getEpidemicPreventionInfo(EpidemicPreventionFormDTO formDTO) { + EpidemicPreventionInfoDTO result = new EpidemicPreventionInfoDTO(); + IcResiUserEntity icResiUser = baseDao.selectById(formDTO.getId()); + if (null != icResiUser) { + //核酸检测 + List natList = icNatService.getNatList(formDTO.getCustomerId(), icResiUser.getIdCard()); + result.setNatList(natList); + //疫苗接种 + List vaccineList = icResiVaccineService.getVaccineList(formDTO.getCustomerId(), icResiUser.getIdCard()); + result.setVaccineList(vaccineList); + //行程信息 + List tripList = icTripReportRecordService.tripList(formDTO.getCustomerId(), icResiUser.getIdCard()); + result.setTripList(tripList); + } + return result; + } + /** * @Description 居民分类 和 网格名 处理 * @param list diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java new file mode 100644 index 0000000000..2f5f0b0928 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java @@ -0,0 +1,116 @@ +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.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.IcResiVaccineDao; +import com.epmet.dto.IcResiVaccineDTO; +import com.epmet.dto.result.VaccineListDTO; +import com.epmet.entity.IcResiVaccineEntity; +import com.epmet.service.IcResiVaccineService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +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 IcResiVaccineServiceImpl extends BaseServiceImpl implements IcResiVaccineService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiVaccineDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiVaccineDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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)); + } + + /** + * 获取居民疫苗接种信息 + * + * @param idCard + * @Param idCard + * @Return {@link List< VaccineListDTO >} + * @Author zhaoqifeng + * @Date 2022/3/30 10:24 + */ + @Override + public List getVaccineList(String customerId, String idCard) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiVaccineEntity::getCustomerId, customerId); + wrapper.eq(IcResiVaccineEntity::getIdCard, idCard); + wrapper.orderByDesc(IcResiVaccineEntity::getInoculateTime); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + VaccineListDTO dto = new VaccineListDTO(); + dto.setAddress(item.getInoculateAddress()); + dto.setManufactor(item.getManufacturer()); + dto.setVaccinateTime(DateUtils.format(item.getInoculateTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java new file mode 100644 index 0000000000..9fc799e122 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java @@ -0,0 +1,429 @@ +package com.epmet.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +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.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.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.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.utils.*; +import com.epmet.constant.IcResiUserConstant; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dao.IcTripReportRecordDao; +import com.epmet.dao.UserBaseInfoDao; +import com.epmet.dto.IcEpidemicSpecialAttentionDTO; +import com.epmet.dto.IcTripReportRecordDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.TripListDTO; +import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.entity.IcTripReportRecordEntity; +import com.epmet.excel.data.IcTripReportExcelData; +import com.epmet.excel.handler.IcTripReportExcelImportListener; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.OssFeignClient; +import com.epmet.service.IcEpidemicSpecialAttentionService; +import com.epmet.service.IcNoticeService; +import com.epmet.service.IcTripReportRecordService; +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.collections4.ListUtils; +import org.apache.commons.collections4.MapUtils; +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.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Slf4j +@Service +public class IcTripReportRecordServiceImpl extends BaseServiceImpl implements IcTripReportRecordService, ResultDataResolver { + @Autowired + private UserBaseInfoDao userBaseInfoDao; + //关注 + @Autowired + private IcEpidemicSpecialAttentionService epidemicSpecialAttentionService; + //通知 + @Autowired + private IcNoticeService icNoticeService; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private OssFeignClient ossFeignClient; + + /** + * pc: 行程上报-列表 + * @param formDTO + * @return + */ + @Override + public PageData page(PageTripReportFormDTO formDTO) { + //1.获取工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo=queryCurrentStaff(formDTO.getCustomerId(),formDTO.getUserId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + //2.按条件查询业务数据 + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> baseDao.pageList(formDTO)); + List list = data.getList(); + //3.查询最近一次通知时间、核算检测关注名单 + if (CollectionUtils.isNotEmpty(list)) { + Map latestNotice = new HashMap<>(); + List gzIdCardList = new ArrayList<>(); + List idCardList = list.stream().map(m -> m.getIdCard()).distinct().collect(Collectors.toList()); + //如果不分页可能会有很多个身份证号 + List> partionList = ListUtils.partition(idCardList, NumConstant.ONE_HUNDRED); + partionList.forEach(l -> { + Map map = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(), l); + List gzIdCards = epidemicSpecialAttentionService.getHeSuanIdCardList(formDTO.getCustomerId(), l); + latestNotice.putAll(map); + gzIdCardList.addAll(gzIdCards); + }); + for (IcTripReportRecordDTO dto : list) { + //默认未加入 + dto.setHeSuanCheck(false); + dto.setHeSuanCheckDesc("未加入"); + if (CollectionUtils.isNotEmpty(gzIdCardList) && gzIdCardList.contains(dto.getIdCard())) { + dto.setHeSuanCheck(true); + dto.setHeSuanCheckDesc("已加入"); + } + if (MapUtils.isNotEmpty(latestNotice) && latestNotice.containsKey(dto.getIdCard())) { + dto.setLatestNoticeTime(latestNotice.get(dto.getIdCard())); + } + } + } + return new PageData(list, data.getTotal()); + } + + private CustomerStaffInfoCacheResult queryCurrentStaff(String customerId, String userId) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + return staffInfo; + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcTripReportRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + /** + * pc: 行程上报-新增 + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public String save(IcTripReportFormDTO formDTO) { + //如果是单个录入的,默认数据属于当前用户所属组织id + if(IcResiUserConstant.USER_TYPE_INPUT.equals(formDTO.getUserType())){ + //获取当前登录用户所属组织id + CustomerStaffInfoCacheResult staffInfo= queryCurrentStaff(formDTO.getCustomerId(),formDTO.getCurrentStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcTripReportRecordEntity.class); + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(entity.getAgencyId()); + if (null == agencyInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询组织信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + entity.setPids(agencyInfoCache.getPids()); + //1.插入行程记录表 + insert(entity); + if(formDTO.getHeSuanCheck()){ + // 2.加入核算检测关注名单 + vaccinationAdd(formDTO); + } + //3.新增通知表信息 + if (formDTO.getChannel().size() > NumConstant.ZERO && StringUtils.isNotBlank(formDTO.getContent())) { + sendNotice(formDTO,agencyInfoCache.getOrganizationName()); + } + return entity.getId(); + } + + /** + * 行程上报-发送通知 + * @param formDTO + */ + private void sendNotice(IcTripReportFormDTO formDTO,String agencyName) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userList = new ArrayList<>(); + //注意这里的userId是指的pc平台的居民 + userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setUserList(userList); + dto.setChannel(formDTO.getChannel()); + //通知来源 0 行程上报,1 疫苗接种,2 核酸检测 + dto.setOrigin(NumConstant.ZERO_STR); + dto.setContent(formDTO.getContent()); + dto.setOrgName(agencyName); + dto.setStaffId(formDTO.getCurrentStaffId()); + icNoticeService.sendNotice(dto); + } + + /** + * 行程上报-加入核算检测关注 + * @param formDTO + */ + private void vaccinationAdd(IcTripReportFormDTO formDTO) { + VaccinationAddFormDTO vaccinationAddFormDTO=new VaccinationAddFormDTO(); + vaccinationAddFormDTO.setCustomerId(formDTO.getCustomerId()); + vaccinationAddFormDTO.setUserId(formDTO.getCurrentStaffId()); + List list =new ArrayList<>(); + IcEpidemicSpecialAttentionDTO dto=new IcEpidemicSpecialAttentionDTO(); + dto.setName(formDTO.getName()); + dto.setIdCard(formDTO.getIdCard()); + dto.setMobile(formDTO.getMobile()); + //避免再发通知,赋值个空集合吧 + dto.setChannel(Collections.emptyList()); + //关注类型,核酸检测:2,疫苗接种:1;行程上报:0 + dto.setAttentionType(NumConstant.TWO); + list.add(dto); + vaccinationAddFormDTO.setList(list); + epidemicSpecialAttentionService.vaccinationAdd( vaccinationAddFormDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String update(IcTripReportFormDTO formDTO) { + IcTripReportRecordEntity origin=baseDao.selectById(formDTO.getId()); + if(null==origin){ + log.warn("ic_trip_report_record记录不存在id:",formDTO.getId()); + return formDTO.getId(); + } + //如果是单个录入的,默认数据属于当前用户所属组织id + if(IcResiUserConstant.USER_TYPE_INPUT.equals(formDTO.getUserType())){ + //获取当前登录用户所属组织id + CustomerStaffInfoCacheResult staffInfo= queryCurrentStaff(formDTO.getCustomerId(),formDTO.getCurrentStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcTripReportRecordEntity.class); + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(entity.getAgencyId()); + if (null == agencyInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询组织信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + entity.setPids(agencyInfoCache.getPids()); + //1.修改行程记录表 + updateById(entity); + if(formDTO.getHeSuanCheck()){ + // 2.加入核算检测关注名单,如果之前关注了,会在通知的service层移除 + vaccinationAdd(formDTO); + } + //3.新增通知表信息 + if (formDTO.getChannel().size() > NumConstant.ZERO && StringUtils.isNotBlank(formDTO.getContent())) { + sendNotice(formDTO,agencyInfoCache.getOrganizationName()); + } + return entity.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String customerId, String userId, String[] ids) { + CustomerStaffInfoCacheResult staffInfo=queryCurrentStaff(customerId,userId); + baseDao.batchDel(userId,staffInfo.getAgencyId(),ids); + } + + /** + * 居民端小程序:上报行程 + * + * @param formDTO + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public String resiSave(IcTripReportFormDTO formDTO) { + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询网格信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(gridInfoCache.getPid()); + if (null == agencyInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询组织信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcTripReportRecordEntity.class); + entity.setAgencyId(gridInfoCache.getPid()); + entity.setPids(agencyInfoCache.getPids()); + insert(entity); + return entity.getId(); + } + + /** + * 居民端小程序:我的上报 + * + * @param formDTO + * @return + */ + @Override + public List resiList(MyReportedTripFormDTO formDTO) { + String idCard=userBaseInfoDao.selectIdCard(formDTO.getUserId()); + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectMyReported(formDTO.getUserId(), + formDTO.getCustomerId(),idCard)); + return result.getList(); + } + + /** + * 获取居民行程信息 + * + * @param idCard + * @Param idCard + * @Return {@link List< TripListDTO >} + * @Author zhaoqifeng + * @Date 2022/3/30 10:31 + */ + @Override + public List tripList(String customerId, String idCard) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcTripReportRecordEntity::getCustomerId, customerId); + wrapper.eq(IcTripReportRecordEntity::getIdCard, idCard); + wrapper.orderByDesc(IcTripReportRecordEntity::getArriveDate); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + TripListDTO dto = new TripListDTO(); + dto.setArrivalTime(DateUtils.format(item.getArriveDate(), DateUtils.DATE_PATTERN)); + dto.setFromRegion(item.getSourceAddress()); + dto.setLeaveTime(DateUtils.format(item.getLeaveDate(), DateUtils.DATE_PATTERN)); + dto.setRemark(item.getRemark()); + return dto; + }).collect(Collectors.toList()); + } + + @Async + @Override + public void execAsyncExcelImport(Path filePath, String importTaskId) { + String userId = null; + String customerId=null; + try { + userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + customerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID); + //获取当前登录用户所属组织id + CustomerStaffInfoCacheResult staffInfo= queryCurrentStaff(customerId,userId); + + IcTripReportExcelImportListener listener = new IcTripReportExcelImportListener(customerId,staffInfo, this); + + EasyExcel.read(filePath.toFile(), IcTripReportExcelData.class, listener).headRowNumber(2).sheet(0).doRead(); + + Path errorDescFile = null; + String errorDesFileUrl = null; + List errorRows = listener.getErrorRows(); + + // 生成并上传错误文件 + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_trip_preport", "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, IcTripReportExcelData.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows); + + // 文件上传oss + Result 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 entities) { + String currentUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + entities.forEach(e -> { + String id = IdWorker.getIdStr(e); + e.setId(id); + e.setUpdatedBy(currentUserId); + baseDao.insert(e); + }); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java index df3d1c3418..78d860fe7e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java @@ -172,7 +172,7 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl listPage(PatrolQueryFormDTO formDTO) { - return PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage()) + return PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) .doSelectPage(() -> baseDao.selectList(formDTO)); } diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.27__ic_nat.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.27__ic_nat.sql new file mode 100644 index 0000000000..b673ddbc72 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.27__ic_nat.sql @@ -0,0 +1,100 @@ +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='防疫通知'; + + + +CREATE TABLE `ic_follow_up_record` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `NAME` varchar(64) NOT NULL COMMENT '姓名', + `MOBILE` varchar(11) NOT NULL COMMENT '手机号', + `ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', + `ORIGIN` varchar(1) NOT NULL COMMENT '0行程上报,1疫苗接种,2核酸检测', + `VISIT_TIME` datetime NOT NULL COMMENT '随访时间', + `CONTENT` varchar(1024) NOT NULL COMMENT '随访内容', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `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 '更新时间', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '工作人员所属组织id', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='随访记录表'; + +-- ---------------------------- +-- Table structure for ic_trip_report_record +-- ---------------------------- + +CREATE TABLE `ic_trip_report_record` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `GRID_ID` varchar(64) DEFAULT NULL COMMENT '居民端用户所在网格id,数字社区居民所属网格id', + `AGENCY_ID` varchar(32) NOT NULL COMMENT '居民端上报的:存储用户所在网格的组织id;\n从居民信息录入的:存储居民所属网格的组织id;\n单独新增和导入的存储的登录用户所属的组织id;', + `PIDS` varchar(255) NOT NULL COMMENT 'agency_id的所有上级', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `NAME` varchar(64) NOT NULL COMMENT '姓名', + `MOBILE` varchar(11) NOT NULL COMMENT '手机号', + `ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', + `USER_ID` varchar(64) DEFAULT NULL COMMENT '居民端小程序的用户id;数字社区的icResiUserId;其他情况暂时不存储', + `USER_TYPE` varchar(32) NOT NULL COMMENT '居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other', + `PRESENT_ADDRESS_CODE` varchar(32) NOT NULL COMMENT '现居地编码', + `PRESENT_ADDRESS` varchar(255) NOT NULL COMMENT '现居地名称eg:山东省青岛市黄岛区玫瑰山路社区', + `DETAIL_ADDRESS` varchar(255) NOT NULL COMMENT '详细地址', + `SOURCE_ADDRESS_CODE` varchar(32) NOT NULL COMMENT '来源地区编码', + `SOURCE_ADDRESS` varchar(255) NOT NULL COMMENT '来源地区地址', + `ARRIVE_DATE` date NOT NULL COMMENT '到达日期', + `LEAVE_DATE` date DEFAULT NULL COMMENT '离开日期', + `REMARK` varchar(512) DEFAULT NULL COMMENT '备注信息', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `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 COMMENT='行程上报信息'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.28__nat_add_uniquekey.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.28__nat_add_uniquekey.sql new file mode 100644 index 0000000000..76b6b17b34 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.28__nat_add_uniquekey.sql @@ -0,0 +1 @@ +alter table ic_nat add unique index unq_nat(ID_CARD, NAT_TIME) \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql new file mode 100644 index 0000000000..d28bc06972 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql @@ -0,0 +1,2 @@ +alter table ic_trip_report_record MODIFY COLUMN PIDS VARCHAR(255) COMMENT 'agency_id的所有上级'; +alter table ic_trip_report_record MODIFY COLUMN USER_TYPE VARCHAR(32) NOT NULL COMMENT '居民端小程序的人:resi;数字社区的居民:icresi;单独录入:input; 导入:import'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.30__add_vaccine.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.30__add_vaccine.sql new file mode 100644 index 0000000000..a41ed606c6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.30__add_vaccine.sql @@ -0,0 +1,21 @@ +CREATE TABLE `ic_resi_vaccine` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `NAME` varchar(64) NOT NULL COMMENT '姓名', + `MOBILE` varchar(11) NOT NULL COMMENT '手机号', + `ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', + `INOCULATE_TIME` datetime NOT NULL COMMENT '接种时间', + `INOCULATE_ADDRESS` varchar(32) NOT NULL DEFAULT '' COMMENT '接种地点', + `MANUFACTURER` varchar(32) NOT NULL DEFAULT '' COMMENT '疫苗厂家', + `FIELD1` varchar(32) DEFAULT NULL COMMENT '预留字段1', + `FIELD2` varchar(255) DEFAULT NULL COMMENT '预留字段2', + `FIELD3` varchar(255) DEFAULT NULL COMMENT '预留字段3', + `REMAEK` varchar(255) DEFAULT NULL COMMENT '备注', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='居民疫苗情况'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql new file mode 100644 index 0000000000..a7e6ad6382 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql @@ -0,0 +1,2 @@ +alter table ic_trip_report_record MODIFY COLUMN PRESENT_ADDRESS_CODE VARCHAR(32) COMMENT '现居地编码'; +alter table ic_trip_report_record MODIFY COLUMN SOURCE_ADDRESS_CODE VARCHAR(32) COMMENT '来源地区编码'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.32__update_ic_nat.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.32__update_ic_nat.sql new file mode 100644 index 0000000000..30d6bd9ac1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.32__update_ic_nat.sql @@ -0,0 +1,3 @@ + ALTER TABLE `ic_nat` + DROP INDEX `unq_nat` , + ADD UNIQUE INDEX `unq_nat` (`ID_CARD`, `NAT_TIME`, `AGENCY_ID`) USING BTREE ; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.33__modify_trip_reportv3.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.33__modify_trip_reportv3.sql new file mode 100644 index 0000000000..927c2f9a35 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.33__modify_trip_reportv3.sql @@ -0,0 +1,2 @@ +alter table ic_trip_report_record add column PRESENT_ADDRESS_PATH_CODE VARCHAR(255) COMMENT '现居地编码全路径' AFTER PRESENT_ADDRESS_CODE; +alter table ic_trip_report_record add column SOURCE_ADDRESS_PATH_CODE VARCHAR(255) COMMENT '来源地区编码全路径' AFTER SOURCE_ADDRESS_CODE; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.34__modify_collect.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.34__modify_collect.sql new file mode 100644 index 0000000000..a958e05946 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.34__modify_collect.sql @@ -0,0 +1,4 @@ +alter TABLE ic_resi_collect add COLUMN `VILLAGE_NAME` varchar(64) DEFAULT NULL COMMENT '所属小区名称' AFTER VILLAGE_ID; +alter TABLE ic_resi_collect add COLUMN `BUILD_NAME` varchar(64) DEFAULT NULL COMMENT '所属楼宇名称' AFTER BUILD_ID; +alter TABLE ic_resi_collect add COLUMN `UNIT_NAME` varchar(64) DEFAULT NULL COMMENT '单元名' AFTER UNIT_ID; +alter TABLE ic_resi_collect add COLUMN `HOME_NAME` varchar(64) DEFAULT NULL COMMENT '房间名' AFTER HOME_ID; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.35__new_ic_nat.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.35__new_ic_nat.sql new file mode 100644 index 0000000000..8001d9769d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.35__new_ic_nat.sql @@ -0,0 +1,46 @@ +-- ---------------------------- +-- Table structure for ic_nat +-- ---------------------------- +DROP TABLE IF EXISTS `ic_nat`; +CREATE TABLE `ic_nat` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `IS_RESI_USER` varchar(1) NOT NULL DEFAULT '0' COMMENT '是否客户下居民(0:否 1:是)', + `USER_ID` varchar(64) DEFAULT NULL COMMENT '居民端小程序的用户id、数字社区的icResiUserId、其他情况无值', + `USER_TYPE` varchar(32) NOT NULL COMMENT '数据来源【居民端小程序的人:resi;\r\n数字社区的居民:icresi;\r\n导入的:import;\r\n同步的: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_nat_relation +-- ---------------------------- +CREATE TABLE `ic_nat_relation` ( + `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,包含当前agencyId值', + `IC_NAT_ID` varchar(64) NOT NULL COMMENT '核酸记录表Id(ic_nat.id)', + `USER_TYPE` varchar(32) NOT NULL COMMENT '关系数据的绑定途径【居民端录入:resi;\r\n数字社区录入:icresi;\r\n导入的:import;\r\n同步的:synchro】', + `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='核酸记录关系表'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.36__ic_nat_normal.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.36__ic_nat_normal.sql new file mode 100644 index 0000000000..a0bfefa9f9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.36__ic_nat_normal.sql @@ -0,0 +1,4 @@ +ALTER TABLE `ic_nat` +MODIFY COLUMN `USER_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据来源【居民端小程序的人:resi;\r\n数字社区的居民:icresi;\r\n导入的:import;】' AFTER `USER_ID`, +ADD INDEX `idx_ic_card` (`ID_CARD`) USING BTREE ; + diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx new file mode 100644 index 0000000000..1ef3866f47 Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx new file mode 100644 index 0000000000..b186c33b7a Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx new file mode 100644 index 0000000000..d9038bfdc4 Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx new file mode 100644 index 0000000000..e360db9aad Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml b/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml index 6b7089434f..c2a982739d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml +++ b/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml @@ -142,7 +142,6 @@ - diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml new file mode 100644 index 0000000000..1510da99b8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -0,0 +1,112 @@ + + + + + + + + UPDATE ic_epidemic_special_attention + SET UPDATED_TIME = NOW(), + IS_ATTENTION = 0, + del_flag = 1 + WHERE del_flag = 0 + AND attention_type = #{attentionType} + AND id_card IN ( + + #{l} + + ) + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml new file mode 100644 index 0000000000..a8710f4094 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml new file mode 100644 index 0000000000..8392bf5856 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + DELETE FROM ic_nat WHERE id = #{icNatId} + + + + INSERT INTO epmet_user.ic_nat + (ID, CUSTOMER_ID, AGENCY_ID, PIDS, USER_ID, + USER_TYPE, NAME, MOBILE, ID_CARD, NAT_TIME, NAT_RESULT, NAT_ADDRESS, FILE_NAME, ATTACHMENT_TYPE, ATTACHMENT_URL, + DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES (#{id}, #{customerId}, #{agencyId}, #{pids}, #{userId}, + #{userType}, #{name}, #{mobile}, #{idCard}, #{natTime}, + #{natResult}, #{natAddress}, #{fileName}, #{attachmentType}, #{attachmentUrl}, + #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, + #{updatedTime}) + ON DUPLICATE KEY update + NAME=#{name}, + MOBILE=#{mobile}, + NAT_ADDRESS=#{natAddress}, + NAT_RESULT=#{natResult}, + UPDATED_BY=#{updatedBy}, + UPDATED_TIME=NOW() + + + UPDATE ic_nat m, + ( + SELECT if(DEL_FLAG,0,1) resiFlag, ID_CARD FROM ic_resi_user + WHERE + 1=1 + + AND ID = #{icResiUserId} + + AND CUSTOMER_ID = #{customerId} + AND DEL_FLAG = '0' + ) t + SET m.IS_RESI_USER = t.resiFlag + WHERE + m.ID_CARD = t.ID_CARD + AND m.DEL_FLAG = '0' + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatRelationDao.xml new file mode 100644 index 0000000000..1857d13df7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatRelationDao.xml @@ -0,0 +1,16 @@ + + + + + + + DELETE + FROM ic_nat_relation + WHERE + ic_nat_id = #{icNatId} + + AND AGENCY_ID = #{agencyId} + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml new file mode 100644 index 0000000000..dab4ffd739 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml index 0be0e43c13..98725fa04e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml @@ -55,11 +55,35 @@ UPDATE ic_resi_collect - SET UPDATED_TIME = NOW(), - HOUSE_TYPE = #{houseType}, - HOUSE_HOLDER_NAME = #{houseHolderName}, - TOTAL_RESI = #{totalResi} + SET + + HOUSE_TYPE = #{houseType}, + + + HOUSE_HOLDER_NAME = #{houseHolderName}, + + + TOTAL_RESI = #{totalResi}, + + + UPDATED_BY = #{updatedBy}, + + UPDATED_TIME = NOW() WHERE id = #{id} + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml index 6423f7ecff..b76345774c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml @@ -4,5 +4,20 @@ - + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 8122ec6bf9..b3fef04dbc 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -301,7 +301,9 @@ IFNULL(ir.MOBILE,'') AS demandUserMobile, concat(ir.`NAME`,'(',ir.MOBILE,')')as label, ir.grid_id as gridId, - ir.ID_CARD as idCard + ir.ID_CARD as idCard, + ir.AGENCY_ID as agencyId, + ir.HOME_ID as houseId FROM ic_resi_user ir WHERE @@ -641,4 +643,161 @@ ) + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml new file mode 100644 index 0000000000..a330bccba9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml new file mode 100644 index 0000000000..f667e9826d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + update ic_trip_report_record set del_flag='1',UPDATED_BY=#{userId},UPDATED_TIME=NOW() + WHERE USER_TYPE !='resi' + AND AGENCY_ID=#{agencyId} + AND ( + + id=#{id} + + ) + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index ae0fbc5486..3164ebcddb 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -143,4 +143,14 @@ AND ubi.user_id != #{excludeUserId} + +