Commit 1628b848 authored by 高建强's avatar 高建强

item:添加注释,添加索引优化

parent 63a091d0
...@@ -455,7 +455,6 @@ public class ContingencyAction implements CustomerAction { ...@@ -455,7 +455,6 @@ public class ContingencyAction implements CustomerAction {
SafteyPlanResult result = new SafteyPlanResult(); SafteyPlanResult result = new SafteyPlanResult();
Map<String, Object> tempmap1 = new HashMap<>(); Map<String, Object> tempmap1 = new HashMap<>();
// String contingencyPlanId = getContingencyPlanId(contingencyRo.getBatchNo(), actionName, icon, tips, buttonJson);
ContingencyPlanInstance contingencyPlanInstance = getContingencyPlan(contingencyRo.getBatchNo(), actionName, icon, tips, buttonJson); ContingencyPlanInstance contingencyPlanInstance = getContingencyPlan(contingencyRo.getBatchNo(), actionName, icon, tips, buttonJson);
String contingencyPlanId = contingencyPlanInstance.getId(); String contingencyPlanId = contingencyPlanInstance.getId();
tempmap1.put("actionName", actionName); tempmap1.put("actionName", actionName);
...@@ -919,8 +918,8 @@ public class ContingencyAction implements CustomerAction { ...@@ -919,8 +918,8 @@ public class ContingencyAction implements CustomerAction {
this.sendweb("recordarea", contingencyRo, result); this.sendweb("recordarea", contingencyRo, result);
updateNumberPlan(batchNo); updateNumberPlan(batchNo);
// 应急处置中断,初始化planStep,json数据;更新预案结束时间 // 应急处置中断,初始化planStep,json数据;更新预案结束时间
// planRuleService.updatePlanRuleByBatchNo(batchNo);
planStepService.initPlanStep(); planStepService.initPlanStep();
// 更新预案结束时间
contingencyInstanceInfoService.updateEndTimeById(batchNo); contingencyInstanceInfoService.updateEndTimeById(batchNo);
} }
......
...@@ -284,12 +284,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -284,12 +284,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
ruleTrigger.publish(contingencyRo, "换流站消防专项预案/" + plan.get(0), ArrayUtils.toArray(equipment.getName())); ruleTrigger.publish(contingencyRo, "换流站消防专项预案/" + plan.get(0), ArrayUtils.toArray(equipment.getName()));
publisherPlanLog(stepCode, buttonCode, batchNo); publisherPlanLog(stepCode, buttonCode, batchNo);
// 更新记录之后发送消息刷新
// String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan");
// System.out.println("=========================> 刷新聊天记录 refreshRecord ");
//
// webMqttComponent.publish(topic, "{\"msgType\":\"refreshRecord\"}");
} }
} else { } else {
throw new Exception("数据异常,请联系管理员."); throw new Exception("数据异常,请联系管理员.");
...@@ -373,12 +367,20 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -373,12 +367,20 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
ContingencyPlanInstance instance = repository.save(contingencyPlanInstance); ContingencyPlanInstance instance = repository.save(contingencyPlanInstance);
if (buttonState.equals("CONFIRM")) { if (buttonState.equals("CONFIRM")) {
String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan");
webMqttComponent.publish(topic, "{\"msgType\":\"operateConfirmMessage\"}"); Map<String, Object> map = new HashMap<>();
map.put("contingency", new ContingencyRo());
map.put("msgContext", Collections.EMPTY_MAP);
map.put("msgType", "operateConfirmMessage");
webMqttComponent.publish(topic, JSON.toJSONString(map));
} }
if (buttonState.equals("CANCEL_0")) { if (buttonState.equals("CANCEL_0")) {
String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan");
System.out.println("=========================> 规则触发 初始化动作 initOperate "); System.out.println("=========================> 规则触发 初始化动作 initOperate ");
webMqttComponent.publish(topic, "{\"msgType\":\"initOperate\"}"); Map<String, Object> map = new HashMap<>();
map.put("contingency", new ContingencyRo());
map.put("msgContext", Collections.EMPTY_MAP);
map.put("msgType", "initOperate");
webMqttComponent.publish(topic, JSON.toJSONString(map));
} }
// 异步数据同步之消息发送 // 异步数据同步之消息发送
contingencyPlanInstanceDataSync(instance); contingencyPlanInstanceDataSync(instance);
...@@ -388,9 +390,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -388,9 +390,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
planStepService.initPlanStep(); planStepService.initPlanStep();
// 应急处置中断,更新预案信息表结束时间 // 应急处置中断,更新预案信息表结束时间
contingencyInstanceInfoService.updateEndTimeById(batchNo); contingencyInstanceInfoService.updateEndTimeById(batchNo);
String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan");
System.out.println("=========================> 规则触发 预案动作结束 ");
} }
} }
} }
...@@ -447,7 +446,9 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -447,7 +446,9 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
map.put("confirm", buttonState); map.put("confirm", buttonState);
map.put("contingencyPlanId", contingencyPlanId); map.put("contingencyPlanId", contingencyPlanId);
map.put("stepState", stepStateOnbutton); map.put("stepState", stepStateOnbutton);
// 是否执行
map.put("isExecute", isExecute); map.put("isExecute", isExecute);
// 是否自动执行
map.put("isAuto", isAuto); map.put("isAuto", isAuto);
if(startUserName != null) { if(startUserName != null) {
map.put("startUserName", startUserName); map.put("startUserName", startUserName);
...@@ -574,6 +575,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -574,6 +575,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
RequestContext.setAppKey(appKey); RequestContext.setAppKey(appKey);
RequestContext.setProduct(product); RequestContext.setProduct(product);
RequestContext.setToken(token); RequestContext.setToken(token);
// 更新redis中预案步骤数据
planVisual3dService.updatePlanStepToRedis(batchNo, stepCode, buttonJson, contingencyPlanId, buttonCode, isExecute, isAuto); planVisual3dService.updatePlanStepToRedis(batchNo, stepCode, buttonJson, contingencyPlanId, buttonCode, isExecute, isAuto);
setButtonExecuted(batchNo, contingencyPlanId, buttonCode, confirm, user); setButtonExecuted(batchNo, contingencyPlanId, buttonCode, confirm, user);
fire(batchNo, stepCode, contingencyPlanId, buttonCode, confirm, stepState); fire(batchNo, stepCode, contingencyPlanId, buttonCode, confirm, stepState);
......
...@@ -9,6 +9,10 @@ public class PlanStepJsonVO { ...@@ -9,6 +9,10 @@ public class PlanStepJsonVO {
private String stepCode; private String stepCode;
private String stepName; private String stepName;
private String stepStatus; private String stepStatus;
/**
* 是否并行,用于卡片展示;1:是,0:否
*/
private String isParallel; private String isParallel;
private String roleCode; private String roleCode;
private String buttonCode; private String buttonCode;
...@@ -17,7 +21,12 @@ public class PlanStepJsonVO { ...@@ -17,7 +21,12 @@ public class PlanStepJsonVO {
private String caseId; private String caseId;
private String buttonJson; private String buttonJson;
private String time = ""; private String time = "";
/**
* 进度条标识
*/
private boolean showLine = false; private boolean showLine = false;
/** /**
* 1:是,0:否 * 1:是,0:否
*/ */
...@@ -44,7 +53,7 @@ public class PlanStepJsonVO { ...@@ -44,7 +53,7 @@ public class PlanStepJsonVO {
private String outAndOr; private String outAndOr;
/** /**
* 1自动,0非自动 * 是否自动执行;1自动,0非自动
*/ */
private Integer isAuto; private Integer isAuto;
} }
...@@ -824,4 +824,23 @@ ...@@ -824,4 +824,23 @@
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='应急预案执行节点报文'; ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='应急预案执行节点报文';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="gaojianqiang" id="20230316-1">
<preConditions onFail="MARK_RAN">
<not>
<indexExists indexName="idx_batch_no" />
</not>
</preConditions>
<comment>预案索引优化</comment>
<sql>
ALTER TABLE `contingency_plan_instance`
ADD INDEX `idx_batch_no`(`batch_no`) USING BTREE;
ALTER TABLE `c_plan_operation_record`
ADD INDEX `idx_batch_no`(`batch_no`) USING BTREE;
ALTER TABLE `contingency_original_data`
DROP INDEX `INDEX_BATCH_NO`,
ADD INDEX `INDEX_BATCH_NO`(`batch_No`) USING BTREE;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment