From c86438917a58c3b0bc12fc579dfc580022bf688d Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Fri, 23 May 2025 14:10:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E8=A3=85=E7=AE=B1=E6=9C=AA?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E7=89=A9=E6=96=99=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=97=B6=E5=BC=B9=E5=87=BA=E5=85=B7=E4=BD=93=E7=9A=84?= =?UTF-8?q?=E7=89=A9=E6=96=99=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ecss/service/impl/CoDelServiceImpl.java | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java b/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java index 9741cd6e..3551ae69 100644 --- a/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java @@ -156,7 +156,8 @@ public class CoDelServiceImpl implements CoDelService { boolean isEmptyRow = true; if (row != null) { for (Cell cell : row) { - if (cell.getCellType() != CellType.BLANK) { + if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR && + !StringUtils.isBlank(String.valueOf(cell))) { isEmptyRow = false; break; } @@ -175,37 +176,37 @@ public class CoDelServiceImpl implements CoDelService { // 获得该行 XSSFRow row = sheet.getRow(j); if (row.getCell(0) == null ) { - throw new RuntimeException("第" + j + "行的Ready Date不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的Ready Date不能为空!"); } if (row.getCell(1) == null || StringUtils.isBlank(String.valueOf(row.getCell(1)))) { - throw new RuntimeException("第" + j + "行的Customer Code不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的Customer Code不能为空!"); } if (row.getCell(3) == null) { - throw new RuntimeException("第" + j + "行的PO#不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的PO#不能为空!"); } /* if (row.getCell(3) == null) { throw new RuntimeException("第" + j + "行的SalesOrder不能为空!"); }*/ if (row.getCell(9) == null) { - throw new RuntimeException("第" + j + "行的PN不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的PN不能为空!"); } if (row.getCell(11) == null) { - throw new RuntimeException("第" + j + "行的Qty不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的Qty不能为空!"); } if (row.getCell(13) == null) { - throw new RuntimeException("第" + j + "行的CMC Invoice不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的CMC Invoice不能为空!"); } if (row.getCell(15) == null) { - throw new RuntimeException("第" + j + "行的Destination不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的Destination不能为空!"); } if (row.getCell(19) == null) { - throw new RuntimeException("第" + j + "行的Shipping Mode不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的Shipping Mode不能为空!"); } if (row.getCell(21) == null) { - throw new RuntimeException("第" + j + "行的Currency不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的Currency不能为空!"); } if (row.getCell(22) == null) { - throw new RuntimeException("第" + j + "行的TP不能为空!"); + throw new RuntimeException("第" + (j+1) + "行的TP不能为空!"); } List customerInfo = coDelMapper.getCustomerInfo(null, getStringCellValue(row, 1)); if (customerInfo.isEmpty()) { @@ -222,7 +223,7 @@ public class CoDelServiceImpl implements CoDelService { String date = getStringCellValue(row, 0); readDate = DateUtils.getDateByParten(date, "yyyy-MM-dd"); } catch (ParseException e) { - throw new RuntimeException("第" + j + "行的ReadyDate格式有误!"); + throw new RuntimeException("第" + (j+1) + "行的ReadyDate格式有误!"); } task.setReadyDate(readDate); task.setCustomerPO(getStringCellValue(row, 3)); @@ -724,7 +725,8 @@ public class CoDelServiceImpl implements CoDelService { boolean isEmptyRow = true; if (row != null) { for (Cell cell : row) { - if (cell.getCellType() != CellType.BLANK) { + if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR && + !StringUtils.isBlank(String.valueOf(cell))) { isEmptyRow = false; break; } @@ -2103,18 +2105,23 @@ public class CoDelServiceImpl implements CoDelService { } int seq = 0; int seqNo = coDelMapper.getCoDelPalletHeaderSeqNo(inData); + StringBuilder partNos = new StringBuilder(); for (String partNo : palletItemMap.keySet()) { List partList = coDelMapper.getPartInfo(inData.getSite(),partNo); - /* List packageDataList = coDelMapper.getPackage(inData.getSite(),inData.getBuNo(),partList.get(0).getPackageNo()); - if (packageDataList.isEmpty()) { - throw new RuntimeException("物料["+partList.get(0).getSku()+"]未维护包装箱信息!"); - }*/ PartSubPropertiesValueData propertiesRollQty = partNoAndItemNoMap.get(partNo + "$ROLLQTY");//每卷数量 PartSubPropertiesValueData propertiesBoxRolls = partNoAndItemNoMap.get(partNo + "$BOXROLLS");//每箱卷数 PartSubPropertiesValueData propertiesBoxWeight = partNoAndItemNoMap.get(partNo + "$BOXWEIGHT");//箱重量 if (propertiesRollQty==null||propertiesBoxRolls==null||propertiesBoxWeight==null) { - throw new RuntimeException("请先维护物料["+partList.get(0).getSku()+"]基本信息!"); + partNos.append(partList.get(0).getSku()).append(" "); } + } + if (!StringUtils.isBlank(partNos.toString())) { + throw new RuntimeException("请先维护物料["+partNos+"]基本信息(每卷数量、每箱卷数、箱重量)!"); + } + for (String partNo : palletItemMap.keySet()) { + PartSubPropertiesValueData propertiesRollQty = partNoAndItemNoMap.get(partNo + "$ROLLQTY");//每卷数量 + PartSubPropertiesValueData propertiesBoxRolls = partNoAndItemNoMap.get(partNo + "$BOXROLLS");//每箱卷数 + PartSubPropertiesValueData propertiesBoxWeight = partNoAndItemNoMap.get(partNo + "$BOXWEIGHT");//箱重量 EcssCoDelPalletHeaderData headerData = new EcssCoDelPalletHeaderData(); BeanUtils.copyProperties(inData, headerData); headerData.setSeqNo(seqNo+seq);