器械工位上货等相关问题修改

dev_no_inv
yewj 9 months ago committed by qyt
parent 8f26ee655a
commit 4fce78f9ad

@ -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();
}

@ -64,6 +64,13 @@ public class IoSplitFifoInvService extends ServiceImpl<IoSplitFifoInvMapper, IoS
ioSplitFifoCodeEntity.setUpdateTime(new Date());
ioSplitFifoCodeEntity.setBusType(busType);
splitFifoCodeService.updateById(ioSplitFifoCodeEntity);
IoSplitFifoInv splitFifoInv = findByFifoCode(ioSplitFifoCodeEntity);
if (splitFifoInv != null) {
splitFifoInv.setInCount(IntUtil.value(splitFifoInv.getInCount()) + IntUtil.value(codeEntity.getReCount()));
splitFifoInv.setReCount(IntUtil.value(splitFifoInv.getInCount()) - IntUtil.value(codeEntity.getReCount()));
splitFifoInv.setAvailableCount(IntUtil.value(splitFifoInv.getAvailableCount()) + IntUtil.value(ioSplitFifoCodeEntity.getTotalCount()));
updateById(splitFifoInv);
}
} else {
IoSplitFifoCodeEntity splitCodeEntity = new IoSplitFifoCodeEntity();
BeanUtils.copyProperties(codeEntity, splitCodeEntity);

@ -4,9 +4,9 @@ server:
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_ywj?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
jdbc-url: jdbc:p6spy:mysql://192.168.0.206:3306/udiwms81?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
password: Glxp@6066
hikari:
connection-timeout: 60000
maximum-pool-size: 20

Loading…
Cancel
Save