|
@ -1,5 +1,6 @@ |
|
|
package com.epmet.service.impl; |
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
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; |
|
@ -13,12 +14,14 @@ 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.redis.common.bean.GridInfoCache; |
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.constant.IcResiUserConstant; |
|
|
import com.epmet.constant.IcResiUserConstant; |
|
|
import com.epmet.dao.IcTripReportRecordDao; |
|
|
import com.epmet.dao.IcTripReportRecordDao; |
|
|
import com.epmet.dao.UserBaseInfoDao; |
|
|
import com.epmet.dao.UserBaseInfoDao; |
|
|
import com.epmet.dto.IcEpidemicSpecialAttentionDTO; |
|
|
import com.epmet.dto.IcEpidemicSpecialAttentionDTO; |
|
|
import com.epmet.dto.IcTripReportRecordDTO; |
|
|
import com.epmet.dto.IcTripReportRecordDTO; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
|
|
|
import com.epmet.dto.result.TripListDTO; |
|
|
import com.epmet.entity.IcTripReportRecordEntity; |
|
|
import com.epmet.entity.IcTripReportRecordEntity; |
|
|
import com.epmet.service.IcEpidemicSpecialAttentionService; |
|
|
import com.epmet.service.IcEpidemicSpecialAttentionService; |
|
|
import com.epmet.service.IcNoticeService; |
|
|
import com.epmet.service.IcNoticeService; |
|
@ -27,6 +30,7 @@ import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -69,14 +73,24 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR |
|
|
List<IcTripReportRecordDTO> list = data.getList(); |
|
|
List<IcTripReportRecordDTO> list = data.getList(); |
|
|
//3.查询最近一次通知时间、核算检测关注名单
|
|
|
//3.查询最近一次通知时间、核算检测关注名单
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
Set<String> idCardSet = list.stream().map(m -> m.getIdCard()).collect(Collectors.toSet()); |
|
|
Map<String, Date> latestNotice = new HashMap<>(); |
|
|
Map<String, Date> latestNotice = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(),idCardSet); |
|
|
List<String> gzIdCardList = new ArrayList<>(); |
|
|
List<String> gzIdCardList = epidemicSpecialAttentionService.getHeSuanIdCardList(formDTO.getCustomerId(),idCardSet); |
|
|
List<String> idCardList = list.stream().map(m -> m.getIdCard()).distinct().collect(Collectors.toList()); |
|
|
|
|
|
//如果不分页可能会有很多个身份证号
|
|
|
|
|
|
List<List<String>> partionList = ListUtils.partition(idCardList, NumConstant.ONE_HUNDRED); |
|
|
|
|
|
partionList.forEach(l -> { |
|
|
|
|
|
Map<String, Date> map = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(), l); |
|
|
|
|
|
List<String> gzIdCards = epidemicSpecialAttentionService.getHeSuanIdCardList(formDTO.getCustomerId(), l); |
|
|
|
|
|
latestNotice.putAll(map); |
|
|
|
|
|
gzIdCardList.addAll(gzIdCards); |
|
|
|
|
|
}); |
|
|
for (IcTripReportRecordDTO dto : list) { |
|
|
for (IcTripReportRecordDTO dto : list) { |
|
|
//默认未加入
|
|
|
//默认未加入
|
|
|
dto.setHeSuanCheck(false); |
|
|
dto.setHeSuanCheck(false); |
|
|
|
|
|
dto.setHeSuanCheckDesc("未加入"); |
|
|
if (CollectionUtils.isNotEmpty(gzIdCardList) && gzIdCardList.contains(dto.getIdCard())) { |
|
|
if (CollectionUtils.isNotEmpty(gzIdCardList) && gzIdCardList.contains(dto.getIdCard())) { |
|
|
dto.setHeSuanCheck(true); |
|
|
dto.setHeSuanCheck(true); |
|
|
|
|
|
dto.setHeSuanCheckDesc("已加入"); |
|
|
} |
|
|
} |
|
|
if (MapUtils.isNotEmpty(latestNotice) && latestNotice.containsKey(dto.getIdCard())) { |
|
|
if (MapUtils.isNotEmpty(latestNotice) && latestNotice.containsKey(dto.getIdCard())) { |
|
|
dto.setLatestNoticeTime(latestNotice.get(dto.getIdCard())); |
|
|
dto.setLatestNoticeTime(latestNotice.get(dto.getIdCard())); |
|
@ -263,5 +277,34 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR |
|
|
return result.getList(); |
|
|
return result.getList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取居民行程信息 |
|
|
|
|
|
* |
|
|
|
|
|
* @param idCard |
|
|
|
|
|
* @Param idCard |
|
|
|
|
|
* @Return {@link List< TripListDTO >} |
|
|
|
|
|
* @Author zhaoqifeng |
|
|
|
|
|
* @Date 2022/3/30 10:31 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<TripListDTO> tripList(String customerId, String idCard) { |
|
|
|
|
|
LambdaQueryWrapper<IcTripReportRecordEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(IcTripReportRecordEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(IcTripReportRecordEntity::getIdCard, idCard); |
|
|
|
|
|
wrapper.orderByDesc(IcTripReportRecordEntity::getArriveDate); |
|
|
|
|
|
List<IcTripReportRecordEntity> list = baseDao.selectList(wrapper); |
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
} |
|
|
|
|
|
return list.stream().map(item -> { |
|
|
|
|
|
TripListDTO dto = new TripListDTO(); |
|
|
|
|
|
dto.setArrivalTime(DateUtils.format(item.getArriveDate(), DateUtils.DATE_PATTERN)); |
|
|
|
|
|
dto.setFromRegion(item.getSourceAddress()); |
|
|
|
|
|
dto.setLeaveTime(DateUtils.format(item.getLeaveDate(), DateUtils.DATE_PATTERN)); |
|
|
|
|
|
dto.setRemark(item.getRemark()); |
|
|
|
|
|
return dto; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |