|
|
|
@ -1488,7 +1488,9 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
extractedContract(data, templateAdapter); |
|
|
|
template.render(5);*/ |
|
|
|
} else if (isHardtag) { |
|
|
|
ExcelTemplateYB template = ExcelTemplateYB.load(new ClassPathResource("templates/YB/declaration-all-template.xlsx").getInputStream()); |
|
|
|
ExcelTemplateYB template = ExcelTemplateYB.load(new ClassPathResource( |
|
|
|
data.getContractFlag()!=null && data.getContractFlag()?"templates/YB/declaration-all-template-invoice.xlsx" |
|
|
|
:"templates/YB/declaration-all-template.xlsx").getInputStream()); |
|
|
|
ExcelTemplateAdapter templateAdapter = new Yb2ExcelTemplateAdapter(template); |
|
|
|
|
|
|
|
// 第一个sheet - 出口货物委托书 |
|
|
|
@ -1514,14 +1516,21 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedElements(data, templateAdapter); |
|
|
|
template.render(4); |
|
|
|
// 第六个sheet - 合同 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedContract(data, templateAdapter); |
|
|
|
template.render(5); |
|
|
|
// 第7个sheet - 出货通知 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedShippingNotice(templateAdapter, notifyHeader); |
|
|
|
template.render(6); |
|
|
|
if (data.getContractFlag()!=null && data.getContractFlag()) { |
|
|
|
// 第六个sheet - 合同 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedContract(data, templateAdapter); |
|
|
|
template.render(5); |
|
|
|
// 第7个sheet - 出货通知 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedShippingNotice(templateAdapter, notifyHeader); |
|
|
|
template.render(6); |
|
|
|
} else { |
|
|
|
// 第六个sheet - 出货通知 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedShippingNotice(templateAdapter, notifyHeader); |
|
|
|
template.render(5); |
|
|
|
} |
|
|
|
} else { |
|
|
|
ExcelTemplateALPHA template = ExcelTemplateALPHA.load(new ClassPathResource("templates/ALPHA/declaration-all-template.xlsx").getInputStream()); |
|
|
|
ExcelTemplateAdapter templateAdapter = new YbExcelTemplateAdapter(template); |
|
|
|
@ -1606,7 +1615,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
template.render(3); |
|
|
|
|
|
|
|
} else if (isHardtag) { |
|
|
|
String xlsx = "templates/YB/declaration-all-template-pdf.xlsx"; |
|
|
|
String xlsx = data.getContractFlag()!=null && data.getContractFlag()?"templates/YB/declaration-all-template-invoice-pdf.xlsx":"templates/YB/declaration-all-template-pdf.xlsx"; |
|
|
|
ExcelTemplateYB template = ExcelTemplateYB.load(new ClassPathResource(xlsx).getInputStream()); |
|
|
|
ExcelTemplateAdapter templateAdapter = new Yb2ExcelTemplateAdapter(template); |
|
|
|
|
|
|
|
@ -1629,10 +1638,21 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
extractedElements(data, templateAdapter); |
|
|
|
template.render(3); |
|
|
|
|
|
|
|
// 第五个sheet - 合同 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedContract(data, templateAdapter); |
|
|
|
template.render(4); |
|
|
|
if (data.getContractFlag()!=null && data.getContractFlag()) { |
|
|
|
// 合同 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedContract(data, templateAdapter); |
|
|
|
template.render(4); |
|
|
|
// 出货通知 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedShippingNotice(templateAdapter, notifyHeader); |
|
|
|
template.render(5); |
|
|
|
} else { |
|
|
|
// 出货通知 |
|
|
|
templateAdapter.clearAll(); |
|
|
|
extractedShippingNotice(templateAdapter, notifyHeader); |
|
|
|
template.render(4); |
|
|
|
} |
|
|
|
} else { |
|
|
|
String xlsx = "templates/ALPHA/declaration-all-template-pdf.xlsx"; |
|
|
|
ExcelTemplateALPHA template = ExcelTemplateALPHA.load(new ClassPathResource(xlsx).getInputStream()); |
|
|
|
@ -1809,13 +1829,15 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
for (int i = 0; i < detailList.size(); i++) { |
|
|
|
Map eorder = detailList.get(i); |
|
|
|
eorder.put("row_num", i + 1); |
|
|
|
if (data.getDeclarationWeight()!=null && data.getDeclarationWeight().equals("显示")) { |
|
|
|
/* if (data.getDeclarationWeight()!=null && data.getDeclarationWeight().equals("显示")) { |
|
|
|
eorder.put("net_weight", eorder.get("net_weight") != null ? eorder.get("net_weight").toString() : ""); |
|
|
|
eorder.put("weight_unit", eorder.get("weight_unit") != null ? eorder.get("weight_unit").toString() : ""); |
|
|
|
} else { |
|
|
|
eorder.put("net_weight", ""); |
|
|
|
eorder.put("weight_unit", ""); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
eorder.put("net_weight", eorder.get("net_weight") != null ? eorder.get("net_weight").toString() : ""); |
|
|
|
eorder.put("weight_unit", eorder.get("weight_unit") != null ? eorder.get("weight_unit").toString() : ""); |
|
|
|
if (eorder.get("currency") != null) { |
|
|
|
String currency = stringInput((String) eorder.get("currency")); |
|
|
|
if (currency.toUpperCase().startsWith("RMB")) { |
|
|
|
@ -1947,7 +1969,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
final int maxCharsPerLine = 85; |
|
|
|
final int maxCharsPerLine = 100; |
|
|
|
StringBuilder result = new StringBuilder(); |
|
|
|
int currentLineLength = 0; |
|
|
|
|
|
|
|
@ -1996,7 +2018,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
template.addVar("localShipAddress", notifyHeader.getLocalShipAddress()); |
|
|
|
template.addVar("ccusname", stringInput(notifyHeader.getOverseasShipper())); |
|
|
|
template.addVar("cDeliverAdd", stringInput(notifyHeader.getOverseasAddress())); |
|
|
|
template.addVar("invoiceTitle", data.getContractFlag()!=null && data.getContractFlag()? "合同" : "INVOICE No."); |
|
|
|
template.addVar("invoiceTitle", "INVOICE No."); |
|
|
|
template.addVar("cmc_invoice", notifyHeader.getCmcInvoice()); |
|
|
|
template.addVar("dateStr", notifyHeader.getReadyDate() == null ? "" : |
|
|
|
new java.text.SimpleDateFormat("d-MMM-yyyy", java.util.Locale.ENGLISH).format(notifyHeader.getReadyDate())); |
|
|
|
@ -2214,7 +2236,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
|
|
|
|
// 构建artNo内容 |
|
|
|
String artNoContent = eorder.get("pn")+" " + eorder.get("part_description") + "\n" |
|
|
|
+ "PO#" + eorder.get("po_no") + |
|
|
|
+ " PO#" + eorder.get("po_no") + |
|
|
|
(data.getHsCodeFlag()!=null && data.getHsCodeFlag()?" HS CODE#" + eorder.get("hsCode"):""); |
|
|
|
eorder.put("artNo", artNoContent); |
|
|
|
// 计算artNo内容的行数,动态设置行高 |
|
|
|
@ -2462,7 +2484,9 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
eorder.put("net_weight", isFirstRow ? ((BigDecimal) list.get(m).get("net_weight")).setScale(2, RoundingMode.HALF_UP) : ""); |
|
|
|
|
|
|
|
// 构建artNo内容 |
|
|
|
String artNoContent = eorder.get("pn")+" " + eorder.get("part_description") ; |
|
|
|
String artNoContent = eorder.get("pn")+" " + eorder.get("part_description") + "\n" |
|
|
|
+ " PO:" + eorder.get("po_no") + |
|
|
|
(data.getHsCodeFlag()!=null && data.getHsCodeFlag()?" HS CODE:" + eorder.get("hsCode"):""); |
|
|
|
eorder.put("artNo", artNoContent); |
|
|
|
// 计算artNo内容的行数,动态设置行高 |
|
|
|
int lineCount = calculateLineCount(artNoContent); |
|
|
|
@ -2707,7 +2731,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
|
|
|
|
// 构建artNo内容 |
|
|
|
String artNoContent = eorder.get("pn")+" " + eorder.get("part_description") + "\n" |
|
|
|
+ "PO:" + eorder.get("po_no") + |
|
|
|
+ " PO:" + eorder.get("po_no") + |
|
|
|
(data.getHsCodeFlag()!=null && data.getHsCodeFlag()?" HS CODE:" + eorder.get("hsCode"):""); |
|
|
|
eorder.put("artNo", artNoContent); |
|
|
|
// 计算artNo内容的行数,动态设置行高 |
|
|
|
|