提交代码

dev-discount
胡锐 3 years ago
parent 80e0567257
commit d662e316db
  1. 6
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  2. 6
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java

@ -97,6 +97,11 @@ public class HighMerchantStoreController {
}
Map<String, SecRegion> regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId());
if (highMerchantStore.getType() != null && highMerchantStore.getType().equals(1)) {
highMerchantStore.setRegionId(regionMap.get("region").getParentId());
highMerchantStore.setRegionName(commonService.getRegionName(regionMap.get("region").getParentId()));
} else {
// 如果是重庆市的区县,使用重庆市的区域代码
if (regionMap.get("region").getRegionId().intValue() == 500100) {
highMerchantStore.setRegionId(regionMap.get("region").getParentId());
@ -105,6 +110,7 @@ public class HighMerchantStoreController {
highMerchantStore.setRegionId(regionMap.get("region").getRegionId());
highMerchantStore.setRegionName(regionMap.get("region").getRegionName());
}
}
if (highMerchantStore.getBrandId() != null) {
highMerchantStore.setBrandName(commonService.getDictionaryCodeName("MERCHANT_STORE_BRANCH", highMerchantStore.getBrandId().toString()));

@ -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();
// 计算金额

Loading…
Cancel
Save