Merge remote-tracking branch 'origin/dev' into dev

dev-discount
袁野 3 years ago
commit c8f129252c
  1. 16
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  2. 10
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  3. 2
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  4. 1
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java
  5. 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) {

@ -92,10 +92,12 @@ public class HighGasController {
if (region != null) {
List<Map<String, Object>> storeList = highGasOilPriceService.getStoreListByOilNo(storeName,region.getRegionId(), oilNoName);
for (Map<String, Object> store : storeList) {
if (StringUtils.isNotBlank(MapUtils.getString(store, "store_logo"))) {
store.put("store_logo", CommonSysConst.getSysConfig().getHsgDomainName() +"/filesystem/"+MapUtils.getString(store, "store_logo"));
} else {
store.put("store_logo", null);
if (MapUtils.getInteger(store, "source_type").equals(1)) {
if (StringUtils.isNotBlank(MapUtils.getString(store, "store_logo"))) {
store.put("store_logo", CommonSysConst.getSysConfig().getHsgDomainName() +"/filesystem/"+MapUtils.getString(store, "store_logo"));
} else {
store.put("store_logo", null);
}
}
double distance = CoordCommonUtil.getDistance(Double.valueOf(store.get("latitude").toString()), Double.valueOf(store.get("longitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
store.put("distance", Math.round(distance/100d)/10d);

@ -191,7 +191,7 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("100")) == 1 ? new BigDecimal("0") : discount);
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("0") : discount);
// 加油补贴, 计算方式:团油枪价 - 团油VIP价
payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));

@ -74,7 +74,6 @@ public class HighGasOilPriceOfficialServiceImpl implements HighGasOilPriceOffici
JSONArray oilArray = resBody.getJSONArray("list");
for (Object oil : oilArray) {
JSONObject oilObject = (JSONObject) oil;
System.out.println();
SecRegion region = commonService.getRegionsByName(oilObject.getString("prov"));
if (region != 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