From 005222859df2d1e2c44660abc61013f6833b5c09 Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Mon, 2 Dec 2024 10:42:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=A7=91=E5=AE=A4=E9=AB=98=E5=80=BC=E5=BA=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thrsys/ForThirdSysApiController.java | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/thrsys/ForThirdSysApiController.java b/src/main/java/com/glxp/api/controller/thrsys/ForThirdSysApiController.java index ea8be6e9d..cf015540f 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ForThirdSysApiController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ForThirdSysApiController.java @@ -126,22 +126,29 @@ public class ForThirdSysApiController { if (codeEntity == null) return ResultVOUtils.error("库存未找到该UDI码,请检查该UDI是否存在错误!"); } - //1.获取预验收库存 - InvWarehouseEntity preInInv = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_PREIN); - if (StrUtil.isNotEmpty(udiEntity.getSerialNo())) { - count = invPreinProductDetailService.vailStockCountByCode(null, preInInv.getCode(), null, filterInvProductRequest.getUdiCode()); - } else - count = invPreinProductDetailService.vailStockCount(checkUdi.getRelId(), udiEntity.getBatchNo(), null, null, preInInv.getCode(), null); - - if (count == 0) { - //2.获取寄售库存 - InvWarehouseEntity preInv = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_ADVANCE); - count = invPreProductDetailService.vailStockCount(checkUdi.getRelId(), udiEntity.getBatchNo(), null, null, preInv.getCode(), null); - } - if (count == 0) { - //3.获取入账库库存 - count = invProductDetailService.vailStockCount(checkUdi.getRelId(), udiEntity.getBatchNo(), null, null, filterInvProductRequest.getInvCode(), null, true); + + Integer purType = checkUdi.getPurType(); + if (purType != null && purType == 2) { + count = 1; + } else { + //1.获取预验收库存 + InvWarehouseEntity preInInv = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_PREIN); + if (StrUtil.isNotEmpty(udiEntity.getSerialNo())) { + count = invPreinProductDetailService.vailStockCountByCode(null, preInInv.getCode(), null, filterInvProductRequest.getUdiCode()); + } else + count = invPreinProductDetailService.vailStockCount(checkUdi.getRelId(), udiEntity.getBatchNo(), null, null, preInInv.getCode(), null); + + if (count == 0) { + //2.获取寄售库存 + InvWarehouseEntity preInv = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_ADVANCE); + count = invPreProductDetailService.vailStockCount(checkUdi.getRelId(), udiEntity.getBatchNo(), null, null, preInv.getCode(), null); + } + if (count == 0) { + //3.获取入账库库存 + count = invProductDetailService.vailStockCount(checkUdi.getRelId(), udiEntity.getBatchNo(), null, null, filterInvProductRequest.getInvCode(), null, true); + } } + InvProductResponse invProductResponse = new InvProductResponse(); BeanUtil.copyProperties(checkUdi, invProductResponse); invProductResponse.setThrCode(checkUdi.getThirdId());