Compare commits
2 Commits
42e5b6dd2b
...
577de8eb64
| Author | SHA1 | Date | |
|---|---|---|---|
| 577de8eb64 | |||
| 03add7c96b |
@@ -249,6 +249,49 @@ public class SqlServerApiBusinessService {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试用:统计 V_VBDA_GAUGE 中各 THICK 列的非空/非零数量,
|
||||
* 用于排查"末架出口厚度恒为 0"问题——确认实际数据落在哪一列。
|
||||
*/
|
||||
public Map<String, Object> getGaugeStats(String matId) {
|
||||
List<Map<String, Object>> rows = asRowList(client.queryGaugeByMatId(matId));
|
||||
String[] cols = {"THICK0", "THICK1", "THICK4", "THICK5",
|
||||
"THICK0REF", "THICK1REF", "THICK4REF", "THICK5REF"};
|
||||
Map<String, Object> stats = new LinkedHashMap<>();
|
||||
for (String col : cols) {
|
||||
long nonNull = 0, nonZero = 0;
|
||||
Double min = null, max = null;
|
||||
for (Map<String, Object> r : rows) {
|
||||
Object raw = r.get(col);
|
||||
if (raw == null) raw = r.get(col.toLowerCase());
|
||||
if (raw == null) continue;
|
||||
nonNull++;
|
||||
Number n = asNumber(raw);
|
||||
if (n == null) continue;
|
||||
double d = n.doubleValue();
|
||||
if (d != 0.0) nonZero++;
|
||||
if (min == null || d < min) min = d;
|
||||
if (max == null || d > max) max = d;
|
||||
}
|
||||
Map<String, Object> info = new LinkedHashMap<>();
|
||||
info.put("nonNullCount", nonNull);
|
||||
info.put("nonZeroCount", nonZero);
|
||||
info.put("min", min);
|
||||
info.put("max", max);
|
||||
stats.put(col, info);
|
||||
}
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("matId", matId);
|
||||
result.put("totalRows", rows.size());
|
||||
result.put("columnStats", stats);
|
||||
List<Map<String, Object>> samples = new ArrayList<>();
|
||||
if (!rows.isEmpty()) samples.add(rows.get(0));
|
||||
if (rows.size() > 1) samples.add(rows.get(rows.size() / 2));
|
||||
if (rows.size() > 2) samples.add(rows.get(rows.size() - 1));
|
||||
result.put("sampleRows", samples);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 轧辊数据:返回全部在辊/备辊数据。
|
||||
*/
|
||||
|
||||
@@ -94,6 +94,15 @@ public class SqlServerApiController {
|
||||
return R.ok(businessService.getRealtimeData(matId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试用:V_VBDA_GAUGE 各 THICK 列非空/非零统计 + 样本行。
|
||||
* 用于定位"末架出口厚度恒为 0"问题。
|
||||
*/
|
||||
@GetMapping("/test/gauge-stats/{matId}")
|
||||
public R<Map<String, Object>> testGaugeStats(@PathVariable String matId) {
|
||||
return R.ok(businessService.getGaugeStats(matId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 轧辊数据:type / status 均可选,不传则返回全量。
|
||||
*/
|
||||
|
||||
@@ -268,7 +268,7 @@ const TREND_GROUPS = [
|
||||
const GAUGE_COLS = [
|
||||
{ col: 'THICK0', title: '入口测厚仪 [%]' },
|
||||
{ col: 'THICK1', title: '1架出口厚度 [%]' },
|
||||
{ col: 'THICK4', title: '末架出口厚度 [%]' },
|
||||
{ col: 'THICK5', title: '末架出口厚度 [%]' },
|
||||
{ col: 'EXIT_SPEED', title: '轧制速度 [m/min]' }
|
||||
]
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ export default {
|
||||
if (!target) return '—'
|
||||
const total = this.gaugeRows.length
|
||||
const pass = this.gaugeRows.filter(r => {
|
||||
const v = getRowVal(r, 'THICK4') || getRowVal(r, 'THICK1')
|
||||
const v = getRowVal(r, 'THICK5') || getRowVal(r, 'THICK1')
|
||||
if (v == null) return true
|
||||
const dev = v - target
|
||||
return dev <= posLim && dev >= -negLim
|
||||
@@ -404,9 +404,9 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
// THICK4 末架出口
|
||||
const t4 = colData(rows, 'THICK4')
|
||||
const t4Ref = colData(rows, 'THICK4REF')
|
||||
// THICK5 末架出口
|
||||
const t4 = colData(rows, 'THICK5')
|
||||
const t4Ref = colData(rows, 'THICK5REF')
|
||||
if (t4.some(v => v != null)) {
|
||||
const c = this.initChart('chartThick4', 180)
|
||||
if (c) {
|
||||
|
||||
Reference in New Issue
Block a user