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 309d3eb0..1aeac46b 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -33,6 +33,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -109,8 +110,15 @@ public class HighMerchantStoreController { } Map regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); - highMerchantStore.setRegionId(regionMap.get("city").getRegionId()); - highMerchantStore.setRegionName(regionMap.get("city").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()); + } highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setStatus(1); // 状态:0:删除,1:正常 @@ -182,8 +190,15 @@ public class HighMerchantStoreController { } Map regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); - highMerchantStore.setRegionId(regionMap.get("city").getRegionId()); - highMerchantStore.setRegionName(regionMap.get("city").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()); + } highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setOperatorId(userInfoModel.getSecUser().getId()); highMerchantStore.setOperatorName(userInfoModel.getSecUser().getUserName());