Merge branch 'test'

This commit is contained in:
caojia
2026-11-04 10:27:30 +08:00
9 changed files with 141 additions and 28 deletions
@@ -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")
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.bms.common.annotation.Log;
import com.bms.common.config.BmsConfig;
@@ -48,6 +49,15 @@ public class PrcProfitReportController extends BaseController
@Autowired
private OssStorage ossStorage;
/** 客户筛选选项,沿用毛利报表的访问权限和查询范围。 */
@PreAuthorize("@ss.hasPermi('report:profit:list')")
@GetMapping("/customer-options")
public TableDataInfo customerOptions(@RequestParam(required = false) String keywords)
{
startPage();
return getDataTable(profitReportService.selectCustomerOptions(keywords));
}
@PreAuthorize("@ss.hasPermi('report:profit:list')")
@GetMapping("/summary")
public AjaxResult summary(PrcProfitReportQuery query)
@@ -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;
}
}
@@ -1,6 +1,7 @@
package com.bms.price.service;
import java.util.List;
import com.bms.customer.customerinfo.domain.BmsCustomerOption;
// 提成功能暂停使用:import com.bms.price.domain.PrcProfitCommissionRate;
import com.bms.price.domain.PrcProfitReportExport;
import com.bms.price.domain.vo.PrcProfitReportOrderRow;
@@ -11,6 +12,8 @@ import com.bms.price.domain.vo.PrcProfitReportSummary;
/** 毛利报表服务。 */
public interface IPrcProfitReportService
{
List<BmsCustomerOption> selectCustomerOptions(String keywords);
List<PrcProfitReportOrderRow> selectOrderRows(PrcProfitReportQuery query);
List<PrcProfitReportProductRow> selectProductRows(PrcProfitReportQuery query);
@@ -9,6 +9,9 @@ import org.springframework.stereotype.Service;
// 提成功能暂停使用:import org.springframework.transaction.annotation.Transactional;
import com.bms.common.exception.ServiceException;
import com.bms.common.utils.SecurityUtils;
import com.bms.customer.customerinfo.domain.BmsCustomer;
import com.bms.customer.customerinfo.domain.BmsCustomerOption;
import com.bms.customer.customerinfo.mapper.BmsCustomerMapper;
// 提成功能暂停使用:import com.bms.price.domain.PrcProfitCommissionRate;
// 提成功能暂停使用:import com.bms.price.mapper.PrcProfitCommissionRateMapper;
import com.bms.price.domain.PrcProfitReportExport;
@@ -28,11 +31,23 @@ public class PrcProfitReportServiceImpl implements IPrcProfitReportService
@Autowired
private PrcProfitReportMapper profitReportMapper;
@Autowired
private BmsCustomerMapper customerMapper;
/* 提成配置依赖暂停使用。
@Autowired
private PrcProfitCommissionRateMapper commissionRateMapper;
*/
@Override
public List<BmsCustomerOption> selectCustomerOptions(String keywords)
{
// 报表不应用客户模块的 DataScope,只接收关键字并构造内部查询条件。
BmsCustomer query = new BmsCustomer();
query.setKeywords(keywords);
return customerMapper.selectCustomerOptions(query);
}
@Override
public List<PrcProfitReportOrderRow> selectOrderRows(PrcProfitReportQuery query)
{
+8
View File
@@ -11,6 +11,14 @@ function createProfitExport(url, params) {
})
}
export function listProfitCustomerOptions(params) {
return request({
url: '/report/profit/customer-options',
method: 'get',
params
})
}
export function listProfitSummary(params) {
return request({
url: '/report/profit/summary',
@@ -28,6 +28,7 @@
<div class="preview-toolbar">
<span v-if="previewSearched" class="preview-summary">可选 {{ previewTotal }} 条订单,已选 <b>{{ displaySelectedCount }}</b> 条,应收合计 <b>{{ money(displaySelectedAmount) }}</b></span>
<span v-else class="preview-summary">请选择客户、币种和账单截止日后查询可生成的计费订单</span>
<el-button v-if="previewSearched && previewTotal > 0" :icon="Download" :loading="previewExportLoading" :disabled="previewLoading" @click="exportPreview">导出查询结果</el-button>
<el-button type="primary" plain :loading="previewLoading" :disabled="!bankAccount" @click="queryGeneratePreview">查询</el-button>
</div>
<div v-if="previewSearched" class="preview-selection-toolbar">
@@ -147,7 +148,7 @@
<script setup name="GenerateBillDialog">
import { listArBillGenerateCustomerOptions, getDefaultArBankAccount, previewArBill, previewExcludedArBill, generateArBill } from '@/api/ar/bill'
import { Refresh, Search, Select } from '@element-plus/icons-vue'
import { Download, Refresh, Search, Select } from '@element-plus/icons-vue'
import { AR_BILL_SELECTION_MODE } from '@/constants/ar/enums'
const props = defineProps({
@@ -166,6 +167,7 @@ const dialogOpen = computed({
const billNameOpen = ref(false)
const generateLoading = ref(false)
const previewLoading = ref(false)
const previewExportLoading = ref(false)
const previewSearched = ref(false)
const previewRows = ref([])
const previewTotal = ref(0)
@@ -350,6 +352,15 @@ function handlePreviewPageChange(page) {
fetchPreview()
}
function exportPreview() {
if (!previewSearched.value || !previewTotal.value || !previewQuery.value || previewExportLoading.value) return
previewExportLoading.value = true
proxy.download('/ar/bill/generate/preview/export', { ...previewQuery.value }, `ar_bill_generate_preview_${Date.now()}.xlsx`)
.finally(() => {
previewExportLoading.value = false
})
}
// 当前页变化只更新当前页 ID,selectedRowMap 因此可以跨页保留手动选择。
function handleSelectionChange(rows) {
if (syncingPageSelection || selectionMode.value === AR_BILL_SELECTION_MODE.ALL_MATCHED) return
@@ -8,6 +8,7 @@
:default-params="defaultParams"
:search-per-row="4"
row-key="billId"
:auto-load="false"
:page-sizes="[100, 200, 300, 400]"
:page-size="100"
selection
+11 -27
View File
@@ -28,27 +28,14 @@
</el-col>
<el-col :xs="24" :sm="12" :lg="8">
<el-form-item label="客户名称" class="filter-item">
<el-input
v-model="query.customerName"
type="textarea"
:rows="3"
resize="vertical"
clearable
placeholder="输入客户名称,多个值请换行"
class="filter-control multi-line-filter"
/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :lg="8">
<el-form-item label="客户代码" class="filter-item">
<el-input
<customer-select
v-model="query.customerCode"
type="textarea"
:rows="3"
resize="vertical"
clearable
placeholder="输入客户代码,多个值请换行"
class="filter-control multi-line-filter"
:fetch-options="listProfitCustomerOptions"
value-key="customerCode"
remote-search
:page-size="20"
placeholder="请输入客户名称或代码搜索"
class="filter-control"
/>
</el-form-item>
</el-col>
@@ -57,8 +44,8 @@
<el-input
v-model="query.orderNo"
type="textarea"
:rows="3"
resize="vertical"
:rows="1"
resize="none"
clearable
placeholder="输入订单号,多个值请换行"
class="filter-control multi-line-filter"
@@ -315,7 +302,7 @@
</template>
<script setup name="ProfitReport">
import { downloadProfitExport, exportProfitOrders, exportProfitProducts, listProfitExports, listProfitOrders, listProfitProducts, listProfitSummary } from '@/api/report/profit'
import { downloadProfitExport, exportProfitOrders, exportProfitProducts, listProfitCustomerOptions, listProfitExports, listProfitOrders, listProfitProducts, listProfitSummary } from '@/api/report/profit'
// 提成功能暂停使用:import { deleteProfitCommissionRate, listProfitCommissionRates, saveProfitCommissionRate } from '@/api/report/profit'
import { parseTime } from '@/utils/bms'
import { ElMessage } from 'element-plus'
@@ -329,7 +316,6 @@ const arBillStatus = ref('')
const query = reactive({
orderNo: '',
customerCode: '',
customerName: '',
belongSalerCode: '',
productCode: ''
})
@@ -405,9 +391,7 @@ function buildQuery(paged = true, includeArBillStatus = dimension.value === 'ord
function validateMultiValueFilters(showMessage = true) {
const filters = [
['orderNo', '订单号'],
['customerCode', '客户代码'],
['customerName', '客户名称']
['orderNo', '订单号']
]
for (const [key, label] of filters) {
const values = new Set(String(query[key] || '').split(/[\s,,;;]+/).map(value => value.trim()).filter(Boolean))