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