【CTC发送初始化消息去除synchronized关键字】
This commit is contained in:
parent
edb9f46753
commit
32ae4fc71b
@ -303,26 +303,23 @@ public class CTCLogicLoop {
|
||||
*/
|
||||
public void sendAllRunPlanChangeMessage(Simulation simulation, Set<String> userIds) {
|
||||
// CTC运行日志发消息
|
||||
synchronized (this) {
|
||||
Map<String, CtcStationRunPlanLogVO> ctcRunPlanVOMap = simulation.getCtcRepository().getRunPlanStatusVOMap();
|
||||
List<CtcStationRunPlanLogVO> messageList = null;
|
||||
if (CollectionUtils.isEmpty(ctcRunPlanVOMap)) {
|
||||
List<CtcStationRunPlanLog> allRunPlanList = simulation.getCtcRepository().getAllRunPlanList();
|
||||
messageList = new ArrayList<>(allRunPlanList.size());
|
||||
List<CtcStationRunPlanLogVO> messageList = new ArrayList<>(allRunPlanList.size());
|
||||
String mapKey = null;
|
||||
CtcStationRunPlanLogVO ctcStationRunPlanLogVO = null;
|
||||
for (CtcStationRunPlanLog runPlan : allRunPlanList) {
|
||||
mapKey = runPlan.getStation().getCode() + "_" + runPlan.getCode();
|
||||
if (ctcRunPlanVOMap.containsKey(mapKey)) {
|
||||
messageList.add(ctcRunPlanVOMap.get(mapKey));
|
||||
} else {
|
||||
ctcStationRunPlanLogVO = new CtcStationRunPlanLogVO(runPlan);
|
||||
ctcRunPlanVOMap.put(mapKey, ctcStationRunPlanLogVO);
|
||||
messageList.add(ctcStationRunPlanLogVO);
|
||||
}
|
||||
} else {
|
||||
messageList = new ArrayList<>(ctcRunPlanVOMap.values());
|
||||
}
|
||||
sendCtcMessage(simulation.getId(), messageList, WebSocketMessageType.SIMULATION_CTC_RUN_PLAN_INIT, userIds);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行计划发送变化事件
|
||||
|
Loading…
Reference in New Issue
Block a user