日志优化+PRODUCING到PRODUCT状态转化优化
This commit is contained in:
@@ -14,12 +14,12 @@ import java.util.*;
|
||||
@Getter
|
||||
public enum DeviceEnum {
|
||||
// === Entry section / 入口段 ===
|
||||
POR1(0, "Uncoiler #1", 0.0, SectionType.ENTRY, SourceType.ENTRY, Arrays.asList("tensionPorBr1", "stripSpeed")),
|
||||
POR2(1, "Uncoiler #2", 0.0, SectionType.ENTRY, SourceType.ENTRY, Arrays.asList("tensionPorBr2", "stripSpeed")),
|
||||
POR1(0, "Uncoiler #1", 0.0, SectionType.ENTRY, SourceType.ENTRY, Arrays.asList("tensionPorBr1", "stripSpeed","bR4or5toBR6Tension")),
|
||||
POR2(1, "Uncoiler #2", 0.0, SectionType.ENTRY, SourceType.ENTRY, Arrays.asList("tensionPorBr2", "stripSpeed","bR4or5toBR6Tension")),
|
||||
WELDER(2, "Welder", 4.98, SectionType.ENTRY, SourceType.ENTRY, Arrays.asList("weldStatus")),
|
||||
ENL1(3, "Entry Looper #1", 19.04, SectionType.PROCESS, SourceType.ENTRY, Arrays.asList("celLength", "celCapacity", "tensionCel")),
|
||||
ENL2(4, "Entry Looper #2", 167.09, SectionType.PROCESS, SourceType.ENTRY, Arrays.asList("celLength", "celCapacity", "tensionCel")),
|
||||
ENL3(5, "Entry Looper #3", 198.19, SectionType.PROCESS, SourceType.ENTRY, Arrays.asList("celLength", "celCapacity", "tensionCel")),
|
||||
ENL3(5, "Entry Looper #3", 198.19, SectionType.PROCESS, SourceType.ENTRY, Arrays.asList("celLength", "celCapacity", "tensionCel","bR4or5toBR6Tension")),
|
||||
|
||||
// === Process section / 工艺段 ===
|
||||
CLEAN(6, "Cleaning Section", 264.803, SectionType.PROCESS, SourceType.FURNACE, Arrays.asList("cleaningVoltage", "cleaningCurrent", "alkaliConcentration", "alkaliTemperature")),
|
||||
|
||||
@@ -80,11 +80,11 @@ public enum L1OperateMatEnum implements IEnum<String>, IOperateMat<L1OperateMatF
|
||||
PAY_OVER("甩尾") {
|
||||
@Override
|
||||
public void operate(L1OperateMatForm form) {
|
||||
ArrayList<String> status = Lists.newArrayList(PlanStatusEnum.PRODUCING.name(), PlanStatusEnum.PRODUCT.name());
|
||||
// ArrayList<String> status = Lists.newArrayList(PlanStatusEnum.PRODUCING.name(), PlanStatusEnum.PRODUCT.name());
|
||||
CrmPdiPlanService planClient = BeanFactory.getBean(CrmPdiPlanService.class);
|
||||
CrmPdiPlanVO plan = planClient.getByCoilIdAndOperId(form.getEntryMatId());
|
||||
Assert.notNull(plan, "计划[{}]不存在", plan.getId());
|
||||
Assert.isTrue(status.contains(plan.getStatus()), "当前状态[{}]不支持甩尾", plan.getStatus());
|
||||
// Assert.isTrue(status.contains(plan.getStatus()), "当前状态[{}]不支持甩尾", plan.getStatus());
|
||||
MatmapUtil.clearMatmap(form.getPorIdx());
|
||||
WebSocketUtil.sendSignalMsg(form);
|
||||
WebSocketUtil.sendMatmapMsg();
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.fizz.business.domain.msg.ExitCutMessage;
|
||||
import com.fizz.business.dto.ExitCoilInfoDTO;
|
||||
import com.fizz.business.dto.MatmapDTO;
|
||||
import com.fizz.business.form.L1OperateMatForm;
|
||||
import com.fizz.business.service.LogDataService;
|
||||
import com.fizz.business.service.OpcMessageHandler;
|
||||
import com.fizz.business.service.PdoExCoilService;
|
||||
import com.fizz.business.service.TrackService;
|
||||
@@ -32,6 +33,7 @@ public class ExitCutHandler implements OpcMessageHandler<ExitCutMessage> {
|
||||
private final TrackService trackService;
|
||||
@Resource
|
||||
private OpcReceiverHandler opcReceiverHandler;
|
||||
private final LogDataService logDataService;
|
||||
@Override
|
||||
public void handle(ExitCutMessage message) {
|
||||
// 1. 获取卷取机 (TR) 上的物料信息
|
||||
@@ -54,16 +56,17 @@ public class ExitCutHandler implements OpcMessageHandler<ExitCutMessage> {
|
||||
pdoExCoilService.saveExCoil(exitCoilInfo);
|
||||
|
||||
if (exitCoilInfo.isLastFlag()) {
|
||||
|
||||
logDataService.logInfo("TRACK", "当前trMatmap的值为 -> matId={}, planId={}", trMatmap.getMatId(), trMatmap.getPlanId());
|
||||
trackService.l1OperateMat(L1OperateMatForm.builder()
|
||||
.trIdx(TR.getIdx())
|
||||
.entryMatId(trMatmap.getMatId())
|
||||
.planId(trMatmap.getPlanId())
|
||||
.entryMatId(exitCoilInfo.getEntryMatId())
|
||||
.planId(exitCoilInfo.getPlanId())
|
||||
.operation(L1OperateMatEnum.PRODUCT)
|
||||
.build());
|
||||
|
||||
|
||||
logDataService.logInfo("EXIT_CUT", "成功处理 EXIT_CUT 消息,已保存成品卷 -> exitMatId={}, planId={}, entryMatId={}", exitCoilInfo.getExitMatId(), exitCoilInfo.getPlanId(), trMatmap.getMatId());
|
||||
}
|
||||
|
||||
log.info("成功处理 EXIT_CUT 消息,已保存成品卷: " + exitCoilInfo.getExitMatId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,9 +166,8 @@ public class CrmPdiPlanServiceImpl extends ServiceImpl<CrmPdiPlanMapper, CrmPdiP
|
||||
QueryWrapper<CrmPdiPlan> wrapper = new QueryWrapper<>();
|
||||
|
||||
if (StrUtil.isBlank(build.getMatId())) {
|
||||
if (logDataService != null) {
|
||||
logDataService.logInfo("PLAN", "changeStatus matId为空, planId={}, operation={}", build.getId(), build.getOperation());
|
||||
}
|
||||
|
||||
logDataService.logInfo("PLAN", "changeStatus matId为空, planId={}, operation={}", build.getId(), build.getOperation());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -183,9 +182,7 @@ public class CrmPdiPlanServiceImpl extends ServiceImpl<CrmPdiPlanMapper, CrmPdiP
|
||||
CrmPdiPlan pdiPlan = baseMapper.selectOne(wrapper);
|
||||
|
||||
if (pdiPlan == null) {
|
||||
if (logDataService != null) {
|
||||
logDataService.logInfo("PLAN", "未找到计划记录, matId={}, planId={}, operation={}", build.getMatId(), build.getId(), build.getOperation());
|
||||
}
|
||||
logDataService.logInfo("PLAN", "未找到计划记录, matId={}, planId={}, operation={}", build.getMatId(), build.getId(), build.getOperation());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -193,13 +190,10 @@ public class CrmPdiPlanServiceImpl extends ServiceImpl<CrmPdiPlanMapper, CrmPdiP
|
||||
|
||||
int rows = baseMapper.updateById(pdiPlan);
|
||||
if (rows <= 0) {
|
||||
if (logDataService != null) {
|
||||
logDataService.logInfo("PLAN", "计划状态更新失败, matId={}, planId={}, operation={}", build.getMatId(), build.getId(), build.getOperation());
|
||||
}
|
||||
logDataService.logInfo("PLAN", "计划状态更新失败, matId={}, planId={}, operation={}", build.getMatId(), build.getId(), build.getOperation());
|
||||
return false;
|
||||
}
|
||||
|
||||
log.info("计划状态更新成功, matId={}, planId={}, 新状态={}", build.getMatId(), build.getId(), build.getOperation());
|
||||
logDataService.logInfo("PLAN", "计划状态更新成功, matId={}, planId={}, operation={}", build.getMatId(), build.getId(), build.getOperation());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,9 +114,10 @@ public class OpcMessageIdsManager {
|
||||
entryLineMeasureIds.put("ns=2;s=ProcessCGL.PLCLine.EntryLineMeasure.rinseConductivity","rinseConductivity");
|
||||
entryLineMeasureIds.put("ns=2;s=ProcessCGL.PLCLine.EntryLineMeasure.rinseTemperature","rinseTemperature");
|
||||
entryLineMeasureIds.put("ns=2;s=ProcessCGL.PLCLine.EntryLineMeasure.dryingTemperature","dryingTemperature");
|
||||
|
||||
entryLineMeasureIds.put("ns=2;s=ProcessCGL.PLCLine.EntryLineMeasure.BR4or5toBR6Tension","bR4or5toBR6Tension");
|
||||
entryLineMeasureIds.put("ns=2;s=ProcessCGL.PLCLine.EntryLineMeasure.hotAirFlow","hotAirFlow");
|
||||
entryLineMeasureIds.put("ns=2;s=ProcessCGL.PLCLine.EntryLineMeasure.hotAirPressure","hotAirPressure");
|
||||
entryLineMeasureIds.put("ns=2;s=ProcessCGL.PLCLine.EntryLineMeasure.BR4or5toBR6Tension","bR4or5toBR6Tension");
|
||||
}
|
||||
|
||||
public static void loadProcLineMeasureIds(){
|
||||
|
||||
@@ -412,25 +412,15 @@ public class SegmentTrackerService {
|
||||
// 设备到达时只更新该入口对应的设备槽位,避免把另一入口(另一开卷机/活套)覆盖。
|
||||
int targetIdx = d.getIdx();
|
||||
if (payOffReelNumber == 1) {
|
||||
// 仅在开卷机位置做 1/2 路隔离。
|
||||
// 入口/出口活套已合并为单套,ENL1/2/3、CXL1/2 为同一活套内不同测点,不再按入口分路。
|
||||
if (d == DeviceEnum.POR2) {
|
||||
continue;
|
||||
}
|
||||
if (d == DeviceEnum.ENL2 || d == DeviceEnum.ENL3) {
|
||||
continue;
|
||||
}
|
||||
if (d == DeviceEnum.CXL2) {
|
||||
continue;
|
||||
}
|
||||
} else if (payOffReelNumber == 2) {
|
||||
if (d == DeviceEnum.POR1) {
|
||||
continue;
|
||||
}
|
||||
if (d == DeviceEnum.ENL1 || d == DeviceEnum.ENL3) {
|
||||
continue;
|
||||
}
|
||||
if (d == DeviceEnum.CXL1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
MatmapUtil.setMatId(targetIdx, coilId, matmap.getPlanId());
|
||||
@@ -440,7 +430,7 @@ public class SegmentTrackerService {
|
||||
trackService.l1OperateMat(L1OperateMatForm.builder()
|
||||
.entryMatId(coilId)
|
||||
.planId(matmap.getPlanId())
|
||||
.porIdx(entry.getPayOffReelNumber())
|
||||
.porIdx(entry.getPayOffReelNumber() - 1)
|
||||
.operation(L1OperateMatEnum.PRODUCING)
|
||||
.build());
|
||||
} else {
|
||||
|
||||
@@ -6,7 +6,6 @@ import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.fizz.business.constants.CommonConstants;
|
||||
import com.fizz.business.constants.enums.WsTypeEnum;
|
||||
import com.fizz.business.domain.msg.AppMeasureEntryMessage;
|
||||
import com.fizz.business.domain.msg.AppMeasureMessage;
|
||||
import com.fizz.business.dto.CoilPositionDTO;
|
||||
import com.fizz.business.dto.DeviceChartDataDTO;
|
||||
@@ -46,11 +45,13 @@ public class WebSocketUtil {
|
||||
Map<String, WebSocketSession> clients = trackWsHandler.getClients().getOrDefault(type.name(), Maps.newConcurrentMap());
|
||||
TextMessage message = new TextMessage(text);
|
||||
clients.values().forEach(s -> {
|
||||
try {
|
||||
s.sendMessage(message);
|
||||
synchronized (s) {
|
||||
try {
|
||||
s.sendMessage(message);
|
||||
// log.info("[websocket]向客户端[{}]推送消息:{}", type + "-" + s.getId(), text);
|
||||
} catch (IOException e) {
|
||||
log.error("[websocket]向客户端[{}]推送消息异常:{}", type + "-" + s.getId(), text);
|
||||
} catch (IOException e) {
|
||||
log.error("[websocket]向客户端[{}]推送消息异常:{}", type + "-" + s.getId(), text);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user