Compare commits
2 Commits
31d8d1ee16
...
31f7a9c0cb
| Author | SHA1 | Date | |
|---|---|---|---|
| 31f7a9c0cb | |||
| 9d208770d8 |
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user