This commit is contained in:
2026-06-03 16:31:54 +08:00
12 changed files with 101 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) {

View File

@@ -123,4 +123,14 @@ public class WmsCoilAbnormal extends BaseEntity {
*/
private String attachmentFiles;
/**
* 数据来源2=二级系统同步3=三级本地录入
*/
private Integer sourceSystem;
/**
* 工序来源(如:粗轧、精轧、酸洗、退火等)
*/
private String processSource;
}

View File

@@ -120,4 +120,14 @@ public class WmsCoilAbnormalBo extends BaseEntity {
*/
private String attachmentFiles;
/**
* 数据来源2=二级系统同步3=三级本地录入
*/
private Integer sourceSystem;
/**
* 工序来源(如:粗轧、精轧、酸洗、退火等)
*/
private String processSource;
}

View File

@@ -195,6 +195,10 @@ public class WmsCoilAbnormalExportVo {
@ColumnWidth(10)
private String plateSurface;
private String sourceSystem;
private String processSource;
/**
* 钢卷ID用于合并单元格的标识隐藏列
*/

View File

@@ -145,4 +145,14 @@ public class WmsCoilAbnormalVo extends BaseEntity {
*/
private String attachmentFiles;
/**
* 数据来源
*/
private Integer sourceSystem;
/**
* 工序来源
*/
private String processSource;
}

View File

@@ -80,6 +80,8 @@ public class WmsCoilAbnormalServiceImpl implements IWmsCoilAbnormalService {
lqw.eq(bo.getJudgeTime() != null, WmsCoilAbnormal::getJudgeTime, bo.getJudgeTime());
lqw.eq(bo.getMainMark() != null, WmsCoilAbnormal::getMainMark, bo.getMainMark());
lqw.eq(bo.getWholeCoilMark() != null, WmsCoilAbnormal::getWholeCoilMark, bo.getWholeCoilMark());
lqw.eq(bo.getSourceSystem() != null, WmsCoilAbnormal::getSourceSystem, bo.getSourceSystem());
lqw.eq(StringUtils.isNotBlank(bo.getProcessSource()), WmsCoilAbnormal::getProcessSource, bo.getProcessSource());
return lqw;
}

View File

@@ -5779,6 +5779,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
dto.setWholeCoilMark(abnormal.getWholeCoilMark() != null ? abnormal.getWholeCoilMark().toString() : "");
dto.setAbnormalRemark(abnormal.getRemark() != null ? abnormal.getRemark() : "");
dto.setPlateSurface(abnormal.getPlateSurface() != null ? abnormal.getPlateSurface() : "");
// dto.setSourceSystem(abnormal.getSourceSystem() != null ? abnormal.getSourceSystem().toString() : "");
// dto.setProcessSource(abnormal.getProcessSource() != null ? abnormal.getProcessSource() : "");
} else {
// 空异常信息
dto.setProductionLine("");
@@ -5798,6 +5800,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
dto.setWholeCoilMark("");
dto.setAbnormalRemark("");
dto.setPlateSurface("");
// dto.setSourceSystem("");
// dto.setProcessSource("");
}
return dto;

View File

@@ -25,6 +25,8 @@
<result property="wholeCoilMark" column="whole_coil_mark"/>
<result property="remark" column="remark"/>
<result property="attachmentFiles" column="attachment_files"/>
<result property="sourceSystem" column="source_system"/>
<result property="processSource" column="process_source"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>

View File

@@ -3210,6 +3210,8 @@ CREATE TABLE `wms_coil_abnormal` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
`plate_surface` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '上下板面',
`source_system` tinyint NOT NULL DEFAULT 3 COMMENT '数据来源2=二级系统同步3=三级本地录入',
`process_source` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '工序来源(如:粗轧、精轧、酸洗、退火等)',
PRIMARY KEY (`abnormal_id`) USING BTREE,
INDEX `idx_coil_id`(`coil_id` ASC) USING BTREE COMMENT '钢卷ID索引',
INDEX `idx_judge_time`(`judge_time` ASC) USING BTREE COMMENT '判级时间索引(可选,根据查询需求添加)',