Commit 49dec6b2 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 c9e6635d 93984635
package com.yeejoin.amos.fas.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*0、运行中,1、完毕,3、中断
* @author suhg
*/
public enum DutyPersonEnum {
FIRE_PERSON("驻站消防","fire"),
OPS_PERSON("运维人员","ops"),
REAL_PERSON("物业安保","realEstate");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 颜色
*/
private String color;
private DutyPersonEnum(String name, String code){
this.name = name;
this.code = code;
}
public static DutyPersonEnum getEnum(String code) {
DutyPersonEnum checkStatusEnum = null;
for(DutyPersonEnum type: DutyPersonEnum.values()) {
if (type.getCode().equals(code)) {
checkStatusEnum = type;
break;
}
}
return checkStatusEnum;
}
public static List<Map<String,Object>> getEnumList() {
List<Map<String,Object>> nameList = new ArrayList<>();
for (DutyPersonEnum c: DutyPersonEnum.values()) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("name", c.getName());
map.put("code", c.getCode());
nameList.add(map);
}
return nameList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
...@@ -136,7 +136,21 @@ ...@@ -136,7 +136,21 @@
<version>6.11</version> <version>6.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-authtoken</artifactId>
<version>1.7.13-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.springfox</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> </dependencies>
......
...@@ -232,4 +232,10 @@ public class ContingencyPlanController extends BaseController { ...@@ -232,4 +232,10 @@ public class ContingencyPlanController extends BaseController {
return CommonResponseUtil2.success(bool); return CommonResponseUtil2.success(bool);
} }
@ApiOperation(value = "获取预案状态")
@RequestMapping(value = "/getPlanStatus", method = RequestMethod.GET)
public ResponseModel getPlanStatus() {
return CommonResponseUtil2.success(contingencyPlanService.getPlanStatus());
}
} }
...@@ -64,10 +64,10 @@ public class LoginController { ...@@ -64,10 +64,10 @@ public class LoginController {
@Value("${outSystem.user.password}") @Value("${outSystem.user.password}")
private String password; private String password;
@Value("${security.productWeb}") @Value("${amos.system.user.product}")
private String product; private String product;
@Value("${security.appKey}") @Value("${amos.system.user.app-key}")
private String appKey; private String appKey;
@ApiOperation(value = "通过userId登录", notes = "查询设备指标") @ApiOperation(value = "通过userId登录", notes = "查询设备指标")
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.controller; ...@@ -2,6 +2,7 @@ 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.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;
...@@ -10,6 +11,7 @@ import com.yeejoin.amos.fas.dao.entity.TextPlan; ...@@ -10,6 +11,7 @@ import com.yeejoin.amos.fas.dao.entity.TextPlan;
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;
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;
...@@ -128,40 +130,44 @@ public class PlanVisual3dController extends BaseController { ...@@ -128,40 +130,44 @@ public class PlanVisual3dController extends BaseController {
List<Map<String, Object>> list = planVisual3dService.getResourceById(type, id); List<Map<String, Object>> list = planVisual3dService.getResourceById(type, id);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
@Permission @Permission
@ApiOperation(value = "预案应用树", notes = "预案应用树") @ApiOperation(value = "预案应用树", notes = "预案应用树")
@GetMapping(value = "/plan/textPlanTree/{appId}") @GetMapping(value = "/plan/textPlanTree/{appId}")
public CommonResponse getPlanTree(@PathVariable("appId") String appId) { public CommonResponse getPlanTree(@PathVariable("appId") String appId) {
return CommonResponseUtil.success(planVisual3dService.getTextPlanBySubjectId(appId)); return CommonResponseUtil.success(planVisual3dService.getTextPlanBySubjectId(appId));
} }
@Permission @Permission
@ApiOperation(value = "删除预案文件", notes = "删除预案文件") @ApiOperation(value = "删除预案文件", notes = "删除预案文件")
@DeleteMapping(value = "/plan/textPlan/{id}") @DeleteMapping(value = "/plan/textPlan/{id}")
public CommonResponse deleteTextPlanFile(@PathVariable("id") Long id) { public CommonResponse deleteTextPlanFile(@PathVariable("id") Long id) {
try { try {
planVisual3dService.deleteTextPlanFile(id); planVisual3dService.deleteTextPlanFile(id);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage()); return CommonResponseUtil.failure(e.getMessage());
} }
} }
@Permission @Permission
@ApiOperation(value = "根据批次号获取预案的步骤", notes = "根据批次号获取预案的步骤") @ApiOperation(value = "根据批次号获取预案的步骤", notes = "根据批次号获取预案的步骤")
@GetMapping(value = "/plan/getPlanStep") @GetMapping(value = "/plan/getPlanStep")
public ResponseModel getPlanStep(@RequestParam("batchNo") String batchNo) { public ResponseModel getPlanStep(@RequestParam(value = "batchNo", required = false) String batchNo) {
if (!StringUtil.isNotEmpty(batchNo)) { if (StringUtils.isEmpty(batchNo)) {
batchNo = planVisual3dService.getNewestBatchNo(); batchNo = planVisual3dService.getNewestBatchNo();
} }
if (!StringUtil.isNotEmpty(batchNo)) {
return CommonResponseUtil.successNew(null);
}
return CommonResponseUtil.successNew(planVisual3dService.getPlanStepByBatchNo(batchNo)); return CommonResponseUtil.successNew(planVisual3dService.getPlanStepByBatchNo(batchNo));
} }
@Permission @Permission
@ApiOperation(value = "根据批次号更新预案的步骤", notes = "根据批次号更新预案的步骤")
@PostMapping(value = "/plan/updatePlanStep")
public ResponseModel updatePlanStep(@RequestBody PlanStepVo planStepVo) {
return CommonResponseUtil.successNew(planVisual3dService.updatePlanStep(planStepVo));
}
@Permission
@ApiOperation(value = "根据批次号获取预案的记录", notes = "根据R批次号获取预案的记录") @ApiOperation(value = "根据批次号获取预案的记录", notes = "根据R批次号获取预案的记录")
@GetMapping(value = "/plan/getPlaneRecord") @GetMapping(value = "/plan/getPlaneRecord")
public ResponseModel getPlaneRecord(@RequestParam("batchNo") String batchNo) { public ResponseModel getPlaneRecord(@RequestParam("batchNo") String batchNo) {
......
...@@ -180,13 +180,7 @@ public class View3dController extends BaseController { ...@@ -180,13 +180,7 @@ public class View3dController extends BaseController {
@ApiOperation(value = "今日值班统计",notes = "今日值班统计") @ApiOperation(value = "今日值班统计",notes = "今日值班统计")
@GetMapping(value = "statistics/duty") @GetMapping(value = "statistics/duty")
public CommonResponse getStatisticsDuty(){ public CommonResponse getStatisticsDuty(){
ReginParams reginParams =getSelectedOrgInfo(); return CommonResponseUtil.success(view3dService.getStatisticsDuty());
String orgCode = this.getOrgCode(reginParams);
appKey = getAppKey();
product = getProduct();
staticOrgCode = orgCode;
token = getToken();
return view3dService.getStatisticsDuty(getAppKey(),getProduct(),token,orgCode);
} }
@Permission @Permission
...@@ -332,6 +326,15 @@ public class View3dController extends BaseController { ...@@ -332,6 +326,15 @@ public class View3dController extends BaseController {
return CommonResponseUtil.success(view3dService.listPointsByRegionId(regionId,type)); return CommonResponseUtil.success(view3dService.listPointsByRegionId(regionId,type));
} }
@Permission
@ApiOperation(value = "今日值班列表",notes = "今日值班列表")
@GetMapping(value = "dutyList")
public CommonResponse dutyList(){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.dutyList(orgCode));
}
@Autowired @Autowired
IRocketMQService rocketMQService; IRocketMQService rocketMQService;
......
package com.yeejoin.amos.fas.business.dao.mapper; package com.yeejoin.amos.fas.business.dao.mapper;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.yeejoin.amos.fas.dao.entity.PlanRule;
import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo; import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -34,4 +35,6 @@ public interface PlanOperationRecordMapper { ...@@ -34,4 +35,6 @@ public interface PlanOperationRecordMapper {
* @return * @return
*/ */
String getNewestBatchNo(); String getNewestBatchNo();
PlanRule getPlanRuleByBatchNo(String batchNo);
} }
...@@ -81,4 +81,7 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP ...@@ -81,4 +81,7 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP
" ORDER BY" + " ORDER BY" +
" t.create_date DESC limit 1", nativeQuery = true) " t.create_date DESC limit 1", nativeQuery = true)
String queryRecordOne(String batchNo, String recordType); String queryRecordOne(String batchNo, String recordType);
@Query(value = "SELECT * FROM `contingency_plan_instance` WHERE batch_no = ?1", nativeQuery = true)
List<ContingencyPlanInstance> findByBatchNo(String batchNo);
} }
...@@ -30,4 +30,5 @@ public interface IPlanOperationRecordDao extends BaseDao<PlanOperationRecord, Lo ...@@ -30,4 +30,5 @@ public interface IPlanOperationRecordDao extends BaseDao<PlanOperationRecord, Lo
*/ */
List<PlanOperationRecord> findByStatus(Integer status); List<PlanOperationRecord> findByStatus(Integer status);
List<PlanOperationRecord> findByBatchNoAndStatus(String batchNo, Integer status);
} }
package com.yeejoin.amos.fas.business.feign;
import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.ResponseModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
/**
* 消息推送
* @author maoying
*
*/
@FeignClient(name = "${Jcs.fegin.name}", configuration={MultipartSupportConfig.class})
public interface JcsFeign {
/**
* 新值班月视图
* @param dutyDay
* @param shiftId
* @param postType
* @return
*/
@RequestMapping(value = "/jcs/common/duty-person/new-duty-detail", method = RequestMethod.GET,consumes = "application/json")
ResponseModel dutyStatisticsByDate(
@RequestParam String beginDate,
@RequestParam String endDate,
@RequestParam(required = false) String fieldCode);
/**
* 查询当前值班人信息列表
* @return
*/
@RequestMapping(value = "/jcs/common/duty-person/person/on_duty/list", method = RequestMethod.GET,consumes = "application/json")
ResponseModel dutyPersonList();
}
...@@ -9,6 +9,7 @@ import java.util.Set; ...@@ -9,6 +9,7 @@ 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 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;
...@@ -38,20 +39,12 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; ...@@ -38,20 +39,12 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
@Service("remoteSecurityService") @Service("remoteSecurityService")
public class RemoteSecurityService { public class RemoteSecurityService {
@Autowired
@Value("${security.password}") AmosRequestContext amosRequestContext;
@Value("${amos.system.user.password}")
private String password; private String password;
@Value("${security.loginId}")
private String loginId;
@Value("${security.productWeb}")
private String productWeb;
@Value("${security.appKey}")
private String appKey;
@Autowired @Autowired
private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
...@@ -157,15 +150,15 @@ public class RemoteSecurityService { ...@@ -157,15 +150,15 @@ public class RemoteSecurityService {
public Toke getServerToken() { public Toke getServerToken() {
IdPasswordAuthModel dPasswordAuthModel=new IdPasswordAuthModel(); IdPasswordAuthModel dPasswordAuthModel=new IdPasswordAuthModel();
dPasswordAuthModel.setLoginId(loginId); dPasswordAuthModel.setLoginId(amosRequestContext.getUserName());
dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz")); dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz"));
Toke toke = null; Toke toke = null;
try { try {
toke = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(loginId)), Toke.class); toke = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(amosRequestContext.getUserName())), Toke.class);
if(ObjectUtils.isEmpty(toke)){ if(ObjectUtils.isEmpty(toke)){
toke = getLogin(dPasswordAuthModel); toke = getLogin(dPasswordAuthModel);
}else{ }else{
RequestContext.setProduct(productWeb); RequestContext.setProduct(amosRequestContext.getProduct());
if (!TokenOperation.refresh(toke.getToke())) { if (!TokenOperation.refresh(toke.getToke())) {
toke = getLogin(dPasswordAuthModel); toke = getLogin(dPasswordAuthModel);
} }
...@@ -178,15 +171,11 @@ public class RemoteSecurityService { ...@@ -178,15 +171,11 @@ public class RemoteSecurityService {
private Toke getLogin(IdPasswordAuthModel dPasswordAuthModel){ private Toke getLogin(IdPasswordAuthModel dPasswordAuthModel){
Toke toke = new Toke(); Toke toke = new Toke();
RequestContext.setProduct(productWeb); RequestContext.setProduct(amosRequestContext.getProduct());
FeignClientResult feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel); toke.setToke(amosRequestContext.getToken());
Map map = (Map) feignClientResult.getResult(); toke.setProduct(amosRequestContext.getProduct());
if(map!=null){ toke.setAppKey(amosRequestContext.getAppKey());
toke.setToke(map.get("token").toString()); redisTemplate.opsForValue().set(buildKey(dPasswordAuthModel.getLoginId()), JSONObject.toJSONString(toke), 28, TimeUnit.DAYS);
toke.setProduct(productWeb);
toke.setAppKey(appKey);
redisTemplate.opsForValue().set(buildKey(dPasswordAuthModel.getLoginId()), JSONObject.toJSONString(toke),28,TimeUnit.DAYS);
}
return toke; return toke;
} }
......
...@@ -8,6 +8,7 @@ import java.util.List; ...@@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import com.yeejoin.amos.fas.business.service.intfc.IPlanRuleService;
import com.yeejoin.amos.fas.datasync.bo.ContingencyOriginalDataSyncBo; import com.yeejoin.amos.fas.datasync.bo.ContingencyOriginalDataSyncBo;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -92,6 +93,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla ...@@ -92,6 +93,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
@Autowired @Autowired
private ContingencyOriginalMapper contingencyOriginalMapper; private ContingencyOriginalMapper contingencyOriginalMapper;
@Autowired
private IPlanRuleService planRuleService;
private static Map<String, String> stepMap = new HashMap<>(); private static Map<String, String> stepMap = new HashMap<>();
...@@ -313,8 +317,13 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla ...@@ -313,8 +317,13 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
if ("CONFIRM".equals(buttonState)) { if ("CONFIRM".equals(buttonState)) {
if (code.equals(operate.getCode())) { if (code.equals(operate.getCode())) {
operate.setState("executed"); operate.setState("executed");
if ("FIRE_CANCEL".equals(code) || "END_EMERGENCY".equals(code)) if ("FIRE_CANCEL".equals(code) || "END_EMERGENCY".equals(code)) {
redisTemplate.delete(RiskSourceServiceImpl.cacheKeyForCanBeRunning()); redisTemplate.delete(RiskSourceServiceImpl.cacheKeyForCanBeRunning());
}
if ("END_EMERGENCY".equals(code)) {
// 应急处置中断,初始化planStep,json数据
planRuleService.updatePlanRuleByBatchNo(batchNo);
}
} else { } else {
operate.setState("disable"); operate.setState("disable");
} }
......
...@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
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.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
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;
...@@ -814,4 +815,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -814,4 +815,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
return bool; return bool;
} }
@Override
public Boolean getPlanStatus() {
return CollectionUtils.isEmpty(planOperationRecordDao.findByStatus(0));
}
} }
\ No newline at end of file
...@@ -130,7 +130,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -130,7 +130,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Value("${autoSys.alarm.nameKeys}") @Value("${autoSys.alarm.nameKeys}")
private String nameKeys; private String nameKeys;
@Value("${security.loginId}") @Value("${amos.system.user.user-name}")
private String loginId; private String loginId;
@Value("${autoSys.fire.pool.index_key}") @Value("${autoSys.fire.pool.index_key}")
......
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper;
import com.yeejoin.amos.fas.business.dao.repository.IPlanRuleDao;
import com.yeejoin.amos.fas.business.service.intfc.IPlanRuleService;
import com.yeejoin.amos.fas.dao.entity.PlanRule;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@Service
public class PlanRuleServiceImpl implements IPlanRuleService {
@Autowired
private IPlanRuleDao planRuleDao;
@Autowired
private PlanOperationRecordMapper planOperationRecordMapper;
@Value("classpath:/json/plan-step.json")
private Resource planStepResource;
@Override
public void updatePlanRuleByBatchNo(String batchNo) {
try {
// 根据批次号查询预案步骤
PlanRule planRule = planOperationRecordMapper.getPlanRuleByBatchNo(batchNo);
String json = IOUtils.toString(planStepResource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
planRule.setPlanStep(json);
planRuleDao.save(planRule);
} catch (IOException e) {
throw new RuntimeException("初始化预案规则planStep数据失败!");
}
}
}
...@@ -2,30 +2,27 @@ package com.yeejoin.amos.fas.business.service.impl; ...@@ -2,30 +2,27 @@ package com.yeejoin.amos.fas.business.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.fas.business.constants.FasConstant; import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.DictMapper; import com.yeejoin.amos.fas.business.dao.mapper.DictMapper;
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.mapper.PlanVisual3dMapper; import com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao; import com.yeejoin.amos.fas.business.dao.repository.*;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository;
import com.yeejoin.amos.fas.business.dao.repository.ITextPlanDao;
import com.yeejoin.amos.fas.business.feign.IMaasVisualServer; import com.yeejoin.amos.fas.business.feign.IMaasVisualServer;
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.IPlanVisual3dService; import com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService;
import com.yeejoin.amos.fas.business.service.model.ToipResponse; import com.yeejoin.amos.fas.business.service.model.ToipResponse;
import com.yeejoin.amos.fas.business.util.JSONUtil; import com.yeejoin.amos.fas.business.util.JSONUtil;
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.TreeSubjectVo; 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.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData; import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance; import org.apache.commons.lang3.StringUtils;
import com.yeejoin.amos.fas.dao.entity.Dict;
import com.yeejoin.amos.fas.dao.entity.TextPlan;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -59,6 +56,12 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -59,6 +56,12 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Autowired @Autowired
private IContingencyPlanInstanceRepository contingencyPlanInstanceRepository; private IContingencyPlanInstanceRepository contingencyPlanInstanceRepository;
@Autowired
private IPlanRuleDao planRuleDao;
@Autowired
private IPlanOperationRecordDao planOperationRecordDao;
@Override @Override
public List<TreeSubjectVo> getPlanTree() { public List<TreeSubjectVo> getPlanTree() {
...@@ -88,11 +91,11 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -88,11 +91,11 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override @Override
public TextPlan getTextPlanInfoById(Long id) { public TextPlan getTextPlanInfoById(Long id) {
Optional<TextPlan> textPlan =iTextPlanDao.findById(id); Optional<TextPlan> textPlan = iTextPlanDao.findById(id);
if(textPlan.isPresent()){ if (textPlan.isPresent()) {
return textPlan.get(); return textPlan.get();
} }
return null; return null;
} }
private List<TreeSubjectVo> listToTree(List<Object> list) { private List<TreeSubjectVo> listToTree(List<Object> list) {
...@@ -117,11 +120,11 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -117,11 +120,11 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
List<TreeSubjectVo> childrenVos = Lists.newArrayList(); List<TreeSubjectVo> childrenVos = Lists.newArrayList();
List<Object> res = (List<Object>) response.getDataList(); List<Object> res = (List<Object>) response.getDataList();
res.forEach(r -> { res.forEach(r -> {
LinkedHashMap<String, Object> map1 = (LinkedHashMap<String, Object>) r; LinkedHashMap<String, Object> map1 = (LinkedHashMap<String, Object>) r;
Integer state = (Integer) map1.get("publishState"); Integer state = (Integer) map1.get("publishState");
if(state == 0) {//过滤 未发布状态 if (state == 0) {//过滤 未发布状态
return; return;
} }
TreeSubjectVo subjectVo = new TreeSubjectVo(); TreeSubjectVo subjectVo = new TreeSubjectVo();
subjectVo.setType("listNode"); subjectVo.setType("listNode");
subjectVo.setParentId((String) map.get("id")); subjectVo.setParentId((String) map.get("id"));
...@@ -187,8 +190,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -187,8 +190,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
Dict dict = new Dict(); Dict dict = new Dict();
dict.setDictCode(type); dict.setDictCode(type);
List<Dict> dictList = dictService.getDictList(dict); List<Dict> dictList = dictService.getDictList(dict);
Map<String, String> dicts = dictList.stream().collect( Map<String, String> dicts = dictList.stream().collect(Collectors.toMap(Dict::getDictValue, Dict::getDictName, (key1, key2) -> key2));
Collectors.toMap(Dict::getDictValue, Dict::getDictName, (key1, key2) -> key2));
//2.1换key为中文 //2.1换key为中文
Map<String, Object> tempMap = new HashMap<String, Object>(); Map<String, Object> tempMap = new HashMap<String, Object>();
...@@ -215,22 +217,22 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -215,22 +217,22 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
dict.setDictCode(FasConstant.PLAN_SOURCE_TYPE); dict.setDictCode(FasConstant.PLAN_SOURCE_TYPE);
List<Dict> dictList = dictMapper.getDictList(dict); List<Dict> dictList = dictMapper.getDictList(dict);
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
list = dictList.stream().map(e->{ list = dictList.stream().map(e -> {
Map<String, Object> newMap = new HashMap<String, Object>(); Map<String, Object> newMap = new HashMap<String, Object>();
newMap.put("key",e.getDictValue()); newMap.put("key", e.getDictValue());
newMap.put("value",e.getDictValue());//前端级联Cascader使用 newMap.put("value", e.getDictValue());//前端级联Cascader使用
newMap.put("isLeaf",false);////前端级联Cascader使用 newMap.put("isLeaf", false);////前端级联Cascader使用
newMap.put("dataType","type"); newMap.put("dataType", "type");
newMap.put("label",e.getDictName()); newMap.put("label", e.getDictName());
return newMap; return newMap;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return list; return list;
} }
@Override @Override
public List<TreeSubjectVo> getTextPlanBySubjectId(String appId) { public List<TreeSubjectVo> getTextPlanBySubjectId(String appId) {
//关联文字预案 //关联文字预案
List<TreeSubjectVo> subjectVos = new ArrayList<>(); List<TreeSubjectVo> subjectVos = new ArrayList<>();
List<TextPlan> textPlans = iTextPlanDao.findByAppId(appId); List<TextPlan> textPlans = iTextPlanDao.findByAppId(appId);
textPlans.forEach(t -> { textPlans.forEach(t -> {
TreeSubjectVo textTreeSubjectVo = new TreeSubjectVo(); TreeSubjectVo textTreeSubjectVo = new TreeSubjectVo();
...@@ -240,13 +242,13 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -240,13 +242,13 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
textTreeSubjectVo.setType("textNode"); textTreeSubjectVo.setType("textNode");
subjectVos.add(textTreeSubjectVo); subjectVos.add(textTreeSubjectVo);
}); });
return subjectVos; return subjectVos;
} }
@Override @Override
public void deleteTextPlanFile(Long id) { public void deleteTextPlanFile(Long id) {
iTextPlanDao.deleteById(id); iTextPlanDao.deleteById(id);
} }
@Override @Override
public String getNewestBatchNo() { public String getNewestBatchNo() {
...@@ -263,9 +265,19 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -263,9 +265,19 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
// 查询当前步骤 // 查询当前步骤
ContingencyOriginalData contingencyOriginalData = contingencyOriginalDataDao.findByBatchNo(batchNo); ContingencyOriginalData contingencyOriginalData = contingencyOriginalDataDao.findByBatchNo(batchNo);
String step = contingencyOriginalData.getStep(); String step = contingencyOriginalData.getStep();
String confirm = contingencyOriginalData.getConfirm();
Map<String, Object> msgContext = new HashMap<>(2); Map<String, Object> msgContext = new HashMap<>(2);
msgContext.put("step", objects); msgContext.put("step", objects);
msgContext.put("currentStep", step); msgContext.put("currentStep", contingencyOriginalData.getStep());
msgContext.put("confirm", contingencyOriginalData.getConfirm());
msgContext.put("createDate", contingencyOriginalData.getCreateDate());
List<ContingencyPlanInstance> list = contingencyPlanInstanceRepository.findByBatchNo(batchNo);
if (!CollectionUtils.isEmpty(list)) {
List<ContingencyPlanInstance> collect = list.stream().filter(x -> "OPERATE".equals(x.getRecordType())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) {
msgContext.put("caseId", collect.get(0).getId());
}
}
toipResponse.setMsgType("steparea"); toipResponse.setMsgType("steparea");
toipResponse.setMsgContext(msgContext); toipResponse.setMsgContext(msgContext);
toipResponse.setContingency(contingencyOriginalData); toipResponse.setContingency(contingencyOriginalData);
...@@ -303,4 +315,18 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -303,4 +315,18 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
} }
return toipResponse; return toipResponse;
} }
@Override
@Transactional
public PlanStepVo updatePlanStep(PlanStepVo planStepVo) {
// 运行中的设置为重置
List<PlanOperationRecord> planList = planOperationRecordDao.findByStatus(0);
if (!CollectionUtils.isEmpty(planList)) {
// 根据批次号查询预案步骤
PlanRule planRule = planOperationRecordMapper.getPlanRuleByBatchNo(planStepVo.getBatchNo());
planRule.setPlanStep(planStepVo.getPlanStep());
planRuleDao.save(planRule);
}
return planStepVo;
}
} }
...@@ -18,6 +18,7 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao; ...@@ -18,6 +18,7 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao; import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import com.yeejoin.amos.fas.business.dao.repository.ISafetyIndexChangeLogDao; import com.yeejoin.amos.fas.business.dao.repository.ISafetyIndexChangeLogDao;
import com.yeejoin.amos.fas.business.feign.IDutyModeServer; import com.yeejoin.amos.fas.business.feign.IDutyModeServer;
import com.yeejoin.amos.fas.business.feign.JcsFeign;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService; import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService; import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService; import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
...@@ -30,6 +31,7 @@ import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse; ...@@ -30,6 +31,7 @@ import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse; import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
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.ResponseModel;
import com.yeejoin.amos.fas.core.util.StringUtil; import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.Equipment; import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.RiskLevel; import com.yeejoin.amos.fas.dao.entity.RiskLevel;
...@@ -87,6 +89,9 @@ public class View3dServiceImpl implements IView3dService { ...@@ -87,6 +89,9 @@ public class View3dServiceImpl implements IView3dService {
@Autowired @Autowired
private IDutyModeServer dutyModeServer; private IDutyModeServer dutyModeServer;
@Autowired
private JcsFeign jcsFeign;
@Value("${param.system.online.date}") @Value("${param.system.online.date}")
private String onLineDate; private String onLineDate;
...@@ -495,12 +500,45 @@ public class View3dServiceImpl implements IView3dService { ...@@ -495,12 +500,45 @@ public class View3dServiceImpl implements IView3dService {
} }
@Override @Override
public CommonResponse getStatisticsDuty(String appKey, String product, String token, String orgCode) { public Map<String, Object> getStatisticsDuty() {
Date curDate = new Date(); Map<String, Object> map = new HashMap<>();
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
JSONObject param = new JSONObject(); String dateStr = format.format(date);
param.put("dutyDate", curDate); ResponseModel responseModel = jcsFeign.dutyStatisticsByDate(dateStr, dateStr, "personType");
return dutyModeServer.dutyListByDay(appKey, product, token, orgCode, param.toJSONString()); if ("SUCCESS".equals(responseModel.getDevMessage())) {
String JSONStr = JSON.toJSONString(responseModel.getResult());
JSONArray dataList = JSONObject.parseArray(JSONStr);
if (!ObjectUtils.isEmpty(dataList)) {
for (Object x : dataList) {
Map<String, Object> resultMap = new HashMap<>();
String json = JSON.toJSONString(((JSONObject) x).get("data"));
JSONArray array = JSONObject.parseArray(json);
if (!ObjectUtils.isEmpty(array)) {
Map<String, String> result = (Map<String, String>) array.get(0);
String total = result.get("total");
String postTypeName = result.get("postTypeName");
if (DutyPersonEnum.FIRE_PERSON.getName().equals(postTypeName)) {
map.put("firePersonNumber", total);
} else if (DutyPersonEnum.OPS_PERSON.getName().equals(postTypeName)) {
map.put("dutyPersonNumber", total);
} else if (DutyPersonEnum.REAL_PERSON.getName().equals(postTypeName)) {
map.put("securityPersonNumber", total);
}
}
}
}
}
if (!map.containsKey("firePersonNumber")) {
map.put("firePersonNumber", 0);
}
if (!map.containsKey("dutyPersonNumber")) {
map.put("dutyPersonNumber", 0);
}
if (!map.containsKey("securityPersonNumber")) {
map.put("securityPersonNumber", 0);
}
return map;
} }
@Override @Override
...@@ -657,6 +695,27 @@ public class View3dServiceImpl implements IView3dService { ...@@ -657,6 +695,27 @@ public class View3dServiceImpl implements IView3dService {
return pointList; return pointList;
} }
@Override
public List<Map<String, Object>> dutyList(String orgCode) {
ArrayList<Map<String, Object>> list = new ArrayList<>();
ResponseModel responseModel = jcsFeign.dutyPersonList();
if ("SUCCESS".equals(responseModel.getDevMessage())) {
String JSONStr = JSON.toJSONString(responseModel.getResult());
JSONArray dataList = JSONObject.parseArray(JSONStr);
if (!ObjectUtils.isEmpty(dataList)) {
dataList.forEach(x -> {
Map<String, Object> resultMap = new HashMap<>();
JSONObject obj = (JSONObject) x;
resultMap.put("postName", obj.getString("postTypeName"));
resultMap.put("name", obj.getString("userName"));
resultMap.put("phone", obj.getString("telephone"));
list.add(resultMap);
});
}
}
return list;
}
private List<Map<String, Object>> getPointsByRegionIds(List<Long> ids) { private List<Map<String, Object>> getPointsByRegionIds(List<Long> ids) {
return view3dMapper.getAllPointInRegions(ids); return view3dMapper.getAllPointInRegions(ids);
......
...@@ -135,4 +135,5 @@ public interface IContingencyPlanService { ...@@ -135,4 +135,5 @@ public interface IContingencyPlanService {
AtomicBoolean planReset(); AtomicBoolean planReset();
Boolean getPlanStatus();
} }
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.dao.entity.PlanRule;
public interface IPlanRuleService {
void updatePlanRuleByBatchNo(String batchNo);
}
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
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.TreeSubjectVo; 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.PlanRule;
import com.yeejoin.amos.fas.dao.entity.TextPlan; import com.yeejoin.amos.fas.dao.entity.TextPlan;
import java.util.List; import java.util.List;
...@@ -68,4 +70,6 @@ public interface IPlanVisual3dService { ...@@ -68,4 +70,6 @@ public interface IPlanVisual3dService {
* @return 预案记录 * @return 预案记录
*/ */
ToipResponse getPlaneRecordOneByBatchNo(String batchNo); ToipResponse getPlaneRecordOneByBatchNo(String batchNo);
PlanStepVo updatePlanStep(PlanStepVo planStepVo);
} }
...@@ -104,7 +104,7 @@ public interface IView3dService { ...@@ -104,7 +104,7 @@ public interface IView3dService {
* 今日值班统计 * 今日值班统计
* @return * @return
*/ */
CommonResponse getStatisticsDuty(String appKey, String product, String token, String orgCode); Map<String, Object> getStatisticsDuty();
/** /**
* 设备状态消息最新5条 * 设备状态消息最新5条
...@@ -189,4 +189,10 @@ public interface IView3dService { ...@@ -189,4 +189,10 @@ public interface IView3dService {
*/ */
List<Map<String, Object>> listPointsByRegionId(Long regionId, String type); List<Map<String, Object>> listPointsByRegionId(Long regionId, String type);
/**
* 今日值班列表
* @param orgCode
* @return
*/
List<Map<String, Object>> dutyList(String orgCode);
} }
package com.yeejoin.amos.fas.business.vo;
import lombok.Data;
@Data
public class PlanStepVo {
private String batchNo;
private String planStep;
}
...@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true ...@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1 spring.datasource.validationQuery = SELECT 1
#系统服务账号,用户后端服务调用 #系统服务账号,用户后端服务调用
security.password=a1234560 #security.password=a1234560
security.loginId=fas_autosys #security.loginId=fas_autosys
amos.system.user.user-name=fas_autosys
amos.system.user.password=a1234560
#应用product appkey #应用product appkey
security.productWeb=STUDIO_APP_WEB #security.productWeb=STUDIO_APP_WEB
security.appKey =studio_normalapp_3056965 #security.appKey =studio_normalapp_3056965
amos.system.user.app-key=studio_normalapp_3056965
amos.system.user.product=STUDIO_APP_WEB
eureka.client.serviceUrl.defaultZone=http://172.16.11.201:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://172.16.11.201:10001/eureka/
eureka.client.register-with-eureka = true eureka.client.register-with-eureka = true
......
...@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true ...@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1 spring.datasource.validationQuery = SELECT 1
#系统服务账号,用户后端服务调用 #系统服务账号,用户后端服务调用
security.password=a1234560 #security.password=a1234560
security.loginId=fas_autosys #security.loginId=fas_autosys
amos.system.user.user-name=fas_autosys
amos.system.user.password=a1234560
#应用product appkey #应用product appkey
security.productWeb=STUDIO_APP_WEB #security.productWeb=STUDIO_APP_WEB
security.appKey =studio_normalapp_2681691 #security.appKey =studio_normalapp_3056965
amos.system.user.app-key=studio_normalapp_3056965
amos.system.user.product=STUDIO_APP_WEB
eureka.client.serviceUrl.defaultZone=http://172.16.11.20:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://172.16.11.20:10001/eureka/
eureka.client.register-with-eureka = true eureka.client.register-with-eureka = true
......
...@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true ...@@ -9,12 +9,16 @@ spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1 spring.datasource.validationQuery = SELECT 1
#系统服务账号,用户后端服务调用 #系统服务账号,用户后端服务调用
security.password=a1234560 #security.password=a1234560
security.loginId=fas_autosys #security.loginId=fas_autosys
amos.system.user.user-name=fas_autosys
amos.system.user.password=a1234560
#应用product appkey #应用product appkey
security.productWeb=STUDIO_APP_WEB #security.productWeb=STUDIO_APP_WEB
security.appKey =studio_normalapp_2681691 #security.appKey =studio_normalapp_3056965
amos.system.user.app-key=studio_normalapp_3056965
amos.system.user.product=STUDIO_APP_WEB
eureka.client.serviceUrl.defaultZone=http://172.16.11.20:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://172.16.11.20:10001/eureka/
eureka.client.register-with-eureka = true eureka.client.register-with-eureka = true
......
...@@ -52,6 +52,10 @@ equipManage.fegin.name=AMOS-EQUIPMANAGE ...@@ -52,6 +52,10 @@ equipManage.fegin.name=AMOS-EQUIPMANAGE
#jpush 服务名称 #jpush 服务名称
Push.fegin.name=AMOS-JPUSH Push.fegin.name=AMOS-JPUSH
#JCS 服务名称
Jcs.fegin.name=JCS
#feginName #feginName
number.plan.projectName=换流站消防专项预案 number.plan.projectName=换流站消防专项预案
......
...@@ -115,6 +115,15 @@ ...@@ -115,6 +115,15 @@
WHERE WHERE
cpor.batch_no = #{batchNo} cpor.batch_no = #{batchNo}
</select> </select>
<select id="getPlanRuleByBatchNo" resultType="com.yeejoin.amos.fas.dao.entity.PlanRule">
SELECT
cpr.*
FROM
c_plan_rule cpr
LEFT JOIN c_plan_operation_record cpor ON cpor.plan_id = cpr.plan_id
WHERE
cpor.batch_no = #{batchNo}
</select>
<select id="getNewestBatchNo" resultType="java.lang.String"> <select id="getNewestBatchNo" resultType="java.lang.String">
select batch_no as batchNo from c_plan_operation_record where status = 0 and is_delete = 0 order by create_date desc limit 1 select batch_no as batchNo from c_plan_operation_record where status = 0 and is_delete = 0 order by create_date desc limit 1
......
[
{
"stepCode": "0",
"stepName": "确认灾情",
"stepStatus": "0",
"buttonCode": "FIRE_CONFIRM"
},
{
"stepCode": "1",
"stepName": "停运换流阀",
"stepStatus": "0",
"buttonCode": "STOP_COMMUTATION"
},
{
"stepCode": "2",
"stepName": "拨打报警电话",
"stepStatus": "0",
"buttonCode": "CALL_PHONE"
},
{
"stepCode": "3",
"stepName": "确认油枕排油系统已开启",
"stepStatus": "0",
"buttonCode": "DRAIN_OIL_CONFIRM"
},
{
"stepCode": "4",
"stepName": "确认水喷雾系统已开启",
"stepStatus": "0",
"buttonCode": "OPEN_WATERSYSTEM"
},
{
"stepCode": "5",
"stepName": "断开上级电源",
"stepStatus": "0",
"buttonCode": "OFF_POWER"
},
{
"stepCode": "6",
"stepName": "停运阀厅空调系统",
"stepStatus": "0",
"buttonCode": "STOP_AIRCON"
},
{
"stepCode": "7",
"stepName": "一键开启消防炮",
"stepStatus": "0",
"buttonCode": "MONITOR_START"
},
{
"stepCode": "8",
"stepName": "驻站消防队指挥权交接",
"stepStatus": "0",
"buttonCode": "HANDOVER_COMMAND"
},
{
"stepCode": "9",
"stepName": "确认本体排油已开启",
"stepStatus": "0",
"buttonCode": "OWNER_DRAIN_OIL"
},
{
"stepCode": "10",
"stepName": "启动阀厅应急预案",
"stepStatus": "0",
"buttonCode": "START_VALVE_HALL_CONTINGENCY"
},
{
"stepCode": "11",
"stepName": "电缆沟封堵",
"stepStatus": "0",
"buttonCode": "PLUG_CABLETRENCH"
},
{
"stepCode": "12",
"stepName": "政府消防队指挥权交接",
"stepStatus": "0",
"buttonCode": "HANDOVER_FIGTHHING"
},
{
"stepCode": "13",
"stepName": "确认明火扑灭",
"stepStatus": "0",
"buttonCode": "FIRE_EXTINCT"
},
{
"stepCode": "14",
"stepName": "应急处置结束",
"stepStatus": "0",
"buttonCode": "END_EMERGENCY"
}
]
\ 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