|
@ -80,6 +80,7 @@ import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.google.common.cache.Cache; |
|
|
import com.google.common.cache.Cache; |
|
|
import com.google.common.cache.CacheBuilder; |
|
|
import com.google.common.cache.CacheBuilder; |
|
|
|
|
|
import lombok.SneakyThrows; |
|
|
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.compress.utils.Lists; |
|
|
import org.apache.commons.compress.utils.Lists; |
|
@ -173,6 +174,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DataReportOpenFeignClient dataReportOpenFeignClient; |
|
|
private DataReportOpenFeignClient dataReportOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IcResiRentContractInfoDao icResiRentContractInfoDao; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IcVaccineDao icVaccineDao; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IcVaccineRelationDao icVaccineRelationDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params) { |
|
|
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params) { |
|
@ -2183,6 +2193,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
return ConvertUtils.sourceToTarget(entityList, RentTenantDataResultDTO.class); |
|
|
return ConvertUtils.sourceToTarget(entityList, RentTenantDataResultDTO.class); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@SneakyThrows |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public String updateImage(TokenDto tokenDto, RentTenantFormDTO formDTO) { |
|
|
public String updateImage(TokenDto tokenDto, RentTenantFormDTO formDTO) { |
|
@ -2222,6 +2233,70 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
images.forEach(item -> icResiUserAttachmentService.save(item)); |
|
|
images.forEach(item -> icResiUserAttachmentService.save(item)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 同步疫苗接种记录信息
|
|
|
|
|
|
IcResiUserDTO user = formDTO.getUser(); |
|
|
|
|
|
List<VaccineLogDetailDTO> vaccineLog = user.getVaccineLog(); |
|
|
|
|
|
if(vaccineLog != null && vaccineLog.size() > 0){ |
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
// 根据身份证号,客户ID删除旧记录
|
|
|
|
|
|
icVaccineDao.deleteByIdCard(user.getIdCard(),user.getCustomerId()); |
|
|
|
|
|
// 删除疫苗接种记录关系表数据
|
|
|
|
|
|
List<String> delList = icVaccineDao.setDeleteByIdCard(user.getIdCard(),user.getCustomerId()); |
|
|
|
|
|
if(delList != null && delList.size() > 0){ |
|
|
|
|
|
icVaccineRelationDao.deleteByIdList(delList); |
|
|
|
|
|
} |
|
|
|
|
|
for(VaccineLogDetailDTO vaccineLogDetailDTO : vaccineLog){ |
|
|
|
|
|
// 插入疫苗接种记录数据
|
|
|
|
|
|
IcVaccineEntity icVaccineEntity = new IcVaccineEntity(); |
|
|
|
|
|
icVaccineEntity.setCustomerId(user.getCustomerId()); |
|
|
|
|
|
icVaccineEntity.setName(user.getName()); |
|
|
|
|
|
icVaccineEntity.setMobile(user.getMobile()); |
|
|
|
|
|
icVaccineEntity.setIdCard(user.getIdCard()); |
|
|
|
|
|
icVaccineEntity.setIsResiUser("1"); |
|
|
|
|
|
icVaccineEntity.setUserType("import"); |
|
|
|
|
|
icVaccineEntity.setUserId(resiUserId); |
|
|
|
|
|
icVaccineEntity.setInoculateTime(sdf.parse(vaccineLogDetailDTO.getVacTime())); |
|
|
|
|
|
icVaccineEntity.setInoculateAddress(vaccineLogDetailDTO.getVacSite()); |
|
|
|
|
|
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("prarmeter"); |
|
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 同步合同信息
|
|
|
|
|
|
IcResiRentContractInfoEntity rentEntityOne = icResiRentContractInfoDao.selectDetailByUserId(resiUserId); |
|
|
|
|
|
if(rentEntityOne == null){ |
|
|
|
|
|
IcResiRentContractInfoEntity rentEntity = new IcResiRentContractInfoEntity(); |
|
|
|
|
|
rentEntity.setIcResiUser(resiUserId); |
|
|
|
|
|
rentEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
rentEntity.setContractStartDate(formDTO.getStartDate()); |
|
|
|
|
|
rentEntity.setContractEndDate(formDTO.getEndDate()); |
|
|
|
|
|
icResiRentContractInfoDao.insert(rentEntity); |
|
|
|
|
|
}else{ |
|
|
|
|
|
rentEntityOne.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
rentEntityOne.setContractStartDate(formDTO.getStartDate()); |
|
|
|
|
|
rentEntityOne.setContractEndDate(formDTO.getEndDate()); |
|
|
|
|
|
icResiRentContractInfoDao.updateById(rentEntityOne); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return resiUserId; |
|
|
return resiUserId; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|