Commit d4c3a5ef authored by 张森's avatar 张森

Merge remote-tracking branch 'origin/develop_dl' into develop_dl_bugfix

# Conflicts: # YeeAmosFireAutoSysService/pom.xml # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/LoginController.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteSecurityService.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EmergencyTaskServiceImpl.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentFireEquipmentServiceImpl.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java # YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties # YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
parents 70430423 afea7a8c
package com.yeejoin.amos.fas.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author keyong
* @title: JudgeSignEnum
* <pre>
* @description: TODO
* </pre>
* @date 2023/3/8 20:54
*/
@Getter
@AllArgsConstructor
public enum PlanTypeEnum {
MAINTRANSFORM("MAINTRANSFORM","主变"),
HIGHRESISTANCE("HIGHRESISTANCE","高抗"),
NORMAL("NORMAL","数字预案");
private String key;
private String describe;
}
package com.yeejoin.amos.fas.dao.dto;
import lombok.Data;
import java.util.List;
@Data
public class PlanStepJsonVO {
private String stepCode;
private String stepName;
private String stepStatus;
/**
* 是否并行,用于卡片展示;1:是,0:否
*/
private String isParallel;
private String roleCode;
private String buttonCode;
private String batchNo;
private String caseId;
private String buttonJson;
private String time = "";
/**
* 进度条标识
*/
private boolean showLine = false;
/**
* 1:是,0:否
*/
private String checkYesOrNo = "";
/**
* 进度索引
*/
private Integer index;
/**
* 节点物联设备指标之间关系
*/
private String inAndOr;
/**
* 节点物联设备之间关系
*/
private String outAndOr;
/**
* 是否自动执行;1自动,0非自动
*/
private Integer isAuto;
}
...@@ -2,10 +2,9 @@ package com.yeejoin.amos.fas.dao.entity; ...@@ -2,10 +2,9 @@ package com.yeejoin.amos.fas.dao.entity;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.*;
import javax.persistence.Entity; import java.util.ArrayList;
import javax.persistence.NamedQuery; import java.util.List;
import javax.persistence.Table;
/** /**
...@@ -17,22 +16,51 @@ import javax.persistence.Table; ...@@ -17,22 +16,51 @@ import javax.persistence.Table;
public class EmergencyTaskContent extends BasicEntity { public class EmergencyTaskContent extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//分工内容
//分工内容id
@Column(name = "content") @Column(name = "content")
private String content; private String content;
//人员名称 //编号
@Column(name = "code") @Column(name = "code")
private String code; private String code;
//人员名称 //关联角色ID
@Column(name = "obligation_id") @Column(name = "obligation_id")
private Long obligationId; private Long obligationId;
//所属流程步骤编号
@Column(name = "step_code")
private String stepCode;
//角色code
@Column(name = "role_code")
private String roleCode;
//任务排序号
@Column(name = "task_num")
private String taskNum;
//是否必填项
@Column(name = "is_must")
private boolean isMust;
//人员名称 //所属流程步骤编号
@Column(name = "button_json")
private String buttonJson;
//预案类型
@Column(name = "plan_type")
private String planType;
//关联角色名称
@Column(name = "obligation_name") @Column(name = "obligation_name")
private String obligationName; private String obligationName;
//是否必填项
@Transient
private String isMustString;
//所属角色
@Transient
private ArrayList<String> roleCodeList;
} }
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import javax.persistence.*;
import java.util.Date;
@Data
@Entity
@Table(name="c_emergency_task_role")
@NamedQuery(name="EmergencyTaskRole.findAll", query="SELECT e FROM EmergencyTaskRole e")
public class EmergencyTaskRole {
/**
* id
*/
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id",nullable=false,unique=true)
private Long id;
@CreatedDate
@Column(name="create_date")
private Date createDate = new Date();
/**
* 角色名称
*/
@Column(name="name")
private String name;
/**
* 角色编码
*/
@Column(name="code")
private String code;
/**
* 排序字段
*/
@Column(name="sort")
private Long sort;
/**
* 是否删除字段
*/
@Column(name="is_delete")
private Integer isDelete = 0;
/**
* 备注
*/
@Column(name="remark")
private String remark;
/**
* 版次
*/
@Column(name="creater")
private String creater;
/**
* 机构编码
*/
@Column(name="biz_org_code")
private String bizOrgCode;
/**
* 机构名称
*/
@Column(name="biz_org_name")
private String bizOrgName;
}
...@@ -42,4 +42,7 @@ public class PlanClassifyTree extends BasicEntity { ...@@ -42,4 +42,7 @@ public class PlanClassifyTree extends BasicEntity {
@Column(name="org_code") @Column(name="org_code")
private String orgCode; private String orgCode;
@Column(name="plan_type")
private String planType;
} }
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity;
import com.yeejoin.amos.fas.dao.dto.PlanStepJsonVO;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class PlanStepTree extends BasicEntity {
private static final long serialVersionUID = 1L;
private String sequenceNbr;
//职责id
private Long obligationId;
//人员名称
private String name;
private String stepName;
//子级
private List<PlanStepJsonVO> children = new ArrayList<>();
//树节点展示标识
private String type;
private String code;
private Integer index;
}
\ No newline at end of file
...@@ -29,6 +29,7 @@ import com.yeejoin.amos.fas.business.util.JSONUtil; ...@@ -29,6 +29,7 @@ import com.yeejoin.amos.fas.business.util.JSONUtil;
import com.yeejoin.amos.fas.business.vo.*; import com.yeejoin.amos.fas.business.vo.*;
import com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum; import com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum;
import com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum; import com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum;
import com.yeejoin.amos.fas.common.enums.PlanTypeEnum;
import com.yeejoin.amos.fas.core.enums.NumberEnum; import com.yeejoin.amos.fas.core.enums.NumberEnum;
import com.yeejoin.amos.fas.core.util.DateUtil; import com.yeejoin.amos.fas.core.util.DateUtil;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance; import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
...@@ -156,8 +157,9 @@ public class ContingencyAction implements CustomerAction { ...@@ -156,8 +157,9 @@ public class ContingencyAction implements CustomerAction {
private com.yeejoin.amos.component.rule.RuleTrigger ruleTrigger; private com.yeejoin.amos.component.rule.RuleTrigger ruleTrigger;
@Autowired @Autowired
private IEquipmentFireEquipmentService equipmentFireEquipmentService; private IEquipmentFireEquipmentService equipmentFireEquipmentService;
@Value("classpath:/json/plan-step.json")
private Resource planStepResource; @Autowired
private IPlanStepService iPlanStepService;
/** /**
* @param stepCode 当前步骤编号 * @param stepCode 当前步骤编号
...@@ -803,13 +805,7 @@ public class ContingencyAction implements CustomerAction { ...@@ -803,13 +805,7 @@ public class ContingencyAction implements CustomerAction {
tempmap1.put("content", content); tempmap1.put("content", content);
result.add(tempmap1); result.add(tempmap1);
String instanceId = iContingencyInstance.getInstanceIdByBatchNOAndCategory("OPERATE", stepName, batchNo); String instanceId = iContingencyInstance.getInstanceIdByBatchNOAndCategory("OPERATE", stepName, batchNo);
String json = iPlanStepService.getPlanStep();
String json;
try {
json = IOUtils.toString(planStepResource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException("获取预案节点信息失败!");
}
List<PlanStepJsonVO> res = JSONObject.parseArray(json, PlanStepJsonVO.class); List<PlanStepJsonVO> res = JSONObject.parseArray(json, PlanStepJsonVO.class);
PlanStepJsonVO vo = res.stream().filter(x -> x.getStepCode().equals(stepCode)).collect(Collectors.toList()).get(0); PlanStepJsonVO vo = res.stream().filter(x -> x.getStepCode().equals(stepCode)).collect(Collectors.toList()).get(0);
Object obj = equipmentFireEquipmentService.automaticExecutePoint(vo.getIndex()); Object obj = equipmentFireEquipmentService.automaticExecutePoint(vo.getIndex());
......
...@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("/api/contingencyPlan") @RequestMapping("/api/contingencyPlan")
...@@ -283,7 +284,8 @@ public class ContingencyPlanController extends BaseController { ...@@ -283,7 +284,8 @@ public class ContingencyPlanController extends BaseController {
@RequestParam(value = "batchNo", required = false) String batchNo, @RequestParam(value = "batchNo", required = false) String batchNo,
@RequestParam(value = "runState", required = false) String runState, @RequestParam(value = "runState", required = false) String runState,
@RequestParam(value = "updateDate", required = false) String updateDate, @RequestParam(value = "updateDate", required = false) String updateDate,
@RequestParam(value = "roleName", required = false) String roleName @RequestParam(value = "roleName", required = false) String roleName,
@RequestParam(value = "stepCode", required = false) String stepCode
) { ) {
if (current < 1 || size < 1) { if (current < 1 || size < 1) {
throw new YeeException("分页参数有误"); throw new YeeException("分页参数有误");
...@@ -293,7 +295,13 @@ public class ContingencyPlanController extends BaseController { ...@@ -293,7 +295,13 @@ public class ContingencyPlanController extends BaseController {
String[] ids = new String(roleName).split(","); String[] ids = new String(roleName).split(",");
list = Arrays.asList(ids); list = Arrays.asList(ids);
} }
return CommonResponseUtil2.success(contingencyPlanService.selectTaskActionPage(current, size, batchNo, runState, updateDate, list)); List<String> steps = new ArrayList<>();
if (!StringUtils.isEmpty(stepCode)) {
String[] codes = new String(stepCode).split(",");
steps = Arrays.asList(codes);
steps = steps.stream().map(x -> String.valueOf(Integer.valueOf(x) - 1)).collect(Collectors.toList());
}
return CommonResponseUtil2.success(contingencyPlanService.selectTaskActionPage(current, size, batchNo, runState, updateDate, list, steps));
} }
} }
...@@ -2,29 +2,35 @@ package com.yeejoin.amos.fas.business.controller; ...@@ -2,29 +2,35 @@ package com.yeejoin.amos.fas.business.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.data.domain.Page;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskRoleMapper;
import com.yeejoin.amos.fas.business.feign.JcsFeign; import com.yeejoin.amos.fas.business.feign.JcsFeign;
import com.yeejoin.amos.fas.business.service.intfc.IDictService; import com.yeejoin.amos.fas.business.service.intfc.IDictService;
import com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService; import com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService;
import com.yeejoin.amos.fas.business.service.intfc.IPlanStepService;
import com.yeejoin.amos.fas.business.vo.EmergencyRelationVo; import com.yeejoin.amos.fas.business.vo.EmergencyRelationVo;
import com.yeejoin.amos.fas.business.vo.PlanStepJsonVO;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.Dict; import com.yeejoin.amos.fas.core.util.CommonResponseUtil2;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelation; import com.yeejoin.amos.fas.core.util.ResponseModel;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree; import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.data.domain.Page; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Controller @Controller
...@@ -42,25 +48,43 @@ public class EmergencyTaskController extends BaseController{ ...@@ -42,25 +48,43 @@ public class EmergencyTaskController extends BaseController{
@Autowired @Autowired
private IDictService dictService; private IDictService dictService;
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private EmergencyTaskRoleMapper emergencyTaskRoleMapper;
@Autowired
private EmergencyTaskMapper emergencyTaskMapper;
@Autowired
private IPlanStepService planStepService;
@ApiOperation(httpMethod = "GET",value = "岗位人员树", notes = "岗位人员树") @ApiOperation(httpMethod = "GET",value = "岗位人员树", notes = "岗位人员树")
@RequestMapping(value = "/tree", method = RequestMethod.GET) @RequestMapping(value = "/tree", method = RequestMethod.GET)
public CommonResponse tree(){ public CommonResponse tree(@RequestParam(value = "type", required = false) String type){
Dict dict = new Dict(); Dict dict = new Dict();
dict.setDictCode("YJZC"); dict.setDictCode("YJZC");
//查询应急角色 //查询应急角色
List<Dict> dictList = dictService.getDictList(dict); // List<Dict> dictList = dictService.getDictList(dict);
List<EmergencyTaskRole> emergencyTaskRoles = new ArrayList<>();
if (StringUtils.isNotEmpty(type)) {
emergencyTaskRoles = emergencyTaskRoleMapper.selectListFilterEmptyTask();
} else {
emergencyTaskRoles = emergencyTaskRoleMapper.selectList();
}
List<EmergencyRelationTree> list = new ArrayList<>(); List<EmergencyRelationTree> list = new ArrayList<>();
List<EmergencyRelationTree> root = new ArrayList<>(); List<EmergencyRelationTree> root = new ArrayList<>();
List<EmergencyRelationTree> treeNodes = iEmergencyTaskService.treeList(); List<EmergencyRelationTree> treeNodes = iEmergencyTaskService.treeList();
//组装对应人员节点 //组装对应人员节点
dictList.forEach(e->{ emergencyTaskRoles.forEach(e->{
EmergencyRelationTree tree = new EmergencyRelationTree(); EmergencyRelationTree tree = new EmergencyRelationTree();
tree.setId(e.getId()); tree.setId(e.getId());
tree.setName(e.getDictName()); tree.setName(e.getName());
tree.setType("0"); tree.setType("0");
tree.setSequenceNbr(String.valueOf(e.getId())); tree.setSequenceNbr(String.valueOf(e.getId()));
tree.setCode(e.getDictValue()); tree.setCode(e.getCode());
tree.setChildren(treeNodes.stream().filter(t->t.getObligationId().equals(e.getId())).collect(Collectors.toList())); tree.setChildren(treeNodes.stream().filter(t->t.getObligationId().equals(e.getId())).collect(Collectors.toList()));
list.add(tree); list.add(tree);
}); });
...@@ -81,7 +105,7 @@ public class EmergencyTaskController extends BaseController{ ...@@ -81,7 +105,7 @@ public class EmergencyTaskController extends BaseController{
@ApiOperation(httpMethod = "GET",value = "分工内容列表", notes = "分工内容列表") @ApiOperation(httpMethod = "GET",value = "分工内容列表", notes = "分工内容列表")
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResponse list(Long obligationId ,@RequestParam int pageNumber, public CommonResponse list(Long obligationId , @RequestParam(required = false) String planType,@RequestParam int pageNumber,
@RequestParam int pageSize){ @RequestParam int pageSize){
if (pageNumber >=1 ){ if (pageNumber >=1 ){
pageNumber = pageNumber -1 ; pageNumber = pageNumber -1 ;
...@@ -90,7 +114,11 @@ public class EmergencyTaskController extends BaseController{ ...@@ -90,7 +114,11 @@ public class EmergencyTaskController extends BaseController{
obligationId = null; obligationId = null;
} }
CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize); CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
Page<EmergencyTaskContent> list = iEmergencyTaskService.list(obligationId,commonPageable);
if (StringUtils.isNotEmpty(planType) && "0".equals(planType)) {
planType = null;
}
Page<EmergencyTaskContent> list = iEmergencyTaskService.list(obligationId, planType, commonPageable);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
...@@ -139,6 +167,30 @@ public class EmergencyTaskController extends BaseController{ ...@@ -139,6 +167,30 @@ public class EmergencyTaskController extends BaseController{
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
@ApiOperation(httpMethod = "POST",value = "新增应急任务配置", notes = "新增应急任务配置")
@PostMapping(value = "/saveTaskConfig", produces = "application/json;charset=UTF-8")
public ResponseModel saveTaskConfig(@RequestBody EmergencyTaskContent emergencyTaskContent){
iEmergencyTaskService.saveTaskConfig(emergencyTaskContent);
return CommonResponseUtil2.success();
}
@ApiOperation(httpMethod = "GET",value = "查询流程节点", notes = "查询流程节点")
@GetMapping(value = "/findStep")
public ResponseModel<List<PlanStepJsonVO>> findStep(@RequestParam String planType){
return CommonResponseUtil2.success(planStepService.getPlanStepByParam(planType));
}
@Permission
@ApiOperation(value = "根据ID删除数据", notes = "根据ID删除数据")
@DeleteMapping(value = "/deleteById", produces = "application/json;charset=UTF-8")
public ResponseModel deleteById(@RequestParam(value = "id") Long id) {
if (!Objects.isNull(id)) {
emergencyTaskMapper.deleteTask(id);
}
return CommonResponseUtil2.success();
}
@ApiOperation(httpMethod = "POST",value = "编辑树人员节点", notes = "编辑树人员节点") @ApiOperation(httpMethod = "POST",value = "编辑树人员节点", notes = "编辑树人员节点")
@PostMapping(value = "/editPerson", produces = "application/json;charset=UTF-8") @PostMapping(value = "/editPerson", produces = "application/json;charset=UTF-8")
public CommonResponse editPerson(@RequestBody EmergencyRelationVo vo){ public CommonResponse editPerson(@RequestBody EmergencyRelationVo vo){
......
package com.yeejoin.amos.fas.business.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskRoleMapper;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil2;
import com.yeejoin.amos.fas.core.util.ResponseModel;
import com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("/api/emergencyTaskRole")
@Api(tags = "应急任务角色API")
public class EmergencyTaskRoleController extends BaseController {
@Autowired
private EmergencyTaskRoleMapper emergencyTaskRoleMapper;
@Autowired
private EmergencyTaskMapper emergencyTaskMapper;
/**
* 创建数字预案
*/
@Permission
@ApiOperation(value = "新增", notes = "新增")
@PostMapping(value = "/save", produces = "application/json;charset=UTF-8")
public ResponseModel save(@RequestBody EmergencyTaskRole emergencyTaskRole) {
if (null == emergencyTaskRole) {
return CommonResponseUtil2.failure("参数有误");
}
int i = emergencyTaskRoleMapper.countByCode(emergencyTaskRole.getCode());
if (i > 0) {
return CommonResponseUtil2.failure("角色编码已存在");
}
AgencyUserModel curUser = getUserInfo();
emergencyTaskRole.setCreater(curUser.getUserId());
ReginParams reginParams = getSelectedOrgInfo();
emergencyTaskRole.setBizOrgCode(getOrgCode(reginParams));
emergencyTaskRole.setBizOrgName(!ObjectUtils.isEmpty(reginParams) && !ObjectUtils.isEmpty(reginParams.getCompany()) ? reginParams.getCompany().getCompanyName() : "");
emergencyTaskRole.setCreateDate(new Date());
emergencyTaskRoleMapper.save(emergencyTaskRole);
return CommonResponseUtil2.success();
}
/**
* 修改数字预案
*/
@Permission
@ApiOperation(value = "编辑", notes = "编辑")
@PutMapping(value = "/update", produces = "application/json;charset=UTF-8")
public ResponseModel update(@RequestBody EmergencyTaskRole emergencyTaskRole) {
if (null == emergencyTaskRole) {
return CommonResponseUtil2.failure("参数有误");
}
emergencyTaskRoleMapper.updateById(emergencyTaskRole);
return CommonResponseUtil2.success();
}
@Permission
@ApiOperation(value = "详情", notes = "详情")
@GetMapping(value = "/getById", produces = "application/json;charset=UTF-8")
public ResponseModel getById(@RequestParam(value = "id") Long id) {
EmergencyTaskRole emergencyTaskRole = emergencyTaskRoleMapper.selectById(id);
return CommonResponseUtil2.success(emergencyTaskRole);
}
@Permission
@ApiOperation(value = "根据角色编码查信息", notes = "根据角色编码查信息")
@GetMapping(value = "/getByCode", produces = "application/json;charset=UTF-8")
public ResponseModel getByCode(@RequestParam(value = "code") String code) {
EmergencyTaskRole emergencyTaskRole = emergencyTaskRoleMapper.selectByCode(code);
return CommonResponseUtil2.success(emergencyTaskRole);
}
@Permission
@ApiOperation(value = "分页查询", notes = "分页查询")
@PostMapping(value = "/getInfoByPage")
public ResponseModel<Page<EmergencyTaskRole>> getInfoByPage(@RequestBody EmergencyTaskRole emergencyTaskRole,
@RequestParam Integer pageNum,
@RequestParam Integer size) {
Page<EmergencyTaskRole> emergencyTaskRolePage = new Page<>(pageNum, size);
int infoCount = emergencyTaskRoleMapper.getInfoCount(emergencyTaskRole);
emergencyTaskRolePage.setTotal(infoCount);
List<EmergencyTaskRole> infoByPage = emergencyTaskRoleMapper.getInfoByPage((pageNum - 1) * size, size, emergencyTaskRole);
emergencyTaskRolePage.setRecords(infoByPage);
return CommonResponseUtil2.success(emergencyTaskRolePage);
}
@Permission
@ApiOperation(value = "根据ID删除数据", notes = "根据ID删除数据")
@DeleteMapping(value = "/deleteById", produces = "application/json;charset=UTF-8")
public ResponseModel deleteById(@RequestParam(value = "id") Long id) {
int total = emergencyTaskMapper.getEmergencyTaskCount(id, null);
if (total > 0) {
return CommonResponseUtil2.failure("已有应急任务,不能删除!");
}
emergencyTaskRoleMapper.deleteRelationByRoleId(id);
emergencyTaskRoleMapper.deleteById(id);
return CommonResponseUtil2.success();
}
@Permission
@ApiOperation(value = "下拉列表", notes = "下拉列表")
@GetMapping(value = "/getList")
public ResponseModel<List<EmergencyTaskRole>> getList() {
List<EmergencyTaskRole> emergencyTaskRoles = emergencyTaskRoleMapper.selectList();
return CommonResponseUtil2.success(emergencyTaskRoles);
}
}
...@@ -17,7 +17,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel; ...@@ -17,7 +17,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel; import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.AesUtil; import com.yeejoin.amos.feign.privilege.util.DesUtil;
import com.yeejoin.amos.feign.privilege.util.PwdUtil; import com.yeejoin.amos.feign.privilege.util.PwdUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -31,6 +31,8 @@ import org.springframework.util.ObjectUtils; ...@@ -31,6 +31,8 @@ import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -68,6 +70,8 @@ public class LoginController { ...@@ -68,6 +70,8 @@ public class LoginController {
@Value("${amos.system.user.app-key}") @Value("${amos.system.user.app-key}")
private String appKey; private String appKey;
private String aProduct = "AMOS_STUDIO_WEB";
@ApiOperation(value = "通过userId登录", notes = "查询设备指标") @ApiOperation(value = "通过userId登录", notes = "查询设备指标")
...@@ -87,7 +91,12 @@ public class LoginController { ...@@ -87,7 +91,12 @@ public class LoginController {
reginParams = getLogin(userId, token); reginParams = getLogin(userId, token);
}else{ }else{
RequestContext.setProduct(product); RequestContext.setProduct(product);
if (!TokenOperation.refresh(reginParams.getToken())) { String cacheKey = Redis.genKey(new String[]{CacheType.ERASABLE.name(), "SESSION_TOKEN", aProduct, reginParams.getToken()});
boolean hasKey = Redis.getRedisTemplate().hasKey(cacheKey);
if (hasKey) {
return reginParams;
} else {
logger.info("Auto自动登陆=====:{}", JSON.toJSONString(reginParams));
reginParams = getLogin(userId, token); reginParams = getLogin(userId, token);
} }
} }
...@@ -99,7 +108,7 @@ public class LoginController { ...@@ -99,7 +108,7 @@ public class LoginController {
ReginParams reginParams = new ReginParams(); ReginParams reginParams = new ReginParams();
IdPasswordAuthModel dPasswordAuthModel = new IdPasswordAuthModel(); IdPasswordAuthModel dPasswordAuthModel = new IdPasswordAuthModel();
dPasswordAuthModel.setLoginId(userId); dPasswordAuthModel.setLoginId(userId);
dPasswordAuthModel.setPassword(PwdUtil.encode(password)); dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz"));
RequestContext.setProduct(product); RequestContext.setProduct(product);
FeignClientResult feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel); FeignClientResult feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel);
if (ObjectUtils.isEmpty(feignClientResult.getResult())){ if (ObjectUtils.isEmpty(feignClientResult.getResult())){
......
...@@ -5,6 +5,7 @@ import com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo; ...@@ -5,6 +5,7 @@ import com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo;
import com.yeejoin.amos.fas.business.vo.ReginParams; import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil2; import com.yeejoin.amos.fas.core.util.CommonResponseUtil2;
import com.yeejoin.amos.fas.core.util.ResponseModel; import com.yeejoin.amos.fas.core.util.ResponseModel;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree;
import com.yeejoin.amos.fas.dao.entity.PlanClassifyTree; import com.yeejoin.amos.fas.dao.entity.PlanClassifyTree;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -12,7 +13,10 @@ import io.swagger.annotations.ApiOperation; ...@@ -12,7 +13,10 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.UUID;
@RestController @RestController
@RequestMapping("/api/planClassifyTree") @RequestMapping("/api/planClassifyTree")
...@@ -30,6 +34,7 @@ public class PlanClassifyTreeController extends BaseController { ...@@ -30,6 +34,7 @@ public class PlanClassifyTreeController extends BaseController {
String compCode = getOrgCode(reginParams); String compCode = getOrgCode(reginParams);
model.setOrgCode(compCode); model.setOrgCode(compCode);
model.setCreator(user.getUserId()); model.setCreator(user.getUserId());
model.setPlanType(UUID.randomUUID().toString());
return CommonResponseUtil2.success(planClassifyTreeService.create(model)); return CommonResponseUtil2.success(planClassifyTreeService.create(model));
} }
...@@ -62,4 +67,31 @@ public class PlanClassifyTreeController extends BaseController { ...@@ -62,4 +67,31 @@ public class PlanClassifyTreeController extends BaseController {
} }
return CommonResponseUtil2.success(list); return CommonResponseUtil2.success(list);
} }
@ApiOperation(value = "查询分类树 - 新页面使用")
@RequestMapping(value = "/treeNew", method = RequestMethod.GET)
public ResponseModel getTreeNew() {
Collection<PlanClassifyTreeVo> list = null;
try {
list = planClassifyTreeService.getTree();
}catch (Exception e){
e.printStackTrace();
System.out.println(e.getStackTrace().toString());
}
//增加根节点
PlanClassifyTreeVo tree = new PlanClassifyTreeVo();
tree.setId(0);
tree.setClassifyName("全部");
tree.setPlanType("0");
tree.setChildren(list);
List<PlanClassifyTreeVo> root = new ArrayList<>();
root.add(tree);
return CommonResponseUtil2.success(root);
}
@ApiOperation(value = "查询分类信息 - 新页面使用")
@RequestMapping(value = "/getPlanClassifyInfo", method = RequestMethod.GET)
public ResponseModel getPlanClassifyInfo() {
return CommonResponseUtil2.success(planClassifyTreeService.findAllInfo());
}
} }
...@@ -10,7 +10,9 @@ import com.yeejoin.amos.fas.core.util.CommonResponse; ...@@ -10,7 +10,9 @@ import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil2; import com.yeejoin.amos.fas.core.util.CommonResponseUtil2;
import com.yeejoin.amos.fas.core.util.ResponseModel; import com.yeejoin.amos.fas.core.util.ResponseModel;
import com.yeejoin.amos.fas.dao.dto.PlanStepJsonVO;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance; import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import com.yeejoin.amos.fas.dao.entity.PlanStepTree;
import com.yeejoin.amos.fas.dao.entity.TextPlan; import com.yeejoin.amos.fas.dao.entity.TextPlan;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -30,6 +32,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -30,6 +32,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping(value = "/api/visual") @RequestMapping(value = "/api/visual")
...@@ -181,6 +184,30 @@ public class PlanVisual3dController extends BaseController { ...@@ -181,6 +184,30 @@ public class PlanVisual3dController extends BaseController {
} }
@Permission @Permission
@ApiOperation(value = "根据批次号获取预案的步骤", notes = "根据批次号获取预案的步骤")
@GetMapping(value = "/plan/step/tree")
public ResponseModel getPlanStepTree(@RequestParam(value = "batchNo", required = false) String batchNo) {
if (StringUtils.isEmpty(batchNo)) {
batchNo = planVisual3dService.getNewestBatchNo();
}
List<PlanStepTree> root = new ArrayList<>();
List<PlanStepJsonVO> list = planVisual3dService.getPlanStepList(batchNo);
list.stream().map(x -> {x.setIndex(x.getIndex() + 1); return x;}).collect(Collectors.toList());
//增加根节点
PlanStepTree tree = new PlanStepTree();
tree.setId(0);
tree.setIndex(0);
tree.setSequenceNbr("0");
tree.setName("全部");
tree.setStepName("全部");
tree.setType("3");
tree.setCode("0");
tree.setChildren(list);
root.add(tree);
return CommonResponseUtil.successNew(root);
}
@Permission
@ApiOperation(value = "根据批次号更新预案的步骤", notes = "根据批次号更新预案的步骤") @ApiOperation(value = "根据批次号更新预案的步骤", notes = "根据批次号更新预案的步骤")
@PostMapping(value = "/plan/updatePlanStep") @PostMapping(value = "/plan/updatePlanStep")
public ResponseModel updatePlanStep(@RequestBody PlanStepVo planStepVo) { public ResponseModel updatePlanStep(@RequestBody PlanStepVo planStepVo) {
......
...@@ -38,8 +38,8 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns ...@@ -38,8 +38,8 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns
List<ContingencyPlanInstanceVO> getTaskActionList(@Param("type") String type, @Param("status") String status, @Param("batchNo") String batchNo); List<ContingencyPlanInstanceVO> getTaskActionList(@Param("type") String type, @Param("status") String status, @Param("batchNo") String batchNo);
int countTaskPage(@Param("type") String type, @Param("batchNo") String batchNo, @Param("list") List<String> roles); int countTaskPage(@Param("type") String type, @Param("batchNo") String batchNo, @Param("list") List<String> roles, @Param("steps") List<String> steps);
List<ContingencyPlanInstanceVO> getTaskActionPage(@Param("current") int current, @Param("size") int size, @Param("batchNo") String batchNo, @Param("type") String type, @Param("runState") String runState, @Param("updateDate") String updateDate, @Param("list") List<String> roles); List<ContingencyPlanInstanceVO> getTaskActionPage(@Param("current") int current, @Param("size") int size, @Param("batchNo") String batchNo, @Param("type") String type, @Param("runState") String runState, @Param("updateDate") String updateDate, @Param("list") List<String> roles, @Param("steps") List<String> steps);
} }
...@@ -9,23 +9,29 @@ import org.apache.ibatis.annotations.Param; ...@@ -9,23 +9,29 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface EmergencyTaskMapper extends BaseMapper { public interface EmergencyTaskMapper extends BaseMapper {
List<EmergencyTaskContent> getEmergencyTaskList(Long obligationId,Long offset,int pageSize); List<EmergencyTaskContent> getEmergencyTaskList(@Param("obligationId") Long obligationId, @Param("offset")Long offset, @Param("pageSize")int pageSize, @Param("planType") String planType);
int getEmergencyTaskCount(Long obligationId); int getEmergencyTaskCount(@Param("obligationId") Long obligationId, @Param("planType") String planType);
List<EmergencyRelationTree> treeList(); List<EmergencyRelationTree> treeList();
void deleteTreeNode(Long obligationId , Long personId); void deleteTreeNode(Long obligationId , Long personId);
void deleteTask(@Param("id") Long id);
void save(EmergencyRelation emergencyRelation); void save(EmergencyRelation emergencyRelation);
void saveTaskConfig(EmergencyTaskContent emergencyTaskContent);
List<String> roleCodes(String amosOrgId); List<String> roleCodes(String amosOrgId);
List<Long> getPersonIds(Long obligationId); List<Long> getPersonIds(Long obligationId);
List<String> roleNames(String amosOrgId); List<String> roleNames(String amosOrgId);
List<EmergencyTaskContentVo> getContentList(@Param("stepCode") String stepCode); List<EmergencyTaskContentVo> getContentList(@Param("stepCode") String stepCode, @Param("planType") String planType);
List<EmergencyTaskContentVo> getMustTaskList(@Param("stepCode") String stepCode); List<EmergencyTaskContentVo> getMustTaskList(@Param("stepCode") String stepCode, @Param("planType") String planType);
} }
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface EmergencyTaskRoleMapper extends BaseMapper<EmergencyTaskRole> {
void save(EmergencyTaskRole emergencyTaskRole);
int countByCode(String code);
int updateById(EmergencyTaskRole emergencyTaskRole);
EmergencyTaskRole selectById(Long id);
int getInfoCount(EmergencyTaskRole emergencyTaskRole);
List<EmergencyTaskRole> getInfoByPage(Integer pageNum,
Integer size,
EmergencyTaskRole emergencyTaskRole);
int deleteById(Long id);
int deleteRelationByRoleId(Long roleId);
EmergencyTaskRole selectByCode(String code);
List<EmergencyTaskRole> selectList();
List<EmergencyTaskRole> selectListFilterEmptyTask();
String getPlanStepInfoByType(@Param("planType") String planType);
}
...@@ -57,4 +57,6 @@ public interface PlanDetailMapper { ...@@ -57,4 +57,6 @@ public interface PlanDetailMapper {
String queryBatchNoByFireEquipmentId(@Param("fireEquipmentId") String fireEquipmentId); String queryBatchNoByFireEquipmentId(@Param("fireEquipmentId") String fireEquipmentId);
PlanDetailVo getPlanDetailById(@Param("id") String id);
} }
package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole;
import org.springframework.stereotype.Repository;
@Repository
public interface EmergencyTaskRoleDao extends BaseDao<EmergencyTaskRole, Long> {
}
...@@ -161,6 +161,7 @@ public class RemoteSecurityService { ...@@ -161,6 +161,7 @@ public class RemoteSecurityService {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
Toke toke = null; Toke toke = null;
try { try {
toke = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(amosRequestContext.getUserName())), Toke.class); toke = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(amosRequestContext.getUserName())), Toke.class);
......
...@@ -458,12 +458,19 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -458,12 +458,19 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
@Override @Override
public Optional<Equipment> clickButton(String batchNo, String stepCode, String buttonJson, String contingencyPlanId, String buttonCode, String buttonState, String stepStateOnbutton, String isExecute, String isAuto, String token, String product, String appKey,String startUserName) throws Exception { public Optional<Equipment> clickButton(String batchNo, String stepCode, String buttonJson, String contingencyPlanId, String buttonCode, String buttonState, String stepStateOnbutton, String isExecute, String isAuto, String token, String product, String appKey,String startUserName) throws Exception {
if ("0".equals(stepCode)) { String planType = null;
if (redisTemplate.hasKey("planType")) {
planType = redisTemplate.boundValueOps("planType").get(0, -1);
}
// 此处逻辑修改为所有任务执行完成才会点亮节点
List<EmergencyTaskContentVo> tasks = emergencyTaskService.getMustTaskList(stepCode, planType);
boolean flag = judgeIfConfirmed(tasks, batchNo);
if ("0".equals(stepCode) && flag) {
contingencyInstance.fire(batchNo, stepCode, buttonJson, contingencyPlanId, contingencyInstance.fire(batchNo, stepCode, buttonJson, contingencyPlanId,
"FIRE_CONFIRM", buttonState, stepStateOnbutton, "true", "false", token, "FIRE_CONFIRM", buttonState, stepStateOnbutton, "true", "false", token,
product, appKey, startUserName); product, appKey, startUserName);
} }
ContingencyPlanInstance instance = contingencyPlanInstanceMapper.getMessageById(contingencyPlanId); ContingencyPlanInstance instance = contingencyPlanInstanceMapper.getMessageById(contingencyPlanId);
instance.setId(null); instance.setId(null);
instance.setRecordType("REPLYMESSAGE"); instance.setRecordType("REPLYMESSAGE");
...@@ -471,8 +478,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -471,8 +478,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
instance.setContent(instance.getCategory()); instance.setContent(instance.getCategory());
ContingencyPlanInstance res = repository.save(instance); ContingencyPlanInstance res = repository.save(instance);
if (!ObjectUtils.isEmpty(res)) { if (!ObjectUtils.isEmpty(res)) {
List<EmergencyTaskContentVo> mustTasks = emergencyTaskService.getMustTaskList(stepCode);
boolean flag = judgeIfConfirmed(mustTasks, batchNo);
if (!"-1".equals(stepCode) && flag) { if (!"-1".equals(stepCode) && flag) {
PlanExecuteVo vo = new PlanExecuteVo(); PlanExecuteVo vo = new PlanExecuteVo();
vo.setConfirm(buttonState); vo.setConfirm(buttonState);
...@@ -535,19 +540,18 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -535,19 +540,18 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
return Optional.empty(); return Optional.empty();
} }
private boolean judgeIfConfirmed(List<EmergencyTaskContentVo> mustTasks, String batchNo) { private boolean judgeIfConfirmed(List<EmergencyTaskContentVo> tasks, String batchNo) {
if (0 == mustTasks.size()) { boolean flag = Boolean.TRUE;
return true; if (!CollectionUtils.isEmpty(tasks)) {
} EmergencyTaskContentVo contentVo = tasks.get(0);
EmergencyTaskContentVo vo = mustTasks.get(0);
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
Integer count = contingencyPlanInstanceMapper.getPlanInstanceByRunState(vo.getStepCode(), batchNo); Integer count = contingencyPlanInstanceMapper.getPlanInstanceByRunState(contentVo.getStepCode(), batchNo);
if (0 == count) { if (0 != count) {
return true; flag = Boolean.FALSE;
} else { }
return false;
} }
return flag;
} }
@Autowired @Autowired
......
...@@ -13,10 +13,7 @@ import com.yeejoin.amos.fas.business.param.AlarmParam; ...@@ -13,10 +13,7 @@ import com.yeejoin.amos.fas.business.param.AlarmParam;
import com.yeejoin.amos.fas.business.service.intfc.*; import com.yeejoin.amos.fas.business.service.intfc.*;
import com.yeejoin.amos.fas.business.util.TreeUtil; import com.yeejoin.amos.fas.business.util.TreeUtil;
import com.yeejoin.amos.fas.business.vo.*; import com.yeejoin.amos.fas.business.vo.*;
import com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum; import com.yeejoin.amos.fas.common.enums.*;
import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.amos.fas.common.enums.ExecutionTypeEnum;
import com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum;
import com.yeejoin.amos.fas.core.enums.NumberEnum; import com.yeejoin.amos.fas.core.enums.NumberEnum;
import com.yeejoin.amos.fas.core.enums.ReserveEnum; import com.yeejoin.amos.fas.core.enums.ReserveEnum;
import com.yeejoin.amos.fas.core.util.DateUtil; import com.yeejoin.amos.fas.core.util.DateUtil;
...@@ -26,6 +23,7 @@ import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo; ...@@ -26,6 +23,7 @@ import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext; import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -47,6 +45,7 @@ import org.typroject.tyboot.component.emq.EmqxListener; ...@@ -47,6 +45,7 @@ import org.typroject.tyboot.component.emq.EmqxListener;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
...@@ -150,7 +149,13 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -150,7 +149,13 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
logger.info("========状态校验==========="); logger.info("========状态校验===========");
ReserveEnum reserveEnum = this.runCheck(vo); ReserveEnum reserveEnum = this.runCheck(vo);
result.setMessage(reserveEnum.getText()); result.setMessage(reserveEnum.getText());
PlanDetailVo detailVo = planDetailMapper.getPlanDetailById(vo.getPlanId());
Optional<PlanClassifyTree> tree = classifyTreeDao.findById(detailVo.getClassifyId());
if (tree.isPresent()) {
PlanClassifyTree entity = tree.get();
redisTemplate.opsForValue().set("planType", entity.getPlanType());
planStepService.initPlanStep(); planStepService.initPlanStep();
}
if (ReserveEnum.THISRUNNING.getStatus().equals(reserveEnum.getStatus())) { if (ReserveEnum.THISRUNNING.getStatus().equals(reserveEnum.getStatus())) {
List<PlanOperationRecord> recordList = planOperationRecordDao.findByPlanId1(Long.valueOf(vo.getPlanId())); List<PlanOperationRecord> recordList = planOperationRecordDao.findByPlanId1(Long.valueOf(vo.getPlanId()));
result.setMessage(ReserveEnum.THISRUNNING.getText()); result.setMessage(ReserveEnum.THISRUNNING.getText());
...@@ -339,8 +344,6 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -339,8 +344,6 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
@Override @Override
public List<HashMap<String, Object>> getBatchNoByCode(String code) { public List<HashMap<String, Object>> getBatchNoByCode(String code) {
List<HashMap<String, Object>> list = new ArrayList<>(); List<HashMap<String, Object>> list = new ArrayList<>();
// 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey);
String idByCode = equipmentSpecificMapper.getIdByCode(code); String idByCode = equipmentSpecificMapper.getIdByCode(code);
if (StringUtils.isEmpty(idByCode)) { if (StringUtils.isEmpty(idByCode)) {
return list; return list;
...@@ -871,11 +874,11 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -871,11 +874,11 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
} }
@Override @Override
public Page<ContingencyPlanInstanceVO> selectTaskActionPage(int current, int size, String batchNo, String runState, String updateDate, List<String> roleList) { public Page<ContingencyPlanInstanceVO> selectTaskActionPage(int current, int size, String batchNo, String runState, String updateDate, List<String> roleList, List<String> steps) {
String type = "TASKOPERATE"; String type = "TASKOPERATE";
Page<ContingencyPlanInstanceVO> page = new Page<>(current, size); Page<ContingencyPlanInstanceVO> page = new Page<>(current, size);
int total = 0; int total = 0;
total = contingencyInstanceInfoMapper.countTaskPage(type, batchNo, roleList); total = contingencyInstanceInfoMapper.countTaskPage(type, batchNo, roleList, steps);
long start = (page.getCurrent() - 1) * page.getSize(); long start = (page.getCurrent() - 1) * page.getSize();
if (total == 0) { if (total == 0) {
page.setCurrent(1); page.setCurrent(1);
...@@ -886,7 +889,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -886,7 +889,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
} }
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
List<ContingencyPlanInstanceVO> list = contingencyInstanceInfoMapper.getTaskActionPage((int) start, size, batchNo, type, runState, updateDate, roleList); List<ContingencyPlanInstanceVO> list = contingencyInstanceInfoMapper.getTaskActionPage((int) start, size, batchNo, type, runState, updateDate, roleList, steps);
list.stream().forEach(e->{ list.stream().forEach(e->{
if(ObjectUtils.isEmpty(e.getCreateUser())) { if(ObjectUtils.isEmpty(e.getCreateUser())) {
List<String> userName = planVisual3dService.getUserName(e.getRoleCode()); List<String> userName = planVisual3dService.getUserName(e.getRoleCode());
......
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskRoleService;
import com.yeejoin.amos.fas.business.vo.PlanDetailVo;
import com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum;
import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.exception.YeeException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class EmergencyTaskRoleServiceImpl implements IEmergencyTaskRoleService {
}
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo; import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper; import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskRoleMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper; import com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository; import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository;
import com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao; import com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao;
...@@ -17,10 +18,7 @@ import com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo; ...@@ -17,10 +18,7 @@ import com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo;
import com.yeejoin.amos.fas.business.vo.MessageVO; import com.yeejoin.amos.fas.business.vo.MessageVO;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.StringUtil; import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance; import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelation;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree;
import com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent;
import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext; import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
...@@ -68,6 +66,9 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService { ...@@ -68,6 +66,9 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
@Autowired @Autowired
private PlanOperationRecordMapper planOperationRecordMapper; private PlanOperationRecordMapper planOperationRecordMapper;
@Autowired
private EmergencyTaskRoleMapper emergencyTaskRoleMapper;
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
...@@ -76,17 +77,20 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService { ...@@ -76,17 +77,20 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
@Value("${auth-key-auth-enabled:}") @Value("${auth-key-auth-enabled:}")
private String authKey; private String authKey;
String taskJson = "{\"type\":\"button\",\"operate\":[{\"code\":\"STOP_OIL_CONSERVATOR_DRAIN\",\"icon\":\"yellow\",\"state\":\"wait\",\"title\":\"已执行\",\"confirm\":false,\"content\":\"_content\",\"delayed\":[0],\"stepState\":\"A\",\"requestUrl\":\"/fireAutoSys/api/timeline/click\"}],\"stepCode\":\"_stepCode\"}";
@Override @Override
public Page<EmergencyTaskContent> list(Long obligationId, CommonPageable pageable) { public Page<EmergencyTaskContent> list(Long obligationId, String planType, CommonPageable pageable) {
int total = emergencyTaskMapper.getEmergencyTaskCount(obligationId); int total = emergencyTaskMapper.getEmergencyTaskCount(obligationId, planType);
List<EmergencyTaskContent> emergencyTaskList = emergencyTaskMapper.getEmergencyTaskList(obligationId, pageable.getOffset(), pageable.getPageSize()); List<EmergencyTaskContent> emergencyTaskList = emergencyTaskMapper.getEmergencyTaskList(obligationId, pageable.getOffset(), pageable.getPageSize(), planType);
Page<EmergencyTaskContent> result = new PageImpl<>(emergencyTaskList, pageable, total); org.springframework.data.domain.Page<EmergencyTaskContent> result = new PageImpl<>(emergencyTaskList, pageable, total);
return result; return result;
} }
@Override @Override
public List<EmergencyRelationTree> treeList() { public List<EmergencyRelationTree> treeList() {
return emergencyTaskMapper.treeList(); return emergencyTaskMapper.treeList();
} }
...@@ -101,6 +105,26 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService { ...@@ -101,6 +105,26 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
} }
@Override @Override
public void saveTaskConfig(EmergencyTaskContent emergencyTaskContent) {
List<String> roleList = emergencyTaskContent.getRoleCodeList();
for (String role : roleList
) {
String json = taskJson.replace("_content", emergencyTaskContent.getContent()).replace("_stepCode", emergencyTaskContent.getStepCode());
emergencyTaskContent.setButtonJson(json);
EmergencyTaskRole emergencyTaskRole = emergencyTaskRoleMapper.selectById(Long.valueOf(role));
emergencyTaskContent.setRoleCode(emergencyTaskRole.getCode());
emergencyTaskContent.setObligationName(emergencyTaskRole.getName());
if("1".equals(emergencyTaskContent.getIsMustString())) {
emergencyTaskContent.setMust(true);
} else {
emergencyTaskContent.setMust(false);
}
emergencyTaskContent.setObligationId(emergencyTaskRole.getId());
emergencyTaskMapper.saveTaskConfig(emergencyTaskContent);
}
}
@Override
public String getRolesByUserId(String userId) { public String getRolesByUserId(String userId) {
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
...@@ -125,7 +149,11 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService { ...@@ -125,7 +149,11 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
@Transactional @Transactional
@Override @Override
public void saveTask(String stepCode, String batchId) { public void saveTask(String stepCode, String batchId) {
List<EmergencyTaskContentVo> list = emergencyTaskMapper.getContentList(stepCode); String planType = null;
if (redisTemplate.hasKey("planType")) {
planType = redisTemplate.boundValueOps("planType").get(0, -1);
}
List<EmergencyTaskContentVo> list = emergencyTaskMapper.getContentList(stepCode, planType);
if (0 < list.size()) { if (0 < list.size()) {
String batchNo = StringUtil.isNotEmpty(batchId) ? batchId : planOperationRecordMapper.getLastBatchNo(); String batchNo = StringUtil.isNotEmpty(batchId) ? batchId : planOperationRecordMapper.getLastBatchNo();
if (!findByBatchNoAndStatus(batchNo)) { if (!findByBatchNoAndStatus(batchNo)) {
...@@ -147,7 +175,7 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService { ...@@ -147,7 +175,7 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
contingencyPlanInstance.setTaskSort(taskNum); contingencyPlanInstance.setTaskSort(taskNum);
contingencyPlanInstance.setStepCode(stepCode); contingencyPlanInstance.setStepCode(stepCode);
contingencyPlanInstance.setContent(buttonJson); contingencyPlanInstance.setContent(buttonJson);
contingencyPlanInstanceRepository.save(contingencyPlanInstance); contingencyPlanInstanceRepository.saveAndFlush(contingencyPlanInstance);
if ("0".equals(stepCode)) { if ("0".equals(stepCode)) {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
...@@ -199,9 +227,9 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService { ...@@ -199,9 +227,9 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
} }
@Override @Override
public List<EmergencyTaskContentVo> getMustTaskList(String stepCode) { public List<EmergencyTaskContentVo> getMustTaskList(String stepCode, String planType) {
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
return emergencyTaskMapper.getMustTaskList(stepCode); return emergencyTaskMapper.getMustTaskList(stepCode, planType);
} }
} }
...@@ -2,20 +2,16 @@ package com.yeejoin.amos.fas.business.service.impl; ...@@ -2,20 +2,16 @@ package com.yeejoin.amos.fas.business.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.yeejoin.amos.fas.business.dao.mapper.*;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PlanMessageMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao; import com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao; import com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IPlanMessageDao; import com.yeejoin.amos.fas.business.dao.repository.IPlanMessageDao;
import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService; import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentFireEquipmentService; import com.yeejoin.amos.fas.business.service.intfc.IEquipmentFireEquipmentService;
import com.yeejoin.amos.fas.business.service.intfc.IPlanStepService;
import com.yeejoin.amos.fas.business.vo.ConditionVO; import com.yeejoin.amos.fas.business.vo.ConditionVO;
import com.yeejoin.amos.fas.business.vo.PlanStepJsonVO; import com.yeejoin.amos.fas.business.vo.PlanStepJsonVO;
import com.yeejoin.amos.fas.common.enums.SqlKeyWordEnum; import com.yeejoin.amos.fas.common.enums.SqlKeyWordEnum;
import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment; import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment;
import com.yeejoin.amos.fas.dao.entity.PlanMessage; import com.yeejoin.amos.fas.dao.entity.PlanMessage;
import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext; import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext;
...@@ -24,15 +20,12 @@ import org.apache.commons.lang3.StringUtils; ...@@ -24,15 +20,12 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -89,10 +82,8 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen ...@@ -89,10 +82,8 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper; EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired @Autowired
private EquipmentSpecificMapper equipmentSpecificMapper; private IPlanStepService iPlanStepService;
@Value("classpath:/json/plan-step.json")
private Resource planStepResource;
@Override @Override
public List<EquipmentFireEquipment> findByEquipmentId(Long equipmentId) { public List<EquipmentFireEquipment> findByEquipmentId(Long equipmentId) {
...@@ -181,13 +172,8 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen ...@@ -181,13 +172,8 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
if (ObjectUtils.isEmpty(index)) { if (ObjectUtils.isEmpty(index)) {
return false; return false;
} }
String json; String planStep = iPlanStepService.getPlanStep();
try { List<PlanStepJsonVO> result = JSONObject.parseArray(planStep, PlanStepJsonVO.class);
json = IOUtils.toString(planStepResource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException("获取预案节点信息失败!");
}
List<PlanStepJsonVO> result = JSONObject.parseArray(json, PlanStepJsonVO.class);
if (!CollectionUtils.isEmpty(result)) { if (!CollectionUtils.isEmpty(result)) {
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
......
...@@ -25,9 +25,11 @@ import com.yeejoin.amos.fas.business.util.RpnUtils; ...@@ -25,9 +25,11 @@ import com.yeejoin.amos.fas.business.util.RpnUtils;
import com.yeejoin.amos.fas.business.vo.*; import com.yeejoin.amos.fas.business.vo.*;
import com.yeejoin.amos.fas.client.invoke.RsDataQueue; import com.yeejoin.amos.fas.client.invoke.RsDataQueue;
import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum; import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.amos.fas.common.enums.PlanTypeEnum;
import com.yeejoin.amos.fas.core.util.StringUtil; import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.*; import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.datasync.bo.ContingencyOriginalDataSyncBo; import com.yeejoin.amos.fas.datasync.bo.ContingencyOriginalDataSyncBo;
import org.apache.commons.io.IOUtils;
import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext; import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -45,6 +47,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext; ...@@ -45,6 +47,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.awt.*; import java.awt.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.List; import java.util.List;
...@@ -84,6 +87,12 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -84,6 +87,12 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Value("${plan.dynamic.execut.topic}") @Value("${plan.dynamic.execut.topic}")
private String planDynamicExecutTopic; private String planDynamicExecutTopic;
@Value("${plan.dynamic.execut.zb.topic}")
private String planDynamicExecutZBTopic;
@Value("${plan.dynamic.execut.gk.topic}")
private String planDynamicExecutGKTopic;
@Autowired @Autowired
private WebMqttComponent webMqttComponent; private WebMqttComponent webMqttComponent;
...@@ -202,7 +211,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -202,7 +211,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
if ("false".equals(topicEntity.getSimulationDate()) && nameKeys.contains(typeCode) && indexStateIsChange(equipmentSpecificIndex)) { if ("false".equals(topicEntity.getSimulationDate()) && nameKeys.contains(typeCode) && indexStateIsChange(equipmentSpecificIndex)) {
log.info("指标值没有发生变化: " + equipmentSpecificIndex.getIotCode() + "-" + equipmentSpecificIndex.getNameKey() + ":" + equipmentSpecificIndex.getValue()); log.info("指标值没有发生变化: " + equipmentSpecificIndex.getIotCode() + "-" + equipmentSpecificIndex.getNameKey() + ":" + equipmentSpecificIndex.getValue());
// 三维屏指标状态推送,没有绑定模型的设备不需要推送至三维 // 三维屏指标状态推送,没有绑定模型的设备不需要推送至三维
if("true".equals(equipmentSpecific.getPush3D())){ if ("true".equals(equipmentSpecific.getPush3D())) {
equipmentSpecificIndex.setId(equipmentSpecific.getId()); equipmentSpecificIndex.setId(equipmentSpecific.getId());
equipmentSpecificIndex.setName(equipmentSpecific.getName()); equipmentSpecificIndex.setName(equipmentSpecific.getName());
equipmentSpecificIndex.setCode(equipmentSpecific.getCode()); equipmentSpecificIndex.setCode(equipmentSpecific.getCode());
...@@ -290,7 +299,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -290,7 +299,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
webMqttComponent.publish(title, JSON.toJSONString(view3dService.getEquipStatusList(equipmentSpecific.getOrgCode()))); webMqttComponent.publish(title, JSON.toJSONString(view3dService.getEquipStatusList(equipmentSpecific.getOrgCode())));
} }
//根据指标数据处理预案按钮 //根据指标数据处理预案按钮
if(planIndex.contains(nameKey) && !ObjectUtils.isEmpty(equipment)){ if (planIndex.contains(nameKey) && !ObjectUtils.isEmpty(equipment)) {
DeviceRo deviceRo = new DeviceRo(); DeviceRo deviceRo = new DeviceRo();
deviceRo.setEquipmentCode(equipment.getCode()); deviceRo.setEquipmentCode(equipment.getCode());
deviceRo.setEquipmentId(equipment.getId()); deviceRo.setEquipmentId(equipment.getId());
...@@ -313,7 +322,16 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -313,7 +322,16 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
try { try {
RequestContext.setToken(toke.getToke()); RequestContext.setToken(toke.getToke());
RequestContext.setProduct(toke.getProduct()); RequestContext.setProduct(toke.getProduct());
ruleTrigger.publish(deviceRo, planDynamicExecutTopic, new String[] {}); if (redisTemplate.hasKey("planType")) {
String planType = redisTemplate.boundValueOps("planType").get(0, -1);
if (PlanTypeEnum.MAINTRANSFORM.getKey().equalsIgnoreCase(planType)) {
ruleTrigger.publish(deviceRo, planDynamicExecutZBTopic, new String[]{});
} else if (PlanTypeEnum.HIGHRESISTANCE.getKey().equalsIgnoreCase(planType)) {
ruleTrigger.publish(deviceRo, planDynamicExecutGKTopic, new String[]{});
} else {
ruleTrigger.publish(deviceRo, planDynamicExecutTopic, new String[]{});
}
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -391,6 +409,47 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -391,6 +409,47 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
return true; return true;
} }
/**
* <pre>
* @Description: rpn, rpni值修改
* </pre>
*
* @MethodName:
* @Param: [fmeaId]
* @Return: void
* @Throws
* @Author keyong
* @Date 2020/11/16 18:26
*/
public void updateFmeaRpn(long fmeaId) {
Fmea fmea = fmeaMapper.getById(fmeaId);
BigDecimal oidValue = new BigDecimal(fmea.getOidValue());
BigDecimal sidValue = new BigDecimal(fmea.getSidValue());
BigDecimal didValue = new BigDecimal(fmea.getDidValue());
// 计算rpni
BigDecimal rpni = oidValue.multiply(sidValue).multiply(didValue).setScale(2, BigDecimal.ROUND_HALF_UP);
BigDecimal rpn;
if (fmea.getNewEvaluationOid() == null) {
EvaluationModel evaluationModel = this.getEvaluationModel(fmeaId);
if (evaluationModel != null) { // 已经绑定点位或者巡检点项且匹配到风险模型,则更新为计算后的结果
BigDecimal newOidValue = new BigDecimal(evaluationModel.getCoefficient());
rpn = newOidValue.multiply(sidValue).multiply(didValue).setScale(2, BigDecimal.ROUND_HALF_UP);
fmea.setNewEvaluationOid(evaluationModel.getId());
} else { // 未绑定点位或者巡检点项或者匹配不到风险模型,则更新为rpn与rpni一致
fmea.setNewEvaluationOid(fmea.getEvaluationOid());
rpn = rpni;
}
} else {
BigDecimal newOidValue = new BigDecimal(fmea.getNewOidValue());
rpn = newOidValue.multiply(sidValue).multiply(didValue).setScale(2, BigDecimal.ROUND_HALF_UP);
}
fmea.setRpni(rpni);
fmea.setRpn(rpn);
// 更新fmea
fmeaMapper.updateRpn(fmea);
}
@Override @Override
public void subscribeTopic() { public void subscribeTopic() {
// 若登录系统则订阅装备数据 // 若登录系统则订阅装备数据
......
...@@ -62,6 +62,7 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService { ...@@ -62,6 +62,7 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService {
for (PlanClassifyTree planClassifyTree : list) { for (PlanClassifyTree planClassifyTree : list) {
PlanClassifyTreeVo planClassifyTreeVo = new PlanClassifyTreeVo(); PlanClassifyTreeVo planClassifyTreeVo = new PlanClassifyTreeVo();
BeanUtils.copyProperties(planClassifyTree, planClassifyTreeVo); BeanUtils.copyProperties(planClassifyTree, planClassifyTreeVo);
planClassifyTreeVo.setParentId(0L);
voList.add(planClassifyTreeVo); voList.add(planClassifyTreeVo);
} }
Map<Object, PlanClassifyTreeVo> map = Bean.listToMap(voList, "id", PlanClassifyTree.class); Map<Object, PlanClassifyTreeVo> map = Bean.listToMap(voList, "id", PlanClassifyTree.class);
...@@ -73,6 +74,11 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService { ...@@ -73,6 +74,11 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService {
return TreeBuilder.buildByRecursive(completeList, ROOT); return TreeBuilder.buildByRecursive(completeList, ROOT);
} }
@Override
public List<PlanClassifyTree> findAllInfo() {
return planClassifyTreeDao.findAll();
}
private List<PlanClassifyTreeVo> buildWithParent(PlanClassifyTreeVo groupModel, Map<Object, PlanClassifyTreeVo> map) { private List<PlanClassifyTreeVo> buildWithParent(PlanClassifyTreeVo groupModel, Map<Object, PlanClassifyTreeVo> map) {
List<PlanClassifyTreeVo> completeList = new ArrayList<>(); List<PlanClassifyTreeVo> completeList = new ArrayList<>();
...@@ -137,6 +143,11 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService { ...@@ -137,6 +143,11 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService {
return planClassifyTreeDao.save(model); return planClassifyTreeDao.save(model);
} }
@Override
public PlanClassifyTree findById(Long id) {
return planClassifyTreeDao.findById(id).orElse(new PlanClassifyTree());
}
private boolean classifyNameExist(String classifyName, Long parentId) { private boolean classifyNameExist(String classifyName, Long parentId) {
return 0 < planClassifyTreeDao.countByClassifyNameAndParentId(classifyName, parentId); return 0 < planClassifyTreeDao.countByClassifyNameAndParentId(classifyName, parentId);
} }
......
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskRoleMapper;
import com.yeejoin.amos.fas.business.service.intfc.IPlanStepService; import com.yeejoin.amos.fas.business.service.intfc.IPlanStepService;
import com.yeejoin.amos.fas.business.vo.PlanStepJsonVO; import com.yeejoin.amos.fas.business.vo.PlanStepJsonVO;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -23,8 +19,8 @@ public class PlanStepServiceImpl implements IPlanStepService { ...@@ -23,8 +19,8 @@ public class PlanStepServiceImpl implements IPlanStepService {
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Value("classpath:/json/plan-step.json") @Autowired
private Resource planStepResource; private EmergencyTaskRoleMapper emergencyTaskRoleMapper;
@Override @Override
public String getPlanStepRoleCodeByButtonCode(String buttonCode) { public String getPlanStepRoleCodeByButtonCode(String buttonCode) {
...@@ -52,23 +48,26 @@ public class PlanStepServiceImpl implements IPlanStepService { ...@@ -52,23 +48,26 @@ public class PlanStepServiceImpl implements IPlanStepService {
@Override @Override
public List<PlanStepJsonVO> getPlanStepJsonVOS() { public List<PlanStepJsonVO> getPlanStepJsonVOS() {
String json = ""; String planStepString = getPlanStep();
try { List<PlanStepJsonVO> result = JSONObject.parseArray(planStepString, PlanStepJsonVO.class);
json = IOUtils.toString(planStepResource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException("获取预案相关角色信息失败!");
}
List<PlanStepJsonVO> result = JSONObject.parseArray(json, PlanStepJsonVO.class);
return result; return result;
} }
@Override @Override
public String getPlanStep() { public String getPlanStep() {
try { String planType = "";
return IOUtils.toString(planStepResource.getInputStream(), String.valueOf(StandardCharsets.UTF_8)); if (redisTemplate.hasKey("planType")) {
} catch (IOException e) { planType = redisTemplate.boundValueOps("planType").get(0, -1);
throw new RuntimeException("获取预案初始化planStep信息失败!"); }
String json = emergencyTaskRoleMapper.getPlanStepInfoByType(planType);
return json;
} }
@Override
public List<PlanStepJsonVO> getPlanStepByParam(String planType) {
String json = emergencyTaskRoleMapper.getPlanStepInfoByType(planType);
List<PlanStepJsonVO> result = JSONObject.parseArray(json, PlanStepJsonVO.class);
return result;
} }
@Override @Override
......
...@@ -26,6 +26,7 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil; ...@@ -26,6 +26,7 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.core.util.ResponseModel; import com.yeejoin.amos.fas.core.util.ResponseModel;
import com.yeejoin.amos.fas.dao.entity.*; import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext; import com.yeejoin.amos.fas.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.fas.dao.dto.PlanStepJsonVO;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
...@@ -283,6 +284,13 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -283,6 +284,13 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
} }
@Override @Override
public List<PlanStepJsonVO> getPlanStepList(String batchNo) {
String json = planStepService.getPlanStep();
List<PlanStepJsonVO> res = JSONObject.parseArray(json, PlanStepJsonVO.class);
return res;
}
@Override
public ToipResponse getPlaneRecordByBatchNo(String batchNo) { public ToipResponse getPlaneRecordByBatchNo(String batchNo) {
// 根据批次号获取预案记录 // 根据批次号获取预案记录
List<Map<String, Object>> instancesList = contingencyPlanInstanceRepository.queryRecord(batchNo, "MESSAGE"); List<Map<String, Object>> instancesList = contingencyPlanInstanceRepository.queryRecord(batchNo, "MESSAGE");
......
...@@ -142,5 +142,5 @@ public interface IContingencyPlanService { ...@@ -142,5 +142,5 @@ public interface IContingencyPlanService {
String getPlanBatchNo(); String getPlanBatchNo();
Page<ContingencyPlanInstanceVO> selectTaskActionPage(int current, int size, String batchNo, String runState, String updateDate, List<String> roleList); Page<ContingencyPlanInstanceVO> selectTaskActionPage(int current, int size, String batchNo, String runState, String updateDate, List<String> roleList, List<String> steps);
} }
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.vo.PlanDetailVo;
import com.yeejoin.amos.fas.exception.YeeException;
import org.springframework.transaction.annotation.Transactional;
public interface IEmergencyTaskRoleService {
}
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public interface IEmergencyTaskService { public interface IEmergencyTaskService {
Page<EmergencyTaskContent> list(Long obligationId, CommonPageable pageable); Page<EmergencyTaskContent> list(Long obligationId, String planType, CommonPageable pageable);
List<EmergencyRelationTree> treeList(); List<EmergencyRelationTree> treeList();
...@@ -20,6 +20,8 @@ public interface IEmergencyTaskService { ...@@ -20,6 +20,8 @@ public interface IEmergencyTaskService {
void save(EmergencyRelation emergencyRelation); void save(EmergencyRelation emergencyRelation);
void saveTaskConfig(EmergencyTaskContent emergencyTaskContent);
String getRolesByUserId(String userId); String getRolesByUserId(String userId);
List<Long> getPersonIds(Long obligationId); List<Long> getPersonIds(Long obligationId);
...@@ -28,5 +30,5 @@ public interface IEmergencyTaskService { ...@@ -28,5 +30,5 @@ public interface IEmergencyTaskService {
void saveTask(String stepCode, String batchNo); void saveTask(String stepCode, String batchNo);
List<EmergencyTaskContentVo> getMustTaskList(String stepCode); List<EmergencyTaskContentVo> getMustTaskList(String stepCode, String planType);
} }
...@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo; ...@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo;
import com.yeejoin.amos.fas.dao.entity.PlanClassifyTree; import com.yeejoin.amos.fas.dao.entity.PlanClassifyTree;
import java.util.Collection; import java.util.Collection;
import java.util.List;
/** /**
* @author wjk * @author wjk
...@@ -28,4 +29,8 @@ public interface IPlanClassifyTreeService { ...@@ -28,4 +29,8 @@ public interface IPlanClassifyTreeService {
PlanClassifyTree create(PlanClassifyTree model); PlanClassifyTree create(PlanClassifyTree model);
PlanClassifyTree update(PlanClassifyTree model); PlanClassifyTree update(PlanClassifyTree model);
PlanClassifyTree findById(Long id);
List<PlanClassifyTree> findAllInfo();
} }
...@@ -26,6 +26,8 @@ public interface IPlanStepService { ...@@ -26,6 +26,8 @@ public interface IPlanStepService {
String getPlanStep(); String getPlanStep();
List<PlanStepJsonVO> getPlanStepByParam(String planType);
void initPlanStep(); void initPlanStep();
void initPlanTask(); void initPlanTask();
......
...@@ -2,10 +2,8 @@ package com.yeejoin.amos.fas.business.service.intfc; ...@@ -2,10 +2,8 @@ package com.yeejoin.amos.fas.business.service.intfc;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.fas.business.service.model.ToipResponse; import com.yeejoin.amos.fas.business.service.model.ToipResponse;
import com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO; import com.yeejoin.amos.fas.business.vo.*;
import com.yeejoin.amos.fas.business.vo.MessageVO; import com.yeejoin.amos.fas.dao.dto.PlanStepJsonVO;
import com.yeejoin.amos.fas.business.vo.PlanStepVo;
import com.yeejoin.amos.fas.business.vo.TreeSubjectVo;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance; import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import com.yeejoin.amos.fas.dao.entity.TextPlan; import com.yeejoin.amos.fas.dao.entity.TextPlan;
...@@ -142,4 +140,6 @@ public interface IPlanVisual3dService { ...@@ -142,4 +140,6 @@ public interface IPlanVisual3dService {
* @return * @return
*/ */
ContingencyPlanInstance updateStatusByIdWeb(ContingencyPlanInstance contingencyPlanInstance, Boolean runStatus); ContingencyPlanInstance updateStatusByIdWeb(ContingencyPlanInstance contingencyPlanInstance, Boolean runStatus);
List<PlanStepJsonVO> getPlanStepList(String batchNo);
} }
...@@ -23,6 +23,7 @@ eureka.client.serviceUrl.defaultZone: http://${spring.security.user.name}:${spri ...@@ -23,6 +23,7 @@ eureka.client.serviceUrl.defaultZone: http://${spring.security.user.name}:${spri
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.security.enabled=true management.security.enabled=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url-path=/actuator/health eureka.instance.health-check-url-path=/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
...@@ -55,12 +56,12 @@ file.readUrl=http://172.16.11.201:8085/file/getFile?in= ...@@ -55,12 +56,12 @@ file.readUrl=http://172.16.11.201:8085/file/getFile?in=
## emqx ## emqx
emqx.clean-session=true emqx.clean-session=true
emqx.client-id=${spring.application.name}-${security-random-int} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.201:1883 emqx.broker=tcp://172.16.11.201:1883
emqx.client-user-name=admin emqx.client-user-name=admin
emqx.client-password=ENC(IWhwMSgko6moJ+JDuh5cq41ixOfhyyiaoRiOCw5Iv3f+YAO8Ib5KpWattlT6h57p) emqx.client-password=ENC(IWhwMSgko6moJ+JDuh5cq41ixOfhyyiaoRiOCw5Iv3f+YAO8Ib5KpWattlT6h57p)
emqx.max-inflight=1000 emqx.max-inflight=1000
riskSourceService
#\u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740 #\u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740
file.downLoad.url=http://172.16.11.201:9000/ file.downLoad.url=http://172.16.11.201:9000/
...@@ -105,6 +106,9 @@ plan.web.isUpdatePlanStep=false ...@@ -105,6 +106,9 @@ plan.web.isUpdatePlanStep=false
maparea.action.is-area=action1-2,action1-6 maparea.action.is-area=action1-2,action1-6
plan.dynamic.execut.topic=\u6362\u6D41\u7AD9\u6D88\u9632\u4E13\u9879\u9884\u6848/autoExec plan.dynamic.execut.topic=\u6362\u6D41\u7AD9\u6D88\u9632\u4E13\u9879\u9884\u6848/autoExec
# \u65B0\u589E\u4E3B\u53D8\u548C\u9AD8\u6297\u81EA\u52A8\u6267\u884C\u4E3B\u9898\u914D\u7F6E
plan.dynamic.execut.zb.topic=\u6362\u6D41\u7AD9\u6D88\u9632\u4E13\u9879\u9884\u6848/autoExec-ZB
plan.dynamic.execut.gk.topic=\u6362\u6D41\u7AD9\u6D88\u9632\u4E13\u9879\u9884\u6848/autoExec-GK
#\u670D\u52A1\u7AEF\u83B7\u53D6isdp\u7684token\u7528 #\u670D\u52A1\u7AEF\u83B7\u53D6isdp\u7684token\u7528
sso.client.id=dce sso.client.id=dce
......
...@@ -967,4 +967,53 @@ ...@@ -967,4 +967,53 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="zs" id="20240418-01">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="c_emergency_task_role" />
</not>
</preConditions>
<comment>create table c_emergency_task_role</comment>
<sql>
CREATE TABLE `c_emergency_task_role` (
`id` bigint NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL COMMENT '角色名称',
`code` varchar(255) DEFAULT NULL COMMENT '角色编码',
`sort` varchar(255) DEFAULT NULL COMMENT '排序字段',
`is_delete` int DEFAULT NULL COMMENT '是否删除',
`remark` text COMMENT '备注',
`creater` varchar(255) DEFAULT NULL COMMENT '创建者',
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
`biz_org_code` varchar(255) DEFAULT NULL COMMENT '机构编码',
`biz_org_name` varchar(255) DEFAULT NULL COMMENT '机构名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
</sql>
</changeSet>
<changeSet author="zs" id="20240419-01">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="c_plan_step_config" />
</not>
</preConditions>
<comment>create table c_plan_step_config</comment>
<sql>
CREATE TABLE `c_plan_step_config` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
`type` varchar(255) DEFAULT NULL COMMENT '类型',
`data` longtext COMMENT 'json数据',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
</sql>
</changeSet>
<changeSet author="litengwei" id="20240425-1">
<preConditions onFail="MARK_RAN">
<columnExists tableName="c_plan_classify_tree" columnName="plan_type" />
</preConditions>
<comment>c_plan_classify_tree</comment>
<sql>
ALTER TABLE `c_plan_classify_tree` MODIFY COLUMN plan_type varchar(100) NULL COMMENT '分类TYPE';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -321,6 +321,11 @@ ...@@ -321,6 +321,11 @@
role_code like concat('%',#{role},'%') role_code like concat('%',#{role},'%')
</foreach> </foreach>
</if> </if>
<if test="steps != null and steps.size() >0">
<foreach collection="steps" item="code" index="index" open="and (" close=") " separator="or">
step_code = #{code}
</foreach>
</if>
</where> </where>
UNION ALL UNION ALL
select count(1) AS tmpcount from contingency_plan_instance select count(1) AS tmpcount from contingency_plan_instance
...@@ -337,6 +342,11 @@ ...@@ -337,6 +342,11 @@
role_code like concat('%',#{role},'%') role_code like concat('%',#{role},'%')
</foreach> </foreach>
</if> </if>
<if test="steps != null and steps.size() >0">
<foreach collection="steps" item="code" index="index" open="and (" close=") " separator="or">
step_code = #{code}
</foreach>
</if>
</where> </where>
) a ) a
</select> </select>
...@@ -346,10 +356,10 @@ ...@@ -346,10 +356,10 @@
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num` select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date` , cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path` , cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name` , `file_type`, `role_code`, ro.name AS role_name, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name , cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id on cpi.batch_no = cii.id left join c_emergency_task_role ro on ro.`code` = cpi.role_code
<where> <where>
cpi.step_code != "-1" cpi.step_code != "-1"
<if test="batchNo != null and batchNo != ''"> <if test="batchNo != null and batchNo != ''">
...@@ -363,6 +373,11 @@ ...@@ -363,6 +373,11 @@
cpi.role_code like concat('%',#{role},'%') cpi.role_code like concat('%',#{role},'%')
</foreach> </foreach>
</if> </if>
<if test="steps != null and steps.size() >0">
<foreach collection="steps" item="code" index="index" open="and (" close=") " separator="or">
step_code = #{code}
</foreach>
</if>
</where> </where>
UNION ALL UNION ALL
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num` select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
...@@ -385,6 +400,11 @@ ...@@ -385,6 +400,11 @@
cpi.role_code like concat('%',#{role},'%') cpi.role_code like concat('%',#{role},'%')
</foreach> </foreach>
</if> </if>
<if test="steps != null and steps.size() >0">
<foreach collection="steps" item="code" index="index" open="and (" close=") " separator="or">
step_code = #{code}
</foreach>
</if>
</where> </where>
) tmp ) tmp
<if test="updateDate != null and updateDate != '' and updateDate == 0"> <if test="updateDate != null and updateDate != '' and updateDate == 0">
......
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskRoleMapper">
<insert id="save" parameterType="com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole">
INSERT INTO `c_emergency_task_role`(`name`, `code`, `sort`, `is_delete`, `remark`, `creater`, `create_date`, `biz_org_code`, `biz_org_name` )
VALUES (#{name}, #{code}, #{sort}, #{isDelete},#{remark},#{creater},#{createDate},#{bizOrgCode},#{bizOrgName});
</insert>
<update id="updateById">
UPDATE
c_emergency_task_role
SET `name` = #{name},
`code` = #{code},
`sort` = #{sort},
`remark` = #{remark},
`creater` = #{creater}
WHERE
`id` = #{id}
</update>
<select id="selectById" resultType="com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole">
select * from c_emergency_task_role where id = #{id}
</select>
<select id="getInfoByPage" resultType="com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole">
select * from
c_emergency_task_role
where 1 = 1
and is_delete = 0
order by create_date DESC
limit #{pageNum}, #{size}
</select>
<select id="getInfoCount" resultType="java.lang.Integer">
select count(1) from
c_emergency_task_role
where 1 = 1
and is_delete = 0
</select>
<delete id="deleteById">
delete from
c_emergency_task_role
WHERE
`id` = #{id}
</delete>
<select id="countByCode" resultType="int">
select count(1) from c_emergency_task_role where is_delete = 0 and code = #{code}
</select>
<select id="selectByCode" resultType="com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole">
select * from c_emergency_task_role where is_delete = 0 and code = #{code}
</select>
<select id="selectList" resultType="com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole">
select * from c_emergency_task_role where is_delete = 0 order by sort desc
</select>
<select id="selectListFilterEmptyTask" resultType="com.yeejoin.amos.fas.dao.entity.EmergencyTaskRole">
SELECT
*
FROM
c_emergency_task_role cet
JOIN c_emergency_task_content cetc ON cetc.obligation_id = cet.id
WHERE
is_delete = 0
GROUP BY
cet.`code`
ORDER BY
cet.sort DESC
</select>
<select id="getPlanStepInfoByType" resultType="java.lang.String">
select `data` from c_plan_step_config
<where>
1 = 1
<if test="planType != null and planType != ''">
AND type = #{planType}
</if>
</where>
order by id ASC
limit 1
</select>
<delete id="deleteRelationByRoleId">
delete from
c_emergency_relation
WHERE
`obligationId` = #{roleId}
</delete>
</mapper>
\ No newline at end of file
...@@ -134,6 +134,16 @@ ...@@ -134,6 +134,16 @@
and d.is_delete = false and d.is_delete = false
limit 1 limit 1
</select> </select>
<select id="getPlanDetailById" resultType="com.yeejoin.amos.fas.business.vo.PlanDetailVo">
select
d.classify_id AS classifyId
from
c_plan_detail d
LEFT JOIN c_plan_classify_tree ct ON d.classify_id = ct.id
where d.id = #{id}
and d.is_delete = false
limit 1
</select>
<update id="planReset"> <update id="planReset">
UPDATE c_plan_detail SET `status` = 2; UPDATE c_plan_detail SET `status` = 2;
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
</select> </select>
<select id="getArraysUserName" resultType="java.lang.String"> <select id="getArraysUserName" resultType="java.lang.String">
SELECT person_name from c_emergency_relation cer where obligationId in ( SELECT person_name from c_emergency_relation cer where obligationId in (
select id from f_dict fd where dict_value = #{roleCode} select id from c_emergency_task_role where code = #{roleCode}
) )
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<if test="obligationId != null "> <if test="obligationId != null ">
obligation_id = #{obligationId} obligation_id = #{obligationId}
</if> </if>
<if test="planType != null ">
AND plan_type = #{planType}
</if>
</where> </where>
LIMIT #{offset}, #{pageSize} LIMIT #{offset}, #{pageSize}
...@@ -28,11 +31,13 @@ ...@@ -28,11 +31,13 @@
FROM FROM
c_emergency_task_content c_emergency_task_content
<where> <where>
<if test="_parameter != null "> <if test="obligationId != null ">
obligation_id = #{obligationId} obligation_id = #{obligationId}
</if> </if>
<if test="planType != null ">
AND plan_type = #{planType}
</if>
</where> </where>
</select> </select>
...@@ -50,9 +55,9 @@ ...@@ -50,9 +55,9 @@
<select id="roleCodes" resultType="string"> <select id="roleCodes" resultType="string">
SELECT SELECT
f.dict_value f.code
FROM FROM
c_emergency_relation cer LEFT JOIN f_dict f ON cer.obligationId = f.id c_emergency_relation cer LEFT JOIN c_emergency_task_role f ON cer.obligationId = f.id
<where> <where>
<if test="_parameter != null "> <if test="_parameter != null ">
cer.amos_id = #{amosOrgId} cer.amos_id = #{amosOrgId}
...@@ -62,9 +67,9 @@ ...@@ -62,9 +67,9 @@
<select id="roleNames" resultType="string"> <select id="roleNames" resultType="string">
SELECT SELECT
f.dict_name AS dictName f.name AS dictName
FROM FROM
c_emergency_relation cer LEFT JOIN f_dict f ON cer.obligationId = f.id c_emergency_relation cer LEFT JOIN c_emergency_task_role f ON cer.obligationId = f.id
<where> <where>
<if test="_parameter != null "> <if test="_parameter != null ">
cer.amos_id = #{amosOrgId} cer.amos_id = #{amosOrgId}
...@@ -84,6 +89,17 @@ ...@@ -84,6 +89,17 @@
</where> </where>
</select> </select>
<delete id="deleteTask">
delete from c_emergency_task_content cer
<where>
<if test="id != null ">
cer.id = #{id}
</if>
</where>
</delete>
<delete id="deleteTreeNode"> <delete id="deleteTreeNode">
delete from c_emergency_relation cer delete from c_emergency_relation cer
...@@ -103,6 +119,11 @@ ...@@ -103,6 +119,11 @@
VALUES (#{id}, #{obligationId}, #{personId}, #{amosOrgId}, #{personName},#{createDate}); VALUES (#{id}, #{obligationId}, #{personId}, #{amosOrgId}, #{personName},#{createDate});
</insert> </insert>
<insert id="saveTaskConfig" parameterType="com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent">
INSERT INTO `c_emergency_task_content`(`content`, `code`, `obligation_id`, `create_date`, `obligation_name`, `step_code`, `role_code`,`button_json`, `task_num`,`is_must`, `plan_type`)
VALUES (#{content}, #{code}, #{obligationId}, #{createDate},#{obligationName}, #{stepCode}, #{roleCode}, #{buttonJson},#{taskNum}, #{isMust} ,#{planType} );
</insert>
<select id="getContentList" resultType="com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo"> <select id="getContentList" resultType="com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo">
SELECT SELECT
* *
...@@ -115,6 +136,9 @@ ...@@ -115,6 +136,9 @@
<if test="stepCode != null and stepCode != '' and stepCode == '-2'"> <if test="stepCode != null and stepCode != '' and stepCode == '-2'">
step_code = -1 step_code = -1
</if> </if>
<if test="planType != null ">
AND plan_type = #{planType}
</if>
</where> </where>
</select> </select>
...@@ -124,9 +148,11 @@ ...@@ -124,9 +148,11 @@
FROM FROM
c_emergency_task_content c_emergency_task_content
<where> <where>
is_must = true
<if test="stepCode != null and stepCode != ''"> <if test="stepCode != null and stepCode != ''">
and step_code = #{stepCode} step_code = #{stepCode}
</if>
<if test="planType != null ">
AND plan_type = #{planType}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -6,30 +6,26 @@ ...@@ -6,30 +6,26 @@
<select id="getSafetyIndexWeek" resultType="java.util.HashMap"> <select id="getSafetyIndexWeek" resultType="java.util.HashMap">
<![CDATA[ <![CDATA[
SELECT distinct temp1.*,IFNULL(S.safety_index,0) as value SELECT distinct temp1.*, IFNULL(S.safety_index, 0) as value
FROM ( FROM (
SELECT @s :=@s + 1 as `index`, DATE(DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date SELECT @s := @s + 1 as `index`, DATE (DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date
FROM mysql.help_topic,(SELECT @s := 0) temp FROM mysql.help_topic, (SELECT @s := 0) temp
) temp1 ) temp1
left join f_safety_index_change_log S on S.collect_date = temp1.date left join f_safety_index_change_log S
on S.collect_date = temp1.date
where temp1.index < 8 where temp1.index < 8
ORDER BY temp1.date ORDER BY temp1.date
]]> ]]>
</select> </select>
<select id="countUpperRiskPoint" resultType="long"> <select id="countUpperRiskPoint" resultType="long">
SELECT SELECT count(DISTINCT frcl.risk_source_id)
count(DISTINCT frcl.risk_source_id) FROM (
FROM SELECT a.id,
(
SELECT
a.id,
a.risk_source_id a.risk_source_id
FROM FROM `f_rpn_change_log` a,
`f_rpn_change_log` a,
`f_risk_source` b `f_risk_source` b
WHERE WHERE a.type = #{type}
a.type = #{type}
and a.risk_source_id = b.id and a.risk_source_id = b.id
and b.org_code = #{orgCode} and b.org_code = #{orgCode}
and date_format(a.create_date, '%Y-%m-%d') = #{date} and date_format(a.create_date, '%Y-%m-%d') = #{date}
...@@ -37,12 +33,9 @@ ...@@ -37,12 +33,9 @@
) as frcl ) as frcl
</select> </select>
<select id="countCheckException" resultType="long"> <select id="countCheckException" resultType="long">
SELECT SELECT count(distinct pc.point_id)
count(distinct pc.point_id) FROM p_check pc
FROM WHERE DATE_FORMAT(pc.check_time, '%Y-%m-%d') = #{date}
p_check pc
WHERE
DATE_FORMAT(pc.check_time, '%Y-%m-%d') = #{date}
AND ( AND (
pc.org_code = #{orgCode} pc.org_code = #{orgCode}
OR pc.org_code LIKE CONCAT(#{orgCode}, '-%') OR pc.org_code LIKE CONCAT(#{orgCode}, '-%')
...@@ -51,68 +44,55 @@ ...@@ -51,68 +44,55 @@
</select> </select>
<select id="countFireException" resultType="long"> <select id="countFireException" resultType="long">
SELECT SELECT count(1)
count(1) FROM wl_equipment_specific_alarm a
FROM WHERE status = 1
wl_equipment_specific_alarm a
WHERE
status = 1
AND org_code = #{orgCode} AND org_code = #{orgCode}
AND type = 'BREAKDOWN' AND type = 'BREAKDOWN'
AND date_format(a.update_date, '%Y-%m-%d') = #{date} AND date_format(a.update_date, '%Y-%m-%d') = #{date}
</select> </select>
<select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo"> <select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo">
SELECT SELECT rcl.id,
rcl.id,
rcl.create_date AS changeDate, rcl.create_date AS changeDate,
rs.risk_level_id AS riskLevelId, rs.risk_level_id AS riskLevelId,
rs.`name` rs.`name`
FROM FROM (
( SELECT risk_source_id,
SELECT
risk_source_id,
MAX(create_date) create_date, MAX(create_date) create_date,
MAX(id) id MAX(id) id
FROM FROM f_rpn_change_log
f_rpn_change_log WHERE type = '0'
WHERE
type = '0'
AND DATE_FORMAT(create_date, '%Y-%m-%d') = #{date} AND DATE_FORMAT(create_date, '%Y-%m-%d') = #{date}
group by risk_source_id group by risk_source_id
) rcl ) rcl
LEFT JOIN f_risk_source rs ON rs.id = rcl.risk_source_id LEFT JOIN f_risk_source rs ON rs.id = rcl.risk_source_id
WHERE rs.risk_level_id is not NULL WHERE rs.risk_level_id is not NULL
AND (rs.org_code = #{orgCode} OR rs.org_code like CONCAT(#{orgCode},'-%')) AND (rs.org_code = #{orgCode} OR rs.org_code like CONCAT(#{orgCode}, '-%'))
</select> </select>
<select id="getAllErrorPatrolPoint" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo"> <select id="getAllErrorPatrolPoint" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo">
SELECT SELECT pc.point_id id,
pc.point_id id,
pc.point_name 'name', pc.point_name 'name',
pc.`is_ok` as status, pc.`is_ok` as status,
max(pc.check_time) as changeDate max(pc.check_time) as changeDate
FROM FROM p_check pc
p_check pc WHERE DATE_FORMAT(pc.check_time, '%Y-%m-%d') = #{date}
WHERE
DATE_FORMAT(pc.check_time, '%Y-%m-%d') = #{date}
AND ( AND (
pc.org_code = #{orgCode} pc.org_code = #{orgCode}
OR pc.org_code LIKE CONCAT(#{orgCode}, '-%') OR pc.org_code LIKE CONCAT(#{orgCode}, '-%')
) )
AND pc.`is_ok` = '2' AND pc.`is_ok` = '2'
GROUP BY pc.point_id,pc.`is_ok`,pc.point_name GROUP BY pc.point_id, pc.`is_ok`, pc.point_name
</select> </select>
<select id="getAllFaultAlarm" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo"> <select id="getAllFaultAlarm" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo">
select select ala.id,
ala.id,
ala.equipment_specific_name as name, ala.equipment_specific_name as name,
cate.name as status, cate.name as status,
ala.update_date as changeDate ala.update_date as changeDate
from from wl_equipment_specific_alarm as ala
wl_equipment_specific_alarm as ala
left join wl_equipment_specific as spe on ala.equipment_specific_id = spe.id left join wl_equipment_specific as spe on ala.equipment_specific_id = spe.id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment as equ on equ.id = det.equipment_id left join wl_equipment as equ on equ.id = det.equipment_id
...@@ -126,94 +106,80 @@ ...@@ -126,94 +106,80 @@
<select id="getStatisticsCheck" resultType="java.util.HashMap"> <select id="getStatisticsCheck" resultType="java.util.HashMap">
<![CDATA[ <![CDATA[
SELECT SELECT (
( SELECT ifnull(sum(`p_plan_task`.`point_num`), 0)
SELECT FROM `p_plan_task`
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) WHERE (
FROM `p_plan_task`.`check_date` LIKE concat(curdate(), '%'))) AS `point_num`,
`p_plan_task`
WHERE
( (
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' ))) AS `point_num`,( SELECT ifnull(sum(`p_plan_task`.`point_num`), 0)
SELECT FROM `p_plan_task`
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) WHERE ((
FROM
`p_plan_task`
WHERE
((
`p_plan_task`.`finish_status` = 3 `p_plan_task`.`finish_status` = 3
) )
AND ( AND (
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' )))) AS `miss_num`,( `p_plan_task`.`check_date` LIKE concat(curdate(), '%')))) AS `miss_num`,
SELECT
count( 1 ) AS `total_num`
FROM
( (
SELECT SELECT count(1) AS `total_num`
`b`.`id` AS `id` FROM (
FROM SELECT `b`.`id` AS `id`
`p_plan_task_detail` `b` FROM `p_plan_task_detail` `b`
LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no` LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no`
LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id` LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id`
LEFT JOIN p_check c ON c.plan_task_detail_id = b.id LEFT JOIN p_check c ON c.plan_task_detail_id = b.id
WHERE WHERE `b`.`is_finish` = 1
`b`.`is_finish` = 1 AND c.is_ok = 1 AND `a`.`check_date` = curdate() AND c.is_ok = 1
ORDER BY AND `a`.`check_date` = curdate()
`b`.`id` ORDER BY `b`.`id`
) `t` ) AS `ok_num`,( ) `t`) AS `ok_num`,
SELECT
count( 1 ) AS `total_num`
FROM
( (
SELECT SELECT count(1) AS `total_num`
`b`.`id` AS `id` FROM (
FROM SELECT `b`.`id` AS `id`
`p_plan_task_detail` `b` FROM `p_plan_task_detail` `b`
LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no` LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no`
LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id` LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id`
LEFT JOIN p_check c ON c.plan_task_detail_id = b.id LEFT JOIN p_check c ON c.plan_task_detail_id = b.id
WHERE WHERE `b`.`is_finish` = 1
`b`.`is_finish` = 1 AND c.is_ok = 2 AND `a`.`check_date` = curdate() AND c.is_ok = 2
ORDER BY AND `a`.`check_date` = curdate()
`b`.`id` ORDER BY `b`.`id`
) `t` ) AS `notOk_num`,( ) `t`) AS `notOk_num`,
SELECT (
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) SELECT ifnull(sum(`p_plan_task`.`point_num`), 0)
FROM FROM `p_plan_task`
`p_plan_task` WHERE ((
WHERE
((
`p_plan_task`.`finish_status` = 0 `p_plan_task`.`finish_status` = 0
) )
AND ( AND (
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' )))) AS `notStart_num` `p_plan_task`.`check_date` LIKE concat(curdate(), '%')))) AS `notStart_num`
]]> ]]>
</select> </select>
<select id="getRiskErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getRiskErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT n.id,r.code,r.name as label,r.id as pointId,'risk' as type,n.create_date as changeDate SELECT n.id, r.code, r.name as label, r.id as pointId, 'risk' as type, n.create_date as changeDate
FROM f_rpn_change_log n FROM f_rpn_change_log n
LEFT JOIN f_risk_source r ON r.id = n.risk_source_id LEFT JOIN f_risk_source r ON r.id = n.risk_source_id
WHERE n.type = 0 WHERE n.type = 0
ORDER BY n.create_date desc ORDER BY n.create_date desc limit 0,5
limit 0,5
</select> </select>
<select id="getCheckErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getCheckErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT p.id,I.point_no as code, SELECT p.id,
IF(p.is_ok = '2', CONCAT(I.name,' 不合格') ,CONCAT(I.name,' 漏检') ) as label, I.point_no as code,
p.point_id,'patrol' as type,p.check_time as changeDate IF(p.is_ok = '2', CONCAT(I.name, ' 不合格'), CONCAT(I.name, ' 漏检')) as label,
p.point_id,
'patrol' as type,
p.check_time as changeDate
FROM p_check p FROM p_check p
left join p_point I ON I.id = p.point_id left join p_point I ON I.id = p.point_id
where p.is_ok IN ('2', '3') where p.is_ok IN ('2', '3')
AND I.is_delete = 0 AND I.is_delete = 0
ORDER BY p.check_time desc ORDER BY p.check_time desc limit 0,5
limit 0,5
</select> </select>
<select id="getFireAlarmTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getFireAlarmTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT SELECT ala.id,
ala.id,
ala.equipment_specific_id AS pointId, ala.equipment_specific_id AS pointId,
'monitorEquipment' AS type, 'monitorEquipment' AS type,
spe.`code`, spe.`code`,
...@@ -224,7 +190,7 @@ ...@@ -224,7 +190,7 @@
'(', '(',
ala.equipment_specific_name, ala.equipment_specific_name,
')', ')',
IF ( IF(
( (
ISNULL(ws.full_name) ISNULL(ws.full_name)
AND ISNULL(sd.description) AND ISNULL(sd.description)
...@@ -240,46 +206,44 @@ ...@@ -240,46 +206,44 @@
) )
) AS label, ) AS label,
ala.update_date AS changeDate ala.update_date AS changeDate
FROM FROM wl_equipment_specific_alarm AS ala
wl_equipment_specific_alarm AS ala
LEFT JOIN wl_equipment_specific AS spe ON ala.equipment_specific_id = spe.id LEFT JOIN wl_equipment_specific AS spe ON ala.equipment_specific_id = spe.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = spe.id LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = spe.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE WHERE ala.`status` = 1
ala.`status` = 1
AND ( AND (
ala.type = 'FIREALARM' ala.type = 'FIREALARM'
) )
ORDER BY ORDER BY ala.update_date DESC LIMIT 0,5
ala.update_date DESC
LIMIT 0,5
</select> </select>
<select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT
wlesi.id, SELECT *
from (
SELECT wlesi.id,
wlesi.`value` `status`, wlesi.`value` `status`,
wles.code, wles.code,
wlesi.update_date changeDate, wlesi.update_date changeDate,
CONCAT(ed.NAME, ' ', wlei.NAME,IF((ISNULL(ws.full_name) AND ISNULL(sd.description)),'',CONCAT( CONCAT(ed.NAME, ' ', wlei.NAME,
IF((ISNULL(ws.full_name) AND ISNULL(sd.description)), '', CONCAT(
'【', '【',
IFNULL(ws.full_name, ''), IFNULL(ws.full_name, ''),
' ', ' ',
IFNULL(sd.description, ''), IFNULL(sd.description, ''),
'】' '】'
))) label ))) label
FROM FROM wl_equipment_specific_index wlesi
wl_equipment_specific_index wlesi
LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
LEFT JOIN wl_equipment_specific wles ON wlesi.equipment_specific_id = wles.id LEFT JOIN wl_equipment_specific wles ON wlesi.equipment_specific_id = wles.id
LEFT JOIN wl_equipment_detail ed ON ed.id = wles.equipment_detail_id LEFT JOIN wl_equipment_detail ed ON ed.id = wles.equipment_detail_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wles.id LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE WHERE wlei.type_code in
wlei.is_alarm = false ('Action', 'Reset', 'FeedBack', 'StartStop', 'Tripping', 'Control', 'Normal', 'WYStartStop')
ORDER BY ORDER BY wlesi.update_date DESC LIMIT 0,5
wlesi.update_date DESC ) a
LIMIT 0,5 where a.label is not null
</select> </select>
<select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo"> <select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
...@@ -369,7 +333,7 @@ ...@@ -369,7 +333,7 @@
LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id
WHERE WHERE
r.is_region = 'FALSE' r.is_region = 'FALSE'
<if test = "dataLevel != null and dataLevel != ''" > <if test="dataLevel != null and dataLevel != ''">
AND rl. level = #{dataLevel} AND rl. level = #{dataLevel}
</if> </if>
UNION ALL UNION ALL
...@@ -612,8 +576,8 @@ ...@@ -612,8 +576,8 @@
<where> <where>
<if test="inputText!=null and inputText != ''"> <if test="inputText!=null and inputText != ''">
( (
tmp.code LIKE '%#{inputText}%' tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%#{inputText}%' OR tmp.name LIKE '%${inputText}%'
) )
</if> </if>
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
...@@ -627,7 +591,8 @@ ...@@ -627,7 +591,8 @@
</select> </select>
<select id="retrieveAll" resultType="java.util.HashMap"> <select id="retrieveAll" resultType="java.util.HashMap">
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
from (select concat('riskSource-',r.id) as id,concat(r.id) as originId,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode, from (select concat('riskSource-',r.id) as id,concat(r.id) as originId,r.name,r.code,r.ue4_location as
ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode, rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -664,8 +629,10 @@ ...@@ -664,8 +629,10 @@
AND rl.level = #{dataLevel} AND rl.level = #{dataLevel}
</if> </if>
UNION all UNION all
select concat('patrol-',p.id) as id,concat(p.id) as originId,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode, select concat('patrol-',p.id) as id,concat(p.id) as originId,p.name,p.point_no as code,p.ue4_location as
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode, ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode,
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as
typeCode,
CASE CASE
WHEN ( WHEN (
ISNULL(p.coordinates) || LENGTH(trim(p.coordinates)) <![CDATA[ <]]> 1 ISNULL(p.coordinates) || LENGTH(trim(p.coordinates)) <![CDATA[ <]]> 1
...@@ -703,7 +670,8 @@ ...@@ -703,7 +670,8 @@
left join f_risk_source r on r.id = p.risk_source_id left join f_risk_source r on r.id = p.risk_source_id
WHERE is_delete = FALSE WHERE is_delete = FALSE
UNION all UNION all
select concat('impEquipment-',e.id) as id,concat(e.id) as originId,e.name,e.code,e.ue4_location as ue4Location,e.ue4_rotation as ue4Rotation ,'impEquipment' as type,e.org_code as orgCode, select concat('impEquipment-',e.id) as id,concat(e.id) as originId,e.name,e.code,e.ue4_location as
ue4Location,e.ue4_rotation as ue4Rotation ,'impEquipment' as type,e.org_code as orgCode,
0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode, 0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -736,8 +704,10 @@ ...@@ -736,8 +704,10 @@
from f_equipment e from f_equipment e
left join f_risk_source r on r.id = e.risk_source_id left join f_risk_source r on r.id = e.risk_source_id
UNION all UNION all
select concat('monitorEquipment-',m.id) as id,concat(m.id) as originId,det.name,m.code as code,'' as ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode, select concat('monitorEquipment-',m.id) as id,concat(m.id) as originId,det.name,m.code as code,'' as
null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode, ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as
typeCode,
CASE CASE
WHEN ( WHEN (
ISNULL(null) || LENGTH(trim(null)) <![CDATA[ <]]> 1 ISNULL(null) || LENGTH(trim(null)) <![CDATA[ <]]> 1
...@@ -779,7 +749,8 @@ ...@@ -779,7 +749,8 @@
where substr(m.equipment_code ,1,4) = '9204' where substr(m.equipment_code ,1,4) = '9204'
group By m.code group By m.code
UNION all UNION all
select concat('video-',vi.id) as id,concat(vi.id) as originId,vi.name,vi.code,null as ue4Location,null as ue4Rotation ,'video' as type,vi.org_code as orgCode, select concat('video-',vi.id) as id,concat(vi.id) as originId,vi.name,vi.code,null as ue4Location,null as
ue4Rotation ,'video' as type,vi.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode, null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -814,7 +785,8 @@ ...@@ -814,7 +785,8 @@
LEFT JOIN wl_warehouse_structure AS ws ON ws.id = vis.source_id LEFT JOIN wl_warehouse_structure AS ws ON ws.id = vis.source_id
group by vi.id group by vi.id
UNION all UNION all
select concat('hydrant-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode, select concat('hydrant-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as
ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -899,7 +871,8 @@ ...@@ -899,7 +871,8 @@
a.instance_id) s a.instance_id) s
LEFT JOIN f_risk_source r ON s.instanceId = r.source_id LEFT JOIN f_risk_source r ON s.instanceId = r.source_id
UNION all UNION all
select concat('fireCar-',car.id) as id,concat(car.id) as originId,car.name,car.car_num as code,null as ue4Location,null as ue4Rotation, 'fireCar' as type,car.org_code as orgCode, select concat('fireCar-',car.id) as id,concat(car.id) as originId,car.name,car.car_num as code,null as
ue4Location,null as ue4Rotation, 'fireCar' as type,car.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -933,8 +906,10 @@ ...@@ -933,8 +906,10 @@
left join wl_equipment as equ on car.equipment_id = equ.id left join wl_equipment as equ on car.equipment_id = equ.id
left join wl_equipment_category as cat on equ.category_id = cat.id left join wl_equipment_category as cat on equ.category_id = cat.id
UNION all UNION all
select concat('extinguisher-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation,'extinguisher' as type,spe.org_code as orgCode, select concat('extinguisher-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as
null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode, ue4Location,null as ue4Rotation,'extinguisher' as type,spe.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as
typeCode,
CASE CASE
WHEN ( WHEN (
ISNULL(null) || LENGTH(trim(null)) <![CDATA[ <]]> 1 ISNULL(null) || LENGTH(trim(null)) <![CDATA[ <]]> 1
...@@ -974,7 +949,8 @@ ...@@ -974,7 +949,8 @@
UNION all UNION all
select select
concat('fireChamber-',s.instanceId) as id, concat('fireChamber-',s.instanceId) as id,
concat(s.instanceId) as originId,s.name,s.code,null as ue4Location,null as ue4Rotation,'fireChamber' as type,s.orgCode, concat(s.instanceId) as originId,s.name,s.code,null as ue4Location,null as ue4Rotation,'fireChamber' as
type,s.orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
null as positionDTO, null as positionDTO,
s.name as label, s.name as label,
...@@ -1021,7 +997,8 @@ ...@@ -1021,7 +997,8 @@
UNION all UNION all
select select
concat('fireFoamRoom-',s.instanceId) as id, concat('fireFoamRoom-',s.instanceId) as id,
concat(s.instanceId) as originId,s.name,s.code,null as ue4Location,null as ue4Rotation,'fireFoamRoom' as type,s.orgCode, concat(s.instanceId) as originId,s.name,s.code,null as ue4Location,null as ue4Rotation,'fireFoamRoom' as
type,s.orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode,
null as positionDTO, null as positionDTO,
s.name as label, s.name as label,
......
[
{
"stepCode": "0",
"stepName": "确认火情",
"stepStatus": "0",
"buttonCode": "FIRE_CONFIRM",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 0,
"checkYesOrNo": ""
},
{
"stepCode": "1",
"stepName": "汇报,通知,报警",
"stepStatus": "0",
"buttonCode": "CALL_PHONE",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 1,
"checkYesOrNo": ""
},
{
"stepCode": "2",
"stepName": "确认开关跳闸",
"stepStatus": "0",
"buttonCode": "OPEN_THREE_SIDE_SWITCHES",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 2,
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "3",
"stepName": "检查固定喷雾灭火设施启动",
"stepStatus": "0",
"buttonCode": "OPEN_SPRAYINGSYSTEM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 3,
"condition": [
{
"equipName": "主机",
"equipCode": "92030100TGX44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "CAFS_CompAirFoamHost_Outfire",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "4",
"stepName": "启动CAFS消防系统",
"stepStatus": "0",
"buttonCode": "OPEN_WATERSYSTEM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 4,
"checkYesOrNo": "",
"condition": [
{
"equipName": "雨淋阀",
"equipCode": "92130300BH644",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "WSS_DelugeValve_Start",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0
},
{
"stepCode": "5",
"stepName": "启动CAFS举高灭火机器人",
"stepStatus": "0",
"buttonCode": "START_TURBOFAN_ROBOT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 5,
"checkYesOrNo": ""
},
{
"stepCode": "6",
"stepName": "申请调检修",
"stepStatus": "0",
"buttonCode": "APPLY_FOR_OVERHAUL",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 6,
"checkYesOrNo": ""
},
{
"stepCode": "7",
"stepName": "断开交、直流电源",
"stepStatus": "0",
"buttonCode": "OFF_POWER",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 7,
"checkYesOrNo": ""
},
{
"stepCode": "8",
"stepName": "执行转检修操作",
"stepStatus": "0",
"buttonCode": "FIRE_TRANSVERTER_TO_OVERHAUL",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 8,
"checkYesOrNo": ""
},
{
"stepCode": "9",
"stepName": "电缆沟封堵",
"stepStatus": "0",
"buttonCode": "PLUG_CABLETRENCH",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 9,
"checkYesOrNo": ""
},
{
"stepCode": "10",
"stepName": "政府消防队指挥权交接",
"stepStatus": "0",
"buttonCode": "HANDOVER_FIGTHHING",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 10,
"checkYesOrNo": ""
},
{
"stepCode": "11",
"stepName": "确认明火扑灭,确认着火设备温度降为环境温度",
"stepStatus": "0",
"buttonCode": "FIRE_EXTINCT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 11,
"checkYesOrNo": ""
},
{
"stepCode": "12",
"stepName": "检查现场情况,汇报调度",
"stepStatus": "0",
"buttonCode": "ACCIDENT_REPORT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 12,
"checkYesOrNo": ""
},
{
"stepCode": "13",
"stepName": "退出预案",
"stepStatus": "0",
"buttonCode": "END_EMERGENCY",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_B",
"index": 13,
"checkYesOrNo": ""
}
]
\ No newline at end of file
[
{
"stepCode": "0",
"stepName": "确认火情",
"stepStatus": "0",
"buttonCode": "FIRE_CONFIRM",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 0,
"checkYesOrNo": ""
},
{
"stepCode": "1",
"stepName": "汇报,通知,报警",
"stepStatus": "0",
"buttonCode": "CALL_PHONE",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 1,
"checkYesOrNo": ""
},
{
"stepCode": "2",
"stepName": "确认开关跳闸",
"stepStatus": "0",
"buttonCode": "OPEN_THREE_SIDE_SWITCHES",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 2,
"isAuto": 0
},
{
"stepCode": "3",
"stepName": "检查固定喷雾灭火设施启动",
"stepStatus": "0",
"buttonCode": "OPEN_SPRAYINGSYSTEM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 3,
"condition": [
{
"equipName": "主机",
"equipCode": "92030100TGX44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "CAFS_CompAirFoamHost_Outfire",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "4",
"stepName": "启动CAFS消防系统",
"stepStatus": "0",
"buttonCode": "OPEN_WATERSYSTEM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 4,
"checkYesOrNo": "",
"condition": [
{
"equipName": "雨淋阀",
"equipCode": "92130300BH644",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "WSS_DelugeValve_Start",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0
},
{
"stepCode": "5",
"stepName": "启动应急排油",
"stepStatus": "0",
"buttonCode": "DRAIN_OIL_CONFIRM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 5,
"condition": [
{
"equipName": "排油阀",
"equipCode": "92100400VWE44",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "ONL_DrainOilValve_Open",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0,
"checkYesOrNo": ""
},
{
"stepCode": "6",
"stepName": "启动CAFS举高灭火机器人",
"stepStatus": "0",
"buttonCode": "START_TURBOFAN_ROBOT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 6,
"checkYesOrNo": ""
},
{
"stepCode": "7",
"stepName": "申请调检修",
"stepStatus": "0",
"buttonCode": "APPLY_FOR_OVERHAUL",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A",
"index": 7,
"checkYesOrNo": ""
},
{
"stepCode": "8",
"stepName": "断开交、直流电源",
"stepStatus": "0",
"buttonCode": "OFF_POWER",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A",
"index": 8,
"checkYesOrNo": ""
},
{
"stepCode": "9",
"stepName": "执行转检修操作",
"stepStatus": "0",
"buttonCode": "FIRE_TRANSVERTER_TO_OVERHAUL",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 9,
"checkYesOrNo": ""
},
{
"stepCode": "10",
"stepName": "电缆沟封堵",
"stepStatus": "0",
"buttonCode": "PLUG_CABLETRENCH",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 10,
"checkYesOrNo": ""
},
{
"stepCode": "11",
"stepName": "政府消防队指挥权交接",
"stepStatus": "0",
"buttonCode": "HANDOVER_FIGTHHING",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 11,
"checkYesOrNo": ""
},
{
"stepCode": "12",
"stepName": "确认明火扑灭,确认着火设备温度降为环境温度",
"stepStatus": "0",
"buttonCode": "FIRE_EXTINCT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 12,
"checkYesOrNo": ""
},
{
"stepCode": "13",
"stepName": "检查现场情况,汇报调度",
"stepStatus": "0",
"buttonCode": "ACCIDENT_REPORT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B",
"index": 13,
"checkYesOrNo": ""
},
{
"stepCode": "14",
"stepName": "退出预案",
"stepStatus": "0",
"buttonCode": "END_EMERGENCY",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_B",
"index": 14,
"checkYesOrNo": ""
}
]
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "CALL_PHONE", "buttonCode": "CALL_PHONE",
"isParallel": "1", "isParallel": "1",
"roleCode": "Digital_Responsing_Plan_B", "roleCode": "Digital_Responsing_Plan_A",
"index": 1, "index": 1,
"checkYesOrNo": "" "checkYesOrNo": ""
}, },
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
"isParallel": "0", "isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A", "roleCode": "Digital_Responsing_Plan_A",
"index": 2, "index": 2,
"isAuto": 0 "isAuto": 0,
"checkYesOrNo": ""
}, },
{ {
"stepCode": "3", "stepCode": "3",
...@@ -54,36 +55,49 @@ ...@@ -54,36 +55,49 @@
}, },
{ {
"stepCode": "4", "stepCode": "4",
"stepName": "启动应急排油", "stepName": "启动CAFS消防系统",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "FIRE_TRANSVERTER_TO_OVERHAUL", "buttonCode": "OPEN_WATERSYSTEM",
"isParallel": "0", "isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B", "roleCode": "Digital_Responsing_Plan_A",
"index": 4, "index": 4,
"checkYesOrNo": "" "checkYesOrNo": "",
"condition": [
{
"equipName": "雨淋阀",
"equipCode": "92130300BH644",
"equipSpeName": "",
"equipSpeCode": "",
"equipSpeIndexKey": "WSS_DelugeValve_Start",
"standardValue": "true",
"inAndOr": "and"
}
],
"outAndOr": "and",
"isAuto": 0
}, },
{ {
"stepCode": "5", "stepCode": "5",
"stepName": "CAFS喷淋系统已开启", "stepName": "启动应急排油",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "VERIFY_EQUIP_STATUS", "buttonCode": "DRAIN_OIL_CONFIRM",
"isParallel": "0", "isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A", "roleCode": "Digital_Responsing_Plan_A",
"index": 5, "index": 5,
"checkYesOrNo": "",
"condition": [ "condition": [
{ {
"equipName": "雨淋阀", "equipName": "排油阀",
"equipCode": "92130300BH644", "equipCode": "92100400VWE44",
"equipSpeName": "", "equipSpeName": "",
"equipSpeCode": "", "equipSpeCode": "",
"equipSpeIndexKey": "WSS_DelugeValve_Start", "equipSpeIndexKey": "ONL_DrainOilValve_Open",
"standardValue": "true", "standardValue": "true",
"inAndOr": "and" "inAndOr": "and"
} }
], ],
"outAndOr": "and", "outAndOr": "and",
"isAuto": 0 "isAuto": 0,
"checkYesOrNo": ""
}, },
{ {
"stepCode": "6", "stepCode": "6",
...@@ -122,7 +136,7 @@ ...@@ -122,7 +136,7 @@
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "FIRE_TRANSVERTER_TO_OVERHAUL", "buttonCode": "FIRE_TRANSVERTER_TO_OVERHAUL",
"isParallel": "0", "isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A", "roleCode": "Digital_Responsing_Plan_B",
"index": 9, "index": 9,
"checkYesOrNo": "" "checkYesOrNo": ""
}, },
......
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