Browse Source

行程列表获取最近一次通知时间、是否加入核算关注

master
yinzuomei 3 years ago
parent
commit
0391223c0a
  1. 12
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java
  2. 48
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java
  3. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
  4. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
  5. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java
  6. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java
  7. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java
  8. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java
  9. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  10. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java
  11. 59
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java
  12. 18
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml
  13. 36
      epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml

12
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java

@ -128,6 +128,7 @@ public class IcTripReportRecordDTO implements Serializable {
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdTime;
/**
@ -138,8 +139,19 @@ public class IcTripReportRecordDTO implements Serializable {
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private Date reportTime;
/**
* pc行程上报-列表返参最近一次通知时间
*/
private Date latestNoticeTime;
/**
* pc行程上报-列表返参是否加入核酸检测关注名单true已加入false未加入
*/
private Boolean heSuanCheck;
}

48
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class PageTripReportFormDTO extends PageFormDTO implements Serializable {
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 来源地区编码
*/
private String sourceAddressCode;
/**
* 来到本地时间
*/
private Date startDate;
private Date endDate;
/**
* token里设置
*/
private String customerId;
private String userId;
/**
* 工作人员所属组织id
*/
private String agencyId;
}

20
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java

@ -15,12 +15,12 @@ import com.epmet.constant.IcResiUserConstant;
import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.dto.form.IcTripReportFormDTO;
import com.epmet.dto.form.MyReportedTripFormDTO;
import com.epmet.dto.form.PageTripReportFormDTO;
import com.epmet.service.IcTripReportRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
@ -36,9 +36,18 @@ public class IcTripReportRecordController {
@Autowired
private IcTripReportRecordService icTripReportRecordService;
/**
* pc: 行程上报-列表
* @param tokenDto
* @param formDTO
* @return
*/
@RequestMapping("page")
public Result<PageData<IcTripReportRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcTripReportRecordDTO> page = icTripReportRecordService.page(params);
public Result<PageData<IcTripReportRecordDTO>> page(@LoginUser TokenDto tokenDto,@RequestBody PageTripReportFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(PageFormDTO.AddUserInternalGroup.class);
PageData<IcTripReportRecordDTO> page = icTripReportRecordService.page(formDTO);
return new Result<PageData<IcTripReportRecordDTO>>().ok(page);
}
@ -48,6 +57,11 @@ public class IcTripReportRecordController {
return new Result<IcTripReportRecordDTO>().ok(data);
}
/**
* pc: 行程上报-新增
* @param dto
* @return
*/
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcTripReportRecordDTO dto){

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java

@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* 疫情特别关注
@ -52,4 +53,12 @@ public interface IcEpidemicSpecialAttentionDao extends BaseDao<IcEpidemicSpecial
*/
List<String> getExistList(@Param("attentionType")Integer attentionType,@Param("list")List<String> list);
/**
* 返回idCardSet中已经关注的身份证号
*
* @param idCardSet
* @param attentionType
* @return
*/
List<String> getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") Set<String> idCardSet, @Param("attentionType") Integer attentionType);
}

15
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java

@ -2,6 +2,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.dto.form.PageTripReportFormDTO;
import com.epmet.entity.IcTripReportRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -17,5 +18,19 @@ import java.util.List;
@Mapper
public interface IcTripReportRecordDao extends BaseDao<IcTripReportRecordEntity> {
/**
* 居民端小程序我的上报
* @param userId
* @param customerId
* @param idCard
* @return
*/
List<IcTripReportRecordDTO> selectMyReported(@Param("userId") String userId, @Param("customerId") String customerId, @Param("idCard") String idCard);
/**
* pc: 行程上报-列表
* @param formDTO
* @return
*/
List<IcTripReportRecordDTO> pageList(PageTripReportFormDTO formDTO);
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java

@ -10,6 +10,7 @@ import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 疫情特别关注
@ -111,4 +112,11 @@ public interface IcEpidemicSpecialAttentionService extends BaseService<IcEpidemi
* @date 2022/3/28 13:51
*/
void cancelAttention(CancelAttentionPackageFormDTO formDTO);
/**
* 传入身份证集合返回已经关注的身份证号列表
* @param idCardSet
* @return
*/
List<String> getHeSuanIdCardList(String customerId,Set<String> idCardSet);
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java

@ -7,8 +7,10 @@ import com.epmet.dto.form.IcNoticeFormDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.entity.IcNoticeEntity;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 防疫通知
@ -96,4 +98,11 @@ public interface IcNoticeService extends BaseService<IcNoticeEntity> {
* @Date 2022/3/28 15:43
*/
IcNoticeDTO getNotice(String customerId, String idCard);
/**
* 根据身份证号查询最近一次通知时间
* @param idCardSet
* @return
*/
Map<String, Date> getUserLatestNoticeTime(String customerId,Set<String> idCardSet);
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.dto.form.IcTripReportFormDTO;
import com.epmet.dto.form.MyReportedTripFormDTO;
import com.epmet.dto.form.PageTripReportFormDTO;
import com.epmet.entity.IcTripReportRecordEntity;
import java.util.List;
@ -19,14 +20,14 @@ import java.util.Map;
public interface IcTripReportRecordService extends BaseService<IcTripReportRecordEntity> {
/**
* 默认分页
* pc行程上报-列表
*
* @param params
* @param formDTO
* @return PageData<IcTripReportRecordDTO>
* @author generator
* @date 2022-03-25
*/
PageData<IcTripReportRecordDTO> page(Map<String, Object> params);
PageData<IcTripReportRecordDTO> page(PageTripReportFormDTO formDTO);
/**
* 默认查询

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

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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;
@ -12,10 +13,11 @@ 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.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcEpidemicSpecialAttentionDao;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.CancelAttentionPackageFormDTO;
import com.epmet.dto.form.VaccinationAddFormDTO;
import com.epmet.dto.form.VaccinationListFormDTO;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import com.epmet.service.IcEpidemicSpecialAttentionService;
@ -23,14 +25,10 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -216,4 +214,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
}
}
/**
* 传入身份证集合返回已经关注的身份证号列表
*
* @param idCardSet
* @return
*/
@Override
public List<String> getHeSuanIdCardList(String customerId,Set<String> idCardSet) {
if(CollectionUtils.isEmpty(idCardSet)){
return new ArrayList<>();
}
//关注类型,核酸检测:2,疫苗接种:1
return baseDao.getIdCardList(customerId,idCardSet,NumConstant.TWO);
}
}

28
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java

@ -29,10 +29,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -202,4 +199,27 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
return result;
}
/**
* 根据身份证号查询最近一次通知时间
*
* @param idCardSet
* @return
*/
@Override
public Map<String, Date> getUserLatestNoticeTime(String customerId,Set<String> idCardSet) {
Map<String, Date> map=new HashMap<>();
for(String idCard:idCardSet) {
LambdaQueryWrapper<IcNoticeEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNoticeEntity::getCustomerId, customerId);
wrapper.eq(IcNoticeEntity::getIdCard, idCard);
wrapper.orderByDesc(IcNoticeEntity::getCreatedTime);
wrapper.last("limit 1");
IcNoticeEntity entity = baseDao.selectOne(wrapper);
if(null!=entity){
map.put(idCard,entity.getCreatedTime());
}
}
return map;
}
}

59
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java

@ -1,13 +1,14 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
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.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -16,18 +17,22 @@ import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.dto.form.IcTripReportFormDTO;
import com.epmet.dto.form.MyReportedTripFormDTO;
import com.epmet.dto.form.PageTripReportFormDTO;
import com.epmet.entity.IcTripReportRecordEntity;
import com.epmet.service.IcEpidemicSpecialAttentionService;
import com.epmet.service.IcNoticeService;
import com.epmet.service.IcTripReportRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* 行程上报信息
@ -39,14 +44,46 @@ import java.util.Map;
public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportRecordDao, IcTripReportRecordEntity> implements IcTripReportRecordService {
@Autowired
private UserBaseInfoDao userBaseInfoDao;
//关注
@Autowired
private IcEpidemicSpecialAttentionService epidemicSpecialAttentionService;
//通知
@Autowired
private IcNoticeService icNoticeService;
/**
* pc: 行程上报-列表
* @param formDTO
* @return
*/
@Override
public PageData<IcTripReportRecordDTO> page(Map<String, Object> params) {
IPage<IcTripReportRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcTripReportRecordDTO.class);
public PageData<IcTripReportRecordDTO> page(PageTripReportFormDTO formDTO) {
//1.获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
formDTO.setAgencyId(staffInfo.getAgencyId());
//2.按条件查询业务数据
PageInfo<IcTripReportRecordDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.doSelectPageInfo(() -> baseDao.pageList(formDTO));
List<IcTripReportRecordDTO> list = data.getList();
//3.查询最近一次通知时间、核算检测关注名单
if (CollectionUtils.isNotEmpty(list)) {
Set<String> idCardSet = list.stream().map(m -> m.getIdCard()).collect(Collectors.toSet());
Map<String, Date> latestNotice = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(),idCardSet);
List<String> gzIdCardList = epidemicSpecialAttentionService.getHeSuanIdCardList(formDTO.getCustomerId(),idCardSet);
for (IcTripReportRecordDTO dto : list) {
//默认未加入
dto.setHeSuanCheck(false);
if (CollectionUtils.isNotEmpty(gzIdCardList) && gzIdCardList.contains(dto.getIdCard())) {
dto.setHeSuanCheck(true);
}
if (MapUtils.isNotEmpty(latestNotice) && latestNotice.containsKey(dto.getIdCard())) {
dto.setLatestNoticeTime(latestNotice.get(dto.getIdCard()));
}
}
}
return new PageData(list, data.getTotal());
}
@Override

18
epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

@ -91,5 +91,21 @@
)
</select>
<select id="getIdCardList" parameterType="map" resultType="java.lang.String">
SELECT
DISTINCT
ID_CARD
FROM
ic_epidemic_special_attention
WHERE
DEL_FLAG = 0
AND IS_ATTENTION = '1'
AND ATTENTION_TYPE = #{attentionType}
AND CUSTOMER_ID=#{customerId}
AND ID_CARD IN (
<foreach collection="idCardSet" item="idCard" separator=",">
#{idCard}
</foreach>
)
</select>
</mapper>

36
epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml

@ -3,6 +3,7 @@
<mapper namespace="com.epmet.dao.IcTripReportRecordDao">
<!-- 居民端小程序:我的上报 -->
<select id="selectMyReported" parameterType="map" resultType="com.epmet.dto.IcTripReportRecordDTO">
SELECT
r.*,
@ -21,5 +22,38 @@
r.CREATED_TIME DESC
</select>
<!-- pc: 行程上报-列表 -->
<select id="pageList" parameterType="com.epmet.dto.form.PageTripReportFormDTO" resultType="com.epmet.dto.IcTripReportRecordDTO">
SELECT
r.*,
r.CREATED_TIME AS reportTime
FROM
ic_trip_report_record r
WHERE
r.DEL_FLAG = '0'
AND r.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>
<if test='null != mobile and "" != mobile'>
AND MOBILE like concat('%',#{mobile},'%')
</if>
<if test='null != idCard and "" != idCard'>
AND ID_CARD like concat('%',#{idCard},'%')
</if>
<if test='null != sourceAddressCode and "" != sourceAddressCode'>
AND SOURCE_ADDRESS_CODE like concat(#{sourceAddressCode},'%')
</if>
<if test='null != startTime and "" != startTime'>
AND ARRIVE_DATE <![CDATA[ >= ]]> #{startTime}
</if>
<if test='null != endTime and "" != endTime'>
AND ARRIVE_DATE <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY
r.CREATED_TIME DESC
</select>
</mapper>
Loading…
Cancel
Save