|
|
@ -258,14 +258,33 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
}); |
|
|
|
|
|
|
|
//3.变更记录表和变更记录明细表新增数据
|
|
|
|
saveUserChangeRecord(tokenDto,map,resiUserId,name); |
|
|
|
|
|
|
|
return resiUserId; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 3.变更记录表和变更记录明细表新增数据 |
|
|
|
* |
|
|
|
* @param tokenDto |
|
|
|
* @param map |
|
|
|
* @param icUserId |
|
|
|
* @param icUserName |
|
|
|
* @return void |
|
|
|
* @author zhy |
|
|
|
* @date 2022/4/29 14:49 |
|
|
|
*/ |
|
|
|
private void saveUserChangeRecord(TokenDto tokenDto, LinkedHashMap<String, String> map, String icUserId, String icUserName) { |
|
|
|
//变更记录表和变更记录明细表新增数据
|
|
|
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
|
//3-1.变更记录表
|
|
|
|
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); |
|
|
|
changeRecordEntity.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
changeRecordEntity.setOperatorId(tokenDto.getUserId()); |
|
|
|
changeRecordEntity.setIcUserId(resiUserId); |
|
|
|
changeRecordEntity.setIcUserId(icUserId); |
|
|
|
changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); |
|
|
|
changeRecordEntity.setIcUserName(name); |
|
|
|
changeRecordEntity.setIcUserName(icUserName); |
|
|
|
changeRecordEntity.setType("add"); |
|
|
|
changeRecordEntity.setTypeName("新增"); |
|
|
|
changeRecordEntity.setBeforeChangeName("-"); |
|
|
@ -273,11 +292,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
changeRecordEntity.setChangeTime(new java.util.Date()); |
|
|
|
icUserChangeRecordService.insert(changeRecordEntity); |
|
|
|
//3-2.变更明细表
|
|
|
|
List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeRecord(tokenDto, map, resiUserId, changeRecordEntity.getId()); |
|
|
|
List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeRecord(tokenDto, map, icUserId, changeRecordEntity.getId()); |
|
|
|
icUserChangeDetailedService.insertBatch(changeDetailedEntityList); |
|
|
|
|
|
|
|
return resiUserId; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1758,4 +1774,48 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
return resiUserId; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@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(TokenDto tokenDto, 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(); |
|
|
|
// 变更记录表和变更记录明细表新增数据
|
|
|
|
LinkedHashMap<String, String> map = new LinkedHashMap(); |
|
|
|
map.put("AGENCY_ID",entity.getAgencyId()); |
|
|
|
saveUserChangeRecord(tokenDto,map,resiUserId,entity.getName()); |
|
|
|
// 新增用户后保存头像信息
|
|
|
|
List<IcResiUserAttachmentDTO> images = formDTO.getImages(); |
|
|
|
images.forEach(item -> item.setUserId(entity.getId())); |
|
|
|
images.forEach(item -> icResiUserAttachmentService.save(item)); |
|
|
|
} |
|
|
|
|
|
|
|
return resiUserId; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|