diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index 01ec3769..fff24cb9 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -125,6 +125,7 @@ public class HighGasController { // 原始油品价格 JSONArray originalOilPriceList = result.getJSONArray("oilPriceList"); + // 新油品价格 JSONArray newOilPriceList = new JSONArray(); @@ -139,7 +140,11 @@ public class HighGasController { // 油品国标价 * 最终优惠比例 price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_DOWN)); } - newOilPriceList.add(price); + + // 过滤油品,只保留汽油 + if (price.getInteger("oilType") == 1) { + newOilPriceList.add(price); + } } result.put("oilPriceList", newOilPriceList); diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java index bae704b1..1da76d92 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -76,6 +76,8 @@ public class HighGasSchedule { JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); + + // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo")); if (highGasOilPrice == null) { diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java index af0c4b7e..0dcb3775 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java @@ -18,11 +18,14 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService { @Override public void editGasOilPrice(HighGasOilPrice highGasOilPrice) { - if (highGasOilPrice.getId() != null) { - highGasOilPriceMapper.updateByPrimaryKey(highGasOilPrice); - } else { - highGasOilPriceMapper.insert(highGasOilPrice); + if (highGasOilPrice.getOilType() != null && highGasOilPrice.getOilType() == 1) { + if (highGasOilPrice.getId() != null) { + highGasOilPriceMapper.updateByPrimaryKey(highGasOilPrice); + } else { + highGasOilPriceMapper.insert(highGasOilPrice); + } } + } @Override