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

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

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