Browse Source

模版修改

java8
han\hanst 4 months ago
parent
commit
cdb26b61f5
  1. 17
      src/main/java/com/xujie/sys/common/utils/ExcelTemplate.java
  2. 15
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java
  3. 8
      src/main/resources/mapper/ecss/CoDelMapper.xml
  4. BIN
      src/main/resources/templates/declaration-all-seal-template.xlsx
  5. BIN
      src/main/resources/templates/declaration-all-template.xlsx
  6. BIN
      src/main/resources/templates/declaration-all2-template.xlsx
  7. BIN
      src/main/resources/templates/declaration-elements-template.xlsx
  8. BIN
      src/main/resources/templates/declaration-invoice-seal-template.xlsx
  9. BIN
      src/main/resources/templates/declaration-invoice-template.xlsx
  10. BIN
      src/main/resources/templates/declaration-invoice2-template.xlsx
  11. BIN
      src/main/resources/templates/declaration-packingList-template.xlsx
  12. BIN
      src/main/resources/templates/declaration-packingList2-template.xlsx
  13. BIN
      src/main/resources/templates/declaration-template.xlsx
  14. BIN
      src/main/resources/templates/export-goods-template.xlsx

17
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);
}
}

15
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()) {

8
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
<where>
<if test="templateName != null and templateName != ''">
AND template_name like '%'+#{templateName}+'%'
</if>
<if test="customerName != null and customerName != ''">
AND customer_name like '%'+#{customerName}+'%'
</if>
</where>
ORDER BY template_name
</select>
</mapper>

BIN
src/main/resources/templates/declaration-all-seal-template.xlsx

BIN
src/main/resources/templates/declaration-all-template.xlsx

BIN
src/main/resources/templates/declaration-all2-template.xlsx

BIN
src/main/resources/templates/declaration-elements-template.xlsx

BIN
src/main/resources/templates/declaration-invoice-seal-template.xlsx

BIN
src/main/resources/templates/declaration-invoice-template.xlsx

BIN
src/main/resources/templates/declaration-invoice2-template.xlsx

BIN
src/main/resources/templates/declaration-packingList-template.xlsx

BIN
src/main/resources/templates/declaration-packingList2-template.xlsx

BIN
src/main/resources/templates/declaration-template.xlsx

BIN
src/main/resources/templates/export-goods-template.xlsx

Loading…
Cancel
Save