|
|
@ -21,6 +21,7 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
import com.epmet.bean.ResiExportBaseInfoData; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.*; |
|
|
@ -213,7 +214,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
|
|
|
|
//1.先往主表新增数据
|
|
|
|
//主表Id
|
|
|
|
String resiUserId = UUID.randomUUID().toString().replaceAll("-", ""); |
|
|
|
String resiUserId = IdWorker.getIdStr(); |
|
|
|
String name = ""; |
|
|
|
LinkedHashMap<String, String> map = new LinkedHashMap<>(); |
|
|
|
com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); |
|
|
@ -240,6 +241,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
if (!map.containsKey("AGENCY_ID")) { |
|
|
|
throw new RenException("新增居民信息--入参AGENCY_ID为空"); |
|
|
|
} |
|
|
|
if (!map.containsKey(UserConstant.GRID_ID)) { |
|
|
|
throw new RenException("新增居民信息--入参GRID_ID为空"); |
|
|
|
} |
|
|
|
//2021.11.25 新增需求 客户下身份证号唯一 start
|
|
|
|
if (map.containsKey("ID_CARD")) { |
|
|
|
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(map.get("ID_CARD"), tokenDto.getCustomerId()); |
|
|
@ -266,7 +270,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
String agencyId = map.get("AGENCY_ID"); |
|
|
|
Result<CustomerAgencyDTO> result = govOrgOpenFeignClient.getAgencyById(agencyId); |
|
|
|
if (result.success() && null != result.getData()) { |
|
|
|
map.put("pids", result.getData().getPids()); |
|
|
|
//pids拼上 agencyId
|
|
|
|
String pids = result.getData().getPids(); |
|
|
|
if (StringUtils.isBlank(pids)) { |
|
|
|
pids = agencyId; |
|
|
|
} else if (!pids.contains(agencyId)){ |
|
|
|
pids = pids + StrConstant.COLON + agencyId; |
|
|
|
} |
|
|
|
map.put("pids", pids); |
|
|
|
} else { |
|
|
|
throw new RenException(String.format("新增居民信息-根据agencyId查询组织信息失败,agencyId->%s", agencyId)); |
|
|
|
} |
|
|
@ -2033,6 +2044,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
IcResiUserEntity entity = ConvertUtils.sourceToTarget(formDTO.getUser(), IcResiUserEntity.class); |
|
|
|
entity.setIsTenant(NumConstant.ONE_STR); |
|
|
|
entity.setIsFloating(NumConstant.ONE_STR); |
|
|
|
//pids 改为 拼接上自身
|
|
|
|
this.setIcResiUserPids(entity); |
|
|
|
insert(entity); |
|
|
|
resiUserId = entity.getId(); |
|
|
|
// 变更记录表和变更记录明细表新增数据
|
|
|
@ -2380,6 +2393,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
dto.setHomeId(user.getHomeId()); |
|
|
|
|
|
|
|
IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); |
|
|
|
this.setIcResiUserPids(entity); |
|
|
|
insert(entity); |
|
|
|
|
|
|
|
return new Result().ok("新增成功"); |
|
|
@ -2411,6 +2425,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
} |
|
|
|
|
|
|
|
IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); |
|
|
|
this.setIcResiUserPids(entity); |
|
|
|
entity.setId(dto.getIcResiUserId()); |
|
|
|
updateById(entity); |
|
|
|
return new Result().ok("修改成功"); |
|
|
@ -2457,6 +2472,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
} |
|
|
|
|
|
|
|
IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); |
|
|
|
this.setIcResiUserPids(entity); |
|
|
|
insert(entity); |
|
|
|
|
|
|
|
return new Result().ok("新增成功"); |
|
|
@ -2751,4 +2767,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
public List<String> getAllUserIds(String idCard, String customerId) { |
|
|
|
return baseDao.getAllUserIds(idCard, customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* desc:设置居民的pids pids为agencyId的pids+agencyId 即包含组织本身 如果pids 为空则pids 为agencyId |
|
|
|
* @param entity |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void setIcResiUserPids(IcResiUserEntity entity) { |
|
|
|
String agencyPath = entity.getPids(); |
|
|
|
if (StringUtils.isBlank(agencyPath)) { |
|
|
|
agencyPath = entity.getAgencyId(); |
|
|
|
} else if (!agencyPath.contains(entity.getAgencyId())) { |
|
|
|
agencyPath = agencyPath + StrConstant.COLON + entity.getAgencyId(); |
|
|
|
} |
|
|
|
entity.setPids(agencyPath); |
|
|
|
} |
|
|
|
} |
|
|
|