This commit is contained in:
linfso 2024-08-26 06:19:13 +08:00
parent 17581db682
commit 9709584e34

View File

@ -422,9 +422,6 @@ public class EmisSettleBillController extends BaseController
return AjaxResult.success("确认成功"); return AjaxResult.success("确认成功");
} }
@Log(title = "导出账单", businessType = BusinessType.EXPORT) @Log(title = "导出账单", businessType = BusinessType.EXPORT)
@PostMapping("/exportBill") @PostMapping("/exportBill")
public void exportBill(HttpServletResponse response, EmisSettleBill emisSettleBill) public void exportBill(HttpServletResponse response, EmisSettleBill emisSettleBill)
@ -466,29 +463,47 @@ public class EmisSettleBillController extends BaseController
BigDecimal transFee = BigDecimal.ZERO; BigDecimal transFee = BigDecimal.ZERO;
BigDecimal cebFee = BigDecimal.ZERO; BigDecimal cebFee = BigDecimal.ZERO;
BigDecimal declareFee = BigDecimal.ZERO; BigDecimal declareFee = BigDecimal.ZERO;
String transFeeStr = "";
String cebFeeStr = "";
String declareFeeStr = "";
String otherFeeStr = "";
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());
transFeeStr= feeitem.getBillFee().toPlainString()+"("+feeitem.getCurrency()+")";
} }
// 报关费 // 报关费
else if ("2002".equals(feeitem.getFeeCode())) { else if ("2002".equals(feeitem.getFeeCode())) {
cebFee = cebFee.add(feeitem.getBillFee()); cebFee = cebFee.add(feeitem.getBillFee());
cebFeeStr= feeitem.getBillFee().toPlainString()+"("+feeitem.getCurrency()+")";
} }
// 清关费 // 清关费
else if ("2003".equals(feeitem.getFeeCode())) { else if ("2003".equals(feeitem.getFeeCode())) {
declareFee = declareFee.add(feeitem.getBillFee()); declareFee = declareFee.add(feeitem.getBillFee());
declareFeeStr= feeitem.getBillFee().toPlainString()+"("+feeitem.getCurrency()+")";
} else { } else {
otherFee = otherFee.add(feeitem.getBillFee()); otherFee = otherFee.add(feeitem.getBillFee());
otherFeeStr= otherFeeStr+""+feeitem.getBillFee().toPlainString()+"("+feeitem.getCurrency()+")"+",";
} }
// }
} }
} // voMap.put("transFee", transFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : transFee.stripTrailingZeros().toPlainString());
voMap.put("transFee", transFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : transFee.stripTrailingZeros().toPlainString()); voMap.put("transFee", transFeeStr);
if( cebFee.compareTo(BigDecimal.ZERO)!=0 || declareFee.compareTo(BigDecimal.ZERO)!=0 || otherFee.compareTo(BigDecimal.ZERO)!=0 ) { if( cebFee.compareTo(BigDecimal.ZERO)!=0 || declareFee.compareTo(BigDecimal.ZERO)!=0 || otherFee.compareTo(BigDecimal.ZERO)!=0 ) {
tplName = "tpl/bill_tpl.xlsx"; tplName = "tpl/bill_tpl.xlsx";
voMap.put("cebFee", cebFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : cebFee.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("declareFee", declareFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : declareFee.stripTrailingZeros().toPlainString());
voMap.put("otherFee", otherFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : otherFee.stripTrailingZeros().toPlainString()); // voMap.put("otherFee", otherFee.compareTo(BigDecimal.ZERO) == 0 ? "0" : otherFee.stripTrailingZeros().toPlainString());
voMap.put("cebFee", cebFeeStr);
voMap.put("declareFee", declareFeeStr);
voMap.put("otherFee", otherFeeStr);
}else{ }else{
tplName = "tpl/bill_tpl_simple.xlsx"; tplName = "tpl/bill_tpl_simple.xlsx";
} }