diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 2fe5b49d9a..0d18e6f706 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -27,7 +27,9 @@ public interface NumConstant { int ELEVEN = 11; int TWELVE = 12; int THIRTEEN = 13; + int SIXTEEN = 16; int SEVENTEEN = 17; + int EIGHTEEN = 18; int FIFTEEN = 15; int FOURTEEN=14; int TWENTY = 20; 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 4995291154..a13d6cf1db 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 @@ -258,6 +258,7 @@ public enum EpmetErrorCode { IC_MOVE_IN(8926,"居民信息中房屋信息与当前选择房屋不一致,是否更新?"), NOT_REGEIST_RESI(8927,"未注册居民"), UNIT_EXIST_HOUSES_ERROR(8928,"单元下存在房屋,不可修改单元数"), + IC_VACCINE(8929,"已存在相同记录,请去修改原有记录"), MISMATCH(10086,"人员与房屋信息不匹配,请与工作人员联系。"), diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java index ecc399cfb3..88075ff9cd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java @@ -150,6 +150,7 @@ public class IcServiceProjectServiceImpl extends BaseServiceImpl pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getServiceProjectList(formDTO)); if (CollectionUtils.isNotEmpty(pageInfo.getList())){ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml index 17f4de965a..c042978f80 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml @@ -43,7 +43,7 @@ AND ID = #{serviceProjectId} - AND AGENCY_ID = #{agencyId} + AND AGENCY_ID_PATH like concat( '%',#{agencyId},'%') AND SERVICE_CATEGORY_KEY = #{serviceCategoryKey} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java index 67b4642640..084d69cdc2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java @@ -16,7 +16,7 @@ public class BuildingListResultDTO implements Serializable { private static final long serialVersionUID = -1423424057500044373L; private String id; private String name; - private Integer unitCoun = 0; + private Integer unitCount = 0; private Integer houseCount = 0; private Integer personCount = 0; private Integer differHouseCount = 0; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 5839114b8b..d7f4e95ac1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -813,7 +813,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } @@ -254,7 +253,7 @@ public class HouseInformationServiceImpl implements HouseInformationService { //排序 list = list.stream().sorted(Comparator.comparing(BuildingListResultDTO::getDifferPersonCount).reversed()).collect(Collectors.toList()); //分页 - list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); + list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); } } @@ -387,7 +386,7 @@ public class HouseInformationServiceImpl implements HouseInformationService { //排序 list = list.stream().sorted(Comparator.comparing(HomeListResultDTO::getPersonCount).reversed()).collect(Collectors.toList()); //分页 - list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); + list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index ba47187e06..7314031436 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -530,7 +530,8 @@ SELECT a.ID, a.BUILDING_NAME AS name, - IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitCount, + IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitRealCount, + IFNULL(c.unitCount, 0) AS unitCount, SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount, SUM( IFNULL( a.REAL_PERSON, 0 ) ) AS personRealCount, IFNULL(b.houseCount, 0) AS houseCount, @@ -541,6 +542,10 @@ FROM ic_house WHERE DEL_FLAG = '0' AND NEIGHBOR_HOOD_ID = #{neighborHoodId} GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_ID + LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS unitCount + FROM ic_building_unit + WHERE DEL_FLAG = '0' + GROUP BY BUILDING_ID ) c ON a.ID = c.BUILDING_ID WHERE a.DEL_FLAG = '0' AND a.NEIGHBOR_HOOD_ID = #{neighborHoodId} @@ -578,7 +583,8 @@ a.ID AS buildingId, a.TYPE AS buildingType, CONCAT(NEIGHBOR_HOOD_NAME,' ',BUILDING_NAME) AS buildingName, - IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitCount, + IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitRealCount, + IFNULL( d.unitCount, 0 ) AS unitCount, SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount, SUM( IFNULL( a.REAL_PERSON, 0 ) ) AS personRealCount, IFNULL( b.houseCount, 0 ) AS houseCount, @@ -590,6 +596,11 @@ WHERE DEL_FLAG = '0' AND BUILDING_ID = #{buildingId} GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_ID + LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS unitCount + FROM ic_building_unit + WHERE DEL_FLAG = '0' + AND BUILDING_ID = #{buildingId} + GROUP BY BUILDING_ID ) d ON a.ID = d.BUILDING_ID INNER JOIN ic_neighbor_hood c ON a.NEIGHBOR_HOOD_ID = c.ID WHERE a.DEL_FLAG = '0' diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java index a1fdca4c49..2059c84f4b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java @@ -4,6 +4,7 @@ import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.aop.NoRepeatSubmit; @@ -32,6 +33,8 @@ import com.epmet.dto.form.IcPartyMemberListFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.PartyMemberAgeResultDTO; import com.epmet.dto.result.PartyMemberEducationResultDTO; +import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partymember.excel.IcPartyMemberExcel; import com.epmet.modules.partymember.service.IcPartyMemberService; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; @@ -55,6 +58,8 @@ import java.io.InputStream; import java.io.PrintWriter; import java.net.URLEncoder; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; @@ -73,6 +78,8 @@ public class IcPartyMemberController implements ResultDataResolver { @Autowired private IcPartyMemberService icPartyMemberService; + @Autowired + private IcPartyOrgDao icPartyOrgDao; @RequestMapping("page") @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) @@ -226,12 +233,12 @@ public class IcPartyMemberController implements ResultDataResolver { */ @PostMapping("partymembereducationstatistics") public Result> partyMemberEducationStatistics(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFormDTO formDTO) { - if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); - if (null == staffInfo) { - throw new EpmetException("获取工作人员信息失败"); + if(StringUtils.isBlank(formDTO.getOrgId())){ + IcPartyOrgEntity org = setOrgId(tokenDto); + if (null == org) { + return new Result>().ok(new ArrayList<>()); } - formDTO.setAgencyId(staffInfo.getAgencyId()); + formDTO.setOrgId(org.getId()); } return new Result>().ok(icPartyMemberService.partyMemberEducationStatistics(formDTO)); } @@ -246,12 +253,12 @@ public class IcPartyMemberController implements ResultDataResolver { @PostMapping("partymemberagelist") @MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) public Result> partyMemberAgelist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) { - if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); - if (null == staffInfo) { - throw new EpmetException("获取工作人员信息失败"); + if(StringUtils.isBlank(formDTO.getOrgId())){ + IcPartyOrgEntity org = setOrgId(tokenDto); + if (null == org) { + return new Result>().ok(new PageData<>(Collections.emptyList(), 0)); } - formDTO.setAgencyId(staffInfo.getAgencyId()); + formDTO.setOrgId(org.getId()); } return new Result>().ok(icPartyMemberService.getPartyMemberAgeList(formDTO)); } @@ -266,12 +273,12 @@ public class IcPartyMemberController implements ResultDataResolver { @PostMapping("partymembereducationlist") @MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) public Result> partyMemberEducationlist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) { - if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); - if (null == staffInfo) { - throw new EpmetException("获取工作人员信息失败"); + if(StringUtils.isBlank(formDTO.getOrgId())){ + IcPartyOrgEntity org = setOrgId(tokenDto); + if (null == org) { + return new Result>().ok(new PageData<>(Collections.emptyList(), 0)); } - formDTO.setAgencyId(staffInfo.getAgencyId()); + formDTO.setOrgId(org.getId()); } return new Result>().ok(icPartyMemberService.getPartyMemberEducationList(formDTO)); } @@ -285,16 +292,36 @@ public class IcPartyMemberController implements ResultDataResolver { */ @PostMapping("partymemberagestatistics") public Result> partyMemberAgeStatistics(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberFormDTO formDTO) { - if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); - if (null == staffInfo) { - throw new EpmetException("获取工作人员信息失败"); + if(StringUtils.isBlank(formDTO.getOrgId())){ + IcPartyOrgEntity org = setOrgId(tokenDto); + if (null == org) { + return new Result>().ok(new ArrayList<>()); } - formDTO.setAgencyId(staffInfo.getAgencyId()); + formDTO.setOrgId(org.getId()); } return new Result>().ok(icPartyMemberService.partyMemberAgeStatistics(formDTO)); } + /** + * @describe: 组装党组织信息 + * @author wangtong + * @date 2022/7/8 16:46 + * @params [tokenDto, formDTO] + * @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity + */ + public IcPartyOrgEntity setOrgId(TokenDto tokenDto){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //获取工作人员所属组织同级的党组织 + LambdaQueryWrapper orgWrapper = new LambdaQueryWrapper<>(); + orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId()); + orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); + orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); + return icPartyOrgDao.selectOne(orgWrapper); + } + @RequestMapping(value = "downloadTemplate", method = {RequestMethod.GET, RequestMethod.POST}) public void downloadTemplate(HttpServletResponse response) throws IOException { 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 index ef59cb992b..9b2a5274b6 100644 --- 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 @@ -70,7 +70,7 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { /** * 手机号 */ - @NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttentionAdd.class) +// @NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttentionAdd.class) private String mobile; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccineDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccineDTO.java index 585b4ef550..115eeb2154 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccineDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccineDTO.java @@ -47,6 +47,11 @@ public class IcVaccineDTO implements Serializable { */ private String isResiUser; + /** + * 数字社区的icResiUserId、其他情况无值 + */ + private String userId; + /** * 数据来源【导入的:import;】 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcVaccineFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcVaccineFormDTO.java new file mode 100644 index 0000000000..482ef97839 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcVaccineFormDTO.java @@ -0,0 +1,96 @@ +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 AddIcVaccineFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + public interface Vaccine extends CustomerClientShowGroup { + } + public interface Edit extends CustomerClientShowGroup { + } + + /** + * 核酸记录Id,修改时使用 + */ + @NotBlank(message = "核酸记录Id不能为空", groups = Edit.class) + private String vaccineId; + /** + * 当前网格所属组织Id + */ + @NotBlank(message = "组织Id不能为空", groups = Vaccine.class) + private String agencyId; + /** + * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 + */ + private String userId; + /** + * 数据来源【居民端小程序的人:resi; 数字社区的居民:icresi; 导入的:import;】 + */ + @NotBlank(message = "居民来源不能为空", groups = Vaccine.class) + private String userType; + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空", groups = Vaccine.class) + private String name; + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = Vaccine.class) + private String mobile; + /** + * 身份证号 + */ + @NotBlank(message = "身份证号不能为空", groups = Vaccine.class) + private String idCard; + /** + * 接种时间 + */ + @NotNull(message = "接种时间不能为空", groups = Vaccine.class) + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date inoculateTime; + /** + * 接种地点 + */ + //@NotBlank(message = "接种地点不能为空", groups = Vaccine.class) + private String inoculateAddress; + /** + * 疫苗厂家 + */ + //@NotBlank(message = "疫苗厂家不能为空", groups = Vaccine.class) + private String manufacturer; + /** + * 是否客户下居民(0:否 1:是) + */ + private String isResiUser = "0"; + /** + * 通知渠道 0小程序通知,1短信通知,多选是数组 + */ + private List channel = new ArrayList<>(); + /** + * 通知内容 + */ + private String content = ""; + + //token中信息 + private String customerId; + private String staffId; + private String client; + + +} 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 index 345d7496b0..4cd9156ea1 100644 --- 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 @@ -80,4 +80,14 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab * 关注类型,核酸检测:2,疫苗接种:1 */ private Integer attentionType; + + /** + * 年龄段查询,起始生日 + */ + private String startBirthDay; + + /** + * 年龄段查询,截止生日 + */ + private String endBirthDay; } 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 index 6d365c9955..c50649b4a9 100644 --- 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 @@ -82,4 +82,14 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable * user所属组织ID */ private String orgId; + + /** + * 开始时间 eg:20220706 + */ + private String startDate; + + /** + * 结束时间 eg:20220706 + */ + private String endDate; } 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 index 0639371186..4946982090 100644 --- 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 @@ -37,6 +37,9 @@ public class EpidemicPreventionResultDTO implements Serializable { * 身份证 */ private String idCard; + + private String birthDay; + /** * 疫苗接种次数 */ @@ -45,4 +48,6 @@ public class EpidemicPreventionResultDTO implements Serializable { * 核酸检测次数 */ private Integer natCount; + + private String createdTime; } 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 index 01c7374dff..29ebb13231 100644 --- 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 @@ -2,8 +2,10 @@ package com.epmet.dto.result; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; +import org.apache.commons.lang3.StringUtils; import java.io.Serializable; +import java.util.regex.Pattern; /** * @Author zxc @@ -39,6 +41,7 @@ public class VaccinationListResultDTO implements Serializable { * 身份证 */ private String idCard; + private String sex; /** * 备注 @@ -110,4 +113,42 @@ public class VaccinationListResultDTO implements Serializable { this.lastInformTime = ""; this.reason = ""; } + + public void setSex(){ + if (StringUtils.isBlank(getIdCard())){ + this.sex = "未知"; + }else { + if (this.idCard.length() == NumConstant.FIFTEEN){ + String substring = this.idCard.substring(NumConstant.FOURTEEN, NumConstant.FIFTEEN); + if (!isNumeric2(substring)){ + this.sex = "未知"; + }else { + if (Integer.parseInt(substring) % NumConstant.TWO == NumConstant.ZERO) { + sex = "女"; + } else { + sex = "男"; + } + } + }else if (this.idCard.length() == NumConstant.EIGHTEEN){ + String substring = this.idCard.substring(NumConstant.SIXTEEN).substring(NumConstant.ZERO, NumConstant.ONE); + if (!isNumeric2(substring)){ + this.sex = "未知"; + }else { + if (Integer.parseInt(substring) % NumConstant.TWO == NumConstant.ZERO) { + sex = "女"; + } else { + sex = "男"; + } + } + }else { + this.sex = "未知"; + } + } + } + + private static final Pattern NUMBER_PATTERN = Pattern.compile("-?\\d+(\\.\\d+)?"); + public static boolean isNumeric2(String str) { + return str != null && NUMBER_PATTERN.matcher(str).matches(); + } + } 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 9becc91a97..fc6dce18f9 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 @@ -619,11 +619,12 @@ public class IcResiUserController implements ResultDataResolver { try { // 都导入成功了没问题,才删除 if (importTempFileSavePath != null) { - if (isAllSuccess) { - Files.delete(importTempFileSavePath); - } else { - log.error("【导入居民信息】未完全成功,上传文件:{}", importTempFileSavePath); - } + Files.delete(importTempFileSavePath); + //if (isAllSuccess) { + // Files.delete(importTempFileSavePath); + //} else { + // log.error("【导入居民信息】未完全成功,上传文件:{}", importTempFileSavePath); + //} } } catch (IOException e) { log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java index ce9f895a60..bb34afd612 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java @@ -20,6 +20,7 @@ import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcVaccineDTO; +import com.epmet.dto.form.AddIcVaccineFormDTO; import com.epmet.dto.form.IcVaccineFormDTO; import com.epmet.dto.form.VaccineListFormDTO; import com.epmet.dto.result.IcVaccineListCommonExcelResultDTO; @@ -237,5 +238,43 @@ public class IcVaccineController implements ResultDataResolver { return new Result().ok(icVaccineService.detail(formDTO.getVaccineId())); } + /** + * @Author sun + * @Description 【疫苗】疫苗接种信息新增 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcVaccineFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddIcVaccineFormDTO.Vaccine.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setClient(tokenDto.getClient()); + icVaccineService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 【疫苗】疫苗接种信息修改 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody AddIcVaccineFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddIcVaccineFormDTO.Edit.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + icVaccineService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 【疫苗】疫苗接种信息删除 + **/ + @PostMapping("del") + public Result del(@RequestBody IcVaccineFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcVaccineFormDTO.Detail.class); + icVaccineService.del(formDTO); + return new Result<>(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java index 15cd0fe88e..d4db61ad5b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java @@ -2,6 +2,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcNatDTO; +import com.epmet.dto.IcVaccineDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.VaccineListFormDTO; import com.epmet.dto.result.IcVaccineListResultDTO; @@ -44,7 +45,7 @@ public interface IcVaccineDao extends BaseDao { * @Author sun * @Description 删除操作--物理删除业务数据 **/ - int delById(@Param("icNatId") String icNatId); + int delById(@Param("icVaccineId") String icVaccineId); /** * @Author sun @@ -60,4 +61,7 @@ public interface IcVaccineDao extends BaseDao { * @return */ int updateIsResiFlag(@Param("customerId") String customerId, @Param("icResiUserId") String icResiUserId); + + IcVaccineDTO getVaccineDTO(@Param("customerId") String customerId, @Param("icVaccineId") String icVaccineId, @Param("idCard") String idCard, @Param("inoculateTime") String inoculateTime); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccineEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccineEntity.java index 215fd77173..b17256f3a0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccineEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccineEntity.java @@ -48,6 +48,11 @@ public class IcVaccineEntity extends BaseEpmetEntity { */ private String isResiUser; + /** + * 数字社区的icResiUserId、其他情况无值 + */ + private String userId; + /** * 数据来源【导入的:import;】 */ 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 index 8fe217466f..34c11ea835 100644 --- 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 @@ -23,6 +23,12 @@ public class VaccinationExportExcel { @Excel(name = "身份证",width = 30) private String idCard; + @Excel(name = "性别",width = 30) + private String sex; + + @Excel(name = "关注原因",width = 40) + private String reason; + @Excel(name = "备注",width = 40) private String remark; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java index 60a83b2582..83625be4d8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java @@ -35,11 +35,11 @@ public class IcVaccineImportExcelData implements Serializable { @ExcelProperty("接种时间") private Date inoculateTime; - @NotBlank(message = "接种地点为必填项") + //@NotBlank(message = "接种地点为必填项") @ExcelProperty("接种地点") private String inoculateAddress; - @NotBlank(message = "疫苗厂家为必填项") + //@NotBlank(message = "疫苗厂家为必填项") @ExcelProperty("疫苗厂家") private String manufacturer; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java index 154b6f9558..c89b5f2db4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java @@ -3,6 +3,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcVaccineDTO; +import com.epmet.dto.form.AddIcVaccineFormDTO; +import com.epmet.dto.form.IcVaccineFormDTO; import com.epmet.dto.form.VaccineListFormDTO; import com.epmet.dto.result.IcVaccineListResultDTO; import com.epmet.dto.result.VaccineListDTO; @@ -60,4 +62,10 @@ public interface IcVaccineService extends BaseService { * @Description 疫苗接种情况-列表点击查询详情 **/ IcVaccineDTO detail(String vaccineId); + + void add(AddIcVaccineFormDTO formDTO); + + void edit(AddIcVaccineFormDTO formDTO); + + void del(IcVaccineFormDTO formDTO); } 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 index 5c36cb1eb2..0258f583ad 100644 --- 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 @@ -165,7 +165,11 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl { + v.setSex(); + }); + } //需求调整 列表和导出增加所属房屋(小区+楼栋+单元+房间)一列值 sun Map houseInfoMap = new HashMap<>(); //查询房屋信息 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 index d44c421e5a..40d9818db8 100644 --- 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 @@ -591,6 +591,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp LambdaQueryWrapper query = new LambdaQueryWrapper(); query.eq(IcResiUserEntity::getCustomerId, customerId); query.eq(IcResiUserEntity::getIdCard, idCard); + query.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); if (StringUtils.isNotBlank(pids)) { query.likeRight(IcResiUserEntity::getPids, pids); } 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 14f489f625..4f44ba7c31 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 @@ -762,6 +762,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, homeId); + wrapper.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); wrapper.orderByAsc(IcResiUserEntity::getYhzgx); List list = baseDao.selectList(wrapper); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java index 1f33bbb603..09da4b8ee2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java @@ -10,21 +10,25 @@ 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.IcResiUserDao; import com.epmet.dao.IcVaccineDao; import com.epmet.dao.IcVaccineRelationDao; +import com.epmet.dto.IcNatDTO; import com.epmet.dto.IcVaccineDTO; -import com.epmet.dto.form.ImportTaskCommonFormDTO; -import com.epmet.dto.form.VaccineListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.IcVaccineListResultDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.dto.result.VaccineListDTO; +import com.epmet.entity.IcNatEntity; import com.epmet.entity.IcResiUserEntity; import com.epmet.entity.IcVaccineEntity; import com.epmet.entity.IcVaccineRelationEntity; @@ -33,6 +37,7 @@ import com.epmet.excel.data.IcVaccineImportExcelData; import com.epmet.excel.handler.IcVaccineExcelImportListener; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.OssFeignClient; +import com.epmet.service.IcNoticeService; import com.epmet.service.IcVaccineService; import com.epmet.service.UserService; import com.epmet.utils.ImportTaskUtils; @@ -77,6 +82,8 @@ public class IcVaccineServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper(); query.eq(IcResiUserEntity::getCustomerId, customerId); query.eq(IcResiUserEntity::getIdCard, idCard); + query.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); if (StringUtils.isNotBlank(pids)) { query.likeRight(IcResiUserEntity::getPids, pids); } @@ -475,4 +483,85 @@ public class IcVaccineServiceImpl extends BaseServiceImpl 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("1"); + dto.setContent(formDTO.getContent()); + dto.setStaffId(formDTO.getStaffId()); + icNoticeService.sendNotice(dto); + } + } + + @Override + public void edit(AddIcVaccineFormDTO formDTO) { + //0.先根据身份证号和接种时间校验除当前数据是否还存在相同数据 + IcVaccineDTO icVaccineDTO = baseDao.getVaccineDTO(formDTO.getCustomerId(), formDTO.getVaccineId(), formDTO.getIdCard(), DateUtils.format(formDTO.getInoculateTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + if (null != icVaccineDTO) { + throw new RenException(EpmetErrorCode.IC_VACCINE.getCode(), EpmetErrorCode.IC_VACCINE.getMsg()); + } + //1.更新核酸记录基础信息表数据 + IcVaccineEntity entity = ConvertUtils.sourceToTarget(formDTO, IcVaccineEntity.class); + entity.setId(formDTO.getVaccineId()); + if (!updateById(entity)) { + log.error(String.format("数据修改失败,核酸记录Id->%s", formDTO.getVaccineId())); + 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("1"); + dto.setContent(formDTO.getContent()); + dto.setStaffId(formDTO.getStaffId()); + icNoticeService.sendNotice(dto); + } + } + + @Override + public void del(IcVaccineFormDTO formDTO) { + //1.确定删除则需要删除基础数据以及所有可能存在的关系数据,物理删除业务数据 + if (baseDao.delById(formDTO.getVaccineId()) < NumConstant.ONE) { + log.error(String.format("数据删除失败,疫苗接种记录Id->%s", formDTO.getVaccineId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据删除失败"); + } + //关系数据删除 + icVaccineRelationDao.delRelation(formDTO.getVaccineId(), null); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.59__alter_ic_vaccine.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.59__alter_ic_vaccine.sql new file mode 100644 index 0000000000..0c96934859 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.59__alter_ic_vaccine.sql @@ -0,0 +1,6 @@ + +ALTER TABLE `ic_vaccine` +ADD COLUMN `USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数字社区的icResiUserId、其他情况无值' AFTER `USER_TYPE`; + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.60__alter_ic_epidemic_special_attention.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.60__alter_ic_epidemic_special_attention.sql new file mode 100644 index 0000000000..6a34b24ec5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.60__alter_ic_epidemic_special_attention.sql @@ -0,0 +1,3 @@ + +ALTER TABLE `ic_epidemic_special_attention` + MODIFY COLUMN `MOBILE` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号'; diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.61__alter_ic_vaccine.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.61__alter_ic_vaccine.sql new file mode 100644 index 0000000000..ab40652c5f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.61__alter_ic_vaccine.sql @@ -0,0 +1,4 @@ +ALTER TABLE `ic_vaccine` +MODIFY COLUMN `INOCULATE_ADDRESS` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '接种地点' AFTER `INOCULATE_TIME`, +MODIFY COLUMN `MANUFACTURER` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '疫苗厂家' AFTER `INOCULATE_ADDRESS`; + 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 index 29a68a7529..fe16fb2908 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -24,7 +24,7 @@ a.`NAME`, a.MOBILE, a.ID_CARD, - a.reason, + IFNULL(a.reason,'') AS reason, a.REMARK, b.VILLAGE_ID, b.BUILD_ID, @@ -34,9 +34,9 @@ IFNULL(v.vaccinationCount,0) AS vaccinationCount FROM ic_epidemic_special_attention a LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and b.CUSTOMER_ID=a.CUSTOMER_ID - LEFT JOIN (SELECT id_card , CUSTOMER_ID, count(1) AS vaccinationCount FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD, CUSTOMER_ID) v ON (v.ID_CARD = a.ID_CARD and v.CUSTOMER_ID=a.CUSTOMER_ID) + LEFT JOIN (SELECT id_card , CUSTOMER_ID, count(1) AS vaccinationCount, CREATED_TIME FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD, CUSTOMER_ID) v ON (v.ID_CARD = a.ID_CARD and v.CUSTOMER_ID=a.CUSTOMER_ID) WHERE a.DEL_FLAG = 0 - AND a.ORG_ID = #{orgId} + AND concat(a.pids,':',ORG_ID) like concat('%',#{orgId},'%') AND a.ATTENTION_TYPE = #{attentionType} AND a.`NAME` LIKE CONCAT('%',#{name},'%') @@ -59,6 +59,12 @@ AND b.home_id = #{homeId} + + AND DATE_FORMAT(v.CREATED_TIME,'%Y%m%d') >= #{startDate} + + + AND DATE_FORMAT(v.CREATED_TIME,'%Y%m%d') #{endDate} + HAVING vaccinationCount = #{vaccinationCount} @@ -81,7 +87,7 @@ FROM ic_epidemic_special_attention a LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID WHERE a.DEL_FLAG = 0 - AND a.ORG_ID = #{orgId} + AND concat(a.pids,':',ORG_ID) like concat('%',#{orgId},'%') AND a.ATTENTION_TYPE = #{attentionType} AND a.`NAME` LIKE CONCAT('%',#{name},'%') 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 1bbaeeaa3b..4459802f6d 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 @@ -142,7 +142,7 @@ UPDATE ic_nat m, ( - SELECT if(DEL_FLAG,0,1) resiFlag, ID_CARD FROM ic_resi_user + SELECT if(STATUS ='0', 1, 0) resiFlag, ID_CARD FROM ic_resi_user WHERE 1=1 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 0dbdacb01b..ce42de4964 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 @@ -824,6 +824,7 @@ HOME_ID, MOBILE, a.ID_CARD, + a.BIRTHDAY, IFNULL( b.count, 0 ) AS vaccineCount, IFNULL( c.count, 0 ) AS natCount FROM @@ -886,6 +887,12 @@ AND a.ID_CARD LIKE concat( '%', #{idCard}, '%' ) + + AND a.BIRTHDAY = ]]> #{startBirthDay} + + + AND a.BIRTHDAY #{endBirthDay} + ORDER BY GRID_ID,VILLAGE_ID,BUILD_ID,UNIT_ID,HOME_ID, convert(NAME using gbk) ) t WHERE diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml index 8bf4afa201..0ed766fb77 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml @@ -40,7 +40,8 @@ b.id_card, b.INOCULATE_TIME, b.INOCULATE_ADDRESS, - b.MANUFACTURER + b.MANUFACTURER, + b.user_id FROM ic_vaccine_relation a INNER JOIN ic_vaccine b ON a.IC_VACCINE_ID = b.ID AND b.DEL_FLAG = '0' WHERE a.DEL_FLAG = '0' @@ -71,6 +72,7 @@ SELECT id vaccineId, is_resi_user isResiUser, + user_id userId, user_type userType, `name` `name`, mobile mobile, @@ -126,8 +128,33 @@ LIMIT 1 + + - DELETE FROM ic_nat WHERE id = #{icNatId} + DELETE FROM ic_vaccine WHERE id = #{icVaccineId}