|
|
@ -181,7 +181,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
private IcVaccineDao icVaccineDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcVaccineService icVaccineService; |
|
|
|
private IcVaccineRelationDao icVaccineRelationDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2240,8 +2240,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
// 根据身份证号,客户ID删除旧记录
|
|
|
|
icVaccineDao.deleteByIdCard(user.getIdCard(),user.getCustomerId()); |
|
|
|
// 删除疫苗接种记录关系表数据
|
|
|
|
List<String> delList = icVaccineDao.setDeleteByIdCard(user.getIdCard(),user.getCustomerId()); |
|
|
|
icVaccineRelationDao.deleteByIdList(delList); |
|
|
|
// 插入新数据
|
|
|
|
List<IcVaccineEntity> icVaccineEntityList = new ArrayList<>(); |
|
|
|
for(VaccineLogDetailDTO vaccineLogDetailDTO : vaccineLog){ |
|
|
|
IcVaccineEntity icVaccineEntity = new IcVaccineEntity(); |
|
|
|
icVaccineEntity.setCustomerId(user.getCustomerId()); |
|
|
@ -2253,9 +2255,26 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
icVaccineEntity.setUserId(resiUserId); |
|
|
|
icVaccineEntity.setInoculateTime(sdf.parse(vaccineLogDetailDTO.getVacTime())); |
|
|
|
icVaccineEntity.setInoculateAddress(vaccineLogDetailDTO.getVacSite()); |
|
|
|
icVaccineEntityList.add(icVaccineEntity); |
|
|
|
icVaccineDao.insert(icVaccineEntity); |
|
|
|
// 插入疫苗接种记录关系表数据
|
|
|
|
IcVaccineRelationEntity icVaccineRelationEntity = new IcVaccineRelationEntity(); |
|
|
|
icVaccineRelationEntity.setCustomerId(user.getCustomerId()); |
|
|
|
icVaccineRelationEntity.setAgencyId(formDTO.getUser().getAgencyId()); |
|
|
|
icVaccineRelationEntity.setPids(formDTO.getUser().getPids()); |
|
|
|
icVaccineRelationEntity.setIcVaccineId(icVaccineEntity.getId()); |
|
|
|
icVaccineRelationEntity.setUserType("synchro"); |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
|
if (null == staffInfo) { |
|
|
|
logger.warn("未查询到工作人员信息" + resiUserId); |
|
|
|
} |
|
|
|
if(staffInfo.getAgencyId().equals(formDTO.getUser().getAgencyId())){ |
|
|
|
icVaccineRelationEntity.setIsLocalResiUser("1"); |
|
|
|
}else{ |
|
|
|
icVaccineRelationEntity.setIsLocalResiUser("0"); |
|
|
|
} |
|
|
|
icVaccineRelationDao.insert(icVaccineRelationEntity); |
|
|
|
|
|
|
|
} |
|
|
|
icVaccineService.insertBatch(icVaccineEntityList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|