|
|
@ -181,6 +181,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if (str.length() > NumConstant.ZERO ) { |
|
|
|
String errorMsg = String.format("新增居民信息,必要字段值为空,%s值为空", str); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|
|
@ -258,14 +259,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 +293,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; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -798,7 +815,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
map.put("groupByTables", new ArrayList<>(groupByTables)); |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @Description 查询个人数据 |
|
|
@ -886,9 +902,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
} |
|
|
|
return personData; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @Description 根据名字搜索 |
|
|
|
* @author zxc |
|
|
|
* @date 2021/11/3 1:42 下午 |
|
|
|
*/ |
|
|
@ -896,7 +912,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
public PageData<SearchByNameResultDTO> searchByName(SearchByNameFormDTO formDTO) { |
|
|
|
// 查询工作人员所属组织
|
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); |
|
|
|
if (null == staffInfo){ |
|
|
|
if (null == staffInfo) { |
|
|
|
throw new RenException("未查询到当前工作人员所属组织"); |
|
|
|
} |
|
|
|
Integer no = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); |
|
|
@ -1726,7 +1742,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
IcResiUserEntity::getIdCard, |
|
|
|
IcResiUserEntity::getBirthday |
|
|
|
) |
|
|
|
.orderByAsc(IcResiUserEntity::getYhzgx); |
|
|
|
.orderByAsc(IcResiUserEntity::getYhzgx, IcResiUserEntity::getCreatedTime, IcResiUserEntity::getId); |
|
|
|
|
|
|
|
List<IcResiUserEntity> homeUserList = baseDao.selectList(lqw); |
|
|
|
if (CollUtil.isEmpty(homeUserList)) { |
|
|
@ -1747,6 +1763,33 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
return baseDao.dynamicQuery(customerId, resultTableName, conditions, map.get("finalSubTables"), showSqlColumns, currentStaffAgencyId, staffOrgPath, map.get("groupByTables")); |
|
|
|
} |
|
|
|
|
|
|
|
@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; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public RentTenantDataResultDTO getRentResiUserInfo(RentTenantDataFormDTO formDTO) { |
|
|
|
IcResiUserEntity entity = baseDao.selectById(formDTO.getUserId()); |
|
|
@ -1763,7 +1806,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public String updateImage(RentTenantFormDTO formDTO) { |
|
|
|
public String updateImage(TokenDto tokenDto, RentTenantFormDTO formDTO) { |
|
|
|
String resiUserId = ""; |
|
|
|
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(formDTO.getIdCard(), formDTO.getCustomerId()); |
|
|
|
if (null != userDTO) { |
|
|
@ -1777,7 +1820,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
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())); |
|
|
|