Compare commits

...

2 Commits

Author SHA1 Message Date
577de8eb64 Merge remote-tracking branch 'origin/0.8.X' into 0.8.X 2026-06-03 16:31:32 +08:00
03add7c96b 模架厚度修复 2026-06-03 16:30:48 +08:00
4 changed files with 57 additions and 5 deletions

View File

@@ -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;
}
/**
* 轧辊数据:返回全部在辊/备辊数据。
*/

View File

@@ -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 均可选,不传则返回全量。
*/

View File

@@ -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]' }
]

View File

@@ -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) {