Commit c0ed1a43 authored by 高建强's avatar 高建强

item:应急处置同步调整提交

parent 02fe2ef2
...@@ -466,19 +466,8 @@ public class ContingencyAction implements CustomerAction { ...@@ -466,19 +466,8 @@ public class ContingencyAction implements CustomerAction {
tempmap1.put("button", buttonJson); tempmap1.put("button", buttonJson);
tempmap1.put("caseId", contingencyPlanId); tempmap1.put("caseId", contingencyPlanId);
result.add(tempmap1); result.add(tempmap1);
this.sendcmd("optionarea", paramObj, result); this.sendcmd("optionarea", paramObj, result);
ContingencyPlanInstance instance = contingencyInstance.getMessageById(contingencyPlanId);
if (instance != null) {
String roleCode = contingencyInstance.getPlanStepRoleCodeByButtonCode(buttonCode);
if (StringUtils.isNotBlank(roleCode)) {
instance.setRoleCode(roleCode);
} else {
instance.setRoleCode(defaultRoleCode);
}
contingencyPlanInstanceMapper.updateMessageById(instance);
}
try { try {
System.out.println("======optionarea 加入队列参数信息======action====="); System.out.println("======optionarea 加入队列参数信息======action=====");
......
...@@ -208,7 +208,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -208,7 +208,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
deviceData.setCode(equipmentSpecific.getCode()); deviceData.setCode(equipmentSpecific.getCode());
boolean isMock = vo.getStatus() == 4; boolean isMock = vo.getStatus() == 4;
deviceData.setIsMock(isMock); deviceData.setIsMock(isMock);
redisTemplate.opsForValue().set("isMock", isMock ? "1" : "0"); redisTemplate.opsForValue().set("isMock", isMock ? "true" : "false");
String batchNo = equipmentHandlerService.executeDynamicPlan(deviceData, equipment, equipmentSpecific, toke, operationRecord.getId()); String batchNo = equipmentHandlerService.executeDynamicPlan(deviceData, equipment, equipmentSpecific, toke, operationRecord.getId());
//更新模型状态 //更新模型状态
PlanDetail planDetail = PlanDetailOp.get(); PlanDetail planDetail = PlanDetailOp.get();
......
...@@ -8,6 +8,7 @@ import org.apache.commons.io.IOUtils; ...@@ -8,6 +8,7 @@ import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.IOException; import java.io.IOException;
...@@ -25,6 +26,9 @@ public class PlanRuleServiceImpl implements IPlanRuleService { ...@@ -25,6 +26,9 @@ public class PlanRuleServiceImpl implements IPlanRuleService {
@Value("classpath:/json/plan-step.json") @Value("classpath:/json/plan-step.json")
private Resource planStepResource; private Resource planStepResource;
@Autowired
private RedisTemplate redisTemplate;
@Override @Override
public void updatePlanRuleByBatchNo(String batchNo) { public void updatePlanRuleByBatchNo(String batchNo) {
try { try {
...@@ -33,6 +37,7 @@ public class PlanRuleServiceImpl implements IPlanRuleService { ...@@ -33,6 +37,7 @@ public class PlanRuleServiceImpl implements IPlanRuleService {
String json = IOUtils.toString(planStepResource.getInputStream(), String.valueOf(StandardCharsets.UTF_8)); String json = IOUtils.toString(planStepResource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
planRule.setPlanStep(json); planRule.setPlanStep(json);
planRuleDao.save(planRule); planRuleDao.save(planRule);
redisTemplate.delete("isMock");
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("初始化预案规则planStep数据失败!"); throw new RuntimeException("初始化预案规则planStep数据失败!");
} }
......
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