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);
}