This commit is contained in:
linfso 2024-07-24 06:28:09 +08:00
parent 2e677d84c0
commit 29a6eb26a4

View File

@ -251,49 +251,45 @@ public class EmisSettleBillController extends BaseController
//计算分项数据 //计算分项数据
List<EmisSettleSubBillFeeitem> feeItemList=billItem.getFeeitemList(); List<EmisSettleSubBillFeeitem> feeItemList=billItem.getFeeitemList();
if( !CollectionUtils.isEmpty(feeItemList) ){ if( !CollectionUtils.isEmpty(feeItemList) ){
if(feeItemList.size()>1){ if(feeItemList.size()>1) {
tplName="tpl/bill_tpl.xlsx"; tplName = "tpl/bill_tpl.xlsx";
}
BigDecimal otherFee = BigDecimal.ZERO; BigDecimal otherFee = BigDecimal.ZERO;
BigDecimal transFee = BigDecimal.ZERO; BigDecimal transFee = BigDecimal.ZERO;
BigDecimal cebFee = BigDecimal.ZERO; BigDecimal cebFee = BigDecimal.ZERO;
BigDecimal declareFee = BigDecimal.ZERO; BigDecimal declareFee = BigDecimal.ZERO;
for(EmisSettleSubBillFeeitem feeitem:feeItemList){ for (EmisSettleSubBillFeeitem feeitem : feeItemList) {
if("CNY".equals(feeitem.getCurrency())) { if ("CNY".equals(feeitem.getCurrency())) {
if ("1001".equals(feeitem.getFeeCode())) { if ("1001".equals(feeitem.getFeeCode())) {
transFee=transFee.add(feeitem.getBillFee()); transFee = transFee.add(feeitem.getBillFee());
} }
// 报关费 // 报关费
else if ("2002".equals(feeitem.getFeeCode())) { else if ("2002".equals(feeitem.getFeeCode())) {
cebFee=cebFee.add(feeitem.getBillFee()); cebFee = cebFee.add(feeitem.getBillFee());
} }
// 清关费 // 清关费
else if ("2003".equals(feeitem.getFeeCode())) { else if ("2003".equals(feeitem.getFeeCode())) {
declareFee=declareFee.add(feeitem.getBillFee()); declareFee = declareFee.add(feeitem.getBillFee());
} else { } else {
otherFee=otherFee.add(feeitem.getBillFee()); otherFee = otherFee.add(feeitem.getBillFee());
} }
}
}
voMap.put("transFee", transFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : transFee.stripTrailingZeros().toPlainString());
voMap.put("cebFee", cebFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : cebFee.stripTrailingZeros().toPlainString());
voMap.put("declareFee", declareFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : declareFee.stripTrailingZeros().toPlainString());
voMap.put("otherFee", otherFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : otherFee.stripTrailingZeros().toPlainString());
}else{ }else{
tplName = "tpl/bill_tpl_simple.xlsx";
}
}
voMap.put("transFee",transFee.compareTo(BigDecimal.ZERO)==0?"0":transFee.stripTrailingZeros().toPlainString());
voMap.put("cebFee",cebFee.compareTo(BigDecimal.ZERO)==0?"0":cebFee.stripTrailingZeros().toPlainString());
voMap.put("declareFee",declareFee.compareTo(BigDecimal.ZERO)==0?"0": declareFee.stripTrailingZeros().toPlainString());
voMap.put("otherFee", otherFee.compareTo(BigDecimal.ZERO)==0?"0":otherFee.stripTrailingZeros().toPlainString());
}else{
}
// {.transFee} {.cebFee} {.declareFee} {.otherFee}
listMap.add(voMap);
}else{
voMap.put("transFee",billItem.getWaybillDetail().getFreight().stripTrailingZeros().toPlainString()); voMap.put("transFee",billItem.getWaybillDetail().getFreight().stripTrailingZeros().toPlainString());
} }
}else{
tplName = "tpl/bill_tpl_simple.xlsx";
voMap.put("transFee",billItem.getWaybillDetail().getFreight().stripTrailingZeros().toPlainString());
}
listMap.add(voMap);
}
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();