|
@ -11,6 +11,7 @@ import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
|
|
import com.epmet.commons.tools.validator.IdCardNoValidatorUtils; |
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
import com.epmet.dto.IcResiUserAttachmentDTO; |
|
|
import com.epmet.dto.IcResiUserAttachmentDTO; |
|
|
import com.epmet.dto.IcResiUserDTO; |
|
|
import com.epmet.dto.IcResiUserDTO; |
|
@ -163,15 +164,27 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
updateById(entity); |
|
|
updateById(entity); |
|
|
// 如果审核通过,就去更新基础库头像信息以及居民信息
|
|
|
// 如果审核通过,就去更新基础库头像信息以及居民信息
|
|
|
if (NumConstant.ONE_STR.equals(entity.getState())) { |
|
|
if (NumConstant.ONE_STR.equals(entity.getState())) { |
|
|
dto.getTenantList().forEach(tenant -> { |
|
|
// 获取基本信息
|
|
|
|
|
|
RentContractInfoDTO contractDto = get(dto.getId()); |
|
|
|
|
|
|
|
|
|
|
|
// 获取租客信息
|
|
|
|
|
|
Map<String, Object> tenantParams = new HashMap<>(4); |
|
|
|
|
|
tenantParams.put("contractId", contractDto.getId()); |
|
|
|
|
|
List<RentTenantInfoDTO> tenantList = rentTenantInfoService.list(tenantParams); |
|
|
|
|
|
|
|
|
|
|
|
tenantList.forEach(tenant -> { |
|
|
RentTenantFormDTO formDTO = new RentTenantFormDTO(); |
|
|
RentTenantFormDTO formDTO = new RentTenantFormDTO(); |
|
|
List<IcResiUserAttachmentDTO> images = new ArrayList<>(); |
|
|
List<IcResiUserAttachmentDTO> images = new ArrayList<>(); |
|
|
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
formDTO.setIdCard(tenant.getIdCard()); |
|
|
formDTO.setIdCard(tenant.getIdCard()); |
|
|
formDTO.setImages(images); |
|
|
|
|
|
formDTO.setType(NumConstant.ONE_STR); |
|
|
formDTO.setType(NumConstant.ONE_STR); |
|
|
|
|
|
|
|
|
tenant.getImgList().forEach(img -> { |
|
|
Map<String, Object> imgParams = new HashMap<>(4); |
|
|
|
|
|
imgParams.put("referenceId", tenant.getId()); |
|
|
|
|
|
imgParams.put("fileType", NumConstant.ZERO_STR); |
|
|
|
|
|
List<RentContractFileDTO> imgList = rentContractFileService.list(imgParams); |
|
|
|
|
|
|
|
|
|
|
|
imgList.forEach(img -> { |
|
|
// 更新基础库的人员头像
|
|
|
// 更新基础库的人员头像
|
|
|
IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); |
|
|
IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); |
|
|
image.setAttachmentUrl(img.getFileUrl()); |
|
|
image.setAttachmentUrl(img.getFileUrl()); |
|
@ -183,24 +196,24 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
// 初始化居民信息
|
|
|
// 初始化居民信息
|
|
|
IcResiUserDTO user = new IcResiUserDTO(); |
|
|
IcResiUserDTO user = new IcResiUserDTO(); |
|
|
user.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
user.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
user.setGridId(dto.getGridId()); |
|
|
user.setGridId(contractDto.getGridId()); |
|
|
user.setVillageId(dto.getVillageId()); |
|
|
user.setVillageId(contractDto.getVillageId()); |
|
|
user.setBuildId(dto.getBuildId()); |
|
|
user.setBuildId(contractDto.getBuildId()); |
|
|
user.setUnitId(dto.getUnitId()); |
|
|
user.setUnitId(contractDto.getUnitId()); |
|
|
user.setHomeId(dto.getHomeId()); |
|
|
user.setHomeId(contractDto.getHomeId()); |
|
|
user.setName(tenant.getName()); |
|
|
user.setName(tenant.getName()); |
|
|
user.setIdCard(tenant.getIdCard()); |
|
|
user.setIdCard(tenant.getIdCard()); |
|
|
user.setMobile(tenant.getMobile()); |
|
|
user.setMobile(tenant.getMobile()); |
|
|
|
|
|
user.setGender(IdCardNoValidatorUtils.getGender(tenant.getIdCard())); |
|
|
|
|
|
|
|
|
user.setAgencyId(dto.getCommunityId()); |
|
|
user.setAgencyId(contractDto.getCommunityId()); |
|
|
Result<CustomerAgencyDTO> agencyInfo = govOrgOpenFeignClient.getAgencyById(dto.getCommunityId()); |
|
|
Result<CustomerAgencyDTO> agencyInfo = govOrgOpenFeignClient.getAgencyById(contractDto.getCommunityId()); |
|
|
user.setPids(agencyInfo.getData().getPids()); |
|
|
user.setPids(agencyInfo.getData().getPids()); |
|
|
|
|
|
|
|
|
formDTO.setUser(user); |
|
|
formDTO.setUser(user); |
|
|
|
|
|
|
|
|
epmetUserOpenFeignClient.updateImage(formDTO); |
|
|
epmetUserOpenFeignClient.updateImage(formDTO); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -250,7 +263,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
}); |
|
|
}); |
|
|
rentTenantInfoService.insertBatch(tenantList); |
|
|
rentTenantInfoService.insertBatch(tenantList); |
|
|
// 处理租客头像
|
|
|
// 处理租客头像
|
|
|
dto.getTenantList().forEach(tenant -> { |
|
|
tenantList.forEach(tenant -> { |
|
|
if (null == tenant.getImgList() || tenant.getImgList().isEmpty()) { |
|
|
if (null == tenant.getImgList() || tenant.getImgList().isEmpty()) { |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客照片不能为空"); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客照片不能为空"); |
|
|
} else { |
|
|
} else { |
|
|