From 0bcc9cb723a880f282965333edefa224061ec26d Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 19 Aug 2024 11:54:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD=EF=BC=88?= =?UTF-8?q?=E7=89=A9=E8=B5=84=E5=BA=93=E5=AD=98=E5=BD=95=E5=85=A5=E6=89=B9?= =?UTF-8?q?=E6=AC=A1=E5=8F=B7=E9=97=AE=E9=A2=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/service/inout/IoAddInoutService.java | 2 +- .../glxp/api/service/inv/impl/InvProductService.java | 11 ++++++++++- src/main/resources/application-dev.yml | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java index 5df46edc7..f9ce5fa6a 100644 --- a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java @@ -338,7 +338,7 @@ public class IoAddInoutService { //校验库存 for (IoOrderDetailBizEntity bizEntity : bizEntities) { if (StrUtil.isNotEmpty(bizEntity.getBatchNo())) { - List invProductEntities = invProductService.selectByRelId(bizEntity.getBindRlFk(), bizEntity.getSupId(), null, orderEntity.getInvCode()); + List invProductEntities = invProductService.selectByBatchNo(bizEntity.getBindRlFk(), bizEntity.getSupId(), null, orderEntity.getInvCode(), bizEntity.getBatchNo()); if (CollUtil.isNotEmpty(invProductEntities)) { int count = 0; for (InvProductEntity invProductEntity : invProductEntities) { diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvProductService.java b/src/main/java/com/glxp/api/service/inv/impl/InvProductService.java index 186c34be6..78fb47260 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvProductService.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvProductService.java @@ -48,7 +48,7 @@ public class InvProductService extends ServiceImpl().eq("relIdFk", relId) .eq(StrUtil.isNotBlank(batchNo), "batchNo", batchNo).isNull(StrUtil.isEmpty(batchNo), "batchNo") .eq("supId", supId) - .eq(StrUtil.isNotBlank(deptCode),"deptCode", deptCode) + .eq(StrUtil.isNotBlank(deptCode), "deptCode", deptCode) .eq("invCode", invCode) .eq(price != null, "price", price).isNull(price == null, "price").last("limit 1") ); @@ -62,6 +62,15 @@ public class InvProductService extends ServiceImpl selectByBatchNo(Long relId, String supId, String deptCode, String invCode, String batchNo) { + return invProductDao.selectList(new QueryWrapper().eq("relIdFk", relId) + .eq("supId", supId) + .eq(StrUtil.isNotEmpty(deptCode), "deptCode", deptCode) + .eq(StrUtil.isNotEmpty(batchNo), "batchNo", batchNo) + .eq("invCode", invCode).gt("reCount", 0).orderByAsc("inBatchNo") + ); + } + public InvProductEntity selectByUnique(Long relId, String batchNo, String supId) { return invProductDao.selectOne(new QueryWrapper().eq("relIdFk", relId).eq(StrUtil.isNotEmpty(batchNo), "batchNo", batchNo) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 087dbec16..a2ecc2dc9 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -4,7 +4,7 @@ server: spring: datasource: driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt2?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 hikari: