|
|
@ -39,7 +39,7 @@ import com.epmet.plugin.power.modules.rent.redis.RentContractInfoRedis; |
|
|
|
import com.epmet.plugin.power.modules.rent.service.RentContractFileService; |
|
|
|
import com.epmet.plugin.power.modules.rent.service.RentContractInfoService; |
|
|
|
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; |
|
|
|
import com.epmet.plugin.power.modules.utils.HkDeviceUtil; |
|
|
|
import com.epmet.plugin.power.modules.hik.utils.HkDeviceUtil; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -194,7 +194,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void savePc(RentContractInfoDTO dto) { |
|
|
|
// PC 端新增,默认审核通过(0:待审核;1:通过;2:不通过)
|
|
|
|
dto.setState("1"); |
|
|
|
dto.setState("0"); |
|
|
|
// 是否是 PC 录入(0:否,1:是)
|
|
|
|
dto.setIsPcInput("1"); |
|
|
|
|
|
|
@ -206,63 +206,63 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf |
|
|
|
updateTenantAndFile(entity.getId(), dto); |
|
|
|
|
|
|
|
// PC新增,默认审核通过,需要更新基础库头像信息以及居民信息,最后更新房屋的状态
|
|
|
|
if (NumConstant.ONE_STR.equals(entity.getState())) { |
|
|
|
// 获取基本信息
|
|
|
|
RentContractInfoDTO contractDto = get(entity.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(); |
|
|
|
List<IcResiUserAttachmentDTO> images = new ArrayList<>(); |
|
|
|
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
formDTO.setIdCard(tenant.getIdCard()); |
|
|
|
formDTO.setType(NumConstant.ONE_STR); |
|
|
|
|
|
|
|
List<RentContractFileDTO> imgList = rentContractFileService.listByRefAndType(tenant.getId(), NumConstant.ZERO_STR); |
|
|
|
|
|
|
|
imgList.forEach(img -> { |
|
|
|
// 更新基础库的人员头像
|
|
|
|
IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); |
|
|
|
image.setAttachmentUrl(img.getFileUrl()); |
|
|
|
image.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
images.add(image); |
|
|
|
}); |
|
|
|
formDTO.setImages(images); |
|
|
|
|
|
|
|
// 初始化居民信息
|
|
|
|
IcResiUserDTO user = new IcResiUserDTO(); |
|
|
|
user.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
user.setGridId(contractDto.getGridId()); |
|
|
|
user.setVillageId(contractDto.getVillageId()); |
|
|
|
user.setBuildId(contractDto.getBuildId()); |
|
|
|
user.setUnitId(contractDto.getUnitId()); |
|
|
|
user.setHomeId(contractDto.getHomeId()); |
|
|
|
user.setName(tenant.getName()); |
|
|
|
user.setIdCard(tenant.getIdCard()); |
|
|
|
user.setMobile(tenant.getMobile()); |
|
|
|
user.setGender(IdCardNoValidatorUtils.getGender(tenant.getIdCard())); |
|
|
|
|
|
|
|
user.setAgencyId(contractDto.getCommunityId()); |
|
|
|
Result<CustomerAgencyDTO> agencyInfo = govOrgOpenFeignClient.getAgencyById(contractDto.getCommunityId()); |
|
|
|
user.setPids(agencyInfo.getData().getPids()); |
|
|
|
|
|
|
|
formDTO.setUser(user); |
|
|
|
|
|
|
|
epmetUserOpenFeignClient.updateImage(formDTO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// 更新房屋的状态为租赁
|
|
|
|
Result<IcHouseDTO> houseInfo = govOrgOpenFeignClient.get(dto.getHomeId()); |
|
|
|
IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class); |
|
|
|
formDTO.setRentFlag(NumConstant.ONE); |
|
|
|
formDTO.setHouseId(dto.getHomeId()); |
|
|
|
govOrgOpenFeignClient.houseUpdate(formDTO); |
|
|
|
} |
|
|
|
// if (NumConstant.ONE_STR.equals(entity.getState())) {
|
|
|
|
// // 获取基本信息
|
|
|
|
// RentContractInfoDTO contractDto = get(entity.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();
|
|
|
|
// List<IcResiUserAttachmentDTO> images = new ArrayList<>();
|
|
|
|
// formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
|
|
|
|
// formDTO.setIdCard(tenant.getIdCard());
|
|
|
|
// formDTO.setType(NumConstant.ONE_STR);
|
|
|
|
//
|
|
|
|
// List<RentContractFileDTO> imgList = rentContractFileService.listByRefAndType(tenant.getId(), NumConstant.ZERO_STR);
|
|
|
|
//
|
|
|
|
// imgList.forEach(img -> {
|
|
|
|
// // 更新基础库的人员头像
|
|
|
|
// IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO();
|
|
|
|
// image.setAttachmentUrl(img.getFileUrl());
|
|
|
|
// image.setCustomerId(loginUserUtil.getLoginUserCustomerId());
|
|
|
|
// images.add(image);
|
|
|
|
// });
|
|
|
|
// formDTO.setImages(images);
|
|
|
|
//
|
|
|
|
// // 初始化居民信息
|
|
|
|
// IcResiUserDTO user = new IcResiUserDTO();
|
|
|
|
// user.setCustomerId(loginUserUtil.getLoginUserCustomerId());
|
|
|
|
// user.setGridId(contractDto.getGridId());
|
|
|
|
// user.setVillageId(contractDto.getVillageId());
|
|
|
|
// user.setBuildId(contractDto.getBuildId());
|
|
|
|
// user.setUnitId(contractDto.getUnitId());
|
|
|
|
// user.setHomeId(contractDto.getHomeId());
|
|
|
|
// user.setName(tenant.getName());
|
|
|
|
// user.setIdCard(tenant.getIdCard());
|
|
|
|
// user.setMobile(tenant.getMobile());
|
|
|
|
// user.setGender(IdCardNoValidatorUtils.getGender(tenant.getIdCard()));
|
|
|
|
//
|
|
|
|
// user.setAgencyId(contractDto.getCommunityId());
|
|
|
|
// Result<CustomerAgencyDTO> agencyInfo = govOrgOpenFeignClient.getAgencyById(contractDto.getCommunityId());
|
|
|
|
// user.setPids(agencyInfo.getData().getPids());
|
|
|
|
//
|
|
|
|
// formDTO.setUser(user);
|
|
|
|
//
|
|
|
|
// epmetUserOpenFeignClient.updateImage(formDTO);
|
|
|
|
//
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// // 更新房屋的状态为租赁
|
|
|
|
// Result<IcHouseDTO> houseInfo = govOrgOpenFeignClient.get(dto.getHomeId());
|
|
|
|
// IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class);
|
|
|
|
// formDTO.setRentFlag(NumConstant.ONE);
|
|
|
|
// formDTO.setHouseId(dto.getHomeId());
|
|
|
|
// govOrgOpenFeignClient.houseUpdate(formDTO);
|
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|