diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java index 0942b606..11de5822 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java @@ -114,7 +114,7 @@ public class HighGasServiceImpl implements HighGasService { highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")); highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")); highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount")); - + highGasOilPrice.setPreferentialMargin(new BigDecimal("0")); // 油品类型 1:汽油:2:柴油;3:天然气 if (oilPriceObject.getString("goodsGroupType").equals("GASOLINE")) { highGasOilPrice.setOilType(1); @@ -146,11 +146,12 @@ public class HighGasServiceImpl implements HighGasService { } } else { + highGasOilPrice.setPreferentialMargin(highGasOilPrice.getPreferentialMargin()!=null?highGasOilPrice.getPreferentialMargin():new BigDecimal("0")); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("goodsCode")); highGasOilPrice.setOilNoName(oilPriceObject.getString("goodsCode") + "#"); highGasOilPrice.setGasStationDrop(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount").subtract(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"))); - highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")); + highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount").subtract(highGasOilPrice.getPreferentialMargin())); highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")); highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount"));