|
|
@ -1,23 +1,28 @@ |
|
|
|
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.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.dao.IcResiVaccineDao; |
|
|
|
import com.epmet.dto.IcResiVaccineDTO; |
|
|
|
import com.epmet.dto.result.VaccineListDTO; |
|
|
|
import com.epmet.entity.IcResiVaccineEntity; |
|
|
|
import com.epmet.service.IcResiVaccineService; |
|
|
|
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.Arrays; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 居民疫苗情况 |
|
|
@ -80,4 +85,32 @@ public class IcResiVaccineServiceImpl extends BaseServiceImpl<IcResiVaccineDao, |
|
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取居民疫苗接种信息 |
|
|
|
* |
|
|
|
* @param idCard |
|
|
|
* @Param idCard |
|
|
|
* @Return {@link List< VaccineListDTO >} |
|
|
|
* @Author zhaoqifeng |
|
|
|
* @Date 2022/3/30 10:24 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<VaccineListDTO> getVaccineList(String customerId, String idCard) { |
|
|
|
LambdaQueryWrapper<IcResiVaccineEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(IcResiVaccineEntity::getCustomerId, customerId); |
|
|
|
wrapper.eq(IcResiVaccineEntity::getIdCard, idCard); |
|
|
|
wrapper.orderByDesc(IcResiVaccineEntity::getInoculateTime); |
|
|
|
List<IcResiVaccineEntity> list = baseDao.selectList(wrapper); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
return list.stream().map(item -> { |
|
|
|
VaccineListDTO dto = new VaccineListDTO(); |
|
|
|
dto.setAddress(item.getInoculateAddress()); |
|
|
|
dto.setManufactor(item.getManufacturer()); |
|
|
|
dto.setVaccinateTime(DateUtils.format(item.getInoculateTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); |
|
|
|
return dto; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
} |