Browse Source

更新代码,保存居民信息和头像信息

dev_power_axis
zhangyuan 3 years ago
parent
commit
00d54ed7b5
  1. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java
  2. 58
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
  3. 7
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java

2
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java

@ -93,7 +93,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl<RentBlacklistDao,
formDTO.setUserId(dto.getUserId()); formDTO.setUserId(dto.getUserId());
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
Result<RentTenantDataResultDTO> result = epmetUserOpenFeignClient.tenantData(formDTO); Result<RentTenantDataResultDTO> result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO);
dto.setIdCard(result.getData().getIdCard()); dto.setIdCard(result.getData().getIdCard());
dto.setMobile(result.getData().getMobile()); dto.setMobile(result.getData().getMobile());

58
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java

@ -10,6 +10,14 @@ import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; 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.dto.CustomerAgencyDTO;
import com.epmet.dto.IcResiUserAttachmentDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.RentTenantFormDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.plugin.power.dto.rent.RentContractFileDTO; import com.epmet.plugin.power.dto.rent.RentContractFileDTO;
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO; import com.epmet.plugin.power.dto.rent.RentContractInfoDTO;
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO;
@ -26,10 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 合同表 * 合同表
@ -46,6 +51,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
@Autowired @Autowired
LoginUserUtil loginUserUtil; LoginUserUtil loginUserUtil;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired @Autowired
private RentTenantInfoService rentTenantInfoService; private RentTenantInfoService rentTenantInfoService;
@ -156,10 +167,45 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl<RentContractInf
public void review(RentContractInfoDTO dto) { public void review(RentContractInfoDTO dto) {
RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class); RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class);
updateById(entity); updateById(entity);
// 如果审核通过,就去更新基础库 // 如果审核通过,就去更新基础库头像信息以及居民信息
if (NumConstant.ONE_STR.equals(entity.getState())) { if (NumConstant.ONE_STR.equals(entity.getState())) {
dto.getTenantList().forEach(tenant->{ dto.getTenantList().forEach(tenant -> {
RentTenantFormDTO formDTO = new RentTenantFormDTO();
List<IcResiUserAttachmentDTO> images = new ArrayList<>();
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
formDTO.setIdCard(tenant.getIdCard());
formDTO.setImages(images);
formDTO.setType(NumConstant.ONE_STR);
tenant.getImgList().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(dto.getGridId());
user.setVillageId(dto.getVillageId());
user.setBuildId(dto.getBuildId());
user.setUnitId(dto.getUnitId());
user.setHomeId(dto.getHomeId());
user.setName(tenant.getName());
user.setIdCard(tenant.getIdCard());
user.setMobile(tenant.getMobile());
Result<GridInfoResultDTO> gridInfo = govOrgOpenFeignClient.queryGridInfo(dto.getGridId());
user.setAgencyId(gridInfo.getData().getParentAgencyId());
Result<CustomerAgencyDTO> agencyInfo = govOrgOpenFeignClient.getAgencyById(gridInfo.getData().getParentAgencyId());
user.setPids(agencyInfo.getData().getPids());
formDTO.setUser(user);
epmetUserOpenFeignClient.updateImage(formDTO);
}); });

7
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java

@ -13,7 +13,6 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dto.IcResiUserAttachmentDTO; import com.epmet.dto.IcResiUserAttachmentDTO;
import com.epmet.dto.form.RentTenantFormDTO; import com.epmet.dto.form.RentTenantFormDTO;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO;
import com.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao; import com.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao;
import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity;
@ -49,9 +48,6 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao
@Autowired @Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired @Autowired
private RentContractFileService rentContractFileService; private RentContractFileService rentContractFileService;
@ -122,7 +118,8 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
formDTO.setIdCard(dto.getIdCard()); formDTO.setIdCard(dto.getIdCard());
formDTO.setImages(images); formDTO.setImages(images);
epmetUserOpenFeignClient.rentUpdate(formDTO); formDTO.setType(dto.getType());
epmetUserOpenFeignClient.updateImage(formDTO);
} }
} }
} }

Loading…
Cancel
Save