模架厚度修复

This commit is contained in:
2026-06-03 16:30:48 +08:00
parent 29328d70e9
commit 03add7c96b
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 均可选,不传则返回全量。
*/