Commit 1b0dbc75 authored by 高建强's avatar 高建强

item:应急处置流程执行修改

parent 512ed150
...@@ -44,6 +44,7 @@ import com.yeejoin.amos.fas.dao.entity.PlanDetail; ...@@ -44,6 +44,7 @@ import com.yeejoin.amos.fas.dao.entity.PlanDetail;
import com.yeejoin.amos.fas.dao.entity.PlanOperationRecord; import com.yeejoin.amos.fas.dao.entity.PlanOperationRecord;
import com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo; import com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo;
import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo; import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -140,6 +141,9 @@ public class ContingencyAction implements CustomerAction { ...@@ -140,6 +141,9 @@ public class ContingencyAction implements CustomerAction {
@Value("${maparea.action.is-area}") @Value("${maparea.action.is-area}")
private String isArea; private String isArea;
@Value("${plan.default.roleCode}")
private String defaultRoleCode;
private static Map<String, String> OPERATE_RECORD_ID = new HashMap<>(); private static Map<String, String> OPERATE_RECORD_ID = new HashMap<>();
private static Map<String, Map<String, String>> stringStringMap = new HashMap<>(); private static Map<String, Map<String, String>> stringStringMap = new HashMap<>();
...@@ -147,9 +151,6 @@ public class ContingencyAction implements CustomerAction { ...@@ -147,9 +151,6 @@ public class ContingencyAction implements CustomerAction {
public static ConcurrentHashMap<String, Map<String, Object>> pointCache = new ConcurrentHashMap<>(); public static ConcurrentHashMap<String, Map<String, Object>> pointCache = new ConcurrentHashMap<>();
private static CacheMap cacheMap = CacheFactory.newChacheMap();
private static final String TOKE = "TOKE";
@Autowired @Autowired
private RemoteSecurityService remoteSecurityService; private RemoteSecurityService remoteSecurityService;
...@@ -508,7 +509,12 @@ public class ContingencyAction implements CustomerAction { ...@@ -508,7 +509,12 @@ public class ContingencyAction implements CustomerAction {
this.sendcmd("optionarea", paramObj, result); this.sendcmd("optionarea", paramObj, result);
ContingencyPlanInstance instance = contingencyInstance.getMessageById(contingencyPlanId); ContingencyPlanInstance instance = contingencyInstance.getMessageById(contingencyPlanId);
if (instance != null) { if (instance != null) {
instance.setRoleCode(contingencyInstance.getPlanStepRoleCodeByButtonCode(buttonCode)); String roleCode = contingencyInstance.getPlanStepRoleCodeByButtonCode(buttonCode);
if (StringUtils.isNotBlank(roleCode)) {
instance.setRoleCode(roleCode);
} else {
instance.setRoleCode(defaultRoleCode);
}
contingencyPlanInstanceMapper.updateMessageById(instance); contingencyPlanInstanceMapper.updateMessageById(instance);
} }
...@@ -882,6 +888,11 @@ public class ContingencyAction implements CustomerAction { ...@@ -882,6 +888,11 @@ public class ContingencyAction implements CustomerAction {
if (!findByBatchNoAndStatus(batchNo)) { if (!findByBatchNoAndStatus(batchNo)) {
String contingencyPlanId = getContingencyPlanId(contingencyRo.getBatchNo(), actionName, icon, tips, buttonJson); String contingencyPlanId = getContingencyPlanId(contingencyRo.getBatchNo(), actionName, icon, tips, buttonJson);
try { try {
ContingencyPlanInstance instance = contingencyInstance.getMessageById(contingencyPlanId);
if (instance != null) {
instance.setRoleCode(contingencyInstance.getPlanStepRoleCodeByButtonCode(buttonCode));
contingencyPlanInstanceMapper.updateMessageById(instance);
}
contingencyInstance.fire(contingencyRo.getBatchNo(), stepCode, contingencyPlanId, buttonCode, confirm, stepState, RequestContext.getToken(), RequestContext.getProduct(), RequestContext.getAppKey()); contingencyInstance.fire(contingencyRo.getBatchNo(), stepCode, contingencyPlanId, buttonCode, confirm, stepState, RequestContext.getToken(), RequestContext.getProduct(), RequestContext.getAppKey());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -117,6 +117,9 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -117,6 +117,9 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
@Autowired @Autowired
private WebMqttComponent webMqttComponent; private WebMqttComponent webMqttComponent;
@Autowired
private IPlanVisual3dService planVisual3dService;
@Value("classpath:/json/plan-step.json") @Value("classpath:/json/plan-step.json")
private Resource planStepResource; private Resource planStepResource;
...@@ -369,6 +372,10 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -369,6 +372,10 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
webMqttComponent.publish(topic, "{\"msgType\":\"replayMessage\"}"); webMqttComponent.publish(topic, "{\"msgType\":\"replayMessage\"}");
} }
ContingencyPlanInstance instance = repository.save(contingencyPlanInstance); ContingencyPlanInstance instance = repository.save(contingencyPlanInstance);
if (buttonState.equals("CONFIRM")) {
// 满足移动端确认按钮展示,确认后,多按钮json只保留最后一个按钮
planVisual3dService.updateStatusById(contingencyPlanId);
}
// 异步数据同步之消息发送 // 异步数据同步之消息发送
contingencyPlanInstanceDataSync(instance); contingencyPlanInstanceDataSync(instance);
} }
......
...@@ -391,6 +391,12 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -391,6 +391,12 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override @Override
public Page<ContingencyPlanInstanceVO> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo, AgencyUserModel user) { public Page<ContingencyPlanInstanceVO> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo, AgencyUserModel user) {
try {
// TODO 为了配合流程,前端获取执行记录消息的数据,后续处理
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
Integer planInstanceCount = contingencyPlanInstanceMapper.getPlanInstanceCount(batchNo); Integer planInstanceCount = contingencyPlanInstanceMapper.getPlanInstanceCount(batchNo);
// 根据批次号获取预案记录 // 根据批次号获取预案记录
List<ContingencyPlanInstance> planInstanceListByPage = contingencyPlanInstanceMapper.getPlanInstanceListByPage(batchNo, (pageNum - 1) * size, size); List<ContingencyPlanInstance> planInstanceListByPage = contingencyPlanInstanceMapper.getPlanInstanceListByPage(batchNo, (pageNum - 1) * size, size);
......
...@@ -61,6 +61,9 @@ file.downLoad.url=http://172.16.11.201:9000/ ...@@ -61,6 +61,9 @@ file.downLoad.url=http://172.16.11.201:9000/
plan.instance.personImg=upload/3dview_icon/plan_via.png plan.instance.personImg=upload/3dview_icon/plan_via.png
plan.instance.playImg=upload/3dview_icon/plan_play.png plan.instance.playImg=upload/3dview_icon/plan_play.png
#应急预案动作执行默认角色编码
plan.default.roleCode=Digital_Responsing_Plan_A
# 是否使用rocketmq on/off # 是否使用rocketmq on/off
rocketmq.producer.sysIsUsed=off rocketmq.producer.sysIsUsed=off
#rocketmq生产者配置 #rocketmq生产者配置
......
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