|
|
|
@ -1146,6 +1146,21 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
template.addVar("Currency", "CNY"); |
|
|
|
template.addVar("Incoterm", "EXW "); |
|
|
|
template.addVar("shippingMode", notifyHeader.getShippingMode()); |
|
|
|
List<Map> notifyDetailList =coDelMapper.getNotifyPartDetail(data); |
|
|
|
Map<Object, Map> notifyDetailMap = notifyDetailList.stream().collect(Collectors.toMap( o -> o.get("partNo"), o -> o)); |
|
|
|
// 装箱明细 |
|
|
|
List<Map> palletDetailList = coDelMapper.exportCoDelPalletDetail(notifyHeader); |
|
|
|
Map<Object, Map> palletMap = palletDetailList.stream().collect(Collectors.toMap( o -> o.get("part_no"), o -> o)); |
|
|
|
// 装箱数据 |
|
|
|
List<EcssCoDelPalletHeaderData> palletHeaderDataList = coDelMapper.searchEcssCoDelPalletHeaderData(notifyHeader);// 总托数 |
|
|
|
Integer totalPlt = palletHeaderDataList.get(0).getPalletQty(); |
|
|
|
// 关务物料属性 |
|
|
|
List<PartSubPropertiesValueData> propertiesValues = coDelMapper.getPropertiesListByTypeAndCodeNo( |
|
|
|
notifyHeader.getSite(), "ECSSPART","BG001",notifyHeader.getBuNo()); |
|
|
|
// 每一个物料加属性对应一个属性,用来下面遍历发货通知单明细时获取具体属性值 |
|
|
|
Map<String, PartSubPropertiesValueData> partNoAndItemNoMap = propertiesValues.stream() |
|
|
|
.collect(Collectors.toMap(o -> o.getPartNo() + "$" + o.getPropertiesItemNo(), o -> o)); |
|
|
|
|
|
|
|
Map poNoMap = new HashMap<>(); |
|
|
|
List<Map> detailList = coDelMapper.exportEcssCoDelNotifyDetail(data); |
|
|
|
Map<String, Map> detailMap = new TreeMap<>(); |
|
|
|
@ -1167,13 +1182,31 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
BigDecimal allPrice = BigDecimal.valueOf(0.0); |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
Map eorder = list.get(i); |
|
|
|
String partNo = (String) eorder.get("part_no"); |
|
|
|
eorder.put("row_num", i + 1); |
|
|
|
Map nodifyData = notifyDetailMap.get(partNo); |
|
|
|
Map pm = palletMap.get(partNo); |
|
|
|
int totalQty = Integer.parseInt(pm.get("total_qty").toString()); |
|
|
|
String lossratio = ""; |
|
|
|
if (nodifyData!=null && nodifyData.get("lossratio") !=null) { |
|
|
|
lossratio = "\n" + (nodifyData.get("ehundred")!=null && StringUtils.isNotEmpty((String) nodifyData.get("ehundred")) |
|
|
|
?"E100-"+nodifyData.get("ehundred"):"") |
|
|
|
+" "+"纯FSC纸重量:"+ |
|
|
|
fscWeight(partNoAndItemNoMap,partNo, totalQty, (String) nodifyData.get("lossratio")); |
|
|
|
} |
|
|
|
eorder.put("designation", eorder.get("part_description") + "\n" + "PO:" + eorder.get("customerPO") |
|
|
|
+ " HS Code:" + eorder.get("hsCode")); |
|
|
|
+ " HS Code:" + eorder.get("hsCode")+ lossratio); |
|
|
|
eorder.put("totalPrice", (((BigDecimal) eorder.get("qty")).multiply((BigDecimal) eorder.get("unitPrice"))). |
|
|
|
setScale(2, RoundingMode.HALF_UP)); |
|
|
|
allPrice = allPrice.add(((BigDecimal) eorder.get("qty")).multiply((BigDecimal) eorder.get("unitPrice"))); |
|
|
|
} |
|
|
|
// 欧洲地区需要 |
|
|
|
if (ecHeader.getPackaging()!=null && ecHeader.getPackaging()) { |
|
|
|
template.addVar("packaging", "Non-reusable plastic packaging:"); |
|
|
|
// 根据维护参数计算出KGS=总托数*plastic packaging维护参数 |
|
|
|
template.addVar("KGS_qty", (ecHeader.getKgs().multiply(BigDecimal.valueOf(totalPlt))).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
template.addVar("KGS", "KGS"); |
|
|
|
} |
|
|
|
template.addVar("allPrice", allPrice.setScale(2, RoundingMode.HALF_UP)); |
|
|
|
template.addListVarAll(list); |
|
|
|
template.render(response.getOutputStream()); |
|
|
|
|