Browse Source

无托合箱:F列箱数只写首行,后续行留空,配合按箱合并居中;有托时箱数不合并,每行都写箱数

master
han\hanst 1 week ago
parent
commit
5a30850c83
  1. 12
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java

12
src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java

@ -3126,8 +3126,8 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService {
boolean isFirstRow = (i == 0);
Object cartonQty = eorder.get("box_qty") != null
? ((BigDecimal) eorder.get("box_qty")).setScale(0, RoundingMode.HALF_UP) : "";
// 合箱时F列箱数只在首行写值后续行留空配合按箱合并后居中有托/无托相同
eorder.put("noCartons", isFirstRow ? cartonQty : "");
// 无托合箱F列箱数只写首行后续行留空配合按箱合并居中有托时箱数不合并每行都写箱数
eorder.put("noCartons", (!hasPalletData && !isFirstRow) ? "" : cartonQty);
eorder.put("qty_percarton", eorder.get("rolls")!=null?((BigDecimal)eorder.get("rolls")).setScale(0, RoundingMode.HALF_UP):"");
// 托盘数一个托盘对应多个箱仅在该托盘第一条明细显示其他行留空后续按托盘合并
boolean showPalletQty = StringUtils.isNotEmpty(palletSeqNo) && !displayedPalletSeqSet.contains(palletSeqNo);
@ -3166,12 +3166,10 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService {
template.addMergeRegion(boxStartIndex, boxEndIndex, 9);
// 毛重列K列索引10
template.addMergeRegion(boxStartIndex, boxEndIndex, 10);
// 合箱F列箱数按箱合并居中有托时A列仍是托号不能按箱合并A列
if (boxEndIndex > boxStartIndex) {
// 无托合箱A列箱号F列箱数按箱合并居中有托时A列是托号F列箱数都不按箱合并
if (!hasPalletData && boxEndIndex > boxStartIndex) {
template.addMergeRegion(boxStartIndex, boxEndIndex, 5);
if (!hasPalletData) {
template.addMergeRegion(boxStartIndex, boxEndIndex, 0);
}
template.addMergeRegion(boxStartIndex, boxEndIndex, 0);
}
}
// 托盘数列按托盘(seq_no)跨箱合并一个托盘下多个箱共享同一托盘数

Loading…
Cancel
Save