|
|
|
@ -192,7 +192,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
} |
|
|
|
// 获得该行 |
|
|
|
XSSFRow row = sheet.getRow(j); |
|
|
|
if (row.getCell(11) == null || StringUtils.isBlank(getStringCellValue(row, 11))) { |
|
|
|
if (row.getCell(13) == null || StringUtils.isBlank(getStringCellValue(row, 13))) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (row.getCell(0) == null ) { |
|
|
|
@ -201,25 +201,25 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
if (row.getCell(1) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的PO#不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(7) == null) { |
|
|
|
if (row.getCell(8) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的PN不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(9) == null) { |
|
|
|
if (row.getCell(11) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的Qty不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(11) == null) { |
|
|
|
if (row.getCell(13) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的CMC Invoice不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(13) == null) { |
|
|
|
if (row.getCell(15) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的Destination不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(15) == null) { |
|
|
|
if (row.getCell(17) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的Shipping Mode不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(19) == null) { |
|
|
|
if (row.getCell(21) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的Currency不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(20) == null) { |
|
|
|
if (row.getCell(22) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的TP不能为空!"); |
|
|
|
} |
|
|
|
// 为对象赋值 |
|
|
|
@ -236,41 +236,43 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
} |
|
|
|
task.setReadyDate(readDate); |
|
|
|
task.setCustomerPO(getStringCellValue(row, 1)); |
|
|
|
task.setSalesOrder(getStringCellValue(row, 2)); |
|
|
|
task.setLine(getStringCellValue(row, 3)); |
|
|
|
task.setVersion(getStringCellValue(row, 4)); |
|
|
|
task.setStatus(getStringCellValue(row, 5)); |
|
|
|
task.setFamily(getStringCellValue(row, 6)); |
|
|
|
task.setPn(getStringCellValue(row, 7)); |
|
|
|
task.setSalesOrder(getStringCellValue(row, 4)); |
|
|
|
task.setLine(getStringCellValue(row, 2)); |
|
|
|
task.setVersion(getStringCellValue(row, 3)); |
|
|
|
task.setSaleslt(getStringCellValue(row, 5)); |
|
|
|
task.setStatus(getStringCellValue(row, 6)); |
|
|
|
task.setFamily(getStringCellValue(row, 7)); |
|
|
|
task.setPn(getStringCellValue(row, 8)); |
|
|
|
List<PartData> parts = coDelMapper.getPartNo(site, task.getPn(), currentUser.getUsername(), inData.getBuNo()); |
|
|
|
if (parts.isEmpty()) { |
|
|
|
throw new RuntimeException("导入失败:物料:" + task.getPn() + "不存在!"); |
|
|
|
} |
|
|
|
task.setPartNo(parts.get(0).getPartNo()); |
|
|
|
task.setPartDescription(getStringCellValue(row, 8)); |
|
|
|
task.setQty(getNumericCellValueOrDefault(row, 9)); |
|
|
|
task.setPartDescription(getStringCellValue(row, 9)); |
|
|
|
task.setManufacturerName(getStringCellValue(row, 10)); |
|
|
|
task.setQty(getNumericCellValueOrDefault(row, 11)); |
|
|
|
if (task.getQty().compareTo(BigDecimal.ZERO)==0) { |
|
|
|
task.setStatus("取消发货"); |
|
|
|
} |
|
|
|
task.setLt(getNumericCellValueOrDefault(row, 10)); |
|
|
|
task.setCmcInvoice(getStringCellValue(row, 11)); |
|
|
|
task.setCmcComment(getStringCellValue(row, 12)); |
|
|
|
task.setDestination(getStringCellValue(row, 13)); |
|
|
|
task.setSaleType(getStringCellValue(row, 16)); |
|
|
|
task.setAwbBl(getStringCellValue(row, 17)); |
|
|
|
task.setShippingNumber(getStringCellValue(row, 14)); |
|
|
|
task.setShippingMode(getStringCellValue(row, 15)); |
|
|
|
task.setForwarderInfo(getStringCellValue(row, 18)); |
|
|
|
task.setCurrency(getStringCellValue(row, 19)); |
|
|
|
task.setTp(getNumericCellValueOrDefault(row, 20)); |
|
|
|
task.setTtlAmount(getNumericCellValueOrDefault(row, 21)); |
|
|
|
task.setVat(getNumericCellValueOrDefault(row, 22)); |
|
|
|
task.setSumPrice(getNumericCellValueOrDefault(row, 23)); |
|
|
|
task.setSo(getStringCellValue(row, 24)); |
|
|
|
task.setUpc(getStringCellValue(row, 25)); |
|
|
|
task.setRemark(getStringCellValue(row, 26)); |
|
|
|
task.setRoll(getNumericCellValueOrDefault(row, 27)); |
|
|
|
task.setCarton(Objects.requireNonNull(getNumericCellValueOrDefault(row, 28)).setScale(1, RoundingMode.HALF_UP)); |
|
|
|
task.setLt(getNumericCellValueOrDefault(row, 12)); |
|
|
|
task.setCmcInvoice(getStringCellValue(row, 13)); |
|
|
|
task.setCmcComment(getStringCellValue(row, 14)); |
|
|
|
task.setDestination(getStringCellValue(row, 15)); |
|
|
|
task.setSaleType(getStringCellValue(row, 18)); |
|
|
|
task.setAwbBl(getStringCellValue(row, 19)); |
|
|
|
task.setShippingNumber(getStringCellValue(row, 16)); |
|
|
|
task.setShippingMode(getStringCellValue(row, 17)); |
|
|
|
task.setForwarderInfo(getStringCellValue(row, 20)); |
|
|
|
task.setCurrency(getStringCellValue(row, 21)); |
|
|
|
task.setTp(getNumericCellValueOrDefault(row, 22)); |
|
|
|
task.setTtlAmount(getNumericCellValueOrDefault(row, 23)); |
|
|
|
task.setVat(getNumericCellValueOrDefault(row, 24)); |
|
|
|
task.setSumPrice(getNumericCellValueOrDefault(row, 25)); |
|
|
|
task.setSo(getStringCellValue(row, 26)); |
|
|
|
task.setUpc(getStringCellValue(row, 27)); |
|
|
|
task.setRemark(getStringCellValue(row, 28)); |
|
|
|
task.setRoll(getNumericCellValueOrDefault(row, 29)); |
|
|
|
task.setCarton(Objects.requireNonNull(getNumericCellValueOrDefault(row, 30)).setScale(1, RoundingMode.HALF_UP)); |
|
|
|
task.setErpFlag("N"); |
|
|
|
task.setNotifyStatus("已计划"); |
|
|
|
task.setUsername(inData.getUsername()); |
|
|
|
@ -1844,7 +1846,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
boolean isMiddleRow = (i == middleIndex); |
|
|
|
eorder.put("noCartons", isMiddleRow ? noCartons.setScale(0, RoundingMode.HALF_UP) : ""); |
|
|
|
eorder.put("gross_weight", isMiddleRow ? ((BigDecimal) list.get(m).get("gross_weight")).setScale(2, RoundingMode.HALF_UP) : ""); |
|
|
|
eorder.put("net_weight", isMiddleRow ? ((BigDecimal) list.get(m).get("gross_weight")).setScale(2, RoundingMode.HALF_UP) : ""); |
|
|
|
eorder.put("net_weight", isMiddleRow ? ((BigDecimal) list.get(m).get("net_weight")).setScale(2, RoundingMode.HALF_UP) : ""); |
|
|
|
eorder.put("rolls", ((BigDecimal)eorder.get("rolls")).setScale(0, RoundingMode.HALF_UP)); |
|
|
|
rolls = rolls.add(eorder.get("rolls") !=null?new BigDecimal(eorder.get("rolls").toString()):BigDecimal.valueOf(0.0)); |
|
|
|
EcssCoDelNotifyDetailData nodifyData = notifyDetailMap.get(partNo); |
|
|
|
@ -1996,7 +1998,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
template.addVar("quantity", ecHeader!=null?(totalPlt==0?ecHeader.getBoxQty()+"CTN("+ecHeader.getBoxQty()+"CTN)": |
|
|
|
totalPlt+"PLT("+ecHeader.getBoxQty()+"CTN)"):""); |
|
|
|
|
|
|
|
template.addVar("price", ttlAmount); |
|
|
|
template.addVar("price", ttlAmount.setScale(2, RoundingMode.HALF_UP)); |
|
|
|
template.addVar("total_qty", totalQty); |
|
|
|
template.addVar("net_weight", netWeight.setScale(2, RoundingMode.HALF_UP)); |
|
|
|
template.addVar("gross_weight", grossWeight.setScale(2, RoundingMode.HALF_UP)); |
|
|
|
|