|
|
@ -208,14 +208,25 @@ public class HighMerchantStoreController { |
|
|
|
log.error("BsStudentController --> addStudent() error!", "未找到门店信息"); |
|
|
|
log.error("BsStudentController --> addStudent() error!", "未找到门店信息"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
BsCompany company = bsCompanyService.getCompanyById(store.getCompanyId()); |
|
|
|
|
|
|
|
if (company == null) { |
|
|
|
|
|
|
|
log.error("HighMerchantStoreController -> insertMerchantStore() error!","未找到分公司"); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Map<String, SecRegion> regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); |
|
|
|
Map<String, SecRegion> regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); |
|
|
|
// 如果是重庆市的区县,使用重庆市的区域代码
|
|
|
|
if (highMerchantStore.getType() != null && highMerchantStore.getType().equals(1)) { |
|
|
|
if (regionMap.get("region").getRegionId().intValue() == 500100) { |
|
|
|
highMerchantStore.setRegionId(Long.parseLong(company.getRegionId())); |
|
|
|
store.setRegionId(regionMap.get("region").getParentId()); |
|
|
|
highMerchantStore.setRegionName(commonService.getRegionName(Long.parseLong(company.getRegionId()))); |
|
|
|
store.setRegionName(regionMap.get("region").getRegionName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
store.setRegionId(regionMap.get("region").getRegionId()); |
|
|
|
// 如果是重庆市的区县,使用重庆市的区域代码
|
|
|
|
store.setRegionName(regionMap.get("region").getRegionName()); |
|
|
|
if (regionMap.get("region").getRegionId().intValue() == 500100) { |
|
|
|
|
|
|
|
highMerchantStore.setRegionId(regionMap.get("region").getParentId()); |
|
|
|
|
|
|
|
highMerchantStore.setRegionName(regionMap.get("region").getRegionName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
highMerchantStore.setRegionId(regionMap.get("region").getRegionId()); |
|
|
|
|
|
|
|
highMerchantStore.setRegionName(regionMap.get("region").getRegionName()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (highMerchantStore.getBrandId() != null) { |
|
|
|
if (highMerchantStore.getBrandId() != null) { |
|
|
|