From afdcb8bed543763b18186ffc0c6727d7176c0ea6 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 31 Mar 2025 15:27:44 +0800 Subject: [PATCH] =?UTF-8?q?1.bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/DistributionStockArticleClient.java | 37 ++++++++++++++++--- .../report/mapper/ReportIncomingMapper.xml | 12 ++++++ .../controller/CarsLoadController.java | 3 ++ .../impl/TrunklineCarsLoadServiceImpl.java | 18 ++++++++- 4 files changed, 63 insertions(+), 7 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java index 6c950d0e8..3d51af06d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java @@ -38,6 +38,7 @@ import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.redis.cache.BladeRedis; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; @@ -59,8 +60,9 @@ public class DistributionStockArticleClient implements IDistributionStockArticle private final IDistributionStockArticleService distributionStockArticleService; private final IDistributionParcelListService distributionParcelListService; + private final BladeRedis bladeRedis; - @Override + @Override @GetMapping(TOP) public BladePage top(Integer current, Integer size) { Query query = new Query(); @@ -73,11 +75,36 @@ public class DistributionStockArticleClient implements IDistributionStockArticle @Override @PostMapping(API_PREFIX + "/addData") public Long addData(DistributionStockArticleEntity distributionStockArticleEntity) { - boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity); - if(saveFlag){ - return distributionStockArticleEntity.getId(); + + String orderCode = distributionStockArticleEntity.getOrderCode(); + Long warehouseId = distributionStockArticleEntity.getWarehouseId(); + + String key = orderCode + warehouseId; + + Boolean exists = bladeRedis.exists(key); + if(exists){ + String idStr = bladeRedis.get(key); + if("1".equals(idStr)){ + throw new CustomerException(405,"订单"+orderCode+"正在更新,请重新扫描"); + }else{ + return Long.valueOf(idStr); + } }else{ - return 0L; + DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); + if(ObjectUtils.isNotEmpty(distributionStockArticle)){ + bladeRedis.setEx(key,distributionStockArticle.getId(),30L); + return distributionStockArticle.getId(); + }else{ + bladeRedis.setEx(key,"1",30L); + + boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity); + if(saveFlag){ + bladeRedis.setEx(key,distributionStockArticle.getId(),30L); + return distributionStockArticleEntity.getId(); + }else{ + throw new CustomerException(405,"订单"+orderCode+"保存失败,请重新扫描"); + } + } } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml index 5aea8e6a4..927d2b628 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml @@ -958,6 +958,12 @@ and lww.settlement_status = #{param.settlementStatus} + + and lww.document_making_time >= #{param.startTime} + + + and lww.document_making_time <= #{param.endTime} + GROUP BY lww.id order by lww.create_time desc @@ -1251,6 +1257,12 @@ and lww.settlement_status = #{param.settlementStatus} + + and lww.document_making_time >= #{param.startTime} + + + and lww.document_making_time <= #{param.endTime} + GROUP BY lww.id order by lww.create_time desc diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java index 5310cf3b3..05bfa2752 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java @@ -1096,6 +1096,9 @@ public class CarsLoadController { carsLoadService.unloadByLoadId(loadCarsDTO); try{ + //同步一次系统无编码数据 + carsLoadService.syncNoSystemData(loadId, myCurrentWarehouse.getId(), myCurrentWarehouse.getName()); + carsLoadService.sendStationArrivedEnter(loadCarsDTO); }catch (Exception e){ diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 104582ce5..3e036ed13 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -1516,8 +1516,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl