diff --git a/klp-admin/src/main/java/com/klp/framework/client/SqlServerApiClient.java b/klp-admin/src/main/java/com/klp/framework/client/SqlServerApiClient.java index eefe27c6..1df3862c 100644 --- a/klp-admin/src/main/java/com/klp/framework/client/SqlServerApiClient.java +++ b/klp-admin/src/main/java/com/klp/framework/client/SqlServerApiClient.java @@ -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; diff --git a/klp-admin/src/main/java/com/klp/framework/service/SqlServerApiBusinessService.java b/klp-admin/src/main/java/com/klp/framework/service/SqlServerApiBusinessService.java index 269ff2ff..75f57d72 100644 --- a/klp-admin/src/main/java/com/klp/framework/service/SqlServerApiBusinessService.java +++ b/klp-admin/src/main/java/com/klp/framework/service/SqlServerApiBusinessService.java @@ -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> rows; private final Map firstRow; + private final List> excoilRows; - public PlanDetailView(String coilId, List> rows, Map firstRow) { + public PlanDetailView(String coilId, List> rows, Map firstRow, List> 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> getExcoilRows() { + return excoilRows; + } + public static PlanDetailView fromExecuteSqlResponse(String coilId, SqlServerApiClient.ExecuteSqlResponse response) { List> rows = asRowList(response); Map firstRow = rows.isEmpty() ? Collections.emptyMap() : rows.get(0); - return new PlanDetailView(coilId, rows, firstRow); + return new PlanDetailView(coilId, rows, firstRow, Collections.>emptyList()); + } + + public static PlanDetailView fromExecuteSqlResponse(String coilId, SqlServerApiClient.ExecuteSqlResponse response, SqlServerApiClient.ExecuteSqlResponse excoilResponse) { + List> rows = asRowList(response); + Map firstRow = rows.isEmpty() ? Collections.emptyMap() : rows.get(0); + List> excoilRows = asRowList(excoilResponse); + return new PlanDetailView(coilId, rows, firstRow, excoilRows); } } diff --git a/klp-ui/src/views/wms/coil/panels/L2MatchPanel.vue b/klp-ui/src/views/wms/coil/panels/L2MatchPanel.vue index b93659d9..74e09fea 100644 --- a/klp-ui/src/views/wms/coil/panels/L2MatchPanel.vue +++ b/klp-ui/src/views/wms/coil/panels/L2MatchPanel.vue @@ -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() { diff --git a/klp-ui/src/views/wms/coil/typing.vue b/klp-ui/src/views/wms/coil/typing.vue index a65086c0..9c5423af 100644 --- a/klp-ui/src/views/wms/coil/typing.vue +++ b/klp-ui/src/views/wms/coil/typing.vue @@ -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,