✨ 新增应收账单生成预览结果导出
This commit is contained in:
@@ -31,6 +31,7 @@ import com.bms.ar.domain.ArBillGenerateTask;
|
||||
import com.bms.ar.domain.ArBillLog;
|
||||
import com.bms.ar.domain.vo.ArBillActionRequest;
|
||||
import com.bms.ar.domain.vo.ArBillGenerateQuery;
|
||||
import com.bms.ar.domain.vo.ArBillGeneratePreviewExportRow;
|
||||
import com.bms.ar.domain.vo.ArBillGenerateRequest;
|
||||
import com.bms.ar.domain.vo.ArBillListExportRow;
|
||||
import com.bms.ar.domain.vo.ArBillQuery;
|
||||
@@ -173,6 +174,22 @@ public class ArBillController extends BaseController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 按生成预览使用的相同筛选条件导出全部匹配订单,不受分页参数影响。 */
|
||||
@Log(title = "应收账单生成订单", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('ar:bill:generate')")
|
||||
@PostMapping("/generate/preview/export")
|
||||
public void exportGeneratePreview(HttpServletResponse response, ArBillGenerateQuery query,
|
||||
HttpServletRequest request) {
|
||||
rejectMultiValueParameter(request, "customerId");
|
||||
List<PrcOrderBill> bills = billService.previewBill(query == null ? new ArBillGenerateQuery() : query);
|
||||
List<ArBillGeneratePreviewExportRow> rows = new ArrayList<>(bills.size());
|
||||
for (PrcOrderBill bill : bills) {
|
||||
rows.add(ArBillGeneratePreviewExportRow.from(bill));
|
||||
}
|
||||
ExcelUtil<ArBillGeneratePreviewExportRow> util = new ExcelUtil<>(ArBillGeneratePreviewExportRow.class);
|
||||
util.exportExcel(response, rows, "应收账单待生成订单");
|
||||
}
|
||||
|
||||
/** 查询需要从全选结果中排除的订单;空条件不执行查询,避免返回全部订单。 */
|
||||
@PreAuthorize("@ss.hasPermi('ar:bill:generate')")
|
||||
@PostMapping("/generate/exclusion-preview")
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.bms.ar.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.bms.common.annotation.Excel;
|
||||
import com.bms.price.domain.PrcOrderBill;
|
||||
import lombok.Data;
|
||||
|
||||
/** 应收账单生成预览结果 Excel 导出行。 */
|
||||
@Data
|
||||
public class ArBillGeneratePreviewExportRow implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "订单号", sort = 0, width = 24)
|
||||
private String orderNo;
|
||||
|
||||
@Excel(name = "运单号", sort = 1, width = 22)
|
||||
private String trackingNo;
|
||||
|
||||
@Excel(name = "转单号", sort = 2, width = 24)
|
||||
private String transferNo;
|
||||
|
||||
@Excel(name = "客户", sort = 3, width = 24)
|
||||
private String customerName;
|
||||
|
||||
@Excel(name = "业务日期", sort = 4, dateFormat = "yyyy-MM-dd HH:mm:ss", width = 22)
|
||||
private Date bizDate;
|
||||
|
||||
@Excel(name = "产品", sort = 5, width = 22)
|
||||
private String productName;
|
||||
|
||||
@Excel(name = "国家/地区", sort = 6, width = 18)
|
||||
private String countryName;
|
||||
|
||||
@Excel(name = "实际重(kg)", sort = 7, scale = 2, width = 16)
|
||||
private BigDecimal actualWeight;
|
||||
|
||||
@Excel(name = "计费重(kg)", sort = 8, scale = 2, width = 16)
|
||||
private BigDecimal chargeWeight;
|
||||
|
||||
@Excel(name = "应收金额", sort = 9, scale = 2, width = 16)
|
||||
private BigDecimal incomeTotal;
|
||||
|
||||
@Excel(name = "币种", sort = 10, width = 12)
|
||||
private String currency;
|
||||
|
||||
public static ArBillGeneratePreviewExportRow from(PrcOrderBill bill) {
|
||||
ArBillGeneratePreviewExportRow row = new ArBillGeneratePreviewExportRow();
|
||||
row.setOrderNo(bill.getOrderNo());
|
||||
row.setTrackingNo(bill.getTrackingNo());
|
||||
row.setTransferNo(bill.getTransferNo());
|
||||
row.setCustomerName(bill.getCustomerName());
|
||||
row.setBizDate(bill.getBizDate());
|
||||
row.setProductName(bill.getProductName());
|
||||
row.setCountryName(bill.getCountryName());
|
||||
row.setActualWeight(bill.getActualWeight());
|
||||
row.setChargeWeight(bill.getChargeWeight());
|
||||
row.setIncomeTotal(bill.getIncomeTotal());
|
||||
row.setCurrency(bill.getCurrency());
|
||||
return row;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user