|
@ -163,7 +163,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { |
|
|
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { |
|
|
//开关开启后,areaCode必填
|
|
|
//开关开启后,areaCode必填
|
|
|
String originalAreaCode =originalEntity.getAreaCode(); |
|
|
String originalAreaCode =originalEntity.getAreaCode(); |
|
|
checkEditAgencyFormDTO(formDTO,originalAreaCode); |
|
|
checkEditAgencyFormDTO(formDTO,originalEntity); |
|
|
// 1、之前当前组织没有编码,本次修改设置了编码
|
|
|
// 1、之前当前组织没有编码,本次修改设置了编码
|
|
|
// 2、之前已经有编码,本次修改为了其他编码
|
|
|
// 2、之前已经有编码,本次修改为了其他编码
|
|
|
if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalAreaCode)) { |
|
|
if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalAreaCode)) { |
|
@ -306,19 +306,22 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
* 如果当前客户开启了areaCode,校验参数逼单 |
|
|
* 如果当前客户开启了areaCode,校验参数逼单 |
|
|
* @param formDTO |
|
|
* @param formDTO |
|
|
*/ |
|
|
*/ |
|
|
private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,String originalAreaCode) { |
|
|
private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,CustomerAgencyEntity originalEntity) { |
|
|
if (StringUtils.isBlank(formDTO.getAreaCode())) { |
|
|
//根组织不允许修改
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open areaCode不能为空", "组织区划不能为空"); |
|
|
if (StringUtils.isNotBlank(originalEntity.getPid()) && !NumConstant.ZERO_STR.equals(originalEntity.getPid())) { |
|
|
} |
|
|
if (StringUtils.isBlank(formDTO.getAreaCode())) { |
|
|
if (StringUtils.isBlank(formDTO.getParentAreaCode())) { |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open areaCode不能为空", "组织区划不能为空"); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open parentAreaCode不能为空", "请先设置上级组织的组织区划"); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isBlank(formDTO.getParentAreaCode())) { |
|
|
//如果当前组织已经使用了自定义编码,不允许在选择其他。
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open parentAreaCode不能为空", "请先设置上级组织的组织区划"); |
|
|
if (StringUtils.isNotBlank(originalAreaCode) |
|
|
} |
|
|
&& originalAreaCode.contains("UD") |
|
|
//如果当前组织已经使用了自定义编码,不允许在选择其他。
|
|
|
&& StringUtils.isNotBlank(formDTO.getAreaCode()) |
|
|
if (StringUtils.isNotBlank(originalEntity.getAreaCode()) |
|
|
&& "other".equals(formDTO.getAreaCode())) { |
|
|
&& originalEntity.getAreaCode().contains("UD") |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义编码不允许修改", "自定义组织区划代码不允许修改"); |
|
|
&& StringUtils.isNotBlank(formDTO.getAreaCode()) |
|
|
|
|
|
&& "other".equals(formDTO.getAreaCode())) { |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义编码不允许修改", "自定义组织区划代码不允许修改"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -398,7 +401,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
} |
|
|
} |
|
|
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end
|
|
|
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end
|
|
|
//2:查询本机关的所有上级机关,按自上而下层级顺序
|
|
|
//2:查询本机关的所有上级机关,按自上而下层级顺序
|
|
|
if (null == entity.getPids()) { |
|
|
if (StringUtils.isBlank(entity.getPids())) { |
|
|
agencysResultDTO.setParentList(parentList); |
|
|
agencysResultDTO.setParentList(parentList); |
|
|
return new Result<AgencysResultDTO>().ok(agencysResultDTO); |
|
|
return new Result<AgencysResultDTO>().ok(agencysResultDTO); |
|
|
} |
|
|
} |
|
|