|
|
|
|
@ -218,10 +218,10 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
throw new ServiceException("入库单-物料不存在");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查是否已经打印过
|
|
|
|
|
BigDecimal printed = detail.getPrintedNum() != null ? detail.getPrintedNum() : BigDecimal.ZERO;
|
|
|
|
|
BigDecimal remaining = detail.getInstockQty().subtract(printed);
|
|
|
|
|
if (remaining.compareTo(BigDecimal.ONE) < 0) {// 剩余数量小于1时无法打印
|
|
|
|
|
throw new ServiceException("无剩余数量可打印");
|
|
|
|
|
if (printed.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
throw new ServiceException("该入库单已经打印过,不允许重复打印");
|
|
|
|
|
}
|
|
|
|
|
int splitInt = bo.getSplitPackageCount() != null ? bo.getSplitPackageCount() : 1;
|
|
|
|
|
BigDecimal split = BigDecimal.valueOf(splitInt);
|
|
|
|
|
@ -255,13 +255,13 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
String order = baseOrder + String.format("%03d", i);
|
|
|
|
|
String batchCode = generateBatchCode(bo, bo.getBatchCode(), order);
|
|
|
|
|
|
|
|
|
|
BigDecimal currentPackageQty = BigDecimal.valueOf(packageQtyList.get(i - 1));
|
|
|
|
|
BigDecimal currentPackageQty = BigDecimal.valueOf(packageQtyList.get(i - 1)); // 当前包的物料数量
|
|
|
|
|
|
|
|
|
|
WmsInstockPrint print = new WmsInstockPrint();
|
|
|
|
|
BeanUtils.copyProperties(bo, print);
|
|
|
|
|
print.setBatchCode(batchCode);
|
|
|
|
|
print.setApportionQty(currentPackageQty);
|
|
|
|
|
print.setMaterialQty(1L); // 每个包打印1份
|
|
|
|
|
print.setApportionQty(BigDecimal.ONE); // 打印的包数:1包
|
|
|
|
|
print.setMaterialQty(currentPackageQty.longValue()); // 每包的物料数量
|
|
|
|
|
print.setInboundStatus("0"); // 入库状态(0-待入库,1-已入库,2-入库中)
|
|
|
|
|
print.setCreateBy(LoginHelper.getUsername());
|
|
|
|
|
print.setCreateTime(new Date());
|
|
|
|
|
@ -282,13 +282,13 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
WmsInstockPrint print = new WmsInstockPrint();
|
|
|
|
|
BeanUtils.copyProperties(bo, print);
|
|
|
|
|
print.setBatchCode(batchCode);
|
|
|
|
|
print.setApportionQty(remaining);
|
|
|
|
|
print.setMaterialQty(copies.longValue()); // 转换为Long
|
|
|
|
|
print.setApportionQty(copies); // 打印的包数(打印份数)
|
|
|
|
|
print.setMaterialQty(detail.getInstockQty().longValue()); // 每包的物料数量(全部入库数量)
|
|
|
|
|
print.setInboundStatus("0");//入库状态(0-待入库,1-已入库,2-入库中)
|
|
|
|
|
|
|
|
|
|
wmsInstockPrintService.insertWmsInstockPrint(print);
|
|
|
|
|
|
|
|
|
|
totalPackaged = remaining;
|
|
|
|
|
totalPackaged = detail.getInstockQty(); // 全部入库数量都被打印
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新 printedNum
|
|
|
|
|
|