feat(wms/acid): 出口卷实绩新增筛选条件并优化搜索功能

1.  为出口卷实绩接口新增钢卷号模糊搜索和时间范围过滤能力
2.  给入场/当前卷号输入框添加清除按钮
3.  优化酸洗实绩页面的布局样式
4.  重构实绩列表分页和搜索逻辑
This commit is contained in:
2026-05-28 13:24:58 +08:00
parent 1c272792f7
commit d9f9c948cc
6 changed files with 90 additions and 49 deletions

View File

@@ -496,25 +496,47 @@ public class SqlServerApiClient {
// return executeSql("oracle", sql.toString(), params);
// }
public ExecuteSqlResponse queryExcoilList(int page, int pageSize) {
public ExecuteSqlResponse queryExcoilList(int page, int pageSize, String coilId, String startDate, String endDate) {
int endRow = page * pageSize;
int startRow = endRow - pageSize;
Map<String, Object> params = new java.util.HashMap<>();
params.put("startRow", startRow);
params.put("endRow", endRow);
return executeSql(
"oracle",
"select * from (select t.*, ROWNUM rn from (select * from JXPLTCM.PLTCM_PDO_EXCOIL order by END_DATE desc) t where ROWNUM <= :endRow) where rn > :startRow",
params
);
StringBuilder where = new StringBuilder();
if (coilId != null && !coilId.trim().isEmpty()) {
where.append(" AND UPPER(EXCOILID) LIKE '%' || UPPER(:coilId) || '%'");
params.put("coilId", coilId.trim());
}
if (startDate != null && !startDate.trim().isEmpty()) {
where.append(" AND END_DATE >= TO_DATE(:startDate, 'YYYY-MM-DD HH24:MI:SS')");
params.put("startDate", startDate.trim());
}
if (endDate != null && !endDate.trim().isEmpty()) {
where.append(" AND END_DATE <= TO_DATE(:endDate, 'YYYY-MM-DD HH24:MI:SS')");
params.put("endDate", endDate.trim());
}
String sql = "select * from (select t.*, ROWNUM rn from (select * from JXPLTCM.PLTCM_PDO_EXCOIL WHERE 1=1"
+ where.toString() + " order by END_DATE desc) t where ROWNUM <= :endRow) where rn > :startRow";
return executeSql("oracle", sql, params);
}
public ExecuteSqlResponse queryExcoilCount() {
return executeSql(
"oracle",
"select count(*) as total from JXPLTCM.PLTCM_PDO_EXCOIL",
emptyParams()
);
public ExecuteSqlResponse queryExcoilCount(String coilId, String startDate, String endDate) {
Map<String, Object> params = new java.util.HashMap<>();
StringBuilder where = new StringBuilder();
if (coilId != null && !coilId.trim().isEmpty()) {
where.append(" AND UPPER(EXCOILID) LIKE '%' || UPPER(:coilId) || '%'");
params.put("coilId", coilId.trim());
}
if (startDate != null && !startDate.trim().isEmpty()) {
where.append(" AND END_DATE >= TO_DATE(:startDate, 'YYYY-MM-DD HH24:MI:SS')");
params.put("startDate", startDate.trim());
}
if (endDate != null && !endDate.trim().isEmpty()) {
where.append(" AND END_DATE <= TO_DATE(:endDate, 'YYYY-MM-DD HH24:MI:SS')");
params.put("endDate", endDate.trim());
}
String sql = "select count(*) as total from JXPLTCM.PLTCM_PDO_EXCOIL WHERE 1=1" + where.toString();
return executeSql("oracle", sql, params);
}
public ExecuteSqlResponse queryPresetSetupByCoilId(String coilId) {

View File

@@ -216,15 +216,15 @@ public class SqlServerApiBusinessService {
/**
* 出口卷实绩列表(分页),来自 PLTCM_PDO_EXCOIL。
*/
public ExcoilPageView getExcoilList(int page, int pageSize) {
return new ExcoilPageView(asRowList(client.queryExcoilList(page, pageSize)));
public ExcoilPageView getExcoilList(int page, int pageSize, String coilId, String startDate, String endDate) {
return new ExcoilPageView(asRowList(client.queryExcoilList(page, pageSize, coilId, startDate, endDate)));
}
/**
* 出口卷实绩总数。
* 出口卷实绩总数(支持钢卷号模糊搜索和时间范围过滤)
*/
public long getExcoilCount() {
List<Map<String, Object>> rows = asRowList(client.queryExcoilCount());
public long getExcoilCount(String coilId, String startDate, String endDate) {
List<Map<String, Object>> rows = asRowList(client.queryExcoilCount(coilId, startDate, endDate));
if (rows.isEmpty()) return 0L;
Number n = asNumber(rows.get(0).get("total"));
return n == null ? 0L : n.longValue();

View File

@@ -179,21 +179,28 @@ public class SqlServerApiController {
/**
* 出口卷实绩列表(分页),来自 PLTCM_PDO_EXCOIL。
* 支持 coilId 模糊搜索、startDate/endDate 时间范围过滤。
*/
@GetMapping("/excoil")
public R<SqlServerApiBusinessService.ExcoilPageView> excoilList(
@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "50") int pageSize) {
return R.ok(businessService.getExcoilList(page, pageSize));
@RequestParam(defaultValue = "50") int pageSize,
@RequestParam(required = false) String coilId,
@RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate) {
return R.ok(businessService.getExcoilList(page, pageSize, coilId, startDate, endDate));
}
/**
* 出口卷实绩总数。
* 出口卷实绩总数(支持钢卷号模糊搜索和时间范围过滤)
*/
@GetMapping("/excoil/count")
public R<Map<String, Long>> excoilCount() {
public R<Map<String, Long>> excoilCount(
@RequestParam(required = false) String coilId,
@RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate) {
Map<String, Long> result = new HashMap<>();
result.put("total", businessService.getExcoilCount());
result.put("total", businessService.getExcoilCount(coilId, startDate, endDate));
return R.ok(result);
}

View File

@@ -127,19 +127,20 @@ export function getRollHistoryCount(rollId, standId) {
}
// 出口卷实绩列表分页PLTCM_PDO_EXCOIL
export function getExcoilList(page = 1, pageSize = 50) {
export function getExcoilList(page = 1, pageSize = 50, coilId, startDate, endDate) {
return request({
url: '/sql-server-api/excoil',
method: 'get',
params: { page, pageSize }
params: { page, pageSize, coilId, startDate, endDate }
})
}
// 出口卷实绩总数
export function getExcoilCount() {
export function getExcoilCount(coilId, startDate, endDate) {
return request({
url: '/sql-server-api/excoil/count',
method: 'get'
method: 'get',
params: { coilId, startDate, endDate }
})
}

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div class="actual-page">
<div class="actual-container">
<!-- 顶部实绩列表 (PLTCM_PDO_EXCOIL) -->
<div class="top-section">
@@ -403,6 +403,7 @@ export default {
searchStartDate: '',
searchEndDate: '',
pagination: { page: 1, pageSize: 50, total: 0 },
currentFilters: { coilId: null, startDate: null, endDate: null },
topTableHeight: 'calc(40vh - 80px)',
chartInstances: [],
resizeHandler: null,
@@ -417,16 +418,16 @@ export default {
this.disposeAllCharts()
},
methods: {
async loadExcoilCount() {
async loadExcoilCount(coilId, startDate, endDate) {
try {
const res = await getExcoilCount()
const res = await getExcoilCount(coilId, startDate, endDate)
this.pagination.total = res?.data?.total ?? 0
} catch (_) {}
},
async loadExcoilList() {
async loadExcoilList(coilId, startDate, endDate) {
this.excoilLoading = true
try {
const res = await getExcoilList(this.pagination.page, this.pagination.pageSize)
const res = await getExcoilList(this.pagination.page, this.pagination.pageSize, coilId, startDate, endDate)
this.excoilRows = res?.data?.rows || []
} finally {
this.excoilLoading = false
@@ -434,7 +435,7 @@ export default {
},
handlePageChange(page) {
this.pagination.page = page
this.loadExcoilList()
this.loadExcoilList(this.currentFilters.coilId, this.currentFilters.startDate, this.currentFilters.endDate)
},
async handleRowClick(row) {
// 快速点击防重:每次点击递增版本号,旧的 sync 任务检测到版本号变更后自动放弃
@@ -840,26 +841,26 @@ export default {
},
// ── 查找 ─────────────────────────────────────
handleFindSearch() {
if (this.searchType === 'coil' && this.searchCoilId) {
const found = this.excoilRows.find(r =>
(r.EXCOILID || r.excoilid || '').includes(this.searchCoilId)
)
if (found) {
this.$refs.excoilTable && this.$refs.excoilTable.setCurrentRow(found)
this.handleRowClick(found)
} else {
this.$message.info('当前页未找到该卷号,请翻页查找')
}
} else {
this.pagination.page = 1
this.loadExcoilList()
}
async handleFindSearch() {
const coilId = this.searchType === 'coil' ? (this.searchCoilId || null) : null
const startDate = this.searchType === 'time' ? (this.searchStartDate || null) : null
const endDate = this.searchType === 'time' ? (this.searchEndDate || null) : null
this.currentFilters = { coilId, startDate, endDate }
this.pagination.page = 1
this.selectedRow = null
this.segData = null
this.gaugeRows = null
this.shapeRows = null
this.selectedTrendParam = null
this.disposeAllCharts()
await this.loadExcoilCount(coilId, startDate, endDate)
await this.loadExcoilList(coilId, startDate, endDate)
},
handleFindReset() {
this.searchCoilId = ''
this.searchStartDate = ''
this.searchEndDate = ''
this.currentFilters = { coilId: null, startDate: null, endDate: null }
this.selectedRow = null
this.segData = null
this.gaugeRows = null
@@ -899,6 +900,14 @@ export default {
</script>
<style scoped lang="scss">
/* 外层 wrapper必须限定高度否则 flex 百分比高度失效,导致内容溢出屏幕 */
.actual-page {
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
.actual-container {
display: flex;
flex-direction: column;
@@ -907,6 +916,7 @@ export default {
background: #f0f2f5;
gap: 6px;
box-sizing: border-box;
overflow: hidden;
}
.top-section {
@@ -948,6 +958,7 @@ export default {
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
::v-deep .el-tabs__content {
flex: 1;

View File

@@ -16,10 +16,10 @@
<!-- 常规筛选区, 通过调拨前库区和调拨后库区查询 -->
<el-form :model="queryParams" inline>
<el-form-item label="入场卷号">
<el-input v-model="queryParams.enterCoilNo" placeholder="请输入入场卷号"></el-input>
<el-input v-model="queryParams.enterCoilNo" placeholder="请输入入场卷号" clearable></el-input>
</el-form-item>
<el-form-item label="当前卷号">
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入当前卷号"></el-input>
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入当前卷号" clearable></el-input>
</el-form-item>
<el-form-item label="调拨前库区">
<WarehouseSelect v-model="queryParams.warehouseIdBefore" placeholder="请选择调拨前库区">