diff --git a/src/main/java/com/xujie/sys/common/utils/ExcelTemplate.java b/src/main/java/com/xujie/sys/common/utils/ExcelTemplate.java index d6451454..bf78b11e 100644 --- a/src/main/java/com/xujie/sys/common/utils/ExcelTemplate.java +++ b/src/main/java/com/xujie/sys/common/utils/ExcelTemplate.java @@ -320,7 +320,9 @@ public class ExcelTemplate { // 设置千分位格式 DataFormat dataFormat = workbook.createDataFormat(); - style7.setDataFormat(i==6?dataFormat.getFormat("#,##0.0"):dataFormat.getFormat("#,##0.00")); + style7.setDataFormat(i==6?dataFormat.getFormat("#,##0"): + i==7?dataFormat.getFormat("#,##0.00000") + :dataFormat.getFormat("#,##0.00")); c7.setCellStyle(style7); } @@ -360,11 +362,14 @@ public class ExcelTemplate { style7.setVerticalAlignment(VerticalAlignment.TOP); style7.setAlignment(HorizontalAlignment.RIGHT); - // 设置千分位格式 - DataFormat dataFormat = workbook.createDataFormat(); - style7.setDataFormat(dataFormat.getFormat("#,##0.0")); - + if (i==4 || i==5 || i==8) { + DataFormat dataFormat = workbook.createDataFormat(); + style7.setDataFormat(dataFormat.getFormat("#,##0")); + } else { + DataFormat dataFormat = workbook.createDataFormat(); + style7.setDataFormat(dataFormat.getFormat("#,##0.00")); + } c7.setCellStyle(style7); } @@ -406,7 +411,7 @@ public class ExcelTemplate { style7.setAlignment(HorizontalAlignment.RIGHT); // 设置千分位格式 DataFormat dataFormat = workbook.createDataFormat(); - style7.setDataFormat(i==6?dataFormat.getFormat("#,##0.0"):dataFormat.getFormat("#,##0.00")); + style7.setDataFormat(i==6?dataFormat.getFormat("#,##0"):dataFormat.getFormat("#,##0.00")); c7.setCellStyle(style7); } } 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 71d8d1ce..ac3b824e 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 @@ -275,12 +275,15 @@ public class CoDelServiceImpl implements CoDelService { } // 获得该行 XSSFRow row = sheet.getRow(j); - if (row.getCell(18) != null && getStringCellValue(row, 18).equals("内销")) { + if (row==null) { continue; } if (row.getCell(13) == null || StringUtils.isBlank(getStringCellValue(row, 13))) { continue; } + if (row.getCell(18) != null && getStringCellValue(row, 18).equals("内销")) { + continue; + } if (row.getCell(0) == null ) { throw new RuntimeException("第" + (j+1) + "行的Ready Date不能为空!"); } @@ -500,6 +503,7 @@ public class CoDelServiceImpl implements CoDelService { } catch (NumberFormatException e) { throw new RuntimeException("无效的数值格式: " + cell.getStringCellValue()); } + default:return null; } default: throw new RuntimeException("不支持的单元格类型: " + cell.getCellType()); @@ -934,7 +938,7 @@ public class CoDelServiceImpl implements CoDelService { // 获得该行 XSSFRow row = sheet.getRow(j); if (row.getCell(1) != null && !inData.getCmcInvoice().equals(row.getCell(1).getStringCellValue())) { - throw new RuntimeException("第" + j + "行的发票号与发货通知单的发票号不一致!"); + continue; } if (row.getCell(6) == null) { throw new RuntimeException("第" + j + "行的PN不能为空!"); @@ -2023,14 +2027,17 @@ public class CoDelServiceImpl implements CoDelService { String plt = "CTN"; if (!palletHeaderDataList.isEmpty()) { plt = "PLT"; + } else { + totalPlt = totalQty; } template.addVar("total_plt", totalPlt+plt); template.addVar("total:", "total:"); template.addVar("madein", stringInput(data.getOrigin())); template.addVar("shippingNo", "shipping no"); template.addVar("sp_cmc_invoice", notifyHeader.getCmcInvoice()); - template.addVar("pallet_weight_name", "pallet weight:"); - template.addVar("pallet_weight", palletWeight.setScale(0, RoundingMode.HALF_UP)); + // 如果palletWeight==0,不显示 + template.addVar("pallet_weight_name", palletWeight.compareTo(BigDecimal.ZERO)==0?"":"pallet weight:"); + template.addVar("pallet_weight", palletWeight.compareTo(BigDecimal.ZERO)==0?"":palletWeight.setScale(0, RoundingMode.HALF_UP)); } // 孟加拉需要的 if (data.getMaterial()!=null && data.getMaterial()) { diff --git a/src/main/resources/mapper/ecss/CoDelMapper.xml b/src/main/resources/mapper/ecss/CoDelMapper.xml index dd65579c..57520e50 100644 --- a/src/main/resources/mapper/ecss/CoDelMapper.xml +++ b/src/main/resources/mapper/ecss/CoDelMapper.xml @@ -1163,6 +1163,14 @@ left join ecss_CoDelNotifyHeader noHeader on a.site=noHeader.site and a.delNo=no cnative, overseasShipper FROM ecss_Customer_template + + + AND template_name like '%'+#{templateName}+'%' + + + AND customer_name like '%'+#{customerName}+'%' + + ORDER BY template_name diff --git a/src/main/resources/templates/declaration-all-seal-template.xlsx b/src/main/resources/templates/declaration-all-seal-template.xlsx index b0075110..4f6ee4dd 100644 Binary files a/src/main/resources/templates/declaration-all-seal-template.xlsx and b/src/main/resources/templates/declaration-all-seal-template.xlsx differ diff --git a/src/main/resources/templates/declaration-all-template.xlsx b/src/main/resources/templates/declaration-all-template.xlsx index e1d2e294..d82863f5 100644 Binary files a/src/main/resources/templates/declaration-all-template.xlsx and b/src/main/resources/templates/declaration-all-template.xlsx differ diff --git a/src/main/resources/templates/declaration-all2-template.xlsx b/src/main/resources/templates/declaration-all2-template.xlsx index fea1ff7a..4d3454b1 100644 Binary files a/src/main/resources/templates/declaration-all2-template.xlsx and b/src/main/resources/templates/declaration-all2-template.xlsx differ diff --git a/src/main/resources/templates/declaration-elements-template.xlsx b/src/main/resources/templates/declaration-elements-template.xlsx index 425ab895..e3cf75ef 100644 Binary files a/src/main/resources/templates/declaration-elements-template.xlsx and b/src/main/resources/templates/declaration-elements-template.xlsx differ diff --git a/src/main/resources/templates/declaration-invoice-seal-template.xlsx b/src/main/resources/templates/declaration-invoice-seal-template.xlsx index 27a2074c..a8887c74 100644 Binary files a/src/main/resources/templates/declaration-invoice-seal-template.xlsx and b/src/main/resources/templates/declaration-invoice-seal-template.xlsx differ diff --git a/src/main/resources/templates/declaration-invoice-template.xlsx b/src/main/resources/templates/declaration-invoice-template.xlsx index 9dad6003..eb0d0136 100644 Binary files a/src/main/resources/templates/declaration-invoice-template.xlsx and b/src/main/resources/templates/declaration-invoice-template.xlsx differ diff --git a/src/main/resources/templates/declaration-invoice2-template.xlsx b/src/main/resources/templates/declaration-invoice2-template.xlsx index 300956c2..cf3dc946 100644 Binary files a/src/main/resources/templates/declaration-invoice2-template.xlsx and b/src/main/resources/templates/declaration-invoice2-template.xlsx differ diff --git a/src/main/resources/templates/declaration-packingList-template.xlsx b/src/main/resources/templates/declaration-packingList-template.xlsx index 0ecc35e9..f740185b 100644 Binary files a/src/main/resources/templates/declaration-packingList-template.xlsx and b/src/main/resources/templates/declaration-packingList-template.xlsx differ diff --git a/src/main/resources/templates/declaration-packingList2-template.xlsx b/src/main/resources/templates/declaration-packingList2-template.xlsx index 6478588c..01d4be76 100644 Binary files a/src/main/resources/templates/declaration-packingList2-template.xlsx and b/src/main/resources/templates/declaration-packingList2-template.xlsx differ diff --git a/src/main/resources/templates/declaration-template.xlsx b/src/main/resources/templates/declaration-template.xlsx index 53ab1f5f..8543cd88 100644 Binary files a/src/main/resources/templates/declaration-template.xlsx and b/src/main/resources/templates/declaration-template.xlsx differ diff --git a/src/main/resources/templates/export-goods-template.xlsx b/src/main/resources/templates/export-goods-template.xlsx index b366a63e..dac1e465 100644 Binary files a/src/main/resources/templates/export-goods-template.xlsx and b/src/main/resources/templates/export-goods-template.xlsx differ