提交代码

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

@ -97,13 +97,19 @@ public class HighMerchantStoreController {
}
Map<String, SecRegion> 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) {

@ -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