From e8ee0a0f877799ee988adc7b63fb3c82a91e1e4b Mon Sep 17 00:00:00 2001 From: 199901012 Date: Wed, 24 Mar 2021 10:59:04 +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 --- .../HighMerchantStoreController.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) 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 76fce1b2..709420ff 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -1,5 +1,6 @@ package com.bweb.controller; +import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; @@ -11,6 +12,7 @@ import com.hai.common.utils.MemberValidateUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighMerchant; import com.hai.entity.HighMerchantStore; +import com.hai.entity.SecRegion; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; @@ -106,7 +108,15 @@ public class HighMerchantStoreController { throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); } - highMerchantStore.setRegionName(commonService.getRegionsById(highMerchantStore.getRegionId()).getRegionName()); + Map regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); + // 如果是重庆市的区县,使用重庆市的区域代码 + if (regionMap.get("city").getRegionId().intValue() == 500000) { + highMerchantStore.setRegionId(regionMap.get("city").getRegionId()); + highMerchantStore.setRegionName(regionMap.get("city").getRegionName()); + + } else { + highMerchantStore.setRegionName(commonService.getRegionsById(highMerchantStore.getRegionId()).getRegionName()); + } highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setStatus(1); // 状态:0:删除,1:正常 @@ -114,7 +124,7 @@ public class HighMerchantStoreController { highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setOperatorId(userInfoModel.getSecUser().getId()); highMerchantStore.setOperatorName(userInfoModel.getSecUser().getUserName()); - highMerchantStoreService.insertMerchantStore(highMerchantStore); + // highMerchantStoreService.insertMerchantStore(highMerchantStore); return ResponseMsgUtil.success(highMerchantStore); } catch (Exception e) { @@ -177,7 +187,15 @@ public class HighMerchantStoreController { throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); } - highMerchantStore.setRegionName(commonService.getRegionsById(highMerchantStore.getRegionId()).getRegionName()); + Map regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); + // 如果是重庆市的区县,使用重庆市的区域代码 + if (regionMap.get("city").getRegionId().intValue() == 500000) { + highMerchantStore.setRegionId(regionMap.get("city").getRegionId()); + highMerchantStore.setRegionName(regionMap.get("city").getRegionName()); + + } else { + highMerchantStore.setRegionName(commonService.getRegionsById(highMerchantStore.getRegionId()).getRegionName()); + } highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setOperatorId(userInfoModel.getSecUser().getId()); highMerchantStore.setOperatorName(userInfoModel.getSecUser().getUserName());