Browse Source

天线 箱数列(第5列,索引4)按箱明细范围合并

master
han\hanst 2 days ago
parent
commit
6d6842f664
  1. 14
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java
  2. 11
      src/main/resources/mapper/ecss/CoDelMapper.xml

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

@ -1629,6 +1629,9 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService {
// 获取box的volume
BigDecimal volume = list.get(m).get("volume") != null ?
((BigDecimal) list.get(m).get("volume")).setScale(6, RoundingMode.HALF_UP) : BigDecimal.ZERO;
// 箱数统一取箱表 ecss_CoDelBoxList.box_qty
BigDecimal boxQty = list.get(m).get("box_qty") != null ?
new BigDecimal(list.get(m).get("box_qty").toString()) : BigDecimal.ZERO;
for (int i = 0; i < checkList.size(); i++) {
Map eorder = checkList.get(i);
BigDecimal qty = ((BigDecimal)eorder.get("qty")).setScale(6, RoundingMode.HALF_UP);
@ -1638,7 +1641,8 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService {
boolean isFirstRow = (i == 0);
// 第一列箱号seq_no在合箱时只在首行显示配合纵向合并后居中
eorder.put("seq_no", isFirstRow ? eorder.get("seq_no") : "");
eorder.put("noCartons",((BigDecimal)eorder.get("box_qty")).setScale(0, RoundingMode.HALF_UP));
// 箱数合箱时仅首行显示后续行留空并执行纵向合并
eorder.put("noCartons", isFirstRow ? boxQty.setScale(0, RoundingMode.HALF_UP) : "");
eorder.put("qty_percarton", ((BigDecimal)eorder.get("rolls")).setScale(0, RoundingMode.HALF_UP));
// 托盘数一个托盘对应多个箱仅在该托盘第一条明细显示其他行留空后续按托盘合并
boolean showPalletQty = StringUtils.isNotEmpty(palletSeqNo) && !displayedPalletSeqSet.contains(palletSeqNo);
@ -1649,7 +1653,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService {
eorder.put("total_pallets", showPalletQty ? (palletQty != null ? palletQty : 1) : "");
eorder.put("volume", isFirstRow ? volume : "");
eorder.put("gross_weight", isFirstRow ? ((BigDecimal) list.get(m).get("gross_weight")).setScale(2, RoundingMode.HALF_UP) : "");
eorder.put("net_weight", ((BigDecimal) list.get(m).get("net_weight")).setScale(2, RoundingMode.HALF_UP));
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") + "\n"
@ -1670,6 +1674,12 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService {
// 无论是否合箱都统一设置居中样式合箱时会自动执行纵向合并
// 箱号列第1列索引0
template.addMergeRegion(boxStartIndex, boxEndIndex, 0);
// 箱数列第5列索引4按箱明细范围合并
template.addMergeRegion(boxStartIndex, boxEndIndex, 4);
// 体积 按箱明细范围合并
template.addMergeRegion(boxStartIndex, boxEndIndex, 8);
// 净重 按箱明细范围合并
template.addMergeRegion(boxStartIndex, boxEndIndex, 9);
}
// 托盘数列按托盘(seq_no)跨箱合并一个托盘下多个箱共享同一托盘数
String nextPalletSeqNo = "";

11
src/main/resources/mapper/ecss/CoDelMapper.xml

@ -223,9 +223,7 @@
</select>
<select id="getPartNo" resultType="PartData">
select top 1 site,part_no,hsCode,hsCodeDesc,part_desc,umid,brand from Part where site=#{site,jdbcType=VARCHAR} and sku=#{partNo} and sourceBu=#{buNo} and
site in (select site from eam_access_site where username = #{userName})
and (site + '-' + sourceBu) in (select * from dbo.query_bu(#{userName}))
select top 1 site,part_no,hsCode,hsCodeDesc,part_desc,umid,brand from Part where site=#{site,jdbcType=VARCHAR} and sku=#{partNo} and sourceBu=#{buNo}
</select>
<select id="getPartInfo" resultType="PartData">
@ -1330,6 +1328,13 @@ left join ecss_CoDelNotifyHeader noHeader on a.site=noHeader.site and a.delNo=no
left join part_sub_properties_value w on d.part_no = w.part_no and w.site = d.site and w.bu_no = d.bu_no
and w.record_type='ECSSPART' and w.code_no='BG001' and w.properties_item_no='BOXWEIGHT'
where a.site = #{site} and a.bu_no = #{buNo} and a.delNo = #{delNo}
order by
ISNULL(TRY_CONVERT(int, LEFT(a.item_no, CHARINDEX('~', a.item_no + '~') - 1)), 2147483647),
ISNULL(
TRY_CONVERT(int, SUBSTRING(a.item_no, CHARINDEX('~', a.item_no + '~') + 1, LEN(a.item_no))),
ISNULL(TRY_CONVERT(int, LEFT(a.item_no, CHARINDEX('~', a.item_no + '~') - 1)), 2147483647)
),
a.item_no
</select>
<update id="updateBoxInfo">

Loading…
Cancel
Save