feat(service): 添加按热卷号查询计划详情功能

- 在 SqlServerApiBusinessService 中实现按热卷号查询计划详情方法
- 新增调用查询扩展卷数据接口并整合到返回结果中
- 修改 PlanDetailView 构造函数以支持扩展卷数据列表
- 添加 excoilRows 属性和相应的 getter 方法
- 提供新的 fromExecuteSqlResponse 静态工厂方法处理双响应对象
- 在 SqlServerApiClient 中新增 queryExcoilByHotCoilId 查询接口
This commit is contained in:
2026-06-04 10:59:07 +08:00
parent b4fbb8dfc8
commit 9d208770d8
4 changed files with 40 additions and 4 deletions

View File

@@ -361,6 +361,15 @@ public class SqlServerApiClient {
);
}
public ExecuteSqlResponse queryExcoilByHotCoilId(String hotCoilId) {
return executeSql(
"oracle",
"select * from JXPLTCM.PLTCM_PDO_EXCOIL where HOT_COILID = :hotCoilId",
singletonParam("hotCoilId", hotCoilId)
);
}
public ExecuteSqlResponse queryPlanListByHotCoilIdLike(String hotCoilId, int page, int pageSize) {
int endRow = page * pageSize;
int startRow = endRow - pageSize;

View File

@@ -122,7 +122,10 @@ public class SqlServerApiBusinessService {
* 计划详情:按热卷号查询。
*/
public PlanDetailView getPlanByHotCoilId(String hotCoilId) {
return PlanDetailView.fromExecuteSqlResponse(hotCoilId, client.queryPlanByHotCoilId(hotCoilId));
SqlServerApiClient.ExecuteSqlResponse planResponse = client.queryPlanByHotCoilId(hotCoilId);
SqlServerApiClient.ExecuteSqlResponse excoilResponse = null;
excoilResponse = client.queryExcoilByHotCoilId(hotCoilId);
return PlanDetailView.fromExecuteSqlResponse(hotCoilId, planResponse, excoilResponse);
}
/**
@@ -421,11 +424,13 @@ public class SqlServerApiBusinessService {
private final String coilId;
private final List<Map<String, Object>> rows;
private final Map<String, Object> firstRow;
private final List<Map<String, Object>> excoilRows;
public PlanDetailView(String coilId, List<Map<String, Object>> rows, Map<String, Object> firstRow) {
public PlanDetailView(String coilId, List<Map<String, Object>> rows, Map<String, Object> firstRow, List<Map<String, Object>> excoilRows) {
this.coilId = coilId;
this.rows = rows;
this.firstRow = firstRow;
this.excoilRows = excoilRows;
}
public String getCoilId() {
@@ -440,10 +445,21 @@ public class SqlServerApiBusinessService {
return firstRow;
}
public List<Map<String, Object>> getExcoilRows() {
return excoilRows;
}
public static PlanDetailView fromExecuteSqlResponse(String coilId, SqlServerApiClient.ExecuteSqlResponse response) {
List<Map<String, Object>> rows = asRowList(response);
Map<String, Object> firstRow = rows.isEmpty() ? Collections.<String, Object>emptyMap() : rows.get(0);
return new PlanDetailView(coilId, rows, firstRow);
return new PlanDetailView(coilId, rows, firstRow, Collections.<Map<String, Object>>emptyList());
}
public static PlanDetailView fromExecuteSqlResponse(String coilId, SqlServerApiClient.ExecuteSqlResponse response, SqlServerApiClient.ExecuteSqlResponse excoilResponse) {
List<Map<String, Object>> rows = asRowList(response);
Map<String, Object> firstRow = rows.isEmpty() ? Collections.<String, Object>emptyMap() : rows.get(0);
List<Map<String, Object>> excoilRows = asRowList(excoilResponse);
return new PlanDetailView(coilId, rows, firstRow, excoilRows);
}
}

View File

@@ -115,7 +115,15 @@ export default {
this.matchLoading = true
getTimingPlanDetailByHotcoilId(hotCoilId).then(res => {
const fr = res?.data?.firstRow
this.bestMatch = (fr && Object.keys(fr).length > 0) ? fr : null
if (!fr || Object.keys(fr).length === 0) { this.bestMatch = null; return }
const excoilRows = res?.data?.excoilRows || []
const excoil = excoilRows.length > 0 ? excoilRows[0] : null
if (excoil) {
fr.exit_length = excoil.exit_length ?? excoil.EXIT_LENGTH ?? fr.exit_length
fr.start_time = excoil.start_date ?? excoil.START_DATE ?? null
fr.end_time = excoil.end_date ?? excoil.END_DATE ?? null
}
this.bestMatch = fr
}).catch(() => {}).finally(() => { this.matchLoading = false })
},
loadRecentList() {

View File

@@ -641,6 +641,9 @@ export default {
if (data.exit_thick != null) this.$set(this.updateForm, 'actualThickness', parseFloat(data.exit_thick))
if (data.exit_width != null) this.$set(this.updateForm, 'actualWidth', parseFloat(data.exit_width))
if (data.start_date) this.$set(this.updateForm, 'productionStartTime', data.start_date)
if (data.end_date) this.$set(this.updateForm, 'productionEndTime', data.date)
const query = {
specification: data.exit_thick ? `${data.exit_thick}*${data.exit_width}` : '',
material: data.grade,