diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java index 66b631117f..6d11f67930 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java @@ -1,7 +1,6 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.dto.form.CustomerGridFormDTO; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonAggFeignClient; @@ -56,6 +55,10 @@ public class CustomerOrgRedis { * @date 2021/11/5 3:12 下午 */ public static GridInfoCache getGridInfo(String gridId){ + if (StringUtils.isBlank(gridId)) { + log.warn("查询网格缓存,gridId is null"); + return null; + } String key = RedisKeys.getGridInfoKey(gridId); Map grid = customerOrgRedis.redisUtils.hGetAll(key); if (!CollectionUtils.isEmpty(grid)) { diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java index dc5bbe6b52..6124648323 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * @author sun @@ -84,4 +86,17 @@ public class SubUserHouseListResultDTO implements Serializable { */ private Integer usingCommunityNum; + /** + * 人户一致,人在户不在,户在人不在, + * 为空的 暂不清楚 + */ + private Integer rhyzUserTotal = NumConstant.ZERO; + private BigDecimal rhyzUserRatio = NumConstant.ZERO_DECIMAL; + private Integer rzhbzUserTotal = NumConstant.ZERO; + private BigDecimal rzhbzUserRatio = NumConstant.ZERO_DECIMAL; + private Integer hzrbzUserTotal = NumConstant.ZERO; + private BigDecimal hzrbzUserRatio = NumConstant.ZERO_DECIMAL; + private Integer zbqcUserTotal = NumConstant.ZERO; + private BigDecimal zbqcUserRatio = NumConstant.ZERO_DECIMAL; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java index 91dfa20ed9..becc763ba3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java @@ -90,7 +90,7 @@ public class EnterpriseImportExcelDTO { * 默认0 */ @ColumnWidth(20) - @ExcelProperty(value = "场所类别(九小场所/企事业单位)") + @ExcelProperty(value = "场所类别") private String placeCategoryName; @ColumnWidth(20) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 53340d24dc..56b87d06fa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -943,6 +943,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { houseDTO.setOrgId(id); houseList.add(houseChart(houseDTO)); } + //start 2022.11.17需求:http://zentao.elinkservice.cn/story-view-718.html + //原来饼图是:居民总数、常住人口数、流动人口数 后改为下面的人户状况饼图,后面如果所有客户都上线了,就把第2步的查询注释掉。 //2.直属下级列表的居民数据 UserChartFormDTO userDTO = new UserChartFormDTO(); userDTO.setOrgType(orgType); @@ -951,6 +953,15 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { if (!userResult.success()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民人房统计数据失败" + userResult.getInternalMsg(), userResult.getMsg()); } + //end + //3.居民总数、人户一致、人在户不在、户在人不在,没填写是暂不清楚 + RHZKStatisticsFormDTO rhzkStatisticsFormDTO = new RHZKStatisticsFormDTO(); + rhzkStatisticsFormDTO.setOrgIds(idList); + rhzkStatisticsFormDTO.setOrgType(orgType); + Result> rhzkResult = epmetUserOpenFeignClient.renHuCondition(rhzkStatisticsFormDTO); + if (!rhzkResult.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民人户状况统计数据失败" + rhzkResult.getInternalMsg(), rhzkResult.getMsg()); + } //3.汇总封装数据 SubUserHouseListResultDTO dto = null; for (String id : idList) { @@ -994,6 +1005,21 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { // 网格这项数据为0 dto.setUsingCommunityNum(0); } + for (RHZKStatisticsResultDTO r : rhzkResult.getData()) { + if (StringUtils.isNotBlank(r.getOrgId())){ + if (r.getOrgId().equals(id)){ + dto.setRhyzUserTotal(r.getRhyzUserTotal()); + dto.setRhyzUserRatio(r.getRhyzUserRatio()); + dto.setRzhbzUserTotal(r.getRzhbzUserTotal()); + dto.setRzhbzUserRatio(r.getRzhbzUserRatio()); + dto.setHzrbzUserTotal(r.getHzrbzUserTotal()); + dto.setHzrbzUserRatio(r.getHzrbzUserRatio()); + dto.setZbqcUserTotal(r.getZbqcUserTotal()); + dto.setZbqcUserRatio(r.getZbqcUserRatio()); + dto.setUserTotal(r.getUserTotal()); + } + } + } list.add(dto); } return list; 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 index 1e8da051b1..de5e70080b 100644 --- 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 @@ -107,6 +107,11 @@ public class IcNatDTO implements Serializable { */ private String attachmentUrl; + /** + * 试管编号 + */ + private String testTubeCode; + /** * 删除标识 */ 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 index 1d7ba24673..b87f03d8d7 100644 --- 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 @@ -89,6 +89,10 @@ public class AddIcNatFormDTO implements Serializable { * 附件地址 */ private String attachmentUrl; + /** + * 试管编号 + */ + private String testTubeCode; /** * 是否客户下居民(0:否 1:是) */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RHZKStatisticsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RHZKStatisticsFormDTO.java new file mode 100644 index 0000000000..8d42f50714 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RHZKStatisticsFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/11/16 13:26 + */ +@Data +public class RHZKStatisticsFormDTO implements Serializable { + private static final long serialVersionUID = -4474168123286467820L; + + private String orgId; + + /** + * grid:网格;village:小区; + */ + private String orgType; + + /** + * /epmetuser/icresiuser/rhzkList调用会赋值 + */ + private List orgIds; + + //tokenDto中获取 + private String staffId; + private String customerId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java index 7d357089f6..b0b0db77d2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java @@ -27,6 +27,11 @@ public class UserChartFormDTO implements Serializable { */ private String type; + /** + * 人户一致:rhyz;人在户不在:rzhbz;户在人不在:hzrbz;暂不清楚:no;全部:all + */ + private String rhType; + private Integer pageNo = 1; private Integer pageSize = 20; private Boolean isPage = true; 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 index 355d52d213..59b0515e73 100644 --- 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 @@ -73,4 +73,9 @@ public class MyNatListResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date reportTime; + /** + * 试管编号 + */ + private String testTubeCode; + } 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 index a93294b14f..bba32c13af 100644 --- 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 @@ -73,14 +73,14 @@ public class NatListResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @ColumnWidth(25) - @ExcelProperty(value = "采样时间",order = 4) + @ExcelProperty(value = "采样时间",order = 5) private Date sampleTime; /** * 检测结果 */ @ColumnWidth(20) - @ExcelProperty(value = "检测结果",order = 5) + @ExcelProperty(value = "检测结果",order = 7) private String natResult; /** @@ -99,8 +99,15 @@ public class NatListResultDTO implements Serializable { * 检测地点 */ @ColumnWidth(30) - @ExcelProperty(value = "检测地点",order = 7) + @ExcelProperty(value = "检测地点",order = 6) private String natAddress; + /** + * 试管编号 + */ + @ColumnWidth(30) + @ExcelProperty(value = "试管编号",order = 8) + private String testTubeCode; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java index 9a3e0c23d7..8ec9b45ef1 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java @@ -25,5 +25,10 @@ public class OwnerRelationResultDTO implements Serializable { private String userName; private String isSelf; private String relation; + + /** + * 2022.11.17:人户状况:人户一致、人在户不在、户在人不在、暂不清楚 + */ + private String renHuCondition; } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RHZKStatisticsResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RHZKStatisticsResultDTO.java new file mode 100644 index 0000000000..7407375a96 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RHZKStatisticsResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2022/11/16 09:15 + */ +@Data +public class RHZKStatisticsResultDTO implements Serializable { + private static final long serialVersionUID = 6493812449146476415L; + + private Integer userTotal = NumConstant.ZERO; + + /** + * 人户一致,人在户不在,户在人不在, + * 为空的 暂不清楚 + */ + private Integer rhyzUserTotal = NumConstant.ZERO; + private BigDecimal rhyzUserRatio = NumConstant.ZERO_DECIMAL; + private Integer rzhbzUserTotal = NumConstant.ZERO; + private BigDecimal rzhbzUserRatio = NumConstant.ZERO_DECIMAL; + private Integer hzrbzUserTotal = NumConstant.ZERO; + private BigDecimal hzrbzUserRatio = NumConstant.ZERO_DECIMAL; + private Integer zbqcUserTotal = NumConstant.ZERO; + private BigDecimal zbqcUserRatio = NumConstant.ZERO_DECIMAL; + + private String orgId; + @JsonIgnore + private Integer total; + @JsonIgnore + private String rhzk; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index dab50be493..f8f29142a7 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -955,4 +955,8 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/dataSyncConfig/vaccineInfoScanTask") Result vaccineInfoScanTask(@RequestBody DataSyncTaskParam formDTO); + + @PostMapping("/epmetuser/icresiuser/rhzkList") + Result> renHuCondition(@RequestBody RHZKStatisticsFormDTO formDTO); + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 8ac8382a78..e9103269aa 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -746,4 +746,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result vaccineInfoScanTask(DataSyncTaskParam formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "vaccineInfoScanTask", formDTO); } + + @Override + public Result> renHuCondition(RHZKStatisticsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "renHuCondition", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java index a51390f16f..b146f047cd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java @@ -108,4 +108,13 @@ public interface UserConstant { * 居民信息 子表中的主表id */ String IC_RESI_USER = "IC_RESI_USER"; + + /** + * 人户一致,人在户不在,户在人不在, + * 为空的 暂不清楚 + */ + String R_H_Y_Z = "rhyz"; + String R_Z_H_B_Z = "rzhbz"; + String H_Z_R_B_Z = "hzrbz"; + String Z_B_Q_C = ""; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index d6fa1b2d72..298ff6f65e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -1467,4 +1467,22 @@ public class IcResiUserController implements ResultDataResolver { return new Result().ok(icResiUserService.getIcResiUserInfo(userId)); } + /** + * @Description 人户状况统计查询 + * @param tokenDto + * @Author zxc + * @Date 2022/11/16 09:22 + */ + @PostMapping("rhzk") + public Result renHuCondition(@LoginUser TokenDto tokenDto,@RequestBody RHZKStatisticsFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(icResiUserService.renHuCondition(formDTO)); + } + + @PostMapping("rhzkList") + public Result> renHuConditionList(@RequestBody RHZKStatisticsFormDTO formDTO){ + return new Result>().ok(icResiUserService.renHuConditionList(formDTO)); + } + } 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 762baa4ed5..23830a2e4c 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 @@ -442,4 +442,6 @@ public interface IcResiUserDao extends BaseDao { ResiAndLocalResiResultDTO getResiCount(@Param("agencyId")String agencyId,@Param("idCard")String idCard,@Param("customerId")String customerId); List getResiUserList(ComparisonFormDTO formDTO); + + List getUserByRenHu(RHZKStatisticsFormDTO formDTO); } 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 index 7cbe8cdd66..3246d9be0a 100644 --- 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 @@ -94,6 +94,11 @@ public class IcNatEntity extends BaseEpmetEntity { */ private String attachmentUrl; + /** + * 试管编号 + */ + private String testTubeCode; + @TableField(exist = false) private String agencyId; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/RenHuConditionEnum.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/RenHuConditionEnum.java new file mode 100644 index 0000000000..a02850b7d6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/RenHuConditionEnum.java @@ -0,0 +1,55 @@ +package com.epmet.enums; + +import org.apache.commons.lang3.StringUtils; + +/** + * 居民信息里的人户状况枚举类 + */ +public enum RenHuConditionEnum { + + /** + * 人户一致,人在户不在,户在人不在, + * 为空的 暂不清楚 + */ + RHYZ("rhyz","人户一致"), + RZHBZ("rzhbz","人在户不在"), + HZRBZ("hzrbz","户在人不在"), + ZBQC("","暂不清楚"), + ; + + private String code; + private String name; + + public static String getNameByCode(String code){ + if (StringUtils.isBlank(code)){ + return ZBQC.name; + } + for (RenHuConditionEnum e : values()) { + if (e.getCode().equals(code)){ + return e.getName(); + } + } + return ZBQC.name; + } + + RenHuConditionEnum(String code, String name) { + this.code = code; + this.name = name; + } + + 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-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 index b54c571f8f..b5b52f8ea4 100644 --- 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 @@ -43,6 +43,9 @@ public class IcNatImportExcelData { @ExcelProperty("检测结果") private String natResultZh; + @ExcelProperty("试管编号") + private String testTubeCode; + @Data public static class RowRemarkMessage { 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 246f87a15d..f346f2c3b1 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 @@ -525,4 +525,15 @@ public interface IcResiUserService extends BaseService { IcResiUserInfoCache getIcResiUserInfo(String userId); void epidemicPreventionExport(EpidemicPreventionFormDTO formDTO, HttpServletResponse response) throws IOException; + + /** + * @Description 人户状况统计查询 + * @param formDTO + * @Author zxc + * @Date 2022/11/16 09:22 + */ + RHZKStatisticsResultDTO renHuCondition(RHZKStatisticsFormDTO formDTO); + + List renHuConditionList(RHZKStatisticsFormDTO formDTO); + } 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 93952215df..3e341bf86b 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 @@ -64,6 +64,7 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; import com.epmet.entity.*; +import com.epmet.enums.RenHuConditionEnum; import com.epmet.excel.EpidemicPreventionExportExcel; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.feign.*; @@ -1483,6 +1484,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl userByRenHu = baseDao.getUserByRenHu(formDTO); + RHZKStatisticsResultDTO r = new RHZKStatisticsResultDTO(); + if (CollectionUtils.isEmpty(userByRenHu)){ + return r; + } + r.setOrgId(formDTO.getOrgId()); + r.setUserTotal(userByRenHu.stream().collect(Collectors.summingInt(RHZKStatisticsResultDTO::getTotal))); + userByRenHu.forEach(u -> { + switch (u.getRhzk()){ + case UserConstant.R_H_Y_Z: + r.setRhyzUserTotal(u.getTotal()); + r.setRhyzUserRatio(getRatio(r.getUserTotal(),u.getTotal())); + break; + case UserConstant.R_Z_H_B_Z: + r.setRzhbzUserTotal(u.getTotal()); + r.setRzhbzUserRatio(getRatio(r.getUserTotal(),u.getTotal())); + break; + case UserConstant.H_Z_R_B_Z: + r.setHzrbzUserTotal(u.getTotal()); + r.setHzrbzUserRatio(getRatio(r.getUserTotal(),u.getTotal())); + break; + case UserConstant.Z_B_Q_C: + r.setZbqcUserTotal(u.getTotal()); + r.setZbqcUserRatio(getRatio(r.getUserTotal(),u.getTotal())); + break; + default: + break; + } + }); + return r; + } + + @Override + public List renHuConditionList(RHZKStatisticsFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getOrgIds())){ + return new ArrayList<>(); + } + List result = new ArrayList<>(); + formDTO.getOrgIds().forEach(o -> { + formDTO.setOrgId(o); + result.add(renHuCondition(formDTO)); + }); + return result; + } + + /** + * @Description + * @param total 总人数 + * @param fz 分子人数 + * @Author zxc + * @Date 2022/11/16 10:12 + */ + public BigDecimal getRatio(Integer total,Integer fz){ + BigDecimal totalBig = new BigDecimal(total); + BigDecimal fzBig = new BigDecimal(fz); + return fzBig.multiply(NumConstant.ONE_HUNDRED_DECIMAL).divide(totalBig, NumConstant.TWO, BigDecimal.ROUND_HALF_UP); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.89__alter_ic_nat.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.89__alter_ic_nat.sql new file mode 100644 index 0000000000..7925891a55 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.89__alter_ic_nat.sql @@ -0,0 +1,4 @@ +-- 核酸记录表增加非必填字段“试管编号” 对应产蛋4679 +ALTER TABLE `ic_nat` +ADD COLUMN `TEST_TUBE_CODE` varchar(255) NULL COMMENT '试管编号' AFTER `ATTACHMENT_URL`; + 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 index 524d327bd7..de671285c6 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx 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/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index f6daee080d..243fbebcd7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -16,7 +16,8 @@ nat_address natAddress, file_name fileName, attachment_url attachmentUrl, - created_time reportTime + created_time reportTime, + test_tube_code testTubeCode FROM ic_nat WHERE @@ -45,7 +46,8 @@ b.nat_time natTime, b.sample_time sampleTime, b.nat_result natResult, - b.nat_address natAddress + b.nat_address natAddress, + b.test_tube_code testTubeCode FROM ic_nat_relation a INNER JOIN ic_nat b ON a.IC_NAT_ID = b.ID @@ -93,7 +95,8 @@ nat_time natTime, sample_time sampleTime, nat_result natResult, - nat_address natAddress + nat_address natAddress, + test_tube_code testTubeCode FROM ic_nat WHERE @@ -134,7 +137,8 @@ nat_time, sample_time, nat_result, - nat_address + nat_address, + test_tube_code FROM ic_nat WHERE 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 c65e178660..694acafe5b 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 @@ -1359,6 +1359,18 @@ AND (is_floating != '0' or is_floating is null) + + AND RHZK = 'rhyz' + + + AND RHZK = 'rzhbz' + + + AND RHZK = 'hzrbz' + + + AND(RHZK = '' or RHZK IS null) + AND (agency_id = #{orgId} OR pids LIKE CONCAT('%', #{orgId}, '%')) @@ -1402,6 +1414,41 @@ AND ID_CARD = #{idCard} + + +