|
|
@ -152,10 +152,10 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
originalEntity.setCode(formDTO.getCode()); |
|
|
|
originalEntity.setContacts(formDTO.getContacts()); |
|
|
|
originalEntity.setMobile(formDTO.getMobile()); |
|
|
|
if(StringUtils.isNotBlank(formDTO.getAreaCode())&&formDTO.getAreaCode().equals(originalEntity.getAreaCode())){ |
|
|
|
if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalEntity.getAreaCode())) { |
|
|
|
//如果修改了areaCode。
|
|
|
|
customerAgencyDao.updateSubAgencyAreaCode(originalEntity.getCustomerId(),originalEntity.getAreaCode(),formDTO.getUserId()); |
|
|
|
} |
|
|
|
customerAgencyDao.updateSubAgencyAreaCode(originalEntity.getCustomerId(), originalEntity.getAreaCode(), formDTO.getUserId()); |
|
|
|
|
|
|
|
//判断areaCodeSwitch:open: 选择地区编码必填;closed: 无需选择地区编码
|
|
|
|
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { |
|
|
|
//校验areaCode是否被使用过
|
|
|
@ -179,6 +179,7 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
originalEntity.setAreaCode(addAreaCodeResult.getData()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//1:更新当前组织信息
|
|
|
|
if (customerAgencyDao.updateById(originalEntity) < NumConstant.ONE) { |
|
|
@ -314,19 +315,19 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { |
|
|
|
switch (entity.getLevel()) { |
|
|
|
case CustomerAgencyConstant.PROVINCE_LEVEL: |
|
|
|
agencysResultDTO.setAreaName(null == entity.getProvince() ? StrConstant.EPMETY_STR : entity.getProvince()); |
|
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getProvince()) ? entity.getProvince():entity.getOrganizationName()); |
|
|
|
break; |
|
|
|
case CustomerAgencyConstant.CITY_LEVEL: |
|
|
|
agencysResultDTO.setAreaName(null == entity.getCity() ? StrConstant.EPMETY_STR : entity.getCity()); |
|
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCity()) ? entity.getCity():entity.getOrganizationName()); |
|
|
|
break; |
|
|
|
case CustomerAgencyConstant.DISTRICT: |
|
|
|
agencysResultDTO.setAreaName(null == entity.getDistrict() ? StrConstant.EPMETY_STR : entity.getDistrict()); |
|
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getDistrict()) ? entity.getDistrict():entity.getOrganizationName()); |
|
|
|
break; |
|
|
|
case CustomerAgencyConstant.STREET_LEVEL: |
|
|
|
agencysResultDTO.setAreaName(null == entity.getStreet() ? StrConstant.EPMETY_STR : entity.getStreet()); |
|
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getStreet()) ? entity.getStreet():entity.getOrganizationName()); |
|
|
|
break; |
|
|
|
case CustomerAgencyConstant.COMMUNITY_LEVEL: |
|
|
|
agencysResultDTO.setAreaName(null == entity.getCommunity() ? StrConstant.EPMETY_STR : entity.getCommunity()); |
|
|
|
agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCommunity()) ? entity.getCommunity():entity.getOrganizationName()); |
|
|
|
break; |
|
|
|
default: |
|
|
|
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); |
|
|
|