Browse Source

Merge branch 'master' of http://git.elinkit.com.cn:7070/r/epmet-cloud

feature/teamB_zz_wgh
wangxianzhang 3 years ago
parent
commit
e763129b53
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java
  4. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml
  5. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java
  6. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  7. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java
  8. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
  9. 67
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java
  10. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java
  11. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccineDTO.java
  12. 96
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcVaccineFormDTO.java
  13. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java
  14. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java
  15. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java
  16. 41
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java
  17. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  18. 39
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java
  19. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java
  20. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccineEntity.java
  21. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java
  22. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java
  23. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java
  24. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  25. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  26. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  27. 93
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java
  28. 6
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.59__alter_ic_vaccine.sql
  29. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.60__alter_ic_epidemic_special_attention.sql
  30. 4
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.61__alter_ic_vaccine.sql
  31. 14
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml
  32. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml
  33. 7
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml
  34. 31
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml

2
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;

1
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,"人员与房屋信息不匹配,请与工作人员联系。"),

1
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<IcServiceProjec
if (null == staffInfo){
throw new EpmetException("未查询到此工作人员"+formDTO.getUserId());
}
//查询当前组织及下级 的数据
formDTO.setAgencyId(staffInfo.getAgencyId());
PageInfo<ServiceProjectListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getServiceProjectList(formDTO));
if (CollectionUtils.isNotEmpty(pageInfo.getList())){

2
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml

@ -43,7 +43,7 @@
AND ID = #{serviceProjectId}
</if>
<if test='null != agencyId and agencyId != "" '>
AND AGENCY_ID = #{agencyId}
AND AGENCY_ID_PATH like concat( '%',#{agencyId},'%')
</if>
<if test='null != serviceCategoryKey and serviceCategoryKey != "" '>
AND SERVICE_CATEGORY_KEY = #{serviceCategoryKey}

2
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;

6
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<CustomerAgencyDao
boolean party = false;
//网格指导员角色
boolean gridParty = false;
for (CustomerStaffRoleListResultDTO role : RoleList) {
//2022.7.8 pc端党建声音发布单位取消角色限制
party = true;
/*for (CustomerStaffRoleListResultDTO role : RoleList) {
if (CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())) {
party = true;
}
@ -823,7 +825,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
if (!party && !gridParty) {
return returnDTO;
}
}*/
//4:根据不同角色查询不同数据
CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId());

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java

@ -61,7 +61,7 @@ public class HouseInformationServiceImpl implements HouseInformationService {
if (StringUtils.isEmpty(formDTO.getCommunityId())) {
//获取工作人员所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if(null == staffInfo) {
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败");
}
formDTO.setCommunityId(staffInfo.getAgencyId());
@ -121,7 +121,6 @@ public class HouseInformationServiceImpl implements HouseInformationService {
}
item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
});
}
return new PageData<>(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());
}
}

15
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'

67
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<List<OptionDataResultDTO>> 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<List<OptionDataResultDTO>>().ok(new ArrayList<>());
}
formDTO.setAgencyId(staffInfo.getAgencyId());
formDTO.setOrgId(org.getId());
}
return new Result<List<OptionDataResultDTO>>().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<PageData<PartyMemberAgeResultDTO>> 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<PageData<PartyMemberAgeResultDTO>>().ok(new PageData<>(Collections.emptyList(), 0));
}
formDTO.setAgencyId(staffInfo.getAgencyId());
formDTO.setOrgId(org.getId());
}
return new Result<PageData<PartyMemberAgeResultDTO>>().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<PageData<PartyMemberEducationResultDTO>> 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<PageData<PartyMemberEducationResultDTO>>().ok(new PageData<>(Collections.emptyList(), 0));
}
formDTO.setAgencyId(staffInfo.getAgencyId());
formDTO.setOrgId(org.getId());
}
return new Result<PageData<PartyMemberEducationResultDTO>>().ok(icPartyMemberService.getPartyMemberEducationList(formDTO));
}
@ -285,16 +292,36 @@ public class IcPartyMemberController implements ResultDataResolver {
*/
@PostMapping("partymemberagestatistics")
public Result<List<OptionDataResultDTO>> 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<List<OptionDataResultDTO>>().ok(new ArrayList<>());
}
formDTO.setAgencyId(staffInfo.getAgencyId());
formDTO.setOrgId(org.getId());
}
return new Result<List<OptionDataResultDTO>>().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<IcPartyOrgEntity> 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 {

2
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;
/**

5
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;
*/

96
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<String> channel = new ArrayList<>();
/**
* 通知内容
*/
private String content = "";
//token中信息
private String customerId;
private String staffId;
private String client;
}

10
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;
}

10
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;
/**
* 开始时间 eg20220706
*/
private String startDate;
/**
* 结束时间 eg20220706
*/
private String endDate;
}

5
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;
}

41
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();
}
}

11
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));

39
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<IcVaccineDTO>().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<>();
}
}

6
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<IcVaccineEntity> {
* @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<IcVaccineEntity> {
* @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);
}

5
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;
*/

6
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;

4
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;

8
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<IcVaccineEntity> {
* @Description 疫苗接种情况-列表点击查询详情
**/
IcVaccineDTO detail(String vaccineId);
void add(AddIcVaccineFormDTO formDTO);
void edit(AddIcVaccineFormDTO formDTO);
void del(IcVaccineFormDTO formDTO);
}

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

@ -165,7 +165,11 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
result.setTotal(list.size());
}
}
if (CollectionUtils.isNotEmpty(result.getList())){
result.getList().forEach(v -> {
v.setSex();
});
}
//需求调整 列表和导出增加所属房屋(小区+楼栋+单元+房间)一列值 sun
Map<String, HouseInfoDTO> houseInfoMap = new HashMap<>();
//查询房屋信息

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

@ -591,6 +591,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
LambdaQueryWrapper<IcResiUserEntity> 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);
}

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

@ -762,6 +762,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, homeId);
wrapper.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
wrapper.orderByAsc(IcResiUserEntity::getYhzgx);
List<IcResiUserEntity> list = baseDao.selectList(wrapper);

93
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<IcVaccineDao, IcVaccin
private IcResiUserDao icResiUserDao;
@Autowired
private UserService userService;
@Autowired
private IcNoticeService icNoticeService;
/**
* @Author sun
@ -394,6 +401,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin
LambdaQueryWrapper<IcResiUserEntity> 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<IcVaccineDao, IcVaccin
return ConvertUtils.sourceToTarget(entity, IcVaccineDTO.class);
}
@Override
public void add(AddIcVaccineFormDTO formDTO) {
//0.先根据身份证号和接种时间校验数据是否存在
IcVaccineDTO icVaccineDTO = baseDao.getVaccineDTO(formDTO.getCustomerId(), null, 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.获取所填居民所属组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
}
//2.新增疫苗基础信息数据
IcVaccineEntity entity = ConvertUtils.sourceToTarget(formDTO, IcVaccineEntity.class);
if (StringUtils.isNotBlank(formDTO.getUserId())) {
entity.setIsResiUser("1");
}
insert(entity);
//3.疫苗记录关系表新增与组织的关系数据
IcVaccineRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcVaccineRelationEntity.class);
relationEntity.setIcVaccineId(entity.getId());
relationEntity.setPids(StringUtils.isNotBlank(agencyInfo.getPids()) ? agencyInfo.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId());
icVaccineRelationDao.insert(relationEntity);
//3.新增通知表信息
if (formDTO.getChannel().size() > NumConstant.ZERO) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> userList = new ArrayList<>();
userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class));
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserList(userList);
dto.setChannel(formDTO.getChannel());
dto.setOrigin("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<SendNoticeFormDTO.UserListBean> userList = new ArrayList<>();
userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class));
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserList(userList);
dto.setChannel(formDTO.getChannel());
dto.setOrigin("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);
}
}

6
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`;

3
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 '手机号';

4
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`;

14
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}
<if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
@ -59,6 +59,12 @@
<if test='null != homeId and "" != homeId'>
AND b.home_id = #{homeId}
</if>
<if test='null != startDate and "" != startDate'>
AND DATE_FORMAT(v.CREATED_TIME,'%Y%m%d') >= #{startDate}
</if>
<if test='null != endDate and "" != endDate'>
AND DATE_FORMAT(v.CREATED_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
<if test=' null != vaccinationCount'>
HAVING vaccinationCount = #{vaccinationCount}
</if>
@ -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}
<if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%')

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

@ -142,7 +142,7 @@
<update id="updateIsResiFlag">
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
<if test="icResiUserId != null and icResiUserId != ''">

7
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 @@
<if test="idCard != null and idCard != ''">
AND a.ID_CARD LIKE concat( '%', #{idCard}, '%' )
</if>
<if test=" null != startBirthDay and startBirthDay != '' ">
AND a.BIRTHDAY <![CDATA[ >= ]]> #{startBirthDay}
</if>
<if test="null != endBirthDay and endBirthDay != '' ">
AND a.BIRTHDAY <![CDATA[ <= ]]> #{endBirthDay}
</if>
ORDER BY GRID_ID,VILLAGE_ID,BUILD_ID,UNIT_ID,HOME_ID, convert(NAME using gbk)
) t
WHERE

31
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
</select>
<select id="getVaccineDTO" resultType="com.epmet.dto.IcVaccineDTO">
SELECT
id,
is_resi_user,
user_type,
`name`,
mobile,
id_card,
is_resi_user,
inoculate_time,
inoculate_time,
manufacturer
FROM
ic_vaccine
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND id_card = #{idCard}
AND DATE_FORMAT(inoculate_time, '%Y-%m-%d %h:%i') = DATE_FORMAT(#{inoculateTime}, '%Y-%m-%d %h:%i')
<if test='null != icVaccineId and "" != icVaccineId'>
AND id != #{icVaccineId}
</if>
LIMIT 1
</select>
<delete id="delById">
DELETE FROM ic_nat WHERE id = #{icNatId}
DELETE FROM ic_vaccine WHERE id = #{icVaccineId}
</delete>
<update id="updateIsResiFlag">

Loading…
Cancel
Save