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));