Browse Source

Merge remote-tracking branch 'origin/develop' into release_temp

master
yinzuomei 3 years ago
parent
commit
0ab3d79246
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  4. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java
  5. 82
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatRelationDTO.java
  6. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java
  7. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java
  8. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java
  9. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java
  10. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java
  11. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java
  12. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java
  13. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  14. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java
  15. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  16. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java
  17. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  18. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java
  19. 52
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java
  20. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java
  21. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java
  22. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatRelationService.java
  23. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  24. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  25. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatRelationServiceImpl.java
  26. 113
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  27. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
  28. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  29. 4
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.34__modify_collect.sql
  30. 51
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml
  31. 16
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatRelationDao.xml
  32. 97
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java

@ -33,7 +33,7 @@ public class PageFormDTO implements Serializable {
*/
private Integer offset;
private boolean isPage = true;
private Boolean isPage;
public Integer getOffset() {
return (pageNo-1)*pageSize;

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -251,7 +251,7 @@ public enum EpmetErrorCode {
ORG_EDIT_FAILED(8920,"编辑失败"),
ORG_DEL_FAILED(8921,"删除失败"),
NEIGHBORHOOD_DEL_FAILED(8922,""),
IC_NAT_IDCARD_NATTIME(8923,"核酸检测时间已存在相同记录"),
IC_NAT_IDCARD_NATTIME(8923,"已存在相同记录"),
//通用错误码 start

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -694,7 +694,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId());
PageData<IcNeighborHoodDTO> result = null;
List<IcNeighborHoodDTO> list = null;
if (params.isPage()){
if (params.getIsPage()){
Page<IcNeighborHoodEntity> objects = PageHelper.startPage(params.getPageNo(), params.getPageSize()).doSelectPage(() -> {
baseDao.selectList(wrapper);
});

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

@ -1,13 +1,13 @@
package com.epmet.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
* 核酸上报记录
@ -32,14 +32,9 @@ public class IcNatDTO implements Serializable {
private String customerId;
/**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id
*/
private String agencyId;
/**
* 组织pids
* 是否客户下居民(0: 1:)
*/
private String pids;
private String isResiUser;
/**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值

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

@ -0,0 +1,82 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@Data
public class IcNatRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id
*/
private String agencyId;
/**
* 组织pids,包含当前agencyId值
*/
private String pids;
/**
* 核酸记录表Id(ic_nat.id)
*/
private String icNatId;
/**
* 关系数据的绑定途径居民端录入resi;
数字社区录入icresi;
导入的import;
同步的synchro
*/
private String userType;
/**
* 删除标识
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -80,11 +80,14 @@ public class AddIcNatFormDTO implements Serializable {
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 是否客户下居民(0: 1:)
*/
private String isResiUser = "0";
/**
* 通知渠道 0小程序通知1短信通知多选是数组
*/

15
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java

@ -56,6 +56,16 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab
* 身份证
*/
private String idCard;
/**
* 开始日期
*/
private String startDate;
/**
* 结束日期
*/
private String endDate;
/**
* 疫苗接种次数
*/
@ -64,4 +74,9 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab
* 核酸检测次数
*/
private Integer natCount;
/**
* 关注类型核酸检测2疫苗接种1
*/
private Integer attentionType;
}

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

@ -38,6 +38,10 @@ public class MyNatListFormDTO extends PageFormDTO {
* 手机号
*/
private String mobile;
/**
* 是否客户下居民(0: 1:)
*/
private String isResiUser;
/**
* 检测开始时间yyyy-MM-dd HH:mm
*/

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

@ -52,24 +52,32 @@ public class ResiCollectFormDTO implements Serializable {
*/
@NotBlank(message = "小区不能为空", groups = InternalShowGroup.class)
private String villageId;
@NotBlank(message = "小区名不能为空", groups = InternalShowGroup.class)
private String villageName;
/**
* 所属楼宇Id
*/
@NotBlank(message = "楼栋不能为空", groups = InternalShowGroup.class)
private String buildId;
@NotBlank(message = "楼栋名不能为空",groups = InternalShowGroup.class)
private String buildName;
/**
* 单元id
*/
@NotBlank(message = "单元不能为空", groups = InternalShowGroup.class)
private String unitId;
@NotBlank(message = "单元名不能为空",groups = InternalShowGroup.class)
private String unitName;
/**
* 所属家庭Id
*/
@NotBlank(message = "家庭不能为空", groups = InternalShowGroup.class)
private String homeId;
@NotBlank(message = "家庭名不能为空",groups = InternalShowGroup.class)
private String homeName;
/**
* 详细地址
@ -102,4 +110,5 @@ public class ResiCollectFormDTO implements Serializable {
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
}

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

@ -59,6 +59,11 @@ public class LatestCollectResDTO implements Serializable {
*/
private Integer totalResi;
private String villageName;
private String buildName;
private String unitName;
private String homeName;
@Valid
private List<IcResiCollectMemFormDTO> memberList;
@ -78,5 +83,9 @@ public class LatestCollectResDTO implements Serializable {
this.houseHolderName="";
this.totalResi=0;
this.memberList=new ArrayList<>();
this.villageName="";
this.buildName="";
this.unitName="";
this.homeName="";
}
}

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

@ -35,6 +35,10 @@ public class NatListResultDTO implements Serializable {
*/
@ExcelIgnore
private String userId;
/**
* 是否客户下居民(0: 1:)
*/
private String isResiUser;
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
*/

7
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java

@ -64,6 +64,13 @@ public class IcEpidemicPreventionController{
return new Result<PageData<EpidemicPreventionResultDTO>>().ok(result);
}
@PostMapping("user-list")
public Result<PageData<EpidemicPreventionResultDTO>> userList(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
PageData<EpidemicPreventionResultDTO> result = icResiUserService.userList(formDTO);
return new Result<PageData<EpidemicPreventionResultDTO>>().ok(result);
}
/**
* 居民防疫信息详情
* @Param formDTO

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

@ -155,6 +155,20 @@ public class IcNatController implements ResultDataResolver {
return new Result();
}
/**
* @Author sun
* @Description 核酸核酸检测信息取消同步
**/
@NoRepeatSubmit
@PostMapping("cancelsynchro")
public Result cancelSynchro(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Synchro.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icNucleinService.cancelSynchro(formDTO);
return new Result<>();
}
/**
* 导入excel
* @return

24
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java

@ -0,0 +1,24 @@
package com.epmet.controller;
import com.epmet.service.IcNatRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@RestController
@RequestMapping("icNatRelation")
public class IcNatRelationController {
@Autowired
private IcNatRelationService icNatRelationService;
}

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

@ -28,13 +28,19 @@ public interface IcNatDao extends BaseDao<IcNatEntity> {
/**
* @Author sun
* @Description 核酸核酸检测信息列表
* @Description 核酸本辖区核酸检测信息列表
**/
List<NatListResultDTO> getNatList(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 删除/取消同步操作--物理删除业务数据
* @Description 核酸客户下核酸检测信息列表
**/
List<NatListResultDTO> getCustomerNatList(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 删除操作--物理删除业务数据
**/
int delById(@Param("icNatId") String icNatId);
@ -48,5 +54,5 @@ public interface IcNatDao extends BaseDao<IcNatEntity> {
* @Author sun
* @Description 按条件查询业务数据
**/
IcNatDTO getNatDTO(@Param("customerId") String customerId, @Param("icNatId") String icNatId, @Param("idCard") String idCard, @Param("natTime") String natTime);
IcNatDTO getNatDTO(@Param("customerId") String customerId, @Param("icNatId") String icNatId, @Param("idCard") String idCard, @Param("natTime") String natTime, @Param("natResult") String natResult);
}

22
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java

@ -0,0 +1,22 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcNatRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@Mapper
public interface IcNatRelationDao extends BaseDao<IcNatRelationEntity> {
/**
* @Author sun
* @Description 关系数据删除--物理删除
**/
int delRelation(@Param("icNatId") String icNatId, @Param("agencyId") String agencyId);
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -281,4 +281,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<EpidemicPreventionResultDTO> getEpidemicPreventionList(EpidemicPreventionFormDTO formDTO);
List<EpidemicPreventionResultDTO> natList(EpidemicPreventionFormDTO formDTO);
List<EpidemicPreventionResultDTO> vaccineList(EpidemicPreventionFormDTO formDTO);
}

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

@ -29,15 +29,10 @@ public class IcNatEntity extends BaseEpmetEntity {
@TableField(fill = FieldFill.INSERT)
private String customerId;
/**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id
*/
private String agencyId;
/**
* 组织pids
*/
private String pids;
/**
* 是否客户下居民(0: 1:)
*/
private String isResiUser;
/**
* 居民端小程序的用户id数字社区的icResiUserId其他情况无值

52
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java

@ -0,0 +1,52 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_nat_relation")
public class IcNatRelationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id
*/
private String agencyId;
/**
* 组织pids,包含当前agencyId值
*/
private String pids;
/**
* 核酸记录表Id(ic_nat.id)
*/
private String icNatId;
/**
* 关系数据的绑定途径居民端录入resi;
数字社区录入icresi;
导入的import;
同步的synchro
*/
private String userType;
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java

@ -82,5 +82,8 @@ public class IcResiCollectEntity extends BaseEpmetEntity {
* 居住成员人数
*/
private Integer totalResi;
private String villageName;
private String buildName;
private String unitName;
private String homeName;
}

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

@ -68,8 +68,8 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
}
IcNatEntity icNatEntity = ConvertUtils.sourceToTarget(data, IcNatEntity.class);
icNatEntity.setAgencyId(currentAgencyId);
icNatEntity.setPids(currentAgencyPids);
//icNatEntity.setAgencyId(currentAgencyId);
//icNatEntity.setPids(currentAgencyPids);
icNatEntity.setUserId(currentUserId);
icNatEntity.setUserType("import");
icNatEntity.setNatResult(natResult);

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatRelationService.java

@ -0,0 +1,14 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.IcNatRelationEntity;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
public interface IcNatRelationService extends BaseService<IcNatRelationEntity> {
}

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

@ -64,6 +64,12 @@ public interface IcNatService extends BaseService<IcNatEntity> {
**/
void synchro(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息取消同步
**/
void cancelSynchro(MyNatListFormDTO formDTO);
/**
* 执行Excel导入
* @param filePath

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

@ -226,6 +226,7 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @Date 2022/3/29 14:27
*/
PageData<EpidemicPreventionResultDTO> epidemicPreventionList(EpidemicPreventionFormDTO formDTO);
PageData<EpidemicPreventionResultDTO> userList(EpidemicPreventionFormDTO formDTO);
/**
* 居民防疫信息详情

19
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatRelationServiceImpl.java

@ -0,0 +1,19 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.IcNatRelationDao;
import com.epmet.entity.IcNatRelationEntity;
import com.epmet.service.IcNatRelationService;
import org.springframework.stereotype.Service;
/**
* 核酸记录关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-31
*/
@Service
public class IcNatRelationServiceImpl extends BaseServiceImpl<IcNatRelationDao, IcNatRelationEntity> implements IcNatRelationService {
}

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

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -20,12 +21,14 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcNatDao;
import com.epmet.dao.IcNatRelationDao;
import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcNatEntity;
import com.epmet.entity.IcNatRelationEntity;
import com.epmet.excel.data.IcNatImportExcelData;
import com.epmet.excel.handler.IcNatExcelImportListener;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -69,18 +72,16 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private IcNoticeService icNoticeService;
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private UserBaseInfoDao userBaseInfoDao;
@Autowired
private IcNatRelationDao icNatRelationDao;
/**
* @Author sun
@ -89,8 +90,8 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override
@Transactional(rollbackFor = Exception.class)
public void add(AddIcNatFormDTO formDTO) {
//0.先根据身份证号和检查时间校验数据是否存在
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE));
//0.先根据身份证号和检查时间以及检测结果校验数据是否存在
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult());
if (null != icNatDTO) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
}
@ -99,10 +100,17 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
}
//2.新增核酸记录表数据
//2.新增核酸基础信息数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
entity.setPids(agencyInfo.getPids());
if (StringUtils.isNotBlank(formDTO.getUserId())) {
entity.setIsResiUser("1");
}
insert(entity);
//3.核酸记录关系表新增与组织的关系数据
IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class);
relationEntity.setIcNatId(entity.getId());
relationEntity.setPids(StringUtils.isNotBlank(agencyInfo.getPids()) ? agencyInfo.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId());
icNatRelationDao.insert(relationEntity);
//3.新增通知表信息
if (formDTO.getChannel().size() > NumConstant.ZERO) {
@ -128,33 +136,42 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
public List<MyNatListResultDTO> myNatList(MyNatListFormDTO formDTO) {
//1.根据token信息查询居民身份证号
UserBaseInfoResultDTO dto = userBaseInfoDao.selectListByUserIdList(formDTO.getUserId());
formDTO.setIdCard(dto.getIdNum());
//2.查询当前人员创建的或该身份证号录入的核算检测数据(居民端录入、数字平台录入、数字平台导入)
if (null != dto) {
formDTO.setIdCard(dto.getIdNum());
}
//2.查询当前人员创建的或该身份证号录入的核算检测数据(居民端录入、数字平台录入、数字平台导入、数字平台同步的)
List<MyNatListResultDTO> resultList = baseDao.getMyNatList(formDTO);
return resultList;
}
/**
* @Author sun
* @Description 核酸核酸检测信息列表
* @Description 核酸本组织及下级核酸检测信息列表
*
* @return*/
@Override
public PageData<NatListResultDTO> natList(MyNatListFormDTO formDTO) {
//1.根据orgType值判断是查询当前组织下还是整个客户下数据
//1.根据是查询客户数据还是本辖区数据走不同逻辑
if ("current".equals(formDTO.getOrgType())) {
//获取工作人员缓存信息
//本辖区数据
//2.获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
formDTO.setAgencyId(staffInfo.getAgencyId());
//3.按条件查询业务数据
PageInfo<NatListResultDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.doSelectPageInfo(() -> baseDao.getNatList(formDTO));
return new PageData(data.getList(), data.getTotal());
} else if ("all".equals(formDTO.getOrgType())) {
//客户下数据
PageInfo<NatListResultDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.doSelectPageInfo(() -> baseDao.getCustomerNatList(formDTO));
return new PageData(data.getList(), data.getTotal());
}
//2.按条件查询业务数据
PageInfo<NatListResultDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.doSelectPageInfo(() -> baseDao.getNatList(formDTO));
return new PageData(data.getList(),data.getTotal());
return new PageData(new ArrayList(), 0);
}
/**
@ -188,18 +205,19 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(AddIcNatFormDTO formDTO) {
//0.先根据身份证号和检测时间校验除当前数据是否还存在相同数据
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE));
//0.先根据身份证号和检测时间以及检测结果校验除当前数据是否还存在相同数据
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult());
if (null != icNatDTO) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
}
//1.更新核酸记录表数据
//1.更新核酸记录基础信息表数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
entity.setId(formDTO.getIcNatId());
if (!updateById(entity)) {
log.error(String.format("数据修改失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "核酸记录修改失败");
}
//修改只涉及到基础信息的修改 不会修改关系数据 关系表不涉及更新
//3.新增通知表信息
if (CollectionUtils.isNotEmpty(formDTO.getChannel())) {
@ -223,11 +241,13 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override
@Transactional(rollbackFor = Exception.class)
public void del(MyNatListFormDTO formDTO) {
//1.物理删除业务数据
//1.确定删除则需要删除基础数据以及所有可能存在的关系数据,物理删除业务数据
if (baseDao.delById(formDTO.getIcNatId()) < NumConstant.ONE) {
log.error(String.format("数据删除/取消同步失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据操作失败");
log.error(String.format("数据删除失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据删除失败");
}
//关系数据删除
icNatRelationDao.delRelation(formDTO.getIcNatId(), null);
}
/**
@ -237,25 +257,46 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override
@Transactional(rollbackFor = Exception.class)
public void synchro(MyNatListFormDTO formDTO) {
//1.检验核酸基础信息是否存在
IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId());
if (null == entity) {
log.error(String.format("核酸记录数据不存在同步失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,核酸记录数据不存在");
}
//获取工作人员缓存数据
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
//2.不管是否已存在关系数据都是先删后增
icNatRelationDao.delRelation(formDTO.getIcNatId(), staffInfo.getAgencyId());
//3.新增关系数据
IcNatRelationEntity relationEntity = new IcNatRelationEntity();
relationEntity.setCustomerId(formDTO.getCustomerId());
relationEntity.setIcNatId(formDTO.getIcNatId());
relationEntity.setAgencyId(staffInfo.getAgencyId());
relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds())?staffInfo.getAgencyPIds()+":"+formDTO.getAgencyId():staffInfo.getAgencyId());
relationEntity.setUserType("synchro");
icNatRelationDao.insert(relationEntity);
}
/**
* @Author sun
* @Description 核酸核酸检测信息取消同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void cancelSynchro(MyNatListFormDTO formDTO) {
//1.获取工作人员缓存数据
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
//1.根据核酸记录Id查询业务数据并进行必要校验
IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId());
if (null == entity || staffInfo.getAgencyId().equals(entity.getAgencyId())
|| (!"import".equals(entity.getUserType()) && !"synchro".equals(entity.getUserType()))) {
log.error(String.format("数据同步失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,不是导入数据或非本组织数据");
//1.物理删除关系数据
if (icNatRelationDao.delRelation(formDTO.getIcNatId(), staffInfo.getAgencyId()) < NumConstant.ONE) {
log.error(String.format("数据取消同步失败,核酸记录Id->%s", formDTO.getIcNatId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消同步操作失败");
}
//3.待同步组织新增业务数据
entity.setId("");
entity.setAgencyId(staffInfo.getAgencyId());
entity.setPids(staffInfo.getAgencyPIds());
entity.setUserType("synchro");
insert(entity);
}
@Async

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

@ -170,6 +170,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
mem.setCustomerId(formDTO.getCustomerId());
//姓名或份身份证号不为空时插入
mem.setIcResiCollectId(insert.getId());
mem.setId(null);
icResiMemberDao.insert(mem);
}
});
@ -230,5 +231,9 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
resDTO.setHouseType(entity.getHouseType());
resDTO.setHouseHolderName(entity.getHouseHolderName());
resDTO.setTotalResi(entity.getTotalResi());
resDTO.setVillageName(StringUtils.isBlank(entity.getVillageName()) ? StrConstant.EPMETY_STR : entity.getVillageName());
resDTO.setBuildName(StringUtils.isBlank(entity.getBuildName()) ? StrConstant.EPMETY_STR : entity.getBuildName());
resDTO.setUnitName(StringUtils.isBlank(entity.getUnitName()) ? StrConstant.EPMETY_STR : entity.getUnitName());
resDTO.setHomeName(StringUtils.isBlank(entity.getHomeName()) ? StrConstant.EPMETY_STR : entity.getHomeName());
}
}

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

@ -1278,6 +1278,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(list, pageInfo.getTotal());
}
@Override
public PageData<EpidemicPreventionResultDTO> userList(EpidemicPreventionFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<EpidemicPreventionResultDTO> list = new ArrayList<>();
if (formDTO.getAttentionType().equals(NumConstant.TWO)){
list = baseDao.natList(formDTO);
}else if (formDTO.getAttentionType().equals(NumConstant.ONE)){
list = baseDao.vaccineList(formDTO);
}
PageInfo<EpidemicPreventionResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* 居民防疫信息详情
*

4
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.34__modify_collect.sql

@ -0,0 +1,4 @@
alter TABLE ic_resi_collect add COLUMN `VILLAGE_NAME` varchar(64) DEFAULT NULL COMMENT '所属小区名称' AFTER VILLAGE_ID;
alter TABLE ic_resi_collect add COLUMN `BUILD_NAME` varchar(64) DEFAULT NULL COMMENT '所属楼宇名称' AFTER BUILD_ID;
alter TABLE ic_resi_collect add COLUMN `UNIT_NAME` varchar(64) DEFAULT NULL COMMENT '单元名' AFTER UNIT_ID;
alter TABLE ic_resi_collect add COLUMN `HOME_NAME` varchar(64) DEFAULT NULL COMMENT '房间名' AFTER HOME_ID;

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

@ -31,10 +31,52 @@
</select>
<select id="getNatList" resultType="com.epmet.dto.result.NatListResultDTO">
SELECT
a.ic_nat_id icNatId,
a.agency_id agencyId,
a.user_type userType,
b.user_id userId,
b.is_resi_user isResiUser,
b.`name` `name`,
b.mobile mobile,
b.id_card idCard,
b.nat_time natTime,
b.nat_result natResult,
b.nat_address natAddress
FROM
ic_nat_relation a
INNER JOIN ic_nat b ON a.IC_NAT_ID = b.ID
WHERE
a.DEL_FLAG = '0'
AND b.DEL_FLAG = '0'
AND a.customer_id = #{customerId}
AND a.pids like concat('%', #{agencyId}, '%')
<if test='null != name and "" != name'>
AND b.name like concat('%', #{name}, '%')
</if>
<if test='null != mobile and "" != mobile'>
AND b.mobile = #{mobile}
</if>
<if test='null != idCard and "" != idCard'>
AND b.id_card = #{idCard}
</if>
<if test='null != startTime and "" != startTime'>
AND b.nat_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test='null != endTime and "" != endTime'>
AND b.nat_time <![CDATA[ <= ]]> #{endTime}
</if>
<if test='null != isResiUser and "" != isResiUser'>
AND b.is_resi_user = #{isResiUser}
</if>
ORDER BY b.nat_time DESC
</select>
<select id="getCustomerNatList" resultType="com.epmet.dto.result.NatListResultDTO">
SELECT
id icNatId,
agency_id agencyId,
user_id userId,
is_resi_user isResiUser,
user_type userType,
`name` `name`,
mobile mobile,
@ -47,9 +89,6 @@
WHERE
del_flag = '0'
AND customer_id = #{customerId}
<if test='null != agencyId and "" != agencyId'>
AND (agency_id = #{agencyId} OR pids like concat('%', #{agencyId}, '%'))
</if>
<if test='null != name and "" != name'>
AND name like concat('%', #{name}, '%')
</if>
@ -71,7 +110,6 @@
<select id="getNatDTO" resultType="com.epmet.dto.IcNatDTO">
SELECT
id,
agency_id,
user_id,
user_type,
`name`,
@ -87,6 +125,9 @@
AND customer_id = #{customerId}
AND id_card = #{idCard}
AND DATE_FORMAT(nat_time, '%Y-%m-%d %h:%i') = DATE_FORMAT(#{natTime}, '%Y-%m-%d %h:%i')
<if test='null != natResult and "" != natResult'>
AND nat_result = #{natResult}
</if>
<if test='null != icNatId and "" != icNatId'>
AND id != #{icNatId}
</if>

16
epmet-user/epmet-user-server/src/main/resources/mapper/IcNatRelationDao.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcNatRelationDao">
<delete id="delRelation">
DELETE
FROM ic_nat_relation
WHERE
ic_nat_id = #{icNatId}
<if test='null != agencyId and "" != agencyId'>
AND AGENCY_ID = #{agencyId}
</if>
</delete>
</mapper>

97
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -656,8 +656,28 @@
IFNULL( c.count, 0 ) AS natCount
FROM
ic_resi_user a
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count FROM ic_resi_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count FROM ic_nat WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD
LEFT JOIN (
SELECT ID_CARD, count( id ) AS count
FROM ic_resi_vaccine
WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId}
<if test="startDate != null and startDate != ''">
AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") &gt; #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") &lt; #{endDate}
</if>
GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD
LEFT JOIN (
SELECT ID_CARD, count( id ) AS count
FROM ic_nat
WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId}
<if test="startDate != null and startDate != ''">
AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") &gt; #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") &lt; #{endDate}
</if>
GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD
WHERE
a.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
@ -704,4 +724,77 @@
</if>
ORDER BY `NAME`
</select>
<select id="natList" resultType="com.epmet.dto.result.EpidemicPreventionResultDTO">
SELECT * FROM
(SELECT
ID,
`NAME`,
GRID_ID,
HOME_ID,
MOBILE,
a.ID_CARD,
c.created_time,
IFNULL( c.count, 0 ) AS natCount
FROM ic_resi_user a
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count,created_time FROM ic_nat WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD
WHERE a.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND a.CUSTOMER_ID = #{customerId}
</if>
<if test="agencyId != null and agencyId != ''">
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
</if>
<if test="gridId != null and gridId != ''">
AND GRID_ID = #{gridId}
</if>
) t
WHERE 1=1
<if test="startDate != null and startDate != ''">
AND date_format(created_time,'%Y%m%d') >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND date_format(created_time,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
<if test="natCount != null">
AND natCount <![CDATA[ <= ]]> #{natCount}
</if>
ORDER BY `NAME`
</select>
<select id="vaccineList" resultType="com.epmet.dto.result.EpidemicPreventionResultDTO">
SELECT * FROM
(SELECT
ID,
`NAME`,
GRID_ID,
HOME_ID,
MOBILE,
a.ID_CARD,
b.created_time,
IFNULL( b.count, 0 ) AS vaccineCount
FROM ic_resi_user a
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count,created_time FROM ic_resi_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD
WHERE a.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND a.CUSTOMER_ID = #{customerId}
</if>
<if test="agencyId != null and agencyId != ''">
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
</if>
<if test="gridId != null and gridId != ''">
AND GRID_ID = #{gridId}
</if>
) t
WHERE 1=1
<if test="startDate != null and startDate != ''">
AND date_format(created_time,'%Y%m%d') >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND date_format(created_time,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
<if test="vaccineCount != null">
AND vaccineCount <![CDATA[ <= ]]> #{vaccineCount}
</if>
ORDER BY `NAME`
</select>
</mapper>

Loading…
Cancel
Save