|
|
@ -399,29 +399,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
return resiUserId; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public String rentUpdate(RentTenantFormDTO formDTO) { |
|
|
|
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 { |
|
|
|
resiUserId = userDTO.getId(); |
|
|
|
} |
|
|
|
// 插入附件头像
|
|
|
|
IcResiUserAttachmentDTO dto = new IcResiUserAttachmentDTO(); |
|
|
|
dto.setUserId(resiUserId); |
|
|
|
dto.setAttachmentUrl(formDTO.getImg()); |
|
|
|
icResiUserAttachmentService.save(dto); |
|
|
|
return resiUserId; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author sun |
|
|
|
* @Description 居民信息修改--生成变更记录和变更明细 |
|
|
@ -886,12 +863,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
return personData; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public RentTenantDataResultDTO tenantData(RentTenantDataFormDTO formDTO) { |
|
|
|
IcResiUserEntity entity = selectById(formDTO.getUserId()); |
|
|
|
return ConvertUtils.sourceToTarget(entity, RentTenantDataResultDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @Description 根据名字搜索 |
|
|
@ -1627,4 +1598,44 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
return new PageData<>(list, null == list ? NumConstant.ZERO : list.size()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public RentTenantDataResultDTO getRentResiUserInfo(RentTenantDataFormDTO formDTO) { |
|
|
|
IcResiUserEntity entity = baseDao.selectById(formDTO.getUserId()); |
|
|
|
return ConvertUtils.sourceToTarget(entity, RentTenantDataResultDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<RentTenantDataResultDTO> getRentResiUserInfoByIdCard(String idCard) { |
|
|
|
Map<String, Object> params = new HashMap<>(8); |
|
|
|
params.put("idCard", idCard); |
|
|
|
List<IcResiUserEntity> entityList = baseDao.selectList(getWrapper(params)); |
|
|
|
return ConvertUtils.sourceToTarget(entityList, RentTenantDataResultDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public String updateImage(RentTenantFormDTO formDTO) { |
|
|
|
String resiUserId = ""; |
|
|
|
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(formDTO.getIdCard(), formDTO.getCustomerId()); |
|
|
|
if (null != userDTO) { |
|
|
|
resiUserId = userDTO.getId(); |
|
|
|
// 插入附件头像(只有一张)
|
|
|
|
List<IcResiUserAttachmentDTO> images = formDTO.getImages(); |
|
|
|
images.forEach(item -> item.setUserId(userDTO.getId())); |
|
|
|
images.forEach(item-> icResiUserAttachmentService.save(item)); |
|
|
|
} else if (NumConstant.ONE_STR.equals(formDTO.getType())) { |
|
|
|
// 如果是新增的租客,需要新增一条信息,不存在的房东就不管了
|
|
|
|
IcResiUserEntity entity = ConvertUtils.sourceToTarget(formDTO.getUser(), IcResiUserEntity.class); |
|
|
|
insert(entity); |
|
|
|
resiUserId = entity.getId(); |
|
|
|
|
|
|
|
// 新增用户后保存头像信息
|
|
|
|
List<IcResiUserAttachmentDTO> images = formDTO.getImages(); |
|
|
|
images.forEach(item -> item.setUserId(entity.getId())); |
|
|
|
images.forEach(item -> icResiUserAttachmentService.save(item)); |
|
|
|
} |
|
|
|
|
|
|
|
return resiUserId; |
|
|
|
} |
|
|
|
} |
|
|
|