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); // 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 endRow = page * pageSize;
int startRow = endRow - pageSize; int startRow = endRow - pageSize;
Map<String, Object> params = new java.util.HashMap<>(); Map<String, Object> params = new java.util.HashMap<>();
params.put("startRow", startRow); params.put("startRow", startRow);
params.put("endRow", endRow); params.put("endRow", endRow);
return executeSql( StringBuilder where = new StringBuilder();
"oracle", if (coilId != null && !coilId.trim().isEmpty()) {
"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", where.append(" AND UPPER(EXCOILID) LIKE '%' || UPPER(:coilId) || '%'");
params 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() { public ExecuteSqlResponse queryExcoilCount(String coilId, String startDate, String endDate) {
return executeSql( Map<String, Object> params = new java.util.HashMap<>();
"oracle", StringBuilder where = new StringBuilder();
"select count(*) as total from JXPLTCM.PLTCM_PDO_EXCOIL", if (coilId != null && !coilId.trim().isEmpty()) {
emptyParams() 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) { public ExecuteSqlResponse queryPresetSetupByCoilId(String coilId) {

View File

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

View File

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

View File

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

View File

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

View File

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