Browse Source

【核酸】核酸检测信息列表

master
sunyuchao 3 years ago
parent
commit
bbfee55ff9
  1. 27
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java
  2. 76
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java
  3. 56
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  4. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  5. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  6. 76
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  7. 37
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml

27
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) @NotBlank(message = "身份证号不能为空", groups = MyNat.class)
private String idCard; 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信息 //token信息
private String customerId; private String customerId;
private String userId;
} }

76
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<NatListDTO> 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;
}
}

56
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.AddIcNatFormDTO;
import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.service.IcNatService; import com.epmet.service.IcNatService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -98,5 +99,60 @@ public class IcNatController {
return new Result<List<MyNatListResultDTO>>().ok(icNucleinService.myNatList(formDTO)); return new Result<List<MyNatListResultDTO>>().ok(icNucleinService.myNatList(formDTO));
} }
/**
* @Author sun
* @Description 核酸核酸检测信息列表
**/
@NoRepeatSubmit
@PostMapping("natlist")
public Result<NatListResultDTO> natList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<NatListResultDTO>().ok(icNucleinService.natList(formDTO));
}
/**
* @Author sun
* @Description 核酸核酸检测信息详情
**/
@NoRepeatSubmit
@PostMapping("detail")
public Result<NatListResultDTO> detail(@RequestBody MyNatListFormDTO formDTO) {
return new Result<NatListResultDTO>().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<NatListResultDTO> 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();
}
} }

7
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.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.entity.IcNatEntity; import com.epmet.entity.IcNatEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -24,5 +25,9 @@ public interface IcNatDao extends BaseDao<IcNatEntity> {
**/ **/
List<MyNatListResultDTO> getMyNatList(MyNatListFormDTO formDTO); List<MyNatListResultDTO> getMyNatList(MyNatListFormDTO formDTO);
/**
* @Author sun
* @Description 核酸核酸检测信息列表
**/
List<NatListResultDTO.NatListDTO> getNatList(MyNatListFormDTO formDTO);
} }

32
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.AddIcNatFormDTO;
import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.entity.IcNatEntity; import com.epmet.entity.IcNatEntity;
import java.util.List; import java.util.List;
@ -13,7 +14,6 @@ import java.util.Map;
/** /**
* 核酸上报记录 * 核酸上报记录
* *
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25 * @since v1.0.0 2022-03-25
@ -91,4 +91,34 @@ public interface IcNatService extends BaseService<IcNatEntity> {
* @Description 核酸检测-居民端我的上报 * @Description 核酸检测-居民端我的上报
**/ **/
List<MyNatListResultDTO> myNatList(MyNatListFormDTO formDTO); List<MyNatListResultDTO> 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);
} }

76
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.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; 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.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; 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.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcNatDao; 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.AddIcNatFormDTO;
import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.entity.IcNatEntity; import com.epmet.entity.IcNatEntity;
import com.epmet.service.IcNatService; import com.epmet.service.IcNatService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -27,7 +33,6 @@ import java.util.Map;
/** /**
* 核酸上报记录 * 核酸上报记录
* *
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25 * @since v1.0.0 2022-03-25
@ -52,8 +57,8 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
return ConvertUtils.sourceToTarget(entityList, IcNatDTO.class); return ConvertUtils.sourceToTarget(entityList, IcNatDTO.class);
} }
private QueryWrapper<IcNatEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<IcNatEntity> getWrapper(Map<String, Object> params) {
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcNatEntity> wrapper = new QueryWrapper<>(); QueryWrapper<IcNatEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -105,7 +110,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
insert(entity); insert(entity);
//3.新增通知表信息 //3.新增通知表信息
if(formDTO.getChannel().size()> NumConstant.ZERO){ if (formDTO.getChannel().size() > NumConstant.ZERO) {
//TODO //TODO
} }
@ -122,4 +127,67 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
return resultList; 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<NatListResultDTO.NatListDTO> 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) {
}
} }

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

@ -24,4 +24,41 @@
AND id_card = #{idCard} AND id_card = #{idCard}
</select> </select>
<select id="getNatList" resultType="com.epmet.dto.result.NatListResultDTO$NatListDTO">
SELECT
id icNatId,
agency_id agencyId,
user_id userId,
user_type userType,
`name` `name`,
mobile mobile,
id_card idCard,
nat_time natTime,
nat_result natResult,
nat_address natAddress
FROM
ic_nat
WHERE
del_flag = '0'
AND customer_id = #{customerId}
<if test='null != agencyId and "" != agencyId'>
AND pids like concat('%', #{agencyId}, '%')
</if>
<if test='null != name and "" != name'>
AND name like concat('%', #{name}, '%')
</if>
<if test='null != mobile and "" != mobile'>
AND mobile = #{mobile}
</if>
<if test='null != idCard and "" != idCard'>
AND id_card = #{idCard}
</if>
<if test='null != startTime and "" != startTime'>
AND nat_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test='null != endTime and "" != endTime'>
AND nat_time <![CDATA[ <= ]]> #{endTime}
</if>
</select>
</mapper> </mapper>
Loading…
Cancel
Save