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

dev-discount
袁野 3 years ago
commit c8f129252c
  1. 6
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  2. 2
      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,6 +97,11 @@ public class HighMerchantStoreController {
} }
Map<String, SecRegion> regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); 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) { if (regionMap.get("region").getRegionId().intValue() == 500100) {
highMerchantStore.setRegionId(regionMap.get("region").getParentId()); highMerchantStore.setRegionId(regionMap.get("region").getParentId());
@ -105,6 +110,7 @@ public class HighMerchantStoreController {
highMerchantStore.setRegionId(regionMap.get("region").getRegionId()); highMerchantStore.setRegionId(regionMap.get("region").getRegionId());
highMerchantStore.setRegionName(regionMap.get("region").getRegionName()); highMerchantStore.setRegionName(regionMap.get("region").getRegionName());
} }
}
if (highMerchantStore.getBrandId() != null) { if (highMerchantStore.getBrandId() != null) {
highMerchantStore.setBrandName(commonService.getDictionaryCodeName("MERCHANT_STORE_BRANCH", highMerchantStore.getBrandId().toString())); highMerchantStore.setBrandName(commonService.getDictionaryCodeName("MERCHANT_STORE_BRANCH", highMerchantStore.getBrandId().toString()));

@ -92,11 +92,13 @@ public class HighGasController {
if (region != null) { if (region != null) {
List<Map<String, Object>> storeList = highGasOilPriceService.getStoreListByOilNo(storeName,region.getRegionId(), oilNoName); List<Map<String, Object>> storeList = highGasOilPriceService.getStoreListByOilNo(storeName,region.getRegionId(), oilNoName);
for (Map<String, Object> store : storeList) { for (Map<String, Object> store : storeList) {
if (MapUtils.getInteger(store, "source_type").equals(1)) {
if (StringUtils.isNotBlank(MapUtils.getString(store, "store_logo"))) { if (StringUtils.isNotBlank(MapUtils.getString(store, "store_logo"))) {
store.put("store_logo", CommonSysConst.getSysConfig().getHsgDomainName() +"/filesystem/"+MapUtils.getString(store, "store_logo")); store.put("store_logo", CommonSysConst.getSysConfig().getHsgDomainName() +"/filesystem/"+MapUtils.getString(store, "store_logo"));
} else { } else {
store.put("store_logo", null); 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)); 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); 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.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价 // 加油补贴, 计算方式:团油枪价 - 团油VIP价
payPriceModel.setOilSubsidy(priceGun.subtract(priceVip)); payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));

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

@ -136,13 +136,15 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc
// 是否开通了账户 // 是否开通了账户
HighMerchantStoreAccount account = getStoreAccountDetail(storeId); HighMerchantStoreAccount account = getStoreAccountDetail(storeId);
if (account == null) { 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) { if (account.getAmounts().compareTo(amount) == -1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足");
} }
// 变更前金额 // 变更前金额
BigDecimal beforeAmount = account.getAmounts(); BigDecimal beforeAmount = account.getAmounts();
// 计算金额 // 计算金额

Loading…
Cancel
Save