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

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

parent 02fe2ef2
......@@ -466,19 +466,8 @@ public class ContingencyAction implements CustomerAction {
tempmap1.put("button", buttonJson);
tempmap1.put("caseId", contingencyPlanId);
result.add(tempmap1);
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 {
System.out.println("======optionarea 加入队列参数信息======action=====");
......
......@@ -208,7 +208,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
deviceData.setCode(equipmentSpecific.getCode());
boolean isMock = vo.getStatus() == 4;
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());
//更新模型状态
PlanDetail planDetail = PlanDetailOp.get();
......
......@@ -8,6 +8,7 @@ import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.io.IOException;
......@@ -25,6 +26,9 @@ public class PlanRuleServiceImpl implements IPlanRuleService {
@Value("classpath:/json/plan-step.json")
private Resource planStepResource;
@Autowired
private RedisTemplate redisTemplate;
@Override
public void updatePlanRuleByBatchNo(String batchNo) {
try {
......@@ -33,6 +37,7 @@ public class PlanRuleServiceImpl implements IPlanRuleService {
String json = IOUtils.toString(planStepResource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
planRule.setPlanStep(json);
planRuleDao.save(planRule);
redisTemplate.delete("isMock");
} catch (IOException e) {
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