Compare commits

..

2 Commits

1 changed files with 33 additions and 10 deletions

View File

@ -3,6 +3,7 @@ package com.nflg.wms.admin.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.nflg.wms.admin.util.HtmlToImageUtil;
import com.nflg.wms.admin.util.PdfGeneratorUtil;
import com.nflg.wms.admin.util.QRCodeUtil;
@ -18,6 +19,7 @@ import com.nflg.wms.common.pojo.vo.QrCodeItemVO;
import com.nflg.wms.common.pojo.vo.QrCodeVO;
import com.nflg.wms.common.pojo.vo.StrappingVO;
import com.nflg.wms.common.util.NumberUtil;
import com.nflg.wms.common.util.StringUtil;
import com.nflg.wms.common.util.UserUtil;
import com.nflg.wms.common.util.VUtil;
import com.nflg.wms.repository.entity.WmsQrCodeMaster;
@ -43,10 +45,7 @@ import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@ -160,7 +159,7 @@ public class QrCodeMasterController extends BaseController {
}
/**
*
* 箱绑码
*
* @param request
* @return
@ -180,6 +179,18 @@ public class QrCodeMasterController extends BaseController {
List<WmsQrCodeMaster> smallQrCodeMasters = qrCodeMasterService.lambdaQuery()
.in(WmsQrCodeMaster::getBarcodeCode, request.getItems())
.list();
//校验批次号是否一致
String masterBatchNo = qrCodeMaster.getBatchNo();
Set<String> differentBatchNos = new HashSet<>();
for (WmsQrCodeMaster smallCode : smallQrCodeMasters) {
String smallBatchNo = smallCode.getBatchNo();
if (!Objects.equals(masterBatchNo, smallBatchNo)) {
differentBatchNos.add(smallCode.getBarcodeCode());
}
}
VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(differentBatchNos))
.throwMessage("批次号不一致,不一致的物料条码号为:" + differentBatchNos);
// 判断箱子的物料信息是否OK
smallBarcodeValidation(qrCodeMaster, smallQrCodeMasters, BarCodeProcessStage.Packaged);
// 修改小码的所属关系
@ -232,7 +243,7 @@ public class QrCodeMasterController extends BaseController {
}
/**
* 拆箱修改
* 换箱
* 针对仓库内的物料箱合并修改物料的箱属性和库存
* @param request
* @return
@ -259,6 +270,18 @@ public class QrCodeMasterController extends BaseController {
.list();
// 判断箱子的物料信息是否OK
smallBarcodeValidation(qrCodeMaster, smallQrCodeMasters, BarCodeProcessStage.InBound);
//校验批次号是否一致
String masterbatchNo = qrCodeMaster.getBatchNo();
Set<String> differentBatchNos = new HashSet<>();
for (WmsQrCodeMaster smallCode : smallQrCodeMasters) {
String smallBatchNo = smallCode.getBatchNo();
if (!Objects.equals(masterbatchNo, smallBatchNo)) {
differentBatchNos.add(smallCode.getBarcodeCode());
}
}
VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(differentBatchNos))
.throwMessage("批次号不一致,不一致的物料条码号为:" + differentBatchNos);
// 只有同一个工厂的同一个仓库的可以进行换箱
Integer count1 = qrCodeMasterService.lambdaQuery()
.eq(WmsQrCodeMaster::getFactoryCode, request.getFactoryCode())