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 9579ac08..3be2c75a 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -97,13 +97,19 @@ public class HighMerchantStoreController { } Map regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); - // 如果是重庆市的区县,使用重庆市的区域代码 - if (regionMap.get("region").getRegionId().intValue() == 500100) { + + if (highMerchantStore.getType() != null && highMerchantStore.getType().equals(1)) { highMerchantStore.setRegionId(regionMap.get("region").getParentId()); - highMerchantStore.setRegionName(regionMap.get("region").getRegionName()); + highMerchantStore.setRegionName(commonService.getRegionName(regionMap.get("region").getParentId())); } else { - highMerchantStore.setRegionId(regionMap.get("region").getRegionId()); - highMerchantStore.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) { diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java index e4a5f2ad..efb2ee93 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java @@ -136,13 +136,15 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc // 是否开通了账户 HighMerchantStoreAccount account = getStoreAccountDetail(storeId); if (account == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足"); + account = new HighMerchantStoreAccount(); + account.setStoreId(storeId); + account.setAmounts(new BigDecimal("0")); + editStoreAccount(account); } // 账户余额 是否小于 出账余额 if (account.getAmounts().compareTo(amount) == -1) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足"); } - // 变更前金额 BigDecimal beforeAmount = account.getAmounts(); // 计算金额