From 169878d37a13facda8324e53fc2760f05cc3107b Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 30 May 2022 16:23:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HighGasOilPriceTaskController.java | 2 ++ .../HighMerchantStoreController.java | 23 ++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java index 9063a63c..8b970437 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java @@ -109,6 +109,8 @@ public class HighGasOilPriceTaskController { log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站"); } + task.setRegionId(store.getRegionId()); + task.setRegionName(store.getRegionName()); task.setMerStoreId(store.getId()); task.setMerStoreName(store.getStoreName()); task.setMerStoreAddress(store.getAddress()); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java index 5896070e..66b4ad97 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -208,14 +208,25 @@ public class HighMerchantStoreController { log.error("BsStudentController --> addStudent() 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 regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); - // 如果是重庆市的区县,使用重庆市的区域代码 - if (regionMap.get("region").getRegionId().intValue() == 500100) { - store.setRegionId(regionMap.get("region").getParentId()); - store.setRegionName(regionMap.get("region").getRegionName()); + if (highMerchantStore.getType() != null && highMerchantStore.getType().equals(1)) { + highMerchantStore.setRegionId(Long.parseLong(company.getRegionId())); + highMerchantStore.setRegionName(commonService.getRegionName(Long.parseLong(company.getRegionId()))); } 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) {