diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index 8f0a2fe0..e5007e26 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -598,9 +598,9 @@ public class IoCodeTempController extends BaseController { if (IntUtil.value(priceFifo) > 0) { if (bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { //1.获取当前批次已出库数量 - Integer outCount = invProductDetailService.selectCountByInBatch(bussinessTypeEntity, exitLocalEntity.getInBatchNo(), ConstantType.TYPE_OUT); + Integer outCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(),ConstantType.TYPE_OUT); //2.获取当前批次入库数量 - Integer inCount = invProductDetailService.selectCountByInBatch(bussinessTypeEntity, exitLocalEntity.getInBatchNo(), ConstantType.TYPE_PUT); + Integer inCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(),exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT); if ((IntUtil.value(inCount) - IntUtil.value(outCount) - IntUtil.value(exitLocalEntity.getReCount())) < 0) { InvProductDetailEntity nextInvProduct = invProductDetailService.selectNextInBatch(bussinessTypeEntity, exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT, exitLocalEntity.getInBatchNo()); if (nextInvProduct != null) { @@ -610,6 +610,8 @@ public class IoCodeTempController extends BaseController { update = false; } } + +// checkPrice(); } } if (update) { diff --git a/src/main/java/com/glxp/api/dao/inv/InvPreInProductDetailDao.java b/src/main/java/com/glxp/api/dao/inv/InvPreInProductDetailDao.java index 879b3a42..245cdc5d 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvPreInProductDetailDao.java +++ b/src/main/java/com/glxp/api/dao/inv/InvPreInProductDetailDao.java @@ -61,7 +61,7 @@ public interface InvPreInProductDetailDao extends BaseMapperPlus= (outCount + extiReCount + codeTempEntity.getReCount())) { codeTempEntity.setPrice(lastList.get(0).getPrice()); diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailService.java b/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailService.java index b094d686..998e4184 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailService.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailService.java @@ -267,13 +267,13 @@ public class InvProductDetailService extends ServiceImpl + + AND relId = #{relId} + AND inBatchNo = #{inBatchNo} AND mainAction = #{mainAction} + + AND batchNo = #{batchNo} + + + AND batchNo is null + diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml index abb74020..6dc62b45 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml @@ -357,12 +357,21 @@ select sum(reCount) from inv_pre_product_detail + + AND relId = #{relId} + AND inBatchNo = #{inBatchNo} AND mainAction = #{mainAction} + + AND batchNo = #{batchNo} + + + AND batchNo is null + @@ -384,9 +393,7 @@ AND batchNo is null and inBatchNo > #{inBatchNo} - LIMIT 1 + LIMIT 1 - - diff --git a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml index 1adfd38b..64efea8d 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml @@ -461,12 +461,24 @@ select sum(reCount) from inv_product_detail + + AND relId = #{relId} + + + AND invCode = #{invCode} + AND inBatchNo = #{inBatchNo} AND mainAction = #{mainAction} + + AND batchNo = #{batchNo} + + + AND batchNo is null +