中码和小码打印的部分bug修复
This commit is contained in:
parent
49e245b69b
commit
e72d1e3b66
|
|
@ -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.vo.DeliverNormalOrderVO;
|
||||
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.*;
|
||||
|
|
@ -36,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URL;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
|
@ -182,8 +184,10 @@ public class NormalOrderController extends BaseController {
|
|||
}
|
||||
|
||||
private String getSerialNumber(String serialNumber, int index) {
|
||||
if (Objects.isNull(serialNumber) || serialNumber.equals(""))
|
||||
return "";
|
||||
String[] serialNumbers = serialNumber.split(",");
|
||||
if (serialNumbers.length <= 0)
|
||||
if (serialNumbers.length <= 1)
|
||||
return serialNumber;
|
||||
else {
|
||||
return serialNumbers[index - 1];
|
||||
|
|
@ -441,6 +445,7 @@ public class NormalOrderController extends BaseController {
|
|||
.setPackagingType((short) 1)
|
||||
.setCreateUserId(UserUtil.getUserId())
|
||||
.setUnit("箱")
|
||||
.setQuantity(BigDecimal.valueOf(1.0))
|
||||
.setSupplierCode(it.getSupplierCode())
|
||||
.setSupplierId(it.getSupplierId())
|
||||
.setCreateUserName(UserUtil.getUserName())
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class QrCodeMasterController extends BaseController {
|
|||
.eq(WmsQrCodeMaster::getBarcodeCode, request.getBarcodeCode())
|
||||
.one();
|
||||
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())
|
||||
.throwMessage("此箱码已处于【" + BarCodeProcessStage.findByValue(qrCodeMaster.getProcessStage()).getDescription() + "】状态,不可以操作");
|
||||
List<WmsQrCodeMaster> smallQrCodeMasters = qrCodeMasterService.lambdaQuery()
|
||||
|
|
@ -115,24 +115,27 @@ public class QrCodeMasterController extends BaseController {
|
|||
.map(WmsQrCodeMaster::getBarcodeCode)
|
||||
.collect(Collectors.toSet())
|
||||
.size() != smallQrCodeMasters.size();
|
||||
VUtil.trueThrowBusinessError(!hasDuplicates).throwMessage("存在重复的二维码");
|
||||
VUtil.trueThrowBusinessError(hasDuplicates).throwMessage("存在重复的二维码");
|
||||
|
||||
Integer count11 = qrCodeMasterService.lambdaQuery()
|
||||
.eq(WmsQrCodeMaster::getParentBarcodeId, qrCodeMaster.getId())
|
||||
.count().intValue();
|
||||
VUtil.trueThrowBusinessError(count11 > 0).throwMessage("存在已装箱的二维码信息");
|
||||
// Integer count11 = qrCodeMasterService.lambdaQuery()
|
||||
// .eq(WmsQrCodeMaster::getParentBarcodeId, qrCodeMaster.getId())
|
||||
// .count().intValue();
|
||||
// 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(!barcodeCodes.get(0).equals(qrCodeMaster.getMaterialCode())).throwMessage("物料不匹配");
|
||||
VUtil.trueThrowBusinessError(materialCodes.size() > 1).throwMessage("此箱码中包含多中物料");
|
||||
VUtil.trueThrowBusinessError(!materialCodes.get(0).equals(qrCodeMaster.getMaterialCode())).throwMessage("物料不匹配");
|
||||
//判断小码中是否又被使用过了
|
||||
Integer count = qrCodeMasterService.lambdaQuery()
|
||||
.ne(WmsQrCodeMaster::getProcessStage, processStage.getState())
|
||||
.in(WmsQrCodeMaster::getBarcodeCode, barcodeCodes)
|
||||
.eq(WmsQrCodeMaster::getProcessStage, processStage.getState())
|
||||
.count().intValue();
|
||||
VUtil.trueThrowBusinessError(count > 0).throwMessage("此箱码中包含已使用的物料二维码");
|
||||
Integer count1 = qrCodeMasterService.lambdaQuery()
|
||||
.eq(WmsQrCodeMaster::getPackagingType, 0)
|
||||
.in(WmsQrCodeMaster::getBarcodeCode, barcodeCodes)
|
||||
.count().intValue();
|
||||
VUtil.trueThrowBusinessError(count1 > 0).throwMessage("存在箱子码");
|
||||
}
|
||||
|
|
@ -158,7 +161,7 @@ public class QrCodeMasterController extends BaseController {
|
|||
.in(WmsQrCodeMaster::getBarcodeCode, request.getItems())
|
||||
.list();
|
||||
// 判断箱子的物料信息是否OK
|
||||
smallBarcodeValidation(qrCodeMaster, smallQrCodeMasters, BarCodeProcessStage.Unpackaged);
|
||||
smallBarcodeValidation(qrCodeMaster, smallQrCodeMasters, BarCodeProcessStage.Packaged);
|
||||
// 修改小码的所属关系
|
||||
for (WmsQrCodeMaster smallQrCodeMaster : smallQrCodeMasters) {
|
||||
smallQrCodeMaster.setParentBarcodeId(qrCodeMaster.getId());
|
||||
|
|
@ -288,7 +291,6 @@ public class QrCodeMasterController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物料出入库统一扫码接口
|
||||
*
|
||||
|
|
|
|||
|
|
@ -160,7 +160,8 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
}
|
||||
)
|
||||
.toList();
|
||||
if (Objects.equals(request.getType(), 1)) {
|
||||
if (Objects.equals(request.getType(), 2)
|
||||
|| Objects.equals(request.getType(), 4) ) {
|
||||
datas.forEach(it -> {
|
||||
it.setBatchNo(NoUtil.getBatchNo(it.getSupplierNo()));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ public class SRMController extends BaseController {
|
|||
if (!inspect.getInspectionResult().equals("合格")) {
|
||||
isCheck = 2;
|
||||
}
|
||||
|
||||
qcReceiveService.lambdaUpdate()
|
||||
.eq(WmsQcReceive::getOrderNo, inspect.getNoteNum())
|
||||
.set(WmsQcReceive::getIsCheck, isCheck)
|
||||
|
|
|
|||
Loading…
Reference in New Issue