Commit 6dcf3211 authored by maoying's avatar maoying

Merge branch 'dev_upgrade' of…

Merge branch 'dev_upgrade' of http://39.98.45.134:8090/station/YeeAmosFireAutoSysRoot into dev_upgrade
parents b82d7b57 ae00fdc8
package com.yeejoin.amos.fas.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@Accessors(chain = true)
@TableName("contingency_instance_info")
@ApiModel(value = "应急预案执行记录实例", description = "应急预案执行记录实例")
public class ContingencyInstanceInfo extends Model<ContingencyInstanceInfo>{
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ID_WORKER_STR)
@JsonSerialize(using = ToStringSerializer.class)
private String id;
private String name;
private String position;
private String equipmentCode;
private String equipmentName;
private Date startTime;
private Date endTime;
private Boolean isDelete = false;
private Date createDate;
private String orgCode;
}
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import javax.persistence.*;
@Entity @Entity
@Table(name = "contingency_plan_instance") @Table(name = "contingency_plan_instance")
public class ContingencyPlanInstance extends BusinessEntity { @TableName("contingency_plan_instance")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class ContingencyPlanInstance extends BusinessEntity{
private static final long serialVersionUID = 292334653532432432L; private static final long serialVersionUID = 292334653532432432L;
...@@ -23,7 +30,7 @@ public class ContingencyPlanInstance extends BusinessEntity { ...@@ -23,7 +30,7 @@ public class ContingencyPlanInstance extends BusinessEntity {
protected String id; protected String id;
@Column(name = "record_type") @Column(name = "record_type")
private String recordType;// 记录类型:消息MESSAGE,操作OPERATE private String recordType;// 记录类型:消息MESSAGE,操作OPERATE ,回复消息REPLYMESSAGE
@Column(name = "content") @Column(name = "content")
private String content ;// 记录内容:文本信息或者json数据 private String content ;// 记录内容:文本信息或者json数据
...@@ -50,6 +57,82 @@ public class ContingencyPlanInstance extends BusinessEntity { ...@@ -50,6 +57,82 @@ public class ContingencyPlanInstance extends BusinessEntity {
@Column(name = "runstate") @Column(name = "runstate")
private Boolean runstate; private Boolean runstate;
@Column(name = "file_path")
private String filePath; //文件名称
@Column(name = "file_type")
private String fileType;// 文件类型
@Column(name = "role_name")
private String roleName; //角色名称
@Column(name = "role_code")
private String roleCode; //角色编码
@Column(name = "start_user_name")
private String startUserName; //人员名称
@Column(name = "start_user_id")
private String startUserId; //人员ID
@Column(name = "person_img")
private String personImg;
public String getPersonImg() {
return personImg;
}
public void setPersonImg(String personImg) {
this.personImg = personImg;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getFileType() {
return fileType;
}
public void setFileType(String fileType) {
this.fileType = fileType;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getRoleCode() {
return roleCode;
}
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
public String getStartUserName() {
return startUserName;
}
public void setStartUserName(String startUserName) {
this.startUserName = startUserName;
}
public String getStartUserId() {
return startUserId;
}
public void setStartUserId(String startUserId) {
this.startUserId = startUserId;
}
public Boolean getRunstate() { public Boolean getRunstate() {
return runstate; return runstate;
......
...@@ -137,21 +137,10 @@ ...@@ -137,21 +137,10 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-component-authtoken</artifactId> <artifactId>amos-component-security</artifactId>
<version>1.7.13-SNAPSHOT</version> <version>1.7.13-SNAPSHOT</version>
<exclusions> </dependency>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.springfox</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil2; ...@@ -8,6 +8,7 @@ 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.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;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -238,4 +239,15 @@ public class ContingencyPlanController extends BaseController { ...@@ -238,4 +239,15 @@ public class ContingencyPlanController extends BaseController {
return CommonResponseUtil2.success(contingencyPlanService.getPlanStatus()); return CommonResponseUtil2.success(contingencyPlanService.getPlanStatus());
} }
@ApiOperation(value = "获取当前登录人待处置任务及预案信息")
@RequestMapping(value = "/getUserOperateCountAndPlanName", method = RequestMethod.GET)
public ResponseModel getUserOperateCountAndPlanName() {
AgencyUserModel user = getUserInfo();
List<RoleModel> roleModelList = new ArrayList<>();
for (Long key : user.getOrgRoles().keySet()) {
roleModelList.addAll(user.getOrgRoles().get(key));
}
return CommonResponseUtil2.success(contingencyPlanService.getUserOperateCountAndPlanName(roleModelList));
}
} }
...@@ -3,11 +3,19 @@ package com.yeejoin.amos.fas.business.controller; ...@@ -3,11 +3,19 @@ package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService; import com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService;
import com.yeejoin.amos.fas.business.util.StringUtil; import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.business.vo.PlanStepVo; import com.yeejoin.amos.fas.business.vo.PlanStepVo;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.config.Permission; import com.yeejoin.amos.fas.config.Permission;
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.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.ContingencyInstanceInfo;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
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.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -21,6 +29,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -21,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -190,4 +199,85 @@ public class PlanVisual3dController extends BaseController { ...@@ -190,4 +199,85 @@ public class PlanVisual3dController extends BaseController {
} }
return CommonResponseUtil.successNew(planVisual3dService.getPlaneRecordOneByBatchNo(newestBatchNo)); return CommonResponseUtil.successNew(planVisual3dService.getPlaneRecordOneByBatchNo(newestBatchNo));
} }
@Permission
@ApiOperation(value = "处置详情信息", notes = "处置详情信息")
@GetMapping(value = "/plan/selectDisposalDetails")
public ResponseModel selectDisposalDetails(@RequestParam("disposalId") String disposalId) {
return CommonResponseUtil.successNew(planVisual3dService.selectDisposalDetails(disposalId));
}
@Permission
@ApiOperation(httpMethod = "GET", value = "分页查询处置详情信息", notes = "分页查询处置详情信息")
@GetMapping(value = "/plan/selectDisposalListPage")
public ResponseModel selectDisposalListPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size
) {
if (current < 1 || size < 1) {
throw new YeeException("分页参数有误");
}
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
return CommonResponseUtil2.success(planVisual3dService.selectDisposalListPage(current, size, orgCode));
}
@Permission
@ApiOperation(value = "新增处置信息", notes = "新增处置信息")
@PostMapping(value = "/plan/addDisposalDetails")
public ResponseModel addDisposalDetails(@RequestBody ContingencyInstanceInfo contingencyInstanceInfo) {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
contingencyInstanceInfo.setOrgCode(orgCode);
return CommonResponseUtil.successNew(planVisual3dService.addDisposalDetails(contingencyInstanceInfo));
}
@Permission
@ApiOperation(value = "修改处置信息", notes = "修改处置信息")
@PostMapping(value = "/plan/updateDisposalDetails")
public ResponseModel updateDisposalDetails(@RequestBody ContingencyInstanceInfo contingencyInstanceInfo) {
return CommonResponseUtil.successNew(planVisual3dService.updateDisposalDetails(contingencyInstanceInfo));
}
@Permission
@ApiOperation(value = "根据批次号获取预案的消息等记录", notes = "根据批次号获取预案的消息等记录")
@GetMapping(value = "/plan/getPlaneRecordByNew")
public ResponseModel getPlaneRecordByNew(@RequestParam Integer pageNum, @RequestParam Integer size, @RequestParam(required = false) String batchNo) {
if (!StringUtil.isNotEmpty(batchNo)) {
batchNo = planVisual3dService.getNewestBatchNo();
}
if (!StringUtil.isNotEmpty(batchNo)) {
return CommonResponseUtil.successNew(null);
}
return CommonResponseUtil.successNew(planVisual3dService.getPlaneRecordByNew(pageNum, size, batchNo));
}
@Permission
@ApiOperation(value = "回复消息Api", notes = "回复消息Api")
@PostMapping(value = "/plan/replyMessage")
public ResponseModel replyMessage(@RequestBody ContingencyPlanInstance dto) {
AgencyUserModel user = getUserInfo();
planVisual3dService.replyMessage(user, dto);
return CommonResponseUtil.successNew(null);
}
@Permission
@ApiOperation(httpMethod = "GET", value = "分页查询处置详情信息", notes = "分页查询处置详情信息")
@GetMapping(value = "/plan/selectDisposalActionPage")
public ResponseModel selectDisposalActionPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "disposalId") String disposalId,
@RequestParam(value = "dataType") int dataType
) {
if (current < 1 || size < 1) {
throw new YeeException("分页参数有误");
}
AgencyUserModel user = getUserInfo();
List<RoleModel> roleModelList = new ArrayList<>();
for (Long key : user.getOrgRoles().keySet()) {
roleModelList.addAll(user.getOrgRoles().get(key));
}
return CommonResponseUtil2.success(planVisual3dService.selectDisposalActionPage(current, size, disposalId, roleModelList, dataType));
}
} }
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyInstanceInfo> {
ContingencyInstanceInfo selectDisposalDetails(@Param("id") String id);
Boolean addDisposalDetails(@Param("dto") ContingencyInstanceInfo contingencyInstanceInfo);
Boolean updateDisposalDetails(@Param("dto") ContingencyInstanceInfo contingencyInstanceInfo);
int selectCount(@Param("orgCode") String orgCode);
List<ContingencyInstanceInfo> selectDisposalListPage(@Param("current") int current, @Param("size") int size, @Param("orgCode") String orgCode);
List<ContingencyPlanInstance> selectDisposalActionPage(@Param("current") int current, @Param("size") int size,@Param("type") String type, @Param("status") String status,@Param("list") List<String> roles ,@Param("batchNo") String batchNo);
int selectCountDisposalActionPage(@Param("type") String type, @Param("status") String status,@Param("list") List<String> roles ,@Param("batchNo") String batchNo);
List<ContingencyPlanInstance> selectDisposalActionList(@Param("type") String type, @Param("status") String status,@Param("list") List<String> roles ,@Param("batchNo") String batchNo);
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface ContingencyPlanInstanceMapper extends BaseMapper<ContingencyPlanInstance> {
List<ContingencyPlanInstance> getPlanInstanceListByPage(@Param("batchNo") String batchNo, @Param("pageNum") Integer pageNum, @Param("size") Integer size);
Integer getPlanInstanceCount(@Param("batchNo") String batchNo);
Map<String, String> getUserByUserId(@Param("userId") String userId);
}
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.dao.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo; import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.business.vo.PollPointVo; import com.yeejoin.amos.fas.business.vo.PollPointVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
......
...@@ -84,4 +84,6 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP ...@@ -84,4 +84,6 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP
@Query(value = "SELECT * FROM `contingency_plan_instance` WHERE batch_no = ?1", nativeQuery = true) @Query(value = "SELECT * FROM `contingency_plan_instance` WHERE batch_no = ?1", nativeQuery = true)
List<ContingencyPlanInstance> findByBatchNo(String batchNo); List<ContingencyPlanInstance> findByBatchNo(String batchNo);
} }
...@@ -26,4 +26,10 @@ public interface PrivilegeFeign { ...@@ -26,4 +26,10 @@ public interface PrivilegeFeign {
@RequestHeader(name = "appKey", required = true) String appKey, @RequestHeader(name = "appKey", required = true) String appKey,
@RequestHeader(name = "product", required = true) String product, @RequestHeader(name = "product", required = true) String product,
@RequestHeader(name = "token", required = true) String token); @RequestHeader(name = "token", required = true) String token);
@RequestMapping(value = "/privilege/v1/agencyuser/list/role/{roleIds}", method = RequestMethod.GET)
FeignClientResult getUserByRoleIds(@RequestHeader(name = "appKey", required = true) String appKey,
@RequestHeader(name = "product", required = true) String product,
@RequestHeader(name = "token", required = true) String token,
@RequestParam(value = "roleIds", required = true) String roleIds);
} }
...@@ -9,7 +9,8 @@ import java.util.Set; ...@@ -9,7 +9,8 @@ import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.component.authtoken.robot.AmosRequestContext;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
......
...@@ -9,7 +9,8 @@ public enum JPushTypeEnum { ...@@ -9,7 +9,8 @@ public enum JPushTypeEnum {
ALL("广播","1"), ALL("广播","1"),
TAG("标签","2" ), TAG("标签","2" ),
ALIAS("别名", "3"); ALIAS("别名", "3"),
REPLY_MESSAGE("app预案相关消息", "4");
/** /**
......
...@@ -22,6 +22,7 @@ import com.yeejoin.amos.fas.dao.entity.*; ...@@ -22,6 +22,7 @@ import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo; import com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo;
import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo; import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
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;
...@@ -63,6 +64,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -63,6 +64,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
private IEquipmentHandlerService equipmentHandlerService; private IEquipmentHandlerService equipmentHandlerService;
@Autowired @Autowired
private IContingencyPlanInstanceRepository repository; private IContingencyPlanInstanceRepository repository;
@Autowired
private IPlanVisual3dService planVisual3dService;
@Qualifier("contingencyAction") @Qualifier("contingencyAction")
@Autowired @Autowired
private CustomerAction customerAction; private CustomerAction customerAction;
...@@ -820,4 +823,17 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -820,4 +823,17 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
return CollectionUtils.isEmpty(planOperationRecordDao.findByStatus(0)); return CollectionUtils.isEmpty(planOperationRecordDao.findByStatus(0));
} }
@Override
public Map<String, Object> getUserOperateCountAndPlanName(List<RoleModel> roleModelList) {
Map<String, Object> map = new HashMap<>();
List<PlanOperationRecord> recordList = planOperationRecordDao.findByStatus(0);
if (!CollectionUtils.isEmpty(recordList)) {
PlanOperationRecord record = recordList.get(0);
map.put("planName", record.getBatchNo());
List<ContingencyPlanInstance> list = planVisual3dService.selectDisposalActionList(record.getBatchNo(), roleModelList, 1);
map.put("taskNum", list.size());
}
return map;
}
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.fas.business.vo.PlanDetailVo; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.fas.business.vo.PlanDetailVo;
import com.yeejoin.amos.fas.business.vo.Toke; import com.yeejoin.amos.fas.business.vo.Toke;
import com.yeejoin.amos.fas.dao.entity.PlanDetail; import com.yeejoin.amos.fas.dao.entity.PlanDetail;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
...@@ -136,4 +137,6 @@ public interface IContingencyPlanService { ...@@ -136,4 +137,6 @@ public interface IContingencyPlanService {
AtomicBoolean planReset(); AtomicBoolean planReset();
Boolean getPlanStatus(); Boolean getPlanStatus();
Map<String, Object> getUserOperateCountAndPlanName(List<RoleModel> roleModelList);
} }
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.PlanStepVo; import com.yeejoin.amos.fas.business.vo.PlanStepVo;
import com.yeejoin.amos.fas.business.vo.TreeSubjectVo; import com.yeejoin.amos.fas.business.vo.TreeSubjectVo;
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.dao.entity.ContingencyPlanInstance;
import com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import com.yeejoin.amos.fas.dao.entity.PlanRule; import com.yeejoin.amos.fas.dao.entity.PlanRule;
import com.yeejoin.amos.fas.dao.entity.TextPlan; import com.yeejoin.amos.fas.dao.entity.TextPlan;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -72,4 +82,26 @@ public interface IPlanVisual3dService { ...@@ -72,4 +82,26 @@ public interface IPlanVisual3dService {
ToipResponse getPlaneRecordOneByBatchNo(String batchNo); ToipResponse getPlaneRecordOneByBatchNo(String batchNo);
PlanStepVo updatePlanStep(PlanStepVo planStepVo); PlanStepVo updatePlanStep(PlanStepVo planStepVo);
ContingencyInstanceInfo selectDisposalDetails(String disposalId);
Page<ContingencyInstanceInfo> selectDisposalListPage(int current, int size, String orgCode);
Boolean addDisposalDetails(ContingencyInstanceInfo contingencyInstanceInfo);
Boolean updateDisposalDetails(ContingencyInstanceInfo contingencyInstanceInfo);
Page<ContingencyPlanInstance> selectDisposalActionPage(int current, int size, String disposalId , List<RoleModel> roleModelList, int dataType);
/**
* 根据批次号获取预案的消息等记录
* @param batchNo
* @return
*/
Page<ContingencyPlanInstance> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo);
void replyMessage(AgencyUserModel user, ContingencyPlanInstance dto);
List<ContingencyPlanInstance> selectDisposalActionList(String disposalId , List<RoleModel> roleModelList, int dataType);
} }
...@@ -746,4 +746,69 @@ ...@@ -746,4 +746,69 @@
ALTER TABLE `toip_rm_snapshot` MODIFY COLUMN `method_param` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '方法参数' AFTER `equipment_id`; ALTER TABLE `toip_rm_snapshot` MODIFY COLUMN `method_param` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '方法参数' AFTER `equipment_id`;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="gaojianqiang" id="20221017-01">
<preConditions onFail="MARK_RAN">
<columnExists tableName="c_plan_rule" columnName="plan_step"/>
</preConditions>
<comment>修改属性字段值 plan_step</comment>
<sql>
UPDATE c_plan_rule SET plan_step = '[{"stepCode": "0", "stepName": "确认灾情", "buttonCode": "FIRE_CONFIRM", "isParallel": "1", "stepStatus": "0"}, {"stepCode": "1", "stepName": "停运换流阀", "buttonCode": "STOP_COMMUTATION", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "2", "stepName": "拨打报警电话", "buttonCode": "CALL_PHONE", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "3", "stepName": "确认油枕排油系统已开启", "buttonCode": "DRAIN_OIL_CONFIRM", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "4", "stepName": "确认水喷雾系统已开启", "buttonCode": "OPEN_WATERSYSTEM", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "5", "stepName": "断开上级电源", "buttonCode": "OFF_POWER", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "6", "stepName": "停运阀厅空调系统", "buttonCode": "STOP_AIRCON", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "7", "stepName": "一键开启消防炮", "buttonCode": "MONITOR_START", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "8", "stepName": "驻站消防队指挥权交接", "buttonCode": "HANDOVER_COMMAND", "isParallel": "1", "stepStatus": "0"}, {"stepCode": "9", "stepName": "确认本体排油已开启", "buttonCode": "OWNER_DRAIN_OIL", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "10", "stepName": "启动阀厅应急预案", "buttonCode": "START_VALVE_HALL_CONTINGENCY", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "11", "stepName": "电缆沟封堵", "buttonCode": "PLUG_CABLETRENCH", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "12", "stepName": "政府消防队指挥权交接", "buttonCode": "HANDOVER_FIGTHHING", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "13", "stepName": "确认明火扑灭", "buttonCode": "FIRE_EXTINCT", "isParallel": "0", "stepStatus": "0"}, {"stepCode": "14", "stepName": "应急处置结束", "buttonCode": "END_EMERGENCY", "isParallel": "1", "stepStatus": "0"}]';
</sql>
</changeSet>
<changeSet author="zs" id="202210181046-01">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="contingency_plan_instance" columnName="file_path"/>
</not>
</preConditions>
<comment>扩展字段</comment>
<sql>
ALTER TABLE `contingency_plan_instance`
ADD COLUMN `file_path` varchar(2000) NULL COMMENT '文件路径' AFTER `runstate`,
ADD COLUMN `file_type` varchar(36) NULL COMMENT 'image、video' AFTER `file_path`,
ADD COLUMN `role_name` varchar(255) NULL COMMENT '角色名称' AFTER `file_type`,
ADD COLUMN `role_code` varchar(255) NULL COMMENT '角色编码' AFTER `role_name`,
ADD COLUMN `start_user_name` varchar(255) NULL AFTER `role_code`,
ADD COLUMN `start_user_id` varchar(255) NULL AFTER `start_user_name`,
ADD COLUMN `person_img` varchar(1000) NULL AFTER `start_user_id`;
</sql>
</changeSet>
<changeSet author="zs" id="202210181046-02">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_org_usr" columnName="gender"/>
</not>
</preConditions>
<comment>usr表加性别字段</comment>
<sql>
ALTER TABLE `cb_org_usr`
ADD COLUMN `gender` varchar(10) DEFAULT NULL;
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="20221018-01">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="contingency_instance_info" />
</not>
</preConditions>
<comment>create table contingency_instance_info</comment>
<sql>
DROP TABLE IF EXISTS `contingency_instance_info`;
CREATE TABLE `contingency_instance_info` (
`id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '预案序列号',
`name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '预案名称',
`position` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '着火部位',
`equipment_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '装备code',
`equipment_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '装备名称',
`start_time` datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
`end_time` datetime(0) NULL DEFAULT NULL COMMENT '结束时间',
`org_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组织结构编码',
`is_delete` bit(1) NULL DEFAULT NULL COMMENT '是否删除',
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '应急预案执行记录实例' ROW_FORMAT = Dynamic;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
<?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.ContingencyInstanceInfoMapper">
<insert id="addDisposalDetails">
INSERT INTO `contingency_instance_info` ( `id`, `name`, `position`, `equipment_code`
, `equipment_name`, `start_time`, `end_time`, `org_code`, `is_delete`, `create_date` )
VALUES
( #{dto.id}, #{dto.name}, #{dto.position}, #{dto.equipmentCode}
, #{dto.equipmentName}, #{dto.startTime}, #{dto.endTime}, #{dto.orgCode}
, #{dto.isDelete}, #{dto.createDate});
</insert>
<update id="updateDisposalDetails">
UPDATE `contingency_instance_info`
SET `name` = #{dto.name}, `position` = #{dto.position}
, `equipment_code` = #{dto.equipmentCode}, `equipment_name` = #{dto.equipmentName}
, `start_time` = #{dto.startTime}, `end_time` = #{dto.endTime}
WHERE `id` = #{dto.id};
</update>
<select id="selectDisposalDetails" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo">
select * from contingency_instance_info where id=#{id}
</select>
<select id="selectDisposalListPage" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyInstanceInfo">
select * from contingency_instance_info where is_delete = 0
and org_code = #{orgCode}
ORDER BY create_date DESC
LIMIT #{current}, #{size}
</select>
<select id="selectCount" resultType="java.lang.Integer">
select count(1) from contingency_instance_info
where is_delete = 0 and org_code = #{orgCode}
</select>
<select id="selectDisposalActionPage" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance">
select * from contingency_plan_instance
<where>
<if test="batchNo != null and batchNo != ''">
batch_no = #{batchNo}
</if>
<if test="type != null and type != ''">
and record_type = #{type}
</if>
<if test="status != null and status != ''">
and runstate = #{status}
</if>
<if test="list != null and list.size() >0">
<foreach collection="list" item="role" index="index" open="and (" close=") " separator="or">
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
LIMIT #{current}, #{size}
</select>
<select id="selectCountDisposalActionPage" resultType="java.lang.Integer">
select count(1) from contingency_plan_instance
<where>
<if test="batchNo != null and batchNo != ''">
batch_no = #{batchNo}
</if>
<if test="type != null and type != ''">
and record_type = #{type}
</if>
<if test="status != null and status != ''">
and runstate = #{status}
</if>
<if test="list != null and list.size() >0">
<foreach collection="list" item="role" index="index" open="and (" close=") " separator="or">
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
</select>
<select id="selectDisposalActionList" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance">
select * from contingency_plan_instance
<where>
<if test="batchNo != null and batchNo != ''">
batch_no = #{batchNo}
</if>
<if test="type != null and type != ''">
and record_type = #{type}
</if>
<if test="status != null and status != ''">
and runstate = #{status}
</if>
<if test="list != null and list.size() >0">
<foreach collection="list" item="role" index="index" open="and (" close=") " separator="or">
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
</select>
</mapper>
<?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.ContingencyPlanInstanceMapper">
<select id="getPlanInstanceListByPage" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance">
select * from
contingency_plan_instance
where batch_no = #{batchNo}
AND record_type in ('REPLYMESSAGE', 'MESSAGE')
order by create_date DESC
limit #{pageNum}, #{size}
</select>
<select id="getPlanInstanceCount" resultType="java.lang.Integer">
select count(1) from
contingency_plan_instance
where batch_no = #{batchNo}
AND record_type in ('REPLYMESSAGE', 'MESSAGE')
</select>
<select id="getUserByUserId" resultType="java.util.Map">
select
ifnull(gender, "") as gender,
ifnull(personImg, "") as personImg
from cb_org_usr where amos_org_id = #{userId} and is_delete = 0 limit 1
</select>
</mapper>
\ No newline at end of file
...@@ -3,90 +3,120 @@ ...@@ -3,90 +3,120 @@
"stepCode": "0", "stepCode": "0",
"stepName": "确认灾情", "stepName": "确认灾情",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "FIRE_CONFIRM" "buttonCode": "FIRE_CONFIRM",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_A"
}, },
{ {
"stepCode": "1", "stepCode": "1",
"stepName": "停运换流阀", "stepName": "停运换流阀",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "STOP_COMMUTATION" "buttonCode": "STOP_COMMUTATION",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A"
}, },
{ {
"stepCode": "2", "stepCode": "2",
"stepName": "拨打报警电话", "stepName": "拨打报警电话",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "CALL_PHONE" "buttonCode": "CALL_PHONE",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A"
}, },
{ {
"stepCode": "3", "stepCode": "3",
"stepName": "确认油枕排油系统已开启", "stepName": "确认油枕排油系统已开启",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "DRAIN_OIL_CONFIRM" "buttonCode": "DRAIN_OIL_CONFIRM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A"
}, },
{ {
"stepCode": "4", "stepCode": "4",
"stepName": "确认水喷雾系统已开启", "stepName": "确认水喷雾系统已开启",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "OPEN_WATERSYSTEM" "buttonCode": "OPEN_WATERSYSTEM",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A"
}, },
{ {
"stepCode": "5", "stepCode": "5",
"stepName": "断开上级电源", "stepName": "断开上级电源",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "OFF_POWER" "buttonCode": "OFF_POWER",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A"
}, },
{ {
"stepCode": "6", "stepCode": "6",
"stepName": "停运阀厅空调系统", "stepName": "停运阀厅空调系统",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "STOP_AIRCON" "buttonCode": "STOP_AIRCON",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A"
}, },
{ {
"stepCode": "7", "stepCode": "7",
"stepName": "一键开启消防炮", "stepName": "一键开启消防炮",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "MONITOR_START" "buttonCode": "MONITOR_START",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_A"
}, },
{ {
"stepCode": "8", "stepCode": "8",
"stepName": "驻站消防队指挥权交接", "stepName": "驻站消防队指挥权交接",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "HANDOVER_COMMAND" "buttonCode": "HANDOVER_COMMAND",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_B"
}, },
{ {
"stepCode": "9", "stepCode": "9",
"stepName": "确认本体排油已开启", "stepName": "确认本体排油已开启",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "OWNER_DRAIN_OIL" "buttonCode": "OWNER_DRAIN_OIL",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B"
}, },
{ {
"stepCode": "10", "stepCode": "10",
"stepName": "启动阀厅应急预案", "stepName": "启动阀厅应急预案",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "START_VALVE_HALL_CONTINGENCY" "buttonCode": "START_VALVE_HALL_CONTINGENCY",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B"
}, },
{ {
"stepCode": "11", "stepCode": "11",
"stepName": "电缆沟封堵", "stepName": "电缆沟封堵",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "PLUG_CABLETRENCH" "buttonCode": "PLUG_CABLETRENCH",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B"
}, },
{ {
"stepCode": "12", "stepCode": "12",
"stepName": "政府消防队指挥权交接", "stepName": "政府消防队指挥权交接",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "HANDOVER_FIGTHHING" "buttonCode": "HANDOVER_FIGTHHING",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B"
}, },
{ {
"stepCode": "13", "stepCode": "13",
"stepName": "确认明火扑灭", "stepName": "确认明火扑灭",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "FIRE_EXTINCT" "buttonCode": "FIRE_EXTINCT",
"isParallel": "0",
"roleCode": "Digital_Responsing_Plan_B"
}, },
{ {
"stepCode": "14", "stepCode": "14",
"stepName": "应急处置结束", "stepName": "应急处置结束",
"stepStatus": "0", "stepStatus": "0",
"buttonCode": "END_EMERGENCY" "buttonCode": "END_EMERGENCY",
"isParallel": "1",
"roleCode": "Digital_Responsing_Plan_C"
} }
] ]
\ No newline at end of file
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