|
@ -33,6 +33,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
|
|
import com.epmet.commons.tools.utils.NodeTreeUtils; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.constant.CustomerAgencyConstant; |
|
|
import com.epmet.constant.CustomerAgencyConstant; |
|
|
import com.epmet.constant.OrgInfoConstant; |
|
|
import com.epmet.constant.OrgInfoConstant; |
|
@ -156,15 +157,15 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
Result result = new Result(); |
|
|
Result result = new Result(); |
|
|
CustomerAgencyEntity originalEntity = customerAgencyDao.selectById(formDTO.getAgencyId()); |
|
|
CustomerAgencyEntity originalEntity = customerAgencyDao.selectById(formDTO.getAgencyId()); |
|
|
//当前客户下,同级组织中,组织名称不允许重复
|
|
|
//当前客户下,同级组织中,组织名称不允许重复
|
|
|
customerAgencyService.checkAgencyName(formDTO.getAgencyName(),originalEntity.getCustomerId(),originalEntity.getId(),originalEntity.getPid()); |
|
|
customerAgencyService.checkAgencyName(formDTO.getAgencyName(), originalEntity.getCustomerId(), originalEntity.getId(), originalEntity.getPid()); |
|
|
originalEntity.setOrganizationName(formDTO.getAgencyName()); |
|
|
originalEntity.setOrganizationName(formDTO.getAgencyName()); |
|
|
originalEntity.setCode(formDTO.getCode()); |
|
|
originalEntity.setCode(formDTO.getCode()); |
|
|
originalEntity.setContacts(formDTO.getContacts()); |
|
|
originalEntity.setContacts(formDTO.getContacts()); |
|
|
originalEntity.setMobile(formDTO.getMobile()); |
|
|
originalEntity.setMobile(formDTO.getMobile()); |
|
|
if(StringUtils.isNotBlank(formDTO.getLatitude())){ |
|
|
if (StringUtils.isNotBlank(formDTO.getLatitude())) { |
|
|
originalEntity.setLatitude(formDTO.getLatitude()); |
|
|
originalEntity.setLatitude(formDTO.getLatitude()); |
|
|
} |
|
|
} |
|
|
if(StringUtils.isNotBlank(formDTO.getLongitude())){ |
|
|
if (StringUtils.isNotBlank(formDTO.getLongitude())) { |
|
|
originalEntity.setLongitude(formDTO.getLongitude()); |
|
|
originalEntity.setLongitude(formDTO.getLongitude()); |
|
|
} |
|
|
} |
|
|
originalEntity.setCenterAddress(formDTO.getCenterAddress()); |
|
|
originalEntity.setCenterAddress(formDTO.getCenterAddress()); |
|
@ -207,20 +208,20 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
} |
|
|
} |
|
|
//3:循环组织列表,查询每一个组织的所有上级组织重新拼接所有上级名称(allParentName)字段值
|
|
|
//3:循环组织列表,查询每一个组织的所有上级组织重新拼接所有上级名称(allParentName)字段值
|
|
|
List<CustomerAgencyEntity> editList = new ArrayList<>(); |
|
|
List<CustomerAgencyEntity> editList = new ArrayList<>(); |
|
|
agencyList.forEach(agency->{ |
|
|
agencyList.forEach(agency -> { |
|
|
//3-1:查询当前组织的所有上级组织
|
|
|
//3-1:查询当前组织的所有上级组织
|
|
|
List<String> listStr = Arrays.asList(agency.getPids().split(":")); |
|
|
List<String> listStr = Arrays.asList(agency.getPids().split(":")); |
|
|
List<ParentListResultDTO> parentList = customerAgencyDao.selectPAgencyById(listStr); |
|
|
List<ParentListResultDTO> parentList = customerAgencyDao.selectPAgencyById(listStr); |
|
|
//3-2:重新拼接当前组织的所有上级名称字段值,将组织Id和拼好的值存入集合
|
|
|
//3-2:重新拼接当前组织的所有上级名称字段值,将组织Id和拼好的值存入集合
|
|
|
StringBuffer allParentName = new StringBuffer(); |
|
|
StringBuffer allParentName = new StringBuffer(); |
|
|
parentList.forEach(parents->{ |
|
|
parentList.forEach(parents -> { |
|
|
if(StringUtils.isBlank(allParentName)){ |
|
|
if (StringUtils.isBlank(allParentName)) { |
|
|
allParentName.append(parents.getName()); |
|
|
allParentName.append(parents.getName()); |
|
|
}else { |
|
|
} else { |
|
|
allParentName.append("-").append(parents.getName()); |
|
|
allParentName.append("-").append(parents.getName()); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
CustomerAgencyEntity customerAgencyEntity = ConvertUtils.sourceToTarget(agency,CustomerAgencyEntity.class); |
|
|
CustomerAgencyEntity customerAgencyEntity = ConvertUtils.sourceToTarget(agency, CustomerAgencyEntity.class); |
|
|
customerAgencyEntity.setAllParentName(allParentName.toString()); |
|
|
customerAgencyEntity.setAllParentName(allParentName.toString()); |
|
|
customerAgencyEntity.setUpdatedBy(formDTO.getUserId()); |
|
|
customerAgencyEntity.setUpdatedBy(formDTO.getUserId()); |
|
|
editList.add(customerAgencyEntity); |
|
|
editList.add(customerAgencyEntity); |
|
@ -240,11 +241,12 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
/** |
|
|
/** |
|
|
* 所有下家组织、网格、部门的area_code,parent_area_code置为空 |
|
|
* 所有下家组织、网格、部门的area_code,parent_area_code置为空 |
|
|
* 直属组织parent_area_code、直属网格+直属部门的area_code更新为最新值 |
|
|
* 直属组织parent_area_code、直属网格+直属部门的area_code更新为最新值 |
|
|
|
|
|
* |
|
|
* @param customerId |
|
|
* @param customerId |
|
|
* @param formDTO |
|
|
* @param formDTO |
|
|
* @param originalAreaCode |
|
|
* @param originalAreaCode |
|
|
*/ |
|
|
*/ |
|
|
private void updateSubOrg(String customerId, EditAgencyFormDTO formDTO,String originalAreaCode) { |
|
|
private void updateSubOrg(String customerId, EditAgencyFormDTO formDTO, String originalAreaCode) { |
|
|
//如果原来这个组织有area_code再去更新,没有其实应该按照pids去更新。
|
|
|
//如果原来这个组织有area_code再去更新,没有其实应该按照pids去更新。
|
|
|
customerAgencyDao.updateSubAgencyAreaCodeById(customerId, formDTO.getAgencyId(), formDTO.getUserId()); |
|
|
customerAgencyDao.updateSubAgencyAreaCodeById(customerId, formDTO.getAgencyId(), formDTO.getUserId()); |
|
|
//网格的
|
|
|
//网格的
|
|
@ -254,40 +256,39 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
|
|
|
|
|
//1、更新直属网格的areaCode
|
|
|
//1、更新直属网格的areaCode
|
|
|
LambdaUpdateWrapper<CustomerGridEntity> updateGridWrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<CustomerGridEntity> updateGridWrapper = new LambdaUpdateWrapper<>(); |
|
|
updateGridWrapper.eq(CustomerGridEntity::getPid,formDTO.getAgencyId()) |
|
|
updateGridWrapper.eq(CustomerGridEntity::getPid, formDTO.getAgencyId()) |
|
|
.set(CustomerGridEntity::getAreaCode, formDTO.getAreaCode()) |
|
|
.set(CustomerGridEntity::getAreaCode, formDTO.getAreaCode()) |
|
|
.set(CustomerGridEntity::getUpdatedBy,formDTO.getUserId()) |
|
|
.set(CustomerGridEntity::getUpdatedBy, formDTO.getUserId()) |
|
|
.set(CustomerGridEntity::getUpdatedTime,new Date()); |
|
|
.set(CustomerGridEntity::getUpdatedTime, new Date()); |
|
|
int subGridRows=customerGridDao.update(null,updateGridWrapper); |
|
|
int subGridRows = customerGridDao.update(null, updateGridWrapper); |
|
|
log.info(String.format("更新了%s个直属网格的area_code",subGridRows)); |
|
|
log.info(String.format("更新了%s个直属网格的area_code", subGridRows)); |
|
|
|
|
|
|
|
|
// 2、更新直属部门的area_code
|
|
|
// 2、更新直属部门的area_code
|
|
|
LambdaUpdateWrapper<CustomerDepartmentEntity> updateDeptWrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<CustomerDepartmentEntity> updateDeptWrapper = new LambdaUpdateWrapper<>(); |
|
|
updateDeptWrapper.eq(CustomerDepartmentEntity::getAgencyId,formDTO.getAgencyId()) |
|
|
updateDeptWrapper.eq(CustomerDepartmentEntity::getAgencyId, formDTO.getAgencyId()) |
|
|
.set(CustomerDepartmentEntity::getAreaCode, formDTO.getAreaCode()) |
|
|
.set(CustomerDepartmentEntity::getAreaCode, formDTO.getAreaCode()) |
|
|
.set(CustomerDepartmentEntity::getUpdatedBy,formDTO.getUserId()) |
|
|
.set(CustomerDepartmentEntity::getUpdatedBy, formDTO.getUserId()) |
|
|
.set(CustomerDepartmentEntity::getUpdatedTime,new Date()); |
|
|
.set(CustomerDepartmentEntity::getUpdatedTime, new Date()); |
|
|
int gridRows=customerDepartmentDao.update(null,updateDeptWrapper); |
|
|
int gridRows = customerDepartmentDao.update(null, updateDeptWrapper); |
|
|
log.info(String.format("更新了%s个直属部门的area_code",gridRows)); |
|
|
log.info(String.format("更新了%s个直属部门的area_code", gridRows)); |
|
|
|
|
|
|
|
|
// 3、更新下级组织的parent_area_code
|
|
|
// 3、更新下级组织的parent_area_code
|
|
|
LambdaUpdateWrapper<CustomerAgencyEntity> updateAgencyWrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<CustomerAgencyEntity> updateAgencyWrapper = new LambdaUpdateWrapper<>(); |
|
|
updateAgencyWrapper.eq(CustomerAgencyEntity::getPid,formDTO.getAgencyId()) |
|
|
updateAgencyWrapper.eq(CustomerAgencyEntity::getPid, formDTO.getAgencyId()) |
|
|
.set(CustomerAgencyEntity::getParentAreaCode, formDTO.getAreaCode()) |
|
|
.set(CustomerAgencyEntity::getParentAreaCode, formDTO.getAreaCode()) |
|
|
.set(CustomerAgencyEntity::getUpdatedBy,formDTO.getUserId()) |
|
|
.set(CustomerAgencyEntity::getUpdatedBy, formDTO.getUserId()) |
|
|
.set(CustomerAgencyEntity::getUpdatedTime,new Date()); |
|
|
.set(CustomerAgencyEntity::getUpdatedTime, new Date()); |
|
|
Integer rows = customerAgencyDao.update(null, updateAgencyWrapper); |
|
|
Integer rows = customerAgencyDao.update(null, updateAgencyWrapper); |
|
|
log.info(String.format("更新了%s个下级组织的parent_area_code",rows)); |
|
|
log.info(String.format("更新了%s个下级组织的parent_area_code", rows)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* |
|
|
|
|
|
* @param formDTO 编辑组织入参 |
|
|
* @param formDTO 编辑组织入参 |
|
|
* @param parent 当前编辑组织的上级组织 |
|
|
* @param parent 当前编辑组织的上级组织 |
|
|
* @return 返回组织区划编码 |
|
|
* @return 返回组织区划编码 |
|
|
*/ |
|
|
*/ |
|
|
private String getAgencyNewAreaCode(EditAgencyFormDTO formDTO, CustomerAgencyEntity parent) { |
|
|
private String getAgencyNewAreaCode(EditAgencyFormDTO formDTO, CustomerAgencyEntity parent) { |
|
|
String newAreaCode=""; |
|
|
String newAreaCode = ""; |
|
|
if (!"other".equals(formDTO.getAreaCode())) { |
|
|
if (!"other".equals(formDTO.getAreaCode())) { |
|
|
//校验除了当前组织外,areaCode是否被使用过
|
|
|
//校验除了当前组织外,areaCode是否被使用过
|
|
|
List<String> agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(formDTO.getAreaCode(), formDTO.getAgencyId()); |
|
|
List<String> agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(formDTO.getAreaCode(), formDTO.getAgencyId()); |
|
@ -295,7 +296,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
//已经被占用,提示
|
|
|
//已经被占用,提示
|
|
|
throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); |
|
|
throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); |
|
|
} |
|
|
} |
|
|
newAreaCode=formDTO.getAreaCode(); |
|
|
newAreaCode = formDTO.getAreaCode(); |
|
|
} else { |
|
|
} else { |
|
|
//如果选择的是other,需要自定义一个编码
|
|
|
//如果选择的是other,需要自定义一个编码
|
|
|
AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); |
|
|
AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); |
|
@ -310,16 +311,17 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg()); |
|
|
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
newAreaCode=addAreaCodeResult.getData(); |
|
|
newAreaCode = addAreaCodeResult.getData(); |
|
|
} |
|
|
} |
|
|
return newAreaCode; |
|
|
return newAreaCode; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 如果当前客户开启了areaCode,校验参数逼单 |
|
|
* 如果当前客户开启了areaCode,校验参数逼单 |
|
|
|
|
|
* |
|
|
* @param formDTO |
|
|
* @param formDTO |
|
|
*/ |
|
|
*/ |
|
|
private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,CustomerAgencyEntity originalEntity) { |
|
|
private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO, CustomerAgencyEntity originalEntity) { |
|
|
//根组织不允许修改
|
|
|
//根组织不允许修改
|
|
|
if (StringUtils.isNotBlank(originalEntity.getPid()) && !NumConstant.ZERO_STR.equals(originalEntity.getPid())) { |
|
|
if (StringUtils.isNotBlank(originalEntity.getPid()) && !NumConstant.ZERO_STR.equals(originalEntity.getPid())) { |
|
|
//03.23:平阴线上版本与产品主线版本差距太大,平阴的修改组织只能修改组织名称。
|
|
|
//03.23:平阴线上版本与产品主线版本差距太大,平阴的修改组织只能修改组织名称。
|
|
@ -371,7 +373,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
//4:删除当前机关组织(逻辑删)
|
|
|
//4:删除当前机关组织(逻辑删)
|
|
|
if (customerAgencyDao.delByAgencyId(formDTO.getAgencyId(),loginUserUtil.getLoginUserId()) < NumConstant.ONE) { |
|
|
if (customerAgencyDao.delByAgencyId(formDTO.getAgencyId(), loginUserUtil.getLoginUserId()) < NumConstant.ONE) { |
|
|
log.error(CustomerAgencyConstant.DEL_EXCEPTION); |
|
|
log.error(CustomerAgencyConstant.DEL_EXCEPTION); |
|
|
throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); |
|
|
throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); |
|
|
} |
|
|
} |
|
@ -403,24 +405,24 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
agencysResultDTO.setMobile(entity.getMobile()); |
|
|
agencysResultDTO.setMobile(entity.getMobile()); |
|
|
agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); |
|
|
agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); |
|
|
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); |
|
|
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); |
|
|
agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode())?entity.getAreaCode():StrConstant.EPMETY_STR); |
|
|
agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode()) ? entity.getAreaCode() : StrConstant.EPMETY_STR); |
|
|
//查询组织区划的名称
|
|
|
//查询组织区划的名称
|
|
|
if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { |
|
|
if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { |
|
|
switch (entity.getLevel()) { |
|
|
switch (entity.getLevel()) { |
|
|
case CustomerAgencyConstant.PROVINCE_LEVEL: |
|
|
case CustomerAgencyConstant.PROVINCE_LEVEL: |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getProvince()) ? entity.getProvince():entity.getOrganizationName()); |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getProvince()) ? entity.getProvince() : entity.getOrganizationName()); |
|
|
break; |
|
|
break; |
|
|
case CustomerAgencyConstant.CITY_LEVEL: |
|
|
case CustomerAgencyConstant.CITY_LEVEL: |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCity()) ? entity.getCity():entity.getOrganizationName()); |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCity()) ? entity.getCity() : entity.getOrganizationName()); |
|
|
break; |
|
|
break; |
|
|
case CustomerAgencyConstant.DISTRICT: |
|
|
case CustomerAgencyConstant.DISTRICT: |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getDistrict()) ? entity.getDistrict():entity.getOrganizationName()); |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getDistrict()) ? entity.getDistrict() : entity.getOrganizationName()); |
|
|
break; |
|
|
break; |
|
|
case CustomerAgencyConstant.STREET_LEVEL: |
|
|
case CustomerAgencyConstant.STREET_LEVEL: |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getStreet()) ? entity.getStreet():entity.getOrganizationName()); |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getStreet()) ? entity.getStreet() : entity.getOrganizationName()); |
|
|
break; |
|
|
break; |
|
|
case CustomerAgencyConstant.COMMUNITY_LEVEL: |
|
|
case CustomerAgencyConstant.COMMUNITY_LEVEL: |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCommunity()) ? entity.getCommunity():entity.getOrganizationName()); |
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCommunity()) ? entity.getCommunity() : entity.getOrganizationName()); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); |
|
|
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); |
|
@ -504,7 +506,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
} |
|
|
} |
|
|
customerAgencyRedis.set(agencyId, agencyInfoCache); |
|
|
customerAgencyRedis.set(agencyId, agencyInfoCache); |
|
|
} |
|
|
} |
|
|
CustomerAgencyDTO customerAgencyDTO=ConvertUtils.sourceToTarget(agencyInfoCache,CustomerAgencyDTO.class); |
|
|
CustomerAgencyDTO customerAgencyDTO = ConvertUtils.sourceToTarget(agencyInfoCache, CustomerAgencyDTO.class); |
|
|
return customerAgencyDTO; |
|
|
return customerAgencyDTO; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -547,7 +549,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public CustomerAgencyDTO getCustomerRootAgency(String customerId) { |
|
|
public CustomerAgencyDTO getCustomerRootAgency(String customerId) { |
|
|
CustomerAgencyDTO root=customerAgencyDao.getCustomerRootAgency(customerId); |
|
|
CustomerAgencyDTO root = customerAgencyDao.getCustomerRootAgency(customerId); |
|
|
if (null != root) { |
|
|
if (null != root) { |
|
|
root.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(customerId)); |
|
|
root.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(customerId)); |
|
|
} |
|
|
} |
|
@ -652,17 +654,17 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
} |
|
|
} |
|
|
AddAgencyResultDTO resultDTO = new AddAgencyResultDTO(); |
|
|
AddAgencyResultDTO resultDTO = new AddAgencyResultDTO(); |
|
|
resultDTO.setAreaCodeSwitch(formDTO.getAreaCodeSwitch()); |
|
|
resultDTO.setAreaCodeSwitch(formDTO.getAreaCodeSwitch()); |
|
|
CustomerAgencyEntity insertEntity=this.constructInsertEntity(formDTO,parent); |
|
|
CustomerAgencyEntity insertEntity = this.constructInsertEntity(formDTO, parent); |
|
|
//判断areaCodeSwitch:open: 选择地区编码必填;closed: 无需选择地区编码
|
|
|
//判断areaCodeSwitch:open: 选择地区编码必填;closed: 无需选择地区编码
|
|
|
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { |
|
|
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { |
|
|
//校验areaCode是否被使用过
|
|
|
//校验areaCode是否被使用过
|
|
|
if (!"other".equals(formDTO.getAreaCode())) { |
|
|
if (!"other".equals(formDTO.getAreaCode())) { |
|
|
List<String> agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(insertEntity.getAreaCode(),null); |
|
|
List<String> agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(insertEntity.getAreaCode(), null); |
|
|
if (CollectionUtils.isNotEmpty(agencyIds)) { |
|
|
if (CollectionUtils.isNotEmpty(agencyIds)) { |
|
|
//已经被占用,提示
|
|
|
//已经被占用,提示
|
|
|
throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); |
|
|
throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
} else { |
|
|
//如果选择的是other,需要自定义一个编码
|
|
|
//如果选择的是other,需要自定义一个编码
|
|
|
AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); |
|
|
AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); |
|
|
addAreaCodeFormDTO.setCurrentAreaLevel(formDTO.getLevel()); |
|
|
addAreaCodeFormDTO.setCurrentAreaLevel(formDTO.getLevel()); |
|
@ -688,19 +690,19 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 【地图配置】删除 |
|
|
|
|
|
* @param formDTO |
|
|
* @param formDTO |
|
|
|
|
|
* @Description 【地图配置】删除 |
|
|
* @author zxc |
|
|
* @author zxc |
|
|
* @date 2021/10/25 9:30 上午 |
|
|
* @date 2021/10/25 9:30 上午 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public void mapDelArea(MapDelAreaFormDTO formDTO) { |
|
|
public void mapDelArea(MapDelAreaFormDTO formDTO) { |
|
|
customerAgencyDao.delMapArea(formDTO.getOrgId(),formDTO.getLevel()); |
|
|
customerAgencyDao.delMapArea(formDTO.getOrgId(), formDTO.getLevel()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 【地图配置】新增 |
|
|
|
|
|
* @param formDTO |
|
|
* @param formDTO |
|
|
|
|
|
* @Description 【地图配置】新增 |
|
|
* @author zxc |
|
|
* @author zxc |
|
|
* @date 2021/10/25 9:58 上午 |
|
|
* @date 2021/10/25 9:58 上午 |
|
|
*/ |
|
|
*/ |
|
@ -710,14 +712,14 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @param tokenDto |
|
|
* @Description 【地图配置】组织查询 |
|
|
* @Description 【地图配置】组织查询 |
|
|
* 根据level查询去查询不同的表,类型,组织:agency,网格:grid,小区:neighborHood |
|
|
* 根据level查询去查询不同的表,类型,组织:agency,网格:grid,小区:neighborHood |
|
|
* 组织类型去查 customer_agency,看本级是不是 community,是,下级组织就是网格,查询customer_grid,不是,继续查customer_agency |
|
|
* 组织类型去查 customer_agency,看本级是不是 community,是,下级组织就是网格,查询customer_grid,不是,继续查customer_agency |
|
|
* 网格类型去查 查询customer_grid,下级去查 ic_neighbor_hood, |
|
|
* 网格类型去查 查询customer_grid,下级去查 ic_neighbor_hood, |
|
|
* 当前组织没有经纬度的话,直接赋值根组织的经纬度, |
|
|
* 当前组织没有经纬度的话,直接赋值根组织的经纬度, |
|
|
* 下级组织经纬度为空的话,直接赋值上级的经纬度 |
|
|
* 下级组织经纬度为空的话,直接赋值上级的经纬度 |
|
|
* @param formDTO |
|
|
|
|
|
* @param tokenDto |
|
|
|
|
|
* @author zxc |
|
|
* @author zxc |
|
|
* @date 2021/10/25 10:50 上午 |
|
|
* @date 2021/10/25 10:50 上午 |
|
|
*/ |
|
|
*/ |
|
@ -725,38 +727,38 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
public MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto) { |
|
|
public MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto) { |
|
|
MapOrgResultDTO result = new MapOrgResultDTO(); |
|
|
MapOrgResultDTO result = new MapOrgResultDTO(); |
|
|
LambdaQueryWrapper<CustomerAgencyEntity> qw = new LambdaQueryWrapper(); |
|
|
LambdaQueryWrapper<CustomerAgencyEntity> qw = new LambdaQueryWrapper(); |
|
|
qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId,tokenDto.getCustomerId()); |
|
|
qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId, tokenDto.getCustomerId()); |
|
|
CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectOne(qw); |
|
|
CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectOne(qw); |
|
|
if (StringUtils.isBlank(formDTO.getOrgId())){ |
|
|
if (StringUtils.isBlank(formDTO.getOrgId())) { |
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
if (null == staffInfo){ |
|
|
if (null == staffInfo) { |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
formDTO.setOrgId(staffInfo.getAgencyId()); |
|
|
formDTO.setOrgId(staffInfo.getAgencyId()); |
|
|
formDTO.setLevel(OrgInfoConstant.AGENCY); |
|
|
formDTO.setLevel(OrgInfoConstant.AGENCY); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())){ |
|
|
if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())) { |
|
|
result.setLatitude(new BigDecimal(customerAgencyEntity.getLatitude())); |
|
|
result.setLatitude(new BigDecimal(customerAgencyEntity.getLatitude())); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(customerAgencyEntity.getLongitude())){ |
|
|
if (StringUtils.isNotBlank(customerAgencyEntity.getLongitude())) { |
|
|
result.setLongitude(new BigDecimal(customerAgencyEntity.getLongitude())); |
|
|
result.setLongitude(new BigDecimal(customerAgencyEntity.getLongitude())); |
|
|
} |
|
|
} |
|
|
if (formDTO.getLevel().equals(OrgInfoConstant.AGENCY)){ |
|
|
if (formDTO.getLevel().equals(OrgInfoConstant.AGENCY)) { |
|
|
CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getOrgId()); |
|
|
CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getOrgId()); |
|
|
result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class); |
|
|
result = ConvertUtils.sourceToTarget(entity, MapOrgResultDTO.class); |
|
|
result.setName(entity.getOrganizationName()); |
|
|
result.setName(entity.getOrganizationName()); |
|
|
result.setLevel(formDTO.getLevel()); |
|
|
result.setLevel(formDTO.getLevel()); |
|
|
result.setAgencyLevel(entity.getLevel()); |
|
|
result.setAgencyLevel(entity.getLevel()); |
|
|
//经纬度 如果本级没有则取根级组织的 根级没有就空着
|
|
|
//经纬度 如果本级没有则取根级组织的 根级没有就空着
|
|
|
if (StringUtils.isNotBlank(entity.getLatitude())){ |
|
|
if (StringUtils.isNotBlank(entity.getLatitude())) { |
|
|
result.setLatitude(new BigDecimal(entity.getLatitude())); |
|
|
result.setLatitude(new BigDecimal(entity.getLatitude())); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(entity.getLongitude())){ |
|
|
if (StringUtils.isNotBlank(entity.getLongitude())) { |
|
|
result.setLongitude(new BigDecimal(entity.getLongitude())); |
|
|
result.setLongitude(new BigDecimal(entity.getLongitude())); |
|
|
} |
|
|
} |
|
|
if (entity.getLevel().equals(OrgInfoConstant.COMMUNITY)){ |
|
|
if (entity.getLevel().equals(OrgInfoConstant.COMMUNITY)) { |
|
|
List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); |
|
|
List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); |
|
|
if (CollectionUtils.isNotEmpty(son)){ |
|
|
if (CollectionUtils.isNotEmpty(son)) { |
|
|
MapOrgResultDTO finalResult = result; |
|
|
MapOrgResultDTO finalResult = result; |
|
|
son.forEach(s -> { |
|
|
son.forEach(s -> { |
|
|
s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? finalResult.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); |
|
|
s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? finalResult.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); |
|
@ -764,15 +766,15 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
result.setChildren(CollectionUtils.isEmpty(son) ? new ArrayList<>() : son); |
|
|
result.setChildren(CollectionUtils.isEmpty(son) ? new ArrayList<>() : son); |
|
|
}else { |
|
|
} else { |
|
|
List<MapSonOrgResultDTO> dtoList = new ArrayList<>(); |
|
|
List<MapSonOrgResultDTO> dtoList = new ArrayList<>(); |
|
|
List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.AGENCY); |
|
|
List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.AGENCY); |
|
|
if (CollectionUtils.isNotEmpty(son)){ |
|
|
if (CollectionUtils.isNotEmpty(son)) { |
|
|
dtoList.addAll(son); |
|
|
dtoList.addAll(son); |
|
|
} |
|
|
} |
|
|
// 直属网格
|
|
|
// 直属网格
|
|
|
List<MapSonOrgResultDTO> directlySub = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); |
|
|
List<MapSonOrgResultDTO> directlySub = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); |
|
|
if (CollectionUtils.isNotEmpty(directlySub)){ |
|
|
if (CollectionUtils.isNotEmpty(directlySub)) { |
|
|
dtoList.addAll(directlySub); |
|
|
dtoList.addAll(directlySub); |
|
|
} |
|
|
} |
|
|
for (MapSonOrgResultDTO d : dtoList) { |
|
|
for (MapSonOrgResultDTO d : dtoList) { |
|
@ -781,21 +783,21 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
} |
|
|
} |
|
|
result.setChildren(dtoList); |
|
|
result.setChildren(dtoList); |
|
|
} |
|
|
} |
|
|
}else if (formDTO.getLevel().equals(OrgInfoConstant.GRID)){ |
|
|
} else if (formDTO.getLevel().equals(OrgInfoConstant.GRID)) { |
|
|
CustomerGridEntity entity = customerGridDao.selectById(formDTO.getOrgId()); |
|
|
CustomerGridEntity entity = customerGridDao.selectById(formDTO.getOrgId()); |
|
|
result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class); |
|
|
result = ConvertUtils.sourceToTarget(entity, MapOrgResultDTO.class); |
|
|
result.setName(entity.getGridName()); |
|
|
result.setName(entity.getGridName()); |
|
|
result.setLevel(formDTO.getLevel()); |
|
|
result.setLevel(formDTO.getLevel()); |
|
|
result.setAgencyLevel(OrgInfoConstant.GRID); |
|
|
result.setAgencyLevel(OrgInfoConstant.GRID); |
|
|
//经纬度 如果本级没有则取根级组织的 根级没有就空着
|
|
|
//经纬度 如果本级没有则取根级组织的 根级没有就空着
|
|
|
if (StringUtils.isNotBlank(entity.getLatitude())){ |
|
|
if (StringUtils.isNotBlank(entity.getLatitude())) { |
|
|
result.setLatitude(new BigDecimal(entity.getLatitude())); |
|
|
result.setLatitude(new BigDecimal(entity.getLatitude())); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(entity.getLongitude())){ |
|
|
if (StringUtils.isNotBlank(entity.getLongitude())) { |
|
|
result.setLongitude(new BigDecimal(entity.getLongitude())); |
|
|
result.setLongitude(new BigDecimal(entity.getLongitude())); |
|
|
} |
|
|
} |
|
|
List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.NEIGHBOR_HOOD); |
|
|
List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.NEIGHBOR_HOOD); |
|
|
if (CollectionUtils.isNotEmpty(son)){ |
|
|
if (CollectionUtils.isNotEmpty(son)) { |
|
|
for (MapSonOrgResultDTO s : son) { |
|
|
for (MapSonOrgResultDTO s : son) { |
|
|
s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); |
|
|
s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); |
|
|
s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(s.getLongitudeOrigin())); |
|
|
s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(s.getLongitudeOrigin())); |
|
@ -807,35 +809,35 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 查询楼栋信息 |
|
|
|
|
|
* @param formDTO |
|
|
* @param formDTO |
|
|
|
|
|
* @Description 查询楼栋信息 |
|
|
* @author zxc |
|
|
* @author zxc |
|
|
* @date 2021/11/2 9:18 上午 |
|
|
* @date 2021/11/2 9:18 上午 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<BaseInfoFamilyBuildingResultDTO> baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO) { |
|
|
public List<BaseInfoFamilyBuildingResultDTO> baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO) { |
|
|
List<BaseInfoFamilyBuildingResultDTO> result = icBuildingDao.baseInfoFamilyBuilding(formDTO.getNeighborHoodId()); |
|
|
List<BaseInfoFamilyBuildingResultDTO> result = icBuildingDao.baseInfoFamilyBuilding(formDTO.getNeighborHoodId()); |
|
|
if (CollectionUtils.isEmpty(result)){ |
|
|
if (CollectionUtils.isEmpty(result)) { |
|
|
return new ArrayList<>(); |
|
|
return new ArrayList<>(); |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 查询下级agencyId |
|
|
|
|
|
* @param orgId |
|
|
* @param orgId |
|
|
|
|
|
* @Description 查询下级agencyId |
|
|
* @author zxc |
|
|
* @author zxc |
|
|
* @date 2021/12/9 4:42 下午 |
|
|
* @date 2021/12/9 4:42 下午 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<SonOrgResultDTO> getSonAgencyId(String orgId,String type) { |
|
|
public List<SonOrgResultDTO> getSonAgencyId(String orgId, String type) { |
|
|
List<SonOrgResultDTO> result = new ArrayList<>(); |
|
|
List<SonOrgResultDTO> result = new ArrayList<>(); |
|
|
if (type.equals("community")){ |
|
|
if (type.equals("community")) { |
|
|
result = customerAgencyDao.getSonGridId(orgId); |
|
|
result = customerAgencyDao.getSonGridId(orgId); |
|
|
}else { |
|
|
} else { |
|
|
result = customerAgencyDao.getSonAgencyId(orgId); |
|
|
result = customerAgencyDao.getSonAgencyId(orgId); |
|
|
} |
|
|
} |
|
|
if (CollectionUtils.isNotEmpty(result)){ |
|
|
if (CollectionUtils.isNotEmpty(result)) { |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
return new ArrayList<>(); |
|
|
return new ArrayList<>(); |
|
@ -843,6 +845,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Desc: 查询工作人员所属组织下的所有社区 |
|
|
* Desc: 查询工作人员所属组织下的所有社区 |
|
|
|
|
|
* |
|
|
* @param tokenDto |
|
|
* @param tokenDto |
|
|
* @author zxc |
|
|
* @author zxc |
|
|
* @date 2022/3/21 15:13 |
|
|
* @date 2022/3/21 15:13 |
|
@ -850,20 +853,36 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
@Override |
|
|
@Override |
|
|
public List<CommunityListResultDTO> getCommunityList(TokenDto tokenDto) { |
|
|
public List<CommunityListResultDTO> getCommunityList(TokenDto tokenDto) { |
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
if (null == staffInfo){ |
|
|
if (null == staffInfo) { |
|
|
throw new EpmetException("未查询到工作人员信息"+staffInfo.getStaffId()); |
|
|
throw new EpmetException("未查询到工作人员信息" + staffInfo.getStaffId()); |
|
|
} |
|
|
} |
|
|
String agencyId = staffInfo.getAgencyId(); |
|
|
String agencyId = staffInfo.getAgencyId(); |
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId); |
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId); |
|
|
if (null == agencyInfo){ |
|
|
if (null == agencyInfo) { |
|
|
throw new EpmetException("查询组织信息失败"+agencyInfo); |
|
|
throw new EpmetException("查询组织信息失败" + agencyInfo); |
|
|
} |
|
|
} |
|
|
if (agencyInfo.getLevel().equals(CustomerAgencyConstant.COMMUNITY_LEVEL)){ |
|
|
if (agencyInfo.getLevel().equals(CustomerAgencyConstant.COMMUNITY_LEVEL)) { |
|
|
return new ArrayList<>(); |
|
|
return new ArrayList<>(); |
|
|
} |
|
|
} |
|
|
return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId); |
|
|
return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 通讯录树 |
|
|
|
|
|
* |
|
|
|
|
|
* @param name |
|
|
|
|
|
* @param customerId |
|
|
|
|
|
* @return java.util.List<com.epmet.dto.result.AgencyAddressBookTreeResultDTO> |
|
|
|
|
|
* @author LZN |
|
|
|
|
|
* @date 2022/5/16 10:45 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<AgencyAddressBookTreeResultDTO> getAddressTree(String name, String customerId) { |
|
|
|
|
|
List<AgencyAddressBookTreeResultDTO> list = customerAgencyDao.getAddressTree(name, customerId); |
|
|
|
|
|
System.out.println(list); |
|
|
|
|
|
return NodeTreeUtils.build(list); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) { |
|
|
private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) { |
|
|
CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); |
|
|
CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); |
|
|
insertEntity.setOrganizationName(formDTO.getAgencyName()); |
|
|
insertEntity.setOrganizationName(formDTO.getAgencyName()); |
|
@ -879,8 +898,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
insertEntity.setPids(parent.getPids().concat(StrConstant.COLON).concat(parent.getId())); |
|
|
insertEntity.setPids(parent.getPids().concat(StrConstant.COLON).concat(parent.getId())); |
|
|
insertEntity.setAllParentName(parent.getAllParentName().concat(StrConstant.HYPHEN).concat(parent.getOrganizationName())); |
|
|
insertEntity.setAllParentName(parent.getAllParentName().concat(StrConstant.HYPHEN).concat(parent.getOrganizationName())); |
|
|
} |
|
|
} |
|
|
switch(parent.getLevel()) |
|
|
switch (parent.getLevel()) { |
|
|
{ |
|
|
|
|
|
case CustomerAgencyConstant.PROVINCE_LEVEL: |
|
|
case CustomerAgencyConstant.PROVINCE_LEVEL: |
|
|
insertEntity.setLevel(CustomerAgencyConstant.CITY_LEVEL); |
|
|
insertEntity.setLevel(CustomerAgencyConstant.CITY_LEVEL); |
|
|
insertEntity.setProvince(parent.getProvince()); |
|
|
insertEntity.setProvince(parent.getProvince()); |
|
@ -908,7 +926,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
insertEntity.setCommunity(formDTO.getAreaName()); |
|
|
insertEntity.setCommunity(formDTO.getAreaName()); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
log.info("parent.getLevel()="+parent.getLevel()); |
|
|
log.info("parent.getLevel()=" + parent.getLevel()); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
return insertEntity; |
|
|
return insertEntity; |
|
|