|
|
@ -1721,25 +1721,20 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public String rentUpdate(RentTenantFormDTO formDTO) { |
|
|
|
String resiUserId; |
|
|
|
String resiUserId = ""; |
|
|
|
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(formDTO.getIdCard(), formDTO.getCustomerId()); |
|
|
|
if (null != userDTO && null != userDTO.getIdCard()) { |
|
|
|
GridInfoResultDTO deptInfo = govOrgFeignClient.queryGridInfo(formDTO.getGridId()).getData(); |
|
|
|
// 没有该居民,新增一个居民
|
|
|
|
IcResiUserEntity entity = new IcResiUserEntity(); |
|
|
|
|
|
|
|
insert(entity); |
|
|
|
resiUserId = entity.getId(); |
|
|
|
} else { |
|
|
|
if (null != userDTO) { |
|
|
|
resiUserId = userDTO.getId(); |
|
|
|
// 插入附件头像(只有一张)
|
|
|
|
formDTO.getImages().forEach(item -> { |
|
|
|
item.setUserId(userDTO.getId()); |
|
|
|
}); |
|
|
|
formDTO.getImages().forEach(item -> { |
|
|
|
icResiUserAttachmentService.save(item); |
|
|
|
}); |
|
|
|
} |
|
|
|
// 插入附件头像
|
|
|
|
IcResiUserAttachmentDTO dto = new IcResiUserAttachmentDTO(); |
|
|
|
dto.setUserId(resiUserId); |
|
|
|
dto.setAttachmentUrl(formDTO.getImg()); |
|
|
|
icResiUserAttachmentService.save(dto); |
|
|
|
|
|
|
|
return resiUserId; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|