diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java index fa450472ba..7d5eb73285 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java @@ -22,8 +22,35 @@ public class MyNatListFormDTO implements Serializable { */ @NotBlank(message = "身份证号不能为空", groups = MyNat.class) private String idCard; + /** + * 当前组织:current 根组织:all + */ + private String orgType; + private String agencyId; + /** + * 姓名 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 检测开始时间yyyy-MM-dd HH:mm + */ + private String startTime; + /** + * 检测结束时间yyyy-MM-dd HH:mm间yy-mm-dd + */ + private String endTime; + /** + * 分页参数 + */ + private Integer pageNo = 1; + private Integer pageSize = 10; //token信息 private String customerId; + private String userId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java new file mode 100644 index 0000000000..d3cbead954 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.result; + +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; + +/** + * @Description 核酸检测-我的上报记录 + * @Author sun + */ +@Data +public class NatListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //总条数 + private Integer total; + List list = new ArrayList<>(); + + @Data + public static class NatListDTO { + + /** + * 核酸记录Id + */ + private String icNatId; + /** + * 组织Id + */ + private String agencyId; + /** + * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 + */ + private String userId; + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + private String userType; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 检测时间,yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date natTime; + + /** + * 检测结果 + */ + private String natResult; + + /** + * 检测地点 + */ + private String natAddress; + + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 0925456a21..38cb884864 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -14,6 +14,7 @@ import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; +import com.epmet.dto.result.NatListResultDTO; import com.epmet.service.IcNatService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -98,5 +99,60 @@ public class IcNatController { return new Result>().ok(icNucleinService.myNatList(formDTO)); } + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + @NoRepeatSubmit + @PostMapping("natlist") + public Result natList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icNucleinService.natList(formDTO)); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息详情 + **/ + @NoRepeatSubmit + @PostMapping("detail") + public Result detail(@RequestBody MyNatListFormDTO formDTO) { + return new Result().ok(icNucleinService.detail(formDTO)); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息修改 + **/ + @NoRepeatSubmit + @PostMapping("edit") + public Result edit(@RequestBody MyNatListFormDTO formDTO) { + icNucleinService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息删除/取消同步 + **/ + @NoRepeatSubmit + @PostMapping("del") + public Result del(@RequestBody MyNatListFormDTO formDTO) { + icNucleinService.del(formDTO); + return new Result<>(); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息同步 + **/ + @NoRepeatSubmit + @PostMapping("synchro") + public Result synchro(@RequestBody MyNatListFormDTO formDTO) { + icNucleinService.synchro(formDTO); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index 2de5a0fecf..5d292bb229 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -3,6 +3,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; +import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import org.apache.ibatis.annotations.Mapper; @@ -24,5 +25,9 @@ public interface IcNatDao extends BaseDao { **/ List getMyNatList(MyNatListFormDTO formDTO); - + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + List getNatList(MyNatListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index 206b65720c..1bc5c22b63 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -6,6 +6,7 @@ import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; +import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import java.util.List; @@ -13,7 +14,6 @@ import java.util.Map; /** * 核酸上报记录 - * * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 @@ -91,4 +91,34 @@ public interface IcNatService extends BaseService { * @Description 核酸检测-居民端我的上报 **/ List myNatList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + NatListResultDTO natList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息详情 + **/ + NatListResultDTO detail(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息修改 + **/ + void edit(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息删除/取消同步 + **/ + void del(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息同步 + **/ + void synchro(MyNatListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index fe7fa1f814..d2bafa5070 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 @@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; 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.ConvertUtils; import com.epmet.dao.IcNatDao; @@ -15,8 +18,11 @@ import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; +import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import com.epmet.service.IcNatService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -27,7 +33,6 @@ import java.util.Map; /** * 核酸上报记录 - * * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 @@ -52,8 +57,8 @@ public class IcNatServiceImpl extends BaseServiceImpl imp return ConvertUtils.sourceToTarget(entityList, IcNatDTO.class); } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -105,7 +110,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp insert(entity); //3.新增通知表信息 - if(formDTO.getChannel().size()> NumConstant.ZERO){ + if (formDTO.getChannel().size() > NumConstant.ZERO) { //TODO } @@ -122,4 +127,67 @@ public class IcNatServiceImpl extends BaseServiceImpl imp return resultList; } + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + @Override + public NatListResultDTO natList(MyNatListFormDTO formDTO) { + NatListResultDTO resultDTO = new NatListResultDTO(); + //1.根据orgType值判断是查询当前组织下还是整个客户下数据 + if ("current".equals(formDTO.getOrgType())) { + //获取工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + + //2.按条件查询业务数据 + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()) + .doSelectPageInfo(() -> baseDao.getNatList(formDTO)); + resultDTO.setTotal((int) data.getTotal()); + resultDTO.setList(data.getList()); + + return resultDTO; + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息详情 + **/ + @Override + public NatListResultDTO detail(MyNatListFormDTO formDTO) { + + return null; + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息修改 + **/ + @Override + public void edit(MyNatListFormDTO formDTO) { + + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息删除/取消同步 + **/ + @Override + public void del(MyNatListFormDTO formDTO) { + + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息同步 + **/ + @Override + public void synchro(MyNatListFormDTO formDTO) { + + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index d31df0f3d5..0d49f7d6c3 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 @@ -24,4 +24,41 @@ AND id_card = #{idCard} + + \ No newline at end of file