From 4fce78f9ad5c0c71f4388af88744c03f049dd808 Mon Sep 17 00:00:00 2001 From: yewj Date: Tue, 15 Oct 2024 11:59:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=99=A8=E6=A2=B0=E5=B7=A5=E4=BD=8D=E4=B8=8A?= =?UTF-8?q?=E8=B4=A7=E7=AD=89=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoCodeTempController.java | 70 ++++++++++--------- .../service/inout/IoSplitFifoInvService.java | 7 ++ src/main/resources/application-dev.yml | 4 +- 3 files changed, 47 insertions(+), 34 deletions(-) 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 d1e63f6ac..0c4b199e9 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -1,17 +1,25 @@ package com.glxp.api.controller.inout; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.glxp.api.annotation.CusRedissonAnnotation; import com.glxp.api.constant.*; import com.glxp.api.entity.basic.*; +import com.glxp.api.entity.collect.IoCollectCode; import com.glxp.api.entity.collect.IoCollectOrder; import com.glxp.api.entity.collect.IoCollectOrderOrigin; +import com.glxp.api.entity.inv.InvProductDetailEntity; +import com.glxp.api.exception.JsonException; import com.glxp.api.req.collect.CollectOrderBizRequest; import com.glxp.api.req.collect.CollectOrderRequest; import com.glxp.api.res.collect.CollectOrderBizResponse; import com.glxp.api.res.collect.IoCollectOrderResponse; +import com.glxp.api.res.inout.IoOrderDetailCodeResponse; import com.glxp.api.res.inout.VailCodeResultResponse; import com.glxp.api.service.collect.*; import com.glxp.api.service.inout.impl.IoCodeService; +import com.glxp.api.service.inv.impl.InvProductDetailService; +import org.aspectj.weaver.ast.Var; import org.springframework.beans.BeanUtils; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.IdUtil; @@ -34,6 +42,7 @@ import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.res.basic.UdiRlSupResponse; import com.glxp.api.res.inout.AddCodeResult; import com.glxp.api.res.inout.IoCodeTempResponse; +import com.glxp.api.res.inv.InvPlaceDetailResponse; import com.glxp.api.service.auth.InvWarehouseService; import com.glxp.api.service.basic.*; import com.glxp.api.service.inout.*; @@ -83,6 +92,8 @@ public class IoCodeTempController extends BaseController { @Resource InvPreinProductDetailService invPreinProductDetailService; @Resource + InvProductDetailService invProductDetailService; + @Resource IoCodeLostService codeLostService; @Resource IoOrderDetailBizService orderDetailBizService; @@ -808,7 +819,7 @@ public class IoCodeTempController extends BaseController { if (fifoCodeEntity != null && StrUtil.isNotEmpty(fifoCodeEntity.getSerialNo())) { return ResultVOUtils.error(533, "当前追溯码已存在!"); } - } else if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_RETURN)) { + } else { IoSplitFifoCodeEntity fifoCodeEntity = fifoCodeService.findByCode(code, addOrderRequest.getWorkPlaceCode()); if (fifoCodeEntity == null) { @@ -949,21 +960,19 @@ public class IoCodeTempController extends BaseController { String priceFifo = systemParamConfigService.selectValueByParamKey("price_fifo"); if (IntUtil.value(priceFifo) > 0) { if (bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { - // TODO: 2024/10/14 判断价格先进先出 - -// //1.获取当前批次已出库数量 -// Integer outCount = invProductServiceNew.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_OUT); -// //2.获取当前批次入库数量 -// Integer inCount = invProductServiceNew.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) { -// InvProductNewVo nextInvProduct = invProductServiceNew.selectNextInBatch(bussinessTypeEntity, exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT, exitLocalEntity.getInBatchNo()); -// if (nextInvProduct != null) { -// genDetaiEntity.setPrice(nextInvProduct.getPrice()); -// genDetaiEntity.setInBatchNo(nextInvProduct.getInBatchNo()); -// codeTempService.insert(genDetaiEntity); -// update = false; -// } -// } + //1.获取当前批次已出库数量 + Integer outCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_OUT); + //2.获取当前批次入库数量 + 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) { + genDetaiEntity.setPrice(nextInvProduct.getPrice()); + genDetaiEntity.setInBatchNo(nextInvProduct.getInBatchNo()); + codeTempService.insert(genDetaiEntity); + update = false; + } + } // checkPrice(); } @@ -1414,22 +1423,19 @@ public class IoCodeTempController extends BaseController { String priceFifo = systemParamConfigService.selectValueByParamKey("price_fifo"); if (IntUtil.value(priceFifo) > 0) { if (bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { - - - // TODO: 2024/10/14 价格先进先出 -// //1.获取当前批次已出库数量 -// Integer outCount = invProductServiceNew.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_OUT); -// //2.获取当前批次入库数量 -// Integer inCount = invProductServiceNew.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) { -// InvProductNewVo nextInvProduct = invProductServiceNew.selectNextInBatch(bussinessTypeEntity, exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT, exitLocalEntity.getInBatchNo()); -// if (nextInvProduct != null) { -// genDetaiEntity.setPrice(nextInvProduct.getPrice()); -// genDetaiEntity.setInBatchNo(nextInvProduct.getInBatchNo()); -// codeTempService.insert(genDetaiEntity); -// update = false; -// } -// } + //1.获取当前批次已出库数量 + Integer outCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_OUT); + //2.获取当前批次入库数量 + 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) { + genDetaiEntity.setPrice(nextInvProduct.getPrice()); + genDetaiEntity.setInBatchNo(nextInvProduct.getInBatchNo()); + codeTempService.insert(genDetaiEntity); + update = false; + } + } // checkPrice(); } diff --git a/src/main/java/com/glxp/api/service/inout/IoSplitFifoInvService.java b/src/main/java/com/glxp/api/service/inout/IoSplitFifoInvService.java index e2800d4df..62969be4a 100644 --- a/src/main/java/com/glxp/api/service/inout/IoSplitFifoInvService.java +++ b/src/main/java/com/glxp/api/service/inout/IoSplitFifoInvService.java @@ -64,6 +64,13 @@ public class IoSplitFifoInvService extends ServiceImpl