中码和小码打印的部分bug修复

This commit is contained in:
zhangke 2026-03-10 10:45:33 +08:00
parent 49e245b69b
commit e72d1e3b66
4 changed files with 22 additions and 15 deletions

View File

@ -17,6 +17,7 @@ import com.nflg.wms.common.pojo.dto.SAPOrderDTO;
import com.nflg.wms.common.pojo.qo.*; import com.nflg.wms.common.pojo.qo.*;
import com.nflg.wms.common.pojo.vo.DeliverNormalOrderVO; import com.nflg.wms.common.pojo.vo.DeliverNormalOrderVO;
import com.nflg.wms.common.util.NumberUtil; 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.UserUtil;
import com.nflg.wms.common.util.VUtil; import com.nflg.wms.common.util.VUtil;
import com.nflg.wms.repository.entity.*; import com.nflg.wms.repository.entity.*;
@ -36,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.net.URL; import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
@ -182,8 +184,10 @@ public class NormalOrderController extends BaseController {
} }
private String getSerialNumber(String serialNumber, int index) { private String getSerialNumber(String serialNumber, int index) {
if (Objects.isNull(serialNumber) || serialNumber.equals(""))
return "";
String[] serialNumbers = serialNumber.split(","); String[] serialNumbers = serialNumber.split(",");
if (serialNumbers.length <= 0) if (serialNumbers.length <= 1)
return serialNumber; return serialNumber;
else { else {
return serialNumbers[index - 1]; return serialNumbers[index - 1];
@ -441,6 +445,7 @@ public class NormalOrderController extends BaseController {
.setPackagingType((short) 1) .setPackagingType((short) 1)
.setCreateUserId(UserUtil.getUserId()) .setCreateUserId(UserUtil.getUserId())
.setUnit("") .setUnit("")
.setQuantity(BigDecimal.valueOf(1.0))
.setSupplierCode(it.getSupplierCode()) .setSupplierCode(it.getSupplierCode())
.setSupplierId(it.getSupplierId()) .setSupplierId(it.getSupplierId())
.setCreateUserName(UserUtil.getUserName()) .setCreateUserName(UserUtil.getUserName())

View File

@ -76,7 +76,7 @@ public class QrCodeMasterController extends BaseController {
.eq(WmsQrCodeMaster::getBarcodeCode, request.getBarcodeCode()) .eq(WmsQrCodeMaster::getBarcodeCode, request.getBarcodeCode())
.one(); .one();
VUtil.trueThrowBusinessError(ObjectUtil.isNull(qrCodeMaster)).throwMessage("无效码"); VUtil.trueThrowBusinessError(ObjectUtil.isNull(qrCodeMaster)).throwMessage("无效码");
VUtil.trueThrowBusinessError(!qrCodeMaster.getPackagingType().equals(1)).throwMessage("此码不属于箱码"); VUtil.trueThrowBusinessError(qrCodeMaster.getPackagingType()!=1).throwMessage("此码不属于箱码");
VUtil.trueThrowBusinessError(qrCodeMaster.getProcessStage() != BarCodeProcessStage.Unpackaged.getState()) VUtil.trueThrowBusinessError(qrCodeMaster.getProcessStage() != BarCodeProcessStage.Unpackaged.getState())
.throwMessage("此箱码已处于【" + BarCodeProcessStage.findByValue(qrCodeMaster.getProcessStage()).getDescription() + "】状态,不可以操作"); .throwMessage("此箱码已处于【" + BarCodeProcessStage.findByValue(qrCodeMaster.getProcessStage()).getDescription() + "】状态,不可以操作");
List<WmsQrCodeMaster> smallQrCodeMasters = qrCodeMasterService.lambdaQuery() List<WmsQrCodeMaster> smallQrCodeMasters = qrCodeMasterService.lambdaQuery()
@ -115,24 +115,27 @@ public class QrCodeMasterController extends BaseController {
.map(WmsQrCodeMaster::getBarcodeCode) .map(WmsQrCodeMaster::getBarcodeCode)
.collect(Collectors.toSet()) .collect(Collectors.toSet())
.size() != smallQrCodeMasters.size(); .size() != smallQrCodeMasters.size();
VUtil.trueThrowBusinessError(!hasDuplicates).throwMessage("存在重复的二维码"); VUtil.trueThrowBusinessError(hasDuplicates).throwMessage("存在重复的二维码");
Integer count11 = qrCodeMasterService.lambdaQuery() // Integer count11 = qrCodeMasterService.lambdaQuery()
.eq(WmsQrCodeMaster::getParentBarcodeId, qrCodeMaster.getId()) // .eq(WmsQrCodeMaster::getParentBarcodeId, qrCodeMaster.getId())
.count().intValue(); // .count().intValue();
VUtil.trueThrowBusinessError(count11 > 0).throwMessage("存在已装箱的二维码信息"); // VUtil.trueThrowBusinessError(count11 > 0).throwMessage("存在已装箱的二维码信息");
List<String> barcodeCodes = smallQrCodeMasters.stream().map(WmsQrCodeMaster::getMaterialCode).distinct().toList(); List<String> materialCodes = smallQrCodeMasters.stream().map(WmsQrCodeMaster::getMaterialCode).distinct().toList();
List<String> barcodeCodes = smallQrCodeMasters.stream().map(WmsQrCodeMaster::getBarcodeCode).distinct().toList();
//判断中码和小码的物料是否为同一个物料 //判断中码和小码的物料是否为同一个物料
VUtil.trueThrowBusinessError(barcodeCodes.size() > 1).throwMessage("此箱码中包含多中物料"); VUtil.trueThrowBusinessError(materialCodes.size() > 1).throwMessage("此箱码中包含多中物料");
VUtil.trueThrowBusinessError(!barcodeCodes.get(0).equals(qrCodeMaster.getMaterialCode())).throwMessage("物料不匹配"); VUtil.trueThrowBusinessError(!materialCodes.get(0).equals(qrCodeMaster.getMaterialCode())).throwMessage("物料不匹配");
//判断小码中是否又被使用过了 //判断小码中是否又被使用过了
Integer count = qrCodeMasterService.lambdaQuery() Integer count = qrCodeMasterService.lambdaQuery()
.ne(WmsQrCodeMaster::getProcessStage, processStage.getState()) .in(WmsQrCodeMaster::getBarcodeCode, barcodeCodes)
.eq(WmsQrCodeMaster::getProcessStage, processStage.getState())
.count().intValue(); .count().intValue();
VUtil.trueThrowBusinessError(count > 0).throwMessage("此箱码中包含已使用的物料二维码"); VUtil.trueThrowBusinessError(count > 0).throwMessage("此箱码中包含已使用的物料二维码");
Integer count1 = qrCodeMasterService.lambdaQuery() Integer count1 = qrCodeMasterService.lambdaQuery()
.eq(WmsQrCodeMaster::getPackagingType, 0) .eq(WmsQrCodeMaster::getPackagingType, 0)
.in(WmsQrCodeMaster::getBarcodeCode, barcodeCodes)
.count().intValue(); .count().intValue();
VUtil.trueThrowBusinessError(count1 > 0).throwMessage("存在箱子码"); VUtil.trueThrowBusinessError(count1 > 0).throwMessage("存在箱子码");
} }
@ -158,7 +161,7 @@ public class QrCodeMasterController extends BaseController {
.in(WmsQrCodeMaster::getBarcodeCode, request.getItems()) .in(WmsQrCodeMaster::getBarcodeCode, request.getItems())
.list(); .list();
// 判断箱子的物料信息是否OK // 判断箱子的物料信息是否OK
smallBarcodeValidation(qrCodeMaster, smallQrCodeMasters, BarCodeProcessStage.Unpackaged); smallBarcodeValidation(qrCodeMaster, smallQrCodeMasters, BarCodeProcessStage.Packaged);
// 修改小码的所属关系 // 修改小码的所属关系
for (WmsQrCodeMaster smallQrCodeMaster : smallQrCodeMasters) { for (WmsQrCodeMaster smallQrCodeMaster : smallQrCodeMasters) {
smallQrCodeMaster.setParentBarcodeId(qrCodeMaster.getId()); smallQrCodeMaster.setParentBarcodeId(qrCodeMaster.getId());
@ -288,7 +291,6 @@ public class QrCodeMasterController extends BaseController {
} }
/** /**
* 物料出入库统一扫码接口 * 物料出入库统一扫码接口
* *

View File

@ -160,7 +160,8 @@ public class StructuralPackageOrderController extends BaseController {
} }
) )
.toList(); .toList();
if (Objects.equals(request.getType(), 1)) { if (Objects.equals(request.getType(), 2)
|| Objects.equals(request.getType(), 4) ) {
datas.forEach(it -> { datas.forEach(it -> {
it.setBatchNo(NoUtil.getBatchNo(it.getSupplierNo())); it.setBatchNo(NoUtil.getBatchNo(it.getSupplierNo()));
}); });

View File

@ -175,7 +175,6 @@ public class SRMController extends BaseController {
if (!inspect.getInspectionResult().equals("合格")) { if (!inspect.getInspectionResult().equals("合格")) {
isCheck = 2; isCheck = 2;
} }
qcReceiveService.lambdaUpdate() qcReceiveService.lambdaUpdate()
.eq(WmsQcReceive::getOrderNo, inspect.getNoteNum()) .eq(WmsQcReceive::getOrderNo, inspect.getNoteNum())
.set(WmsQcReceive::getIsCheck, isCheck) .set(WmsQcReceive::getIsCheck, isCheck)