From f6265b10fc3c7d068bd5ed299016b2a31646b1a2 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 30 May 2024 16:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hai/service/HighGasOilGunNoService.java | 6 ++++++ .../com/hai/service/impl/HighGasOilGunNoServiceImpl.java | 7 +++++++ .../main/java/com/hai/service/impl/HighGasServiceImpl.java | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java b/hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java index 0896bde2..63f6edd3 100644 --- a/hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java +++ b/hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java @@ -23,6 +23,12 @@ public interface HighGasOilGunNoService { */ HighGasOilGunNo getGunNoById(Long id); + /** + * 清除油号 + * @param storeId + */ + void cleanGunNo(Long storeId); + /** * 根据门店和抢号查询 * @param storeId diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java index a2383a4f..6cbb853a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java @@ -34,6 +34,13 @@ public class HighGasOilGunNoServiceImpl implements HighGasOilGunNoService { return gasOilGunNoMapper.selectByPrimaryKey(id); } + @Override + public void cleanGunNo(Long storeId) { + HighGasOilGunNoExample example = new HighGasOilGunNoExample(); + example.createCriteria().andStoreIdEqualTo(storeId); + gasOilGunNoMapper.deleteByExample(example); + } + @Override public HighGasOilGunNo getDetailByStoreAndGunNo(Long storeId, String gunNo) { HighGasOilGunNoExample example = new HighGasOilGunNoExample(); 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 cef7c97e..e5d2cb47 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 @@ -98,6 +98,8 @@ public class HighGasServiceImpl implements HighGasService { store.setUpdateTime(new Date()); highMerchantStoreService.updateMerchantStoreDetail(store); + gasOilGunNoService.cleanGunNo(store.getId()); + JSONArray oilPriceList = station.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); @@ -297,6 +299,8 @@ public class HighGasServiceImpl implements HighGasService { store.setUpdateTime(new Date()); highMerchantStoreService.updateMerchantStoreDetail(store); + gasOilGunNoService.cleanGunNo(store.getId()); + JSONArray oilPriceList = station.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); @@ -657,6 +661,8 @@ public class HighGasServiceImpl implements HighGasService { store.setUpdateTime(new Date()); highMerchantStoreService.updateMerchantStoreDetail(store); + gasOilGunNoService.cleanGunNo(store.getId()); + JSONArray oilPriceList = station.getJSONArray("oils"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));