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 1/4] =?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)); From 37e3716f6a72861ce554f0c3614e62e06c5fec42 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 11 Jun 2024 10:47:30 +0800 Subject: [PATCH 2/4] =?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 --- .../java/com/bweb/controller/HighGasController.java | 2 +- .../service/impl/HighMerchantStoreServiceImpl.java | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java index dc4e0c4f..4b1a8a72 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -447,7 +447,7 @@ public class HighGasController { Map param = new HashMap<>(); param.put("type", 1); - param.put("sourceType", 1); + param.put("sourceType", "1,3"); param.put("status", 1); if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) { diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java index f359ca40..c85269dc 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java @@ -26,11 +26,9 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; -import java.util.Comparator; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; +import java.util.stream.IntStream; @Service("highMerchantStoreService") @@ -207,8 +205,11 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService { criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); } - if (MapUtils.getInteger(map, "sourceType") != null) { - criteria.andSourceTypeEqualTo(MapUtils.getInteger(map, "sourceType")); + if (StringUtils.isNotBlank(MapUtils.getString(map, "sourceType"))) { + List sourceType = Arrays.stream(MapUtils.getString(map, "sourceType").split(",")) + .flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed() + .collect(Collectors.toList()); + criteria.andSourceTypeIn(sourceType); } if (MapUtils.getLong(map, "companyId") != null) { From 38bf3e3d921e24d9dd351549256eb167baaa5b60 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 12 Jun 2024 13:58:21 +0800 Subject: [PATCH 3/4] =?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/impl/HighGasServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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")); From 57ca922a3cdcf07558344b56857f9bd3c322bc21 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 13 Jun 2024 10:13:13 +0800 Subject: [PATCH 4/4] =?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 --- .../java/com/bweb/controller/HighMerchantStoreController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java index b91ff548..9f718b53 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -128,7 +128,7 @@ public class HighMerchantStoreController { if (highMerchantStore.getType().equals(1) && StringUtils.isBlank(highMerchantStore.getStoreLogo())) { highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getGasDefaultOilStationImg()); } - if (highMerchantStore.getSourceType() == 7) { + if (highMerchantStore.getSourceType() != null && highMerchantStore.getSourceType() == 7) { highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getFileUrl() + highMerchantStore.getStoreLogo()); } highMerchantStore.setCreateTime(new Date());