Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 9 months ago
parent
commit
3b7c776417
  1. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmHandleConstant.java
  2. 6
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmEntity.java
  3. 2
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java
  4. 31
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/RobotTaskVideoDTO.java
  5. 16
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java
  6. 18
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpHistoryDataController.java
  7. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpMonitorController.java
  8. 3
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/FdpDiagnoseClient.java
  9. 13
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpFocusSurveillanceServiceImpl.java
  10. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpHistoryDataServiceImpl.java
  11. 4
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java
  12. 46
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java
  13. 16
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java
  14. 22
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java
  15. 34
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java
  16. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java
  17. 21
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/constants/HikApiConstants.java
  18. 23
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/controller/HikVideoController.java
  19. 1
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/note.md
  20. 62
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/request/PlaybackRequest.java
  21. 32
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/request/RecordStartRequest.java
  22. 32
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/request/RecordStopRequest.java
  23. 8
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/service/IHikApiService.java
  24. 25
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/service/impl/HikApiServiceImpl.java
  25. 17
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
  26. 11
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/IRobotTaskVideoService.java
  27. 136
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/RobotTaskVideoServiceImpl.java
  28. 80
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HiKUtil.java
  29. 228
      hzims-service/inspect/src/main/resources/db/1.0.1.sql

2
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmHandleConstant.java

@ -26,7 +26,7 @@ public interface AlarmHandleConstant {
String FAULT = "3"; String FAULT = "3";
/**预警**/ /**预警**/
Long EARLY_WARNING = 20L; Long EARLY_WARNING = 30L;
String WEBSOCKET_FAULT = "3"; String WEBSOCKET_FAULT = "3";

6
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmEntity.java

@ -49,6 +49,12 @@ public class AlarmEntity extends TenantEntity {
@ApiModelProperty(value = "告警内容") @ApiModelProperty(value = "告警内容")
private String alarmContext; private String alarmContext;
@ApiModelProperty(value = "初步分析原因")
private String diagReason;
@ApiModelProperty(value = "建议处置方式")
private String diagSolution;
@ApiModelProperty(value = "告警状态") @ApiModelProperty(value = "告警状态")
private Integer alarmStatus; private Integer alarmStatus;

2
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java

@ -34,5 +34,5 @@ public interface IFdpDiagnoseClient {
@PostMapping(GET_HISTORY_DATA) @PostMapping(GET_HISTORY_DATA)
List<FdpFaultHistoryDataEntity> getHistoryData(@RequestBody FDPFaultTableDTO req); List<FdpFaultHistoryDataEntity> getHistoryData(@RequestBody FDPFaultTableDTO req);
@PostMapping(SET_FAULT_STATUS_INFO) @PostMapping(SET_FAULT_STATUS_INFO)
R setFaultStatusInfo(Map<String, Object> map); R setFaultStatusInfo(@RequestBody Map<String, Object> map);
} }

31
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/RobotTaskVideoDTO.java

@ -0,0 +1,31 @@
package com.hnac.hzinfo.inspect.task.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
@EqualsAndHashCode
public class RobotTaskVideoDTO implements Serializable {
/**
* 巡检任务ID
*/
@NotNull
private Long taskId;
/**
* 巡检机器人ID
*/
@NotNull
private Long userId;
/**
* 视频记录类型 1为开始 2为结束
*/
@NotNull
private Integer recordType;
}

16
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java

@ -193,4 +193,20 @@ public class TaskEntity extends TenantEntity {
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
private Boolean pushStatus; private Boolean pushStatus;
@ApiModelProperty(value = "视频录制开始时间")
private LocalDateTime videoStartTime;
@ApiModelProperty(value = "视频录制结束时间")
private LocalDateTime videoEndTime;
@ApiModelProperty(value = "手动录制视频地址")
private String videoUrl;
@ApiModelProperty(value = "海康录制视频任务ID")
private String hikVideoTaskId;
@TableField(exist = false)
@ApiModelProperty(value = "机器人第一视角MP4地址")
private String perspectiveUrl;
} }

18
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpHistoryDataController.java

@ -10,6 +10,7 @@ import com.hnac.hzims.fdp.dto.FDPFaultTableDTO;
import com.hnac.hzims.fdp.dto.FdpTaskDTO; import com.hnac.hzims.fdp.dto.FdpTaskDTO;
import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity;
import com.hnac.hzims.fdp.entity.FdpTaskEntity; import com.hnac.hzims.fdp.entity.FdpTaskEntity;
import com.hnac.hzims.fdp.service.IFdpFocusSurveillanceService;
import com.hnac.hzims.fdp.service.IFdpHistoryDataService; import com.hnac.hzims.fdp.service.IFdpHistoryDataService;
import com.hnac.hzims.fdp.service.IFdpTaskService; import com.hnac.hzims.fdp.service.IFdpTaskService;
import com.hnac.hzims.fdp.vo.FdpTaskVO; import com.hnac.hzims.fdp.vo.FdpTaskVO;
@ -32,6 +33,8 @@ import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.HashMap;
import java.util.Map;
/** /**
* 故障诊断任务表 * 故障诊断任务表
@ -46,6 +49,8 @@ import javax.validation.Valid;
public class FdpHistoryDataController extends BladeController { public class FdpHistoryDataController extends BladeController {
private final IFdpHistoryDataService service; private final IFdpHistoryDataService service;
private final IFdpFocusSurveillanceService fdpFocusSurveillanceService;
/** /**
* 分页 * 分页
*/ */
@ -61,5 +66,18 @@ public class FdpHistoryDataController extends BladeController {
} }
/**
* 分页
*/
@ApiLog
@PostMapping("/updateFaultHistory")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:name,emId,faultId,reasonId,satisfaction")
@OperationAnnotation(moduleName = "智能诊断",title = "智能诊断任务",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "分页查询智能诊断任务列表")
public R<IPage<FdpFaultHistoryDataEntity>> updateFaultHistory(@RequestBody Map<String, Object> map) {
return fdpFocusSurveillanceService.setFaultStatusInfo(map);
}
} }

2
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpMonitorController.java

@ -194,7 +194,7 @@ public class FdpMonitorController extends BladeController {
@ApiOperationSupport(order = 160) @ApiOperationSupport(order = 160)
@ApiOperation(value = "数据追溯") @ApiOperation(value = "数据追溯")
public R dataBack(@RequestBody DataBackVo vo) { public R dataBack(@RequestBody DataBackVo vo) {
service.dataBackV2(vo.getFaultId()); // service.dataBackV2(vo.getFaultId());
return service.dataBackV2(vo.getFaultId()); return service.dataBackV2(vo.getFaultId());
} }

3
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/FdpDiagnoseClient.java

@ -11,6 +11,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -42,7 +43,7 @@ public class FdpDiagnoseClient implements IFdpDiagnoseClient {
@Override @Override
@PostMapping(SET_FAULT_STATUS_INFO) @PostMapping(SET_FAULT_STATUS_INFO)
public R setFaultStatusInfo(Map<String, Object> map) { public R setFaultStatusInfo(@RequestBody Map<String, Object> map) {
return iFdpFocusSurveillanceService.setFaultStatusInfo(map); return iFdpFocusSurveillanceService.setFaultStatusInfo(map);
} }
} }

13
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpFocusSurveillanceServiceImpl.java

@ -33,18 +33,6 @@ import java.util.*;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class FdpFocusSurveillanceServiceImpl implements IFdpFocusSurveillanceService { public class FdpFocusSurveillanceServiceImpl implements IFdpFocusSurveillanceService {
private final FdpDeviceMapper fdpDeviceMapper;
private final IEmInfoService emInfoService;
private final IAnalyseInstanceClient deviceInstanceClient;
private final IAnalyseInstanceClient analyseInstanceClient;
private final IRealDataSearchClient realDataSearchClient;
private final IAnalyseDataSearchClient deviceDataSearchClient;
private final IFdpTaskService fdpTaskService;
private final IDiagnoseProxy diagnoseProxy;
private final FdpMonitorNoScopeMapper fdpMonitorNoScopeMapper;
private final IStationClient stationClient;
private final IFdpFaultService fdpFaultService;
private final RedisTemplate redisTemplate;
@Value("${url.setFaultStatusInfo}") @Value("${url.setFaultStatusInfo}")
public String setFaultStatusInfo; public String setFaultStatusInfo;
@ -56,6 +44,7 @@ public class FdpFocusSurveillanceServiceImpl implements IFdpFocusSurveillanceSer
*/ */
@Override @Override
public R setFaultStatusInfo( Map<String, Object> map) { public R setFaultStatusInfo( Map<String, Object> map) {
// map.put("diag_reason","");
String post = HttpRequestUtil.postCallObjectParam(map, setFaultStatusInfo, "POST"); String post = HttpRequestUtil.postCallObjectParam(map, setFaultStatusInfo, "POST");
R r = JSONObject.parseObject(post, new TypeReference<R>() {{}}); R r = JSONObject.parseObject(post, new TypeReference<R>() {{}});
return r; return r;

2
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpHistoryDataServiceImpl.java

@ -50,7 +50,7 @@ public class FdpHistoryDataServiceImpl implements IFdpHistoryDataService {
@Override @Override
public R<IPage<FdpFaultHistoryDataEntity>> getHistoryData(FDPFaultTableDTO req) { public R<IPage<FdpFaultHistoryDataEntity>> getHistoryData(FDPFaultTableDTO req) {
IPage<FdpFaultHistoryDataEntity> page = new Page<>(); IPage<FdpFaultHistoryDataEntity> page = new Page<>();
page.setSize(req.getPageSize()); page.setSize(req.getPageSize()-1);
page.setCurrent(req.getPageIndex()); page.setCurrent(req.getPageIndex());
req.setOrderBy("CREATE_TIME"); req.setOrderBy("CREATE_TIME");
if (StringUtil.isBlank(req.getSource())){ if (StringUtil.isBlank(req.getSource())){

4
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

@ -73,9 +73,9 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
public R getListByProperty(FDPFaultListInfoDTO req) { public R getListByProperty(FDPFaultListInfoDTO req) {
IPage<FdpFaultTableListEntity> page = new Page<>(); IPage<FdpFaultTableListEntity> page = new Page<>();
page.setSize(req.getPageSize()); page.setSize(req.getPageSize());
page.setCurrent(req.getPageIndex()); page.setCurrent(req.getPageIndex()-1);
req.setDisplay(1); req.setDisplay(1);
req.setIsRoot(1); req.setIsRoot(0);
req.setOrderBy("NAME"); req.setOrderBy("NAME");
req.setOrderKind("desc"); req.setOrderKind("desc");
String result = HttpRequestUtil.postCallObjectParam(req, getNeoFaultTableData, "POST"); String result = HttpRequestUtil.postCallObjectParam(req, getNeoFaultTableData, "POST");

46
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java

@ -392,12 +392,12 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl<FdpMonitorMapper, Fdp
return R.fail("未传入faultId参数"); return R.fail("未传入faultId参数");
} }
/**获取故障对象**/ /**获取故障对象**/
LambdaQueryWrapper<FdpFaultEntity> wrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<FdpFaultEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FdpFaultEntity::getFdpId, taskDTO.getFaultId()).last("limit 1"); // wrapper.eq(FdpFaultEntity::getFdpId, taskDTO.getFaultId()).last("limit 1");
FdpFaultEntity fdpFaultEntity = fdpFaultService.getOne(wrapper); // FdpFaultEntity fdpFaultEntity = fdpFaultService.getOne(wrapper);
if (ObjectUtil.isEmpty(fdpFaultEntity)) { // if (ObjectUtil.isEmpty(fdpFaultEntity)) {
throw new ServiceException("获取对应故障对象失败"); // throw new ServiceException("获取对应故障对象失败");
} // }
//拿到最近一次未完成的任务 //拿到最近一次未完成的任务
FdpTaskEntity fdpTaskEntity = fdpTaskService.getOne(new LambdaQueryWrapper<FdpTaskEntity>() {{ FdpTaskEntity fdpTaskEntity = fdpTaskService.getOne(new LambdaQueryWrapper<FdpTaskEntity>() {{
eq(FdpTaskEntity::getFaultId, taskDTO.getFaultId()); eq(FdpTaskEntity::getFaultId, taskDTO.getFaultId());
@ -440,7 +440,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl<FdpMonitorMapper, Fdp
r2.setSuccess(true); r2.setSuccess(true);
r2.setMsg("获取信息成功"); r2.setMsg("获取信息成功");
DiagnoseStatusVo diagnoseStatusVo = new DiagnoseStatusVo(); DiagnoseStatusVo diagnoseStatusVo = new DiagnoseStatusVo();
R nextstep = fdpFaultService.getNextStepWithTree(fdpFaultEntity.getFdpId(), fdpFaultEntity.getStationId()); R nextstep = fdpFaultService.getNextStepWithTree(taskDTO.getFaultId(), taskDTO.getStation());
diagnoseStatusVo.setStatus(4); diagnoseStatusVo.setStatus(4);
diagnoseStatusVo.setMessage("诊断成功"); diagnoseStatusVo.setMessage("诊断成功");
diagnoseStatusVo.setData(nextstep.getData()); diagnoseStatusVo.setData(nextstep.getData());
@ -589,18 +589,21 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl<FdpMonitorMapper, Fdp
@Override @Override
public R updateFaultState(DiagnoseFaultReq diagnoseFaultReq) { public R updateFaultState(DiagnoseFaultReq diagnoseFaultReq) {
diagnoseFaultReq.setPriority(2); diagnoseFaultReq.setPriority(2);
/**获取故障对象**/ // /**获取故障对象**/
LambdaQueryWrapper<FdpFaultEntity> wrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<FdpFaultEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FdpFaultEntity::getFdpId, diagnoseFaultReq.getFaultId()).last("limit 1"); // wrapper.eq(FdpFaultEntity::getFdpId, diagnoseFaultReq.getFaultId()).last("limit 1");
FdpFaultEntity fdpFaultEntity = fdpFaultService.getOne(wrapper); // FdpFaultEntity fdpFaultEntity = fdpFaultService.getOne(wrapper);
if (ObjectUtil.isEmpty(fdpFaultEntity)) { // if (ObjectUtil.isEmpty(fdpFaultEntity)) {
throw new ServiceException("获取对应故障对象失败"); // throw new ServiceException("获取对应故障对象失败");
} // }
Boolean hasKey = redisTemplate.hasKey(KEY_FOR_FDP_TASK_ID + "_" + diagnoseFaultReq.getTaskId().toString()); if(StringUtil.isNotBlank(diagnoseFaultReq.getTaskId())){
//Redis中不存在,该任务过期 Boolean hasKey = redisTemplate.hasKey(KEY_FOR_FDP_TASK_ID + "_" + diagnoseFaultReq.getTaskId().toString());
if (!hasKey) { //Redis中不存在,该任务过期
return R.fail("该任务已过期,请重新生成任务"); if (!hasKey) {
return R.fail("该任务已过期,请重新生成任务");
}
} }
/**更新故障状态**/ /**更新故障状态**/
DiagnoseFaultAllReq faultAllReq = new DiagnoseFaultAllReq(); DiagnoseFaultAllReq faultAllReq = new DiagnoseFaultAllReq();
/**推送数据**/ /**推送数据**/
@ -608,14 +611,15 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl<FdpMonitorMapper, Fdp
// FdpRealTimeAndHisDataVo pushResp = this.dataPushByPartition(fdpFaultEntity.getFdpPartition(), fdpFaultEntity.getCreateDept()); // FdpRealTimeAndHisDataVo pushResp = this.dataPushByPartition(fdpFaultEntity.getFdpPartition(), fdpFaultEntity.getCreateDept());
// faultAllReq.setAutoData(pushResp); // faultAllReq.setAutoData(pushResp);
faultAllReq.setStationId(fdpFaultEntity.getStationId()); faultAllReq.setStationId(diagnoseFaultReq.getTenantId());
diagnoseFaultReq.setTenantId(fdpFaultEntity.getStationId());
diagnoseFaultReq.setLifeTime(24*3);//一旦用户进行修改,智能诊断时效性刷新为3天 diagnoseFaultReq.setLifeTime(24*3);//一旦用户进行修改,智能诊断时效性刷新为3天
faultAllReq.setManualData(diagnoseFaultReq); faultAllReq.setManualData(diagnoseFaultReq);
String jsonString = JSONObject.toJSONString(faultAllReq); String jsonString = JSONObject.toJSONString(faultAllReq);
System.out.println(jsonString); System.out.println(jsonString);
HttpResponse r = HttpClientUtils.post(updateFaultStateAll, JSONObject.toJSONString(faultAllReq)); HttpResponse r = HttpClientUtils.post(updateFaultStateAll, JSONObject.toJSONString(faultAllReq));
redisTemplate.expire(KEY_FOR_FDP_TASK_ID + "_" + diagnoseFaultReq.getTaskId(), 3, TimeUnit.DAYS); if(StringUtil.isNotBlank(diagnoseFaultReq.getTaskId())) {
redisTemplate.expire(KEY_FOR_FDP_TASK_ID + "_" + diagnoseFaultReq.getTaskId(), 3, TimeUnit.DAYS);
}
return JSONObject.parseObject(r.getData(), BaseResp.class).convert2R(); return JSONObject.parseObject(r.getData(), BaseResp.class).convert2R();
} }

16
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java

@ -254,14 +254,18 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn
} }
HttpResponse r = HttpClientUtils.post(submitResult, JSONObject.toJSONString(fdpSubmitResultDTO)); HttpResponse r = HttpClientUtils.post(submitResult, JSONObject.toJSONString(fdpSubmitResultDTO));
if (200 != r.getCode()) { if (200 != r.getCode()) {
throw new ServiceException("智能诊断回传失败"); log.error("调用fdp接口submitResult失败,参数为:"+JSONObject.toJSONString(fdpSubmitResultDTO));
throw new ServiceException("保存失败,请稍后重试!!!");
} }
boolean b = this.updateById(req); if (ObjectUtil.isNotEmpty(req.getId())) {
if (b) { boolean b = this.updateById(req);
return R.success("保存成功"); if (b) {
} else { return R.success("保存成功");
return R.fail("保存失败,请稍后重试"); } else {
return R.fail("保存失败,请稍后重试");
}
} }
return R.success("保存成功");
} }
private static Wrapper<FdpTaskEntity> getFdpTaskEntityWrapper(TaskStatisticsVo statisticsVo) { private static Wrapper<FdpTaskEntity> getFdpTaskEntityWrapper(TaskStatisticsVo statisticsVo) {

22
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java

@ -63,6 +63,7 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpl<AlarmHandleFlowM
return R.fail("消息转换失败"); return R.fail("消息转换失败");
} }
taskId = alarmHandleFlowEntity.getId(); taskId = alarmHandleFlowEntity.getId();
//设置当前环节+当前环节处理人 //设置当前环节+当前环节处理人
if (StringUtils.isNotEmpty(processWorkFlowResponse.getNextStepOperator())) { if (StringUtils.isNotEmpty(processWorkFlowResponse.getNextStepOperator())) {
alarmHandleFlowEntity.setCurrentOperator(processWorkFlowResponse.getTaskName()); alarmHandleFlowEntity.setCurrentOperator(processWorkFlowResponse.getTaskName());
@ -70,6 +71,8 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpl<AlarmHandleFlowM
} else { } else {
alarmHandleFlowEntity.setCurrentOperator("流程结束"); alarmHandleFlowEntity.setCurrentOperator("流程结束");
alarmHandleFlowEntity.setCurrentLinkHandler(""); alarmHandleFlowEntity.setCurrentLinkHandler("");
Map<String, Object> map = new HashMap<>();
map.put("uuid", alarmHandleFlowEntity.getAlarmId());
if (1l == alarmHandleFlowEntity.getHandleWay()) { if (1l == alarmHandleFlowEntity.getHandleWay()) {
//如果是误诊,把处理结果复制到误报原因 //如果是误诊,把处理结果复制到误报原因
alarmHandleFlowEntity.setFalseAlarmDesc(alarmHandleFlowEntity.getDealDesc()); alarmHandleFlowEntity.setFalseAlarmDesc(alarmHandleFlowEntity.getDealDesc());
@ -77,6 +80,18 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpl<AlarmHandleFlowM
.set(AlarmHandleEntity::getHandleWay, alarmHandleFlowEntity.getHandleWay()) .set(AlarmHandleEntity::getHandleWay, alarmHandleFlowEntity.getHandleWay())
.set(AlarmHandleEntity::getFalseAlarmDesc, alarmHandleFlowEntity.getDealDesc()) .set(AlarmHandleEntity::getFalseAlarmDesc, alarmHandleFlowEntity.getDealDesc())
.eq(AlarmHandleEntity::getAlarmId, alarmHandleFlowEntity.getAlarmId())); .eq(AlarmHandleEntity::getAlarmId, alarmHandleFlowEntity.getAlarmId()));
map.put("result", "误报");
map.put("result_info","");
map.put("diag_solution", alarmHandleFlowEntity.getDealDesc());
} else if (2l == alarmHandleFlowEntity.getHandleWay()) {
alarmHandleMapper.update(null, Wrappers.<AlarmHandleEntity>lambdaUpdate()
.set(AlarmHandleEntity::getHandleWay, alarmHandleFlowEntity.getHandleWay())
.set(AlarmHandleEntity::getDelayCause, alarmHandleFlowEntity.getDelayCause())
.set(AlarmHandleEntity::getDelayTime, alarmHandleFlowEntity.getDelayTime())
.eq(AlarmHandleEntity::getAlarmId, alarmHandleFlowEntity.getAlarmId()));
map.put("result", "延后处理");
map.put("result_info", alarmHandleFlowEntity.getDealDesc());
map.put("diag_solution","");
} else { } else {
//流程结束把告警状态修改为结束 //流程结束把告警状态修改为结束
alarmHandleFlowEntity.setHandleWay(6L); alarmHandleFlowEntity.setHandleWay(6L);
@ -85,13 +100,12 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpl<AlarmHandleFlowM
.set(AlarmHandleEntity::getHandleWay, 6l) .set(AlarmHandleEntity::getHandleWay, 6l)
.set(AlarmHandleEntity::getFalseAlarmDesc, alarmHandleFlowEntity.getDealDesc()) .set(AlarmHandleEntity::getFalseAlarmDesc, alarmHandleFlowEntity.getDealDesc())
.eq(AlarmHandleEntity::getAlarmId, alarmHandleFlowEntity.getAlarmId())); .eq(AlarmHandleEntity::getAlarmId, alarmHandleFlowEntity.getAlarmId()));
map.put("result", "处理完成");
map.put("result_info","");
map.put("diag_solution", alarmHandleFlowEntity.getDealDesc());
} }
// 预警,调用fdp // 预警,调用fdp
if (AlarmHandleConstant.EARLY_WARNING.equals(alarmHandleFlowEntity.getAlarmType())) { if (AlarmHandleConstant.EARLY_WARNING.equals(alarmHandleFlowEntity.getAlarmType())) {
Map<String, Object> map = new HashMap<>();
map.put("uuid", alarmHandleFlowEntity.getAlarmId());
map.put("result", alarmHandleFlowEntity.getHandleWay());
map.put("result_info", alarmHandleFlowEntity.getDealDesc());
//流程结束后才,调用fdp修改状态的接口 //流程结束后才,调用fdp修改状态的接口
R r = iFdpDiagnoseClient.setFaultStatusInfo(map); R r = iFdpDiagnoseClient.setFaultStatusInfo(map);
if (!r.isSuccess()) { if (!r.isSuccess()) {

34
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java

@ -74,21 +74,6 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
if (!AlarmHandleConstant.HANDLE_WAY.contains(way)) { if (!AlarmHandleConstant.HANDLE_WAY.contains(way)) {
throw new ServiceException("无效处理!"); throw new ServiceException("无效处理!");
} }
// 预警
if(AlarmHandleConstant.EARLY_WARNING.equals(param.getAlarmType())){
Map<String, Object> map=new HashMap<>();
map.put("uuid",param.getAlarmId());
map.put("result",param.getHandleWay());
if (1l==way){
map.put("result_info",param.getFalseAlarmDesc());
} else if (2l==way){
map.put("result_info",param.getDelayCause());
}
R r = iFdpDiagnoseClient.setFaultStatusInfo(map);
if (!r.isSuccess()){
throw new ServiceException("修改告警状态异常,请稍后重试!");
}
}
// 处理记录 // 处理记录
AlarmHandleEntity entity = new AlarmHandleEntity(); AlarmHandleEntity entity = new AlarmHandleEntity();
entity.setAlarmId(param.getAlarmId()); entity.setAlarmId(param.getAlarmId());
@ -112,6 +97,25 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
entity.setCreateDeptName(param.getCreateDeptName()); entity.setCreateDeptName(param.getCreateDeptName());
} }
this.save(entity); this.save(entity);
// 预警
if(AlarmHandleConstant.EARLY_WARNING.equals(param.getAlarmType())){
Map<String, Object> map=new HashMap<>();
map.put("uuid",param.getAlarmId());
if (1l==way){
map.put("result","误报");
map.put("diag_solution",param.getFalseAlarmDesc());
} else if (2l==way){
map.put("result","延后处理");
map.put("result_info",param.getDelayCause());
}else {
map.put("result","处理中");
}
R r = iFdpDiagnoseClient.setFaultStatusInfo(map);
if (!r.isSuccess()){
log.error("setFaultStatusInfo接口修改处理状态异常,参数为:"+param);
throw new ServiceException("修改告警状态异常,请稍后重试!");
}
}
//开启流程 //开启流程
if (AlarmHandleConstant.HANDLE.contains(way)) { if (AlarmHandleConstant.HANDLE.contains(way)) {
alarmHandleFlowMapper.insert(param); alarmHandleFlowMapper.insert(param);

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java

@ -93,6 +93,8 @@ public class FdpAlarmServiceImpl implements FdpAlarmService {
entity.setAlarmStatus(Integer.valueOf(item.getStatus())); entity.setAlarmStatus(Integer.valueOf(item.getStatus()));
entity.setAlarmValue(item.getInfo()); entity.setAlarmValue(item.getInfo());
entity.setStationId(item.getStation()); entity.setStationId(item.getStation());
entity.setDiagReason(item.getDiagReason());
entity.setDiagSolution(item.getDiagSolution());
entity.setAlarmSource(EARLY_WARNING); entity.setAlarmSource(EARLY_WARNING);
entity.setTenantId("200000"); entity.setTenantId("200000");
R<StationEntity> stationByCode = stationClient.getStationByCode(item.getStation()); R<StationEntity> stationByCode = stationClient.getStationByCode(item.getStation());

21
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/constants/HikApiConstants.java

@ -0,0 +1,21 @@
package com.hnac.hzinfo.inspect.hikVideo.constants;
public interface HikApiConstants {
/**
* 开始手动录像 89ca6c11cc0f40bd89b9653bb4398bc1
*/
String MANUAL_RECORD_START = "/api/video/v1/manualRecord/start";
/**
* 停止手动录像
*/
String MANUAL_RECORD_STOP = "/api/video/v1/manualRecord/stop";
/**
* 获取监控点回放取流URL
*/
String PLAY_BACK_URLS = "/api/video/v2/cameras/playbackURLs";
}

23
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/controller/HikVideoController.java

@ -0,0 +1,23 @@
package com.hnac.hzinfo.inspect.hikVideo.controller;
import com.hnac.hzinfo.inspect.hikVideo.service.IHikApiService;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@AllArgsConstructor
@RequestMapping("/hik/api")
public class HikVideoController {
private final IHikApiService hikApiService;
@GetMapping("/manualCapture")
public R<String> manualCapture(@RequestParam String pointCode) {
return R.data(hikApiService.manualCapture(pointCode));
}
}

1
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/note.md

@ -0,0 +1 @@
## 海康威视Api调用

62
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/request/PlaybackRequest.java

@ -0,0 +1,62 @@
package com.hnac.hzinfo.inspect.hikVideo.request;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@Data
@EqualsAndHashCode
public class PlaybackRequest implements Serializable {
/**
* 监控点唯一标识[分页获取监控点资源]@[软件产品-综合安防管理平台-API列表-视频应用服务-视频资源#分页获取监控点资源]接口获取返回参数cameraIndexCode
*/
private String cameraIndexCode;
/**
* 存储类型,0中心存储 1设备存储 默认为中心存储
*/
private String recordLocation = "1";
/**
* 取流协议应用层协议) hik:HIK私有协议使用视频SDK进行播放时
* 传入此类型 rtsp:RTSP协议rtmp:RTMP协议hls:HLS协议hls:HLS协议HLS协议只支持海康SDK协议EHOME协议ONVIF协议接入的设备只支持H264视频编码和AAC音频编码云存储版本要求v2.2.4及以上的2.x版本或v3.0.5及以上的3.x版本ISC版本要求v1.2.0版本及以上需在运管中心-视频联网共享中切换成启动平台外置VOD
* 参数不填默认为HIK协议
*/
private String protocol = "httpflv";
/**
* 传输协议传输层协议0:UDP 1:TCP 默认为tcp在protocol设置为rtsp或者rtmp时有效 EHOME设备回放只支持TCP传输 GB28181 2011及以前版本只支持UDP传输
*/
private Integer transmode = 1;
/**
* 开始查询时间IOS8601格式yyyy-MM-dd'T'HH:mm:ss.SSSXXX 例如北京时间 2017-06-14T00:00:00.000+08:00参考[附录BISO8601时间格式说明]@[软件产品-综合安防管理平台-附录#附录BISO8601时间格式说明]
*/
private String beginTime;
/**
* 结束查询时间开始时间和结束时间相差不超过三天 IOS8601格式yyyy-MM-dd'T'HH:mm:ss.SSSXXX例如北京时间 2017-06-15T00:00:00.000+08:00参考[附录BISO8601时间格式说明]@[软件产品-综合安防管理平台-附录#附录BISO8601时间格式说明]
*/
private String endTime;
/**
* 分页查询id,上一次查询返回的uuid用于继续查询剩余片段默认为空字符串当存储类型为设备存储时该字段生效中心存储会一次性返回全部片段
*/
private String uuid;
/**
* 扩展内容格式key=value 调用方根据其播放控件支持的解码格式选择相应的封装类型 支持的内容详见[附录F expand扩展内容说明]@[软件产品-综合安防管理平台-附录-附录F expand扩展内容说明]
*/
private String expand;
/**
* 输出码流转封装格式ps:PS封装格式rtp:RTP封装协议当protocol=rtsp时生效且不传值时默认为RTP封装协议
*/
private String streamform;
/**
* 查询录像的锁定类型0-查询全部录像1-查询未锁定录像2-查询已锁定录像不传默认值为0通过[录像锁定与解锁]@[软件产品-综合安防管理平台-API列表-视频应用服务-视频能力#查询预置点信息#录像锁定与解锁]接口来进行录像锁定与解锁
*/
private Integer lockType;
}

32
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/request/RecordStartRequest.java

@ -0,0 +1,32 @@
package com.hnac.hzinfo.inspect.hikVideo.request;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@Data
@EqualsAndHashCode
public class RecordStartRequest implements Serializable {
/**
* 监控点唯一标识
* [分页获取监控点资源]@[软件产品-综合安防管理平台-API列表-视频应用服务-视频资源#分页获取监控点资源]
* 接口获取返回参数cameraIndexCode
*/
private String cameraIndexCode;
/**
* 录像类型 范围:0-65535
* 参考[附录A.31 录像类型]@[软件产品-综合安防管理平台-附录-附录A 数据字典#附录A.31 录像类型]
* 中心存储必填设备存储不填
*/
private Integer recordType;
/**
* 下发的存储类型0-中心存储 1-设备存储如果不传入默认为0-中心存储
*/
private Integer type = 1;
}

32
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/request/RecordStopRequest.java

@ -0,0 +1,32 @@
package com.hnac.hzinfo.inspect.hikVideo.request;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@Data
@EqualsAndHashCode
public class RecordStopRequest implements Serializable {
/**
* 监控点唯一标识
* [分页获取监控点资源]@[软件产品-综合安防管理平台-API列表-视频应用服务-视频资源#分页获取监控点资源]接口
* 获取返回参数cameraIndexCode
*/
private String cameraIndexCode;
/**
* 手动录像编号
* [开始手动录像]@[软件产品-综合安防管理平台-API列表-视频应用服务-视频能力#开始手动录像]接口
* 获取返回参数taskID由于一个监控点同种存储类型同一时间只能进行一个手动录像任务
* taskID不传入时根据监控点编号和存储类型停止手动录像
*/
private String taskID;
/**
* 下发的存储类型,0-中心存储 1-设备存储 如果不传入默认为0-中心存储
*/
private Integer type = 1;
}

8
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/service/IHikApiService.java

@ -0,0 +1,8 @@
package com.hnac.hzinfo.inspect.hikVideo.service;
public interface IHikApiService {
String manualCapture(String pointCode);
}

25
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/hikVideo/service/impl/HikApiServiceImpl.java

@ -0,0 +1,25 @@
package com.hnac.hzinfo.inspect.hikVideo.service.impl;
import com.hnac.hzinfo.inspect.hikVideo.service.IHikApiService;
import com.hnac.hzinfo.inspect.utils.HiKUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Service
@Slf4j
@AllArgsConstructor
public class HikApiServiceImpl implements IHikApiService {
/**
* 从摄像头截图
* @param pointCode cameraIndexCode
* @return 视频云图片minio地址
*/
@Override
public String manualCapture(String pointCode) {
String picUrl = HiKUtil.manualCapture(pointCode);
log.info("摄像头截图地址为:{}",picUrl);
return picUrl;
}
}

17
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java

@ -17,11 +17,13 @@ import com.hnac.hzinfo.core.push.model.PushInfo;
import com.hnac.hzinfo.core.push.model.PushPlatform; import com.hnac.hzinfo.core.push.model.PushPlatform;
import com.hnac.hzinfo.inspect.plan.PlanContants; import com.hnac.hzinfo.inspect.plan.PlanContants;
import com.hnac.hzinfo.inspect.task.TaskContants.ClaimStatusEnum; import com.hnac.hzinfo.inspect.task.TaskContants.ClaimStatusEnum;
import com.hnac.hzinfo.inspect.task.dto.RobotTaskVideoDTO;
import com.hnac.hzinfo.inspect.task.dto.TaskDTO; import com.hnac.hzinfo.inspect.task.dto.TaskDTO;
import com.hnac.hzinfo.inspect.task.entity.EventEntity; import com.hnac.hzinfo.inspect.task.entity.EventEntity;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity; import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.entity.TaskUserEntity; import com.hnac.hzinfo.inspect.task.entity.TaskUserEntity;
import com.hnac.hzinfo.inspect.task.service.IEventService; import com.hnac.hzinfo.inspect.task.service.IEventService;
import com.hnac.hzinfo.inspect.task.service.IRobotTaskVideoService;
import com.hnac.hzinfo.inspect.task.service.ITaskService; import com.hnac.hzinfo.inspect.task.service.ITaskService;
import com.hnac.hzinfo.inspect.task.service.ITaskUserService; import com.hnac.hzinfo.inspect.task.service.ITaskUserService;
import com.hnac.hzinfo.inspect.task.vo.InspectTaskExportVO; import com.hnac.hzinfo.inspect.task.vo.InspectTaskExportVO;
@ -49,6 +51,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -73,6 +76,7 @@ public class TaskController extends BladeController {
private final ITaskService taskService; private final ITaskService taskService;
private final ITaskUserService taskUserService; private final ITaskUserService taskUserService;
private final IEventService eventService; private final IEventService eventService;
private final IRobotTaskVideoService robotTaskVideoService;
/** /**
* 根据计划id获取任务列表 * 根据计划id获取任务列表
@ -463,4 +467,17 @@ public class TaskController extends BladeController {
e.printStackTrace(); e.printStackTrace();
} }
} }
@PostMapping("/recordVideo")
@ApiOperation(value = "任务执行过程中录像功能", notes = "任务执行过程中录像功能")
public R recordVideo(@RequestBody @Valid RobotTaskVideoDTO req) {
robotTaskVideoService.recordVideo(req);
return R.success("调用成功");
}
@GetMapping("/recordVideoByPointCode")
@ApiOperation(value = "根据pointCode测试录像功能", notes = "根据pointCode测试录像功能")
public R<String> recordVideoByPointCode(@RequestParam String pointCode){
return R.data(robotTaskVideoService.recordVideoByPointCode(pointCode));
}
} }

11
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/IRobotTaskVideoService.java

@ -0,0 +1,11 @@
package com.hnac.hzinfo.inspect.task.service;
import com.hnac.hzinfo.inspect.task.dto.RobotTaskVideoDTO;
public interface IRobotTaskVideoService {
void recordVideo(RobotTaskVideoDTO req);
String recordVideoByPointCode(String pointCode);
}

136
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/RobotTaskVideoServiceImpl.java

@ -0,0 +1,136 @@
package com.hnac.hzinfo.inspect.task.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzinfo.inspect.ai.entity.CameraInfoEntity;
import com.hnac.hzinfo.inspect.ai.entity.RobotEntity;
import com.hnac.hzinfo.inspect.ai.service.ICameraInfoService;
import com.hnac.hzinfo.inspect.ai.service.IRobotService;
import com.hnac.hzinfo.inspect.hikVideo.constants.HikApiConstants;
import com.hnac.hzinfo.inspect.hikVideo.request.PlaybackRequest;
import com.hnac.hzinfo.inspect.hikVideo.request.RecordStartRequest;
import com.hnac.hzinfo.inspect.hikVideo.request.RecordStopRequest;
import com.hnac.hzinfo.inspect.task.dto.RobotTaskVideoDTO;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.service.IRobotTaskVideoService;
import com.hnac.hzinfo.inspect.task.service.ITaskService;
import com.hnac.hzinfo.inspect.utils.HiKUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Optional;
@AllArgsConstructor
@Service
@Slf4j
public class RobotTaskVideoServiceImpl implements IRobotTaskVideoService {
private final IRobotService robotService;
private final ICameraInfoService cameraInfoService;
private final ITaskService taskService;
private final BladeLogger bladeLogger;
@Override
public void recordVideo(RobotTaskVideoDTO req) {
RobotEntity robot = robotService.getOne(Wrappers.<RobotEntity>lambdaQuery().eq(RobotEntity::getUserId, req.getUserId()));
TaskEntity task = taskService.getById(req.getTaskId());
Func.toLongList(",",robot.getCameraId()).forEach(cameraId -> {
CameraInfoEntity cameraInfo = cameraInfoService.getById(cameraId);
// cameraInfo.setPointCode("ceea3ef00de54062aa23583bc6112e98");
if(Func.isNotEmpty(cameraInfo) && Func.isNotEmpty(cameraInfo.getPointCode())) {
if(req.getRecordType() == 1) {
// 调用海康接口开启录制视频
RecordStartRequest startRequest = new RecordStartRequest();
startRequest.setCameraIndexCode(cameraInfo.getPointCode());
try {
bladeLogger.info("recordVideo:manualRecord:start:param", JSON.toJSONString(startRequest));
String startResult = HiKUtil.sendApi(HikApiConstants.MANUAL_RECORD_START, startRequest);
bladeLogger.info("recordVideo:manualRecord:start:result", startResult);
task.setHikVideoTaskId(JSONObject.parseObject(startResult).getString("taskID"));
}
catch(ServiceException e) {
log.info("摄像头手动任务已开启需先结束再开启视频录制任务");
RecordStopRequest stopRequest = new RecordStopRequest();
stopRequest.setCameraIndexCode(cameraInfo.getPointCode());
HiKUtil.sendApi(HikApiConstants.MANUAL_RECORD_STOP, stopRequest);
String startResult = HiKUtil.sendApi(HikApiConstants.MANUAL_RECORD_START, startRequest);
task.setHikVideoTaskId(JSONObject.parseObject(startResult).getString("taskID"));
}
// 设置巡检任务视频录制开始时间
if(Func.isEmpty(task.getVideoStartTime())) {
task.setVideoStartTime(LocalDateTime.now());
}
}
else if(req.getRecordType() == 2) {
// 调用海康接口结束录制视频
RecordStopRequest stopRequest = new RecordStopRequest();
stopRequest.setCameraIndexCode(cameraInfo.getPointCode());
//request.setTaskID(task.getHikVideoTaskId());
bladeLogger.info("recordVideo:manualRecord:stop:param", JSON.toJSONString(stopRequest));
String stopResult = HiKUtil.sendApi(HikApiConstants.MANUAL_RECORD_STOP, stopRequest);
bladeLogger.info("recordVideo:manualRecord:stop:result", stopResult);
task.setVideoEndTime(LocalDateTime.now());
// 调用视频回放接口获取URL地址
PlaybackRequest playbackRequest = new PlaybackRequest();
playbackRequest.setCameraIndexCode(cameraInfo.getPointCode());
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
playbackRequest.setBeginTime(task.getVideoStartTime().atZone(ZoneOffset.ofHours(8)).format(dtf));
playbackRequest.setEndTime(task.getVideoEndTime().atZone(ZoneOffset.ofHours(8)).format(dtf));
bladeLogger.info("recordVideo:manualRecord:playBack:param", JSON.toJSONString(playbackRequest));
String playBackResult = HiKUtil.sendApi(HikApiConstants.PLAY_BACK_URLS, playbackRequest);
bladeLogger.info("recordVideo:manualRecord:playBack:result", playBackResult);
String url = JSONObject.parseObject(playBackResult).getString("url");
if(StringUtil.isNotBlank(url)) {
task.setVideoUrl(Optional.ofNullable(task.getVideoUrl()).filter(StringUtil::isNotBlank).map(u -> url).orElse(url));
}
}
taskService.updateById(task);
}
});
}
@Override
public String recordVideoByPointCode(String pointCode) {
// 调用海康接口开启录制视频
RecordStartRequest request = new RecordStartRequest();
request.setCameraIndexCode(pointCode);
try {
HiKUtil.sendApi(HikApiConstants.MANUAL_RECORD_START, request);
}
catch(ServiceException e) {
RecordStopRequest stopRequest = new RecordStopRequest();
stopRequest.setCameraIndexCode(pointCode);
HiKUtil.sendApi(HikApiConstants.MANUAL_RECORD_STOP, stopRequest);
HiKUtil.sendApi(HikApiConstants.MANUAL_RECORD_START, request);
}
// 设置巡检任务视频录制开始时间
LocalDateTime beginTime = LocalDateTime.now();
try {
Thread.sleep(3*60*1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
// 调用海康接口结束录制视频
RecordStopRequest stopRequest = new RecordStopRequest();
stopRequest.setCameraIndexCode(pointCode);
HiKUtil.sendApi(HikApiConstants.MANUAL_RECORD_STOP, stopRequest);
LocalDateTime EndTime = LocalDateTime.now();
// 调用视频回放接口获取URL地址
PlaybackRequest playbackRequest = new PlaybackRequest();
playbackRequest.setCameraIndexCode(pointCode);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
playbackRequest.setBeginTime(beginTime.atZone(ZoneOffset.ofHours(8)).format(dtf));
playbackRequest.setEndTime(EndTime.atZone(ZoneOffset.ofHours(8)).format(dtf));
String result = HiKUtil.sendApi(HikApiConstants.PLAY_BACK_URLS, playbackRequest);
return JSONObject.parseObject(result).getString("url");
}
}

80
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HiKUtil.java

@ -1,6 +1,7 @@
package com.hnac.hzinfo.inspect.utils; package com.hnac.hzinfo.inspect.utils;
import com.alibaba.druid.support.json.JSONUtils; import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.hikvision.artemis.sdk.ArtemisHttpUtil; import com.hikvision.artemis.sdk.ArtemisHttpUtil;
@ -10,11 +11,15 @@ import okhttp3.MultipartBody;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import org.springblade.core.http.HttpRequest; import org.springblade.core.http.HttpRequest;
import org.springblade.core.http.LogLevel; import org.springblade.core.http.LogLevel;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.jackson.JsonUtil; import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.Assert;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Optional;
/** /**
* @Author: liugang * @Author: liugang
@ -27,7 +32,9 @@ public class HiKUtil {
*/ */
@Value("${hzims.inspect.video.minio-url}") @Value("${hzims.inspect.video.minio-url}")
private static String minioUrl; private static String minioUrl;
public static String APP_KEY = "26486442";
public static String APP_SECRET = "tXBM9jsMqeM9yvEMS8qg";
public static String HOST = "140.210.208.111:443";
/** /**
* 获取视频流 * 获取视频流
@ -57,16 +64,67 @@ public class HiKUtil {
* @param pointCode cameraIndexCode * @param pointCode cameraIndexCode
* @return 视频云图片地址 * @return 视频云图片地址
*/ */
private static String manualCapture(String pointCode) { // private static String manualCapture(String pointCode) {
//请求路径 // //请求路径
String api = "/api/video/v1/manualCapture"; // String api = "/api/video/v1/manualCapture";
//STEP5:组装请求参数 // //STEP5:组装请求参数
Map<String, Object> map = new HashMap<>(8); // Map<String, Object> map = new HashMap<>(8);
map.put("cameraIndexCode", pointCode); // map.put("cameraIndexCode", pointCode);
String result = send(api, map); // String result = send(api, map);
JSONObject object = JsonUtil.parse(result, JSONObject.class); // JSONObject object = JsonUtil.parse(result, JSONObject.class);
return object.getString("picUrl"); // return object.getString("picUrl");
} // }
/**
* 从摄像头截图
*
* @param pointCode cameraIndexCode
* @return 视频云图片地址
*/
public static String manualCapture(String pointCode) {
ArtemisConfig.host = HOST;
ArtemisConfig.appKey = APP_KEY;
ArtemisConfig.appSecret = APP_SECRET;
final String ARTEMIS_PATH = "/artemis";
final String manualCaptureURLsApi = ARTEMIS_PATH + "/api/video/v1/manualCapture";
Map <String, String> path = new HashMap <String, String>(2) {{
//根据现场环境部署确认是http还是https
put("https://", manualCaptureURLsApi);
}};
String contentType = "application/json";
JSONObject jsonBody = new JSONObject();
jsonBody.put("cameraIndexCode", pointCode);
String body = jsonBody.toJSONString();
String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null,
contentType , null);// post请求application/json类型参数
return Optional.ofNullable(result).map(JSONObject::parseObject).filter(r -> "0".equals(r.getString("code"))).map(r -> r.getString("data"))
.map(JSONObject::parseObject).map(o -> o.getString("picUrl")).orElse(null);
}
/**
* 海康视频调用API
* @param api 海康API
* @param variable 传参
* @return
*/
public static String sendApi(String api,Object variable) {
ArtemisConfig.host = HOST;
ArtemisConfig.appKey = APP_KEY;
ArtemisConfig.appSecret = APP_SECRET;
final String ARTEMIS_PATH = "/artemis";
final String url = ARTEMIS_PATH + api;
Map <String, String> path = new HashMap <String, String>(2) {{
//根据现场环境部署确认是http还是https
put("https://", url);
}};
final String contentType = "application/json";
System.out.println("海康调用传参"+ JSON.toJSONString(variable));
String result = ArtemisHttpUtil.doPostStringArtemis(path, JSON.toJSONString(variable), null, null, contentType , null);
Assert.isTrue("0".equals(JSONObject.parseObject(result).getString("code")),() -> {
throw new ServiceException("调用海康URL失败,报错信息为:" + result);
});
return JSONObject.parseObject(result).getString("data");
}
/** /**

228
hzims-service/inspect/src/main/resources/db/1.0.1.sql

@ -0,0 +1,228 @@
-- 巡检摄像头管理添加设备编号
alter table `hz_st_camera_info` add column `em_code` varchar(50) default null comment '设备编号';
-- 巡检情况对象记录异常告警
alter table `hz_st_ex_event_record` add column `abnormal_condition` varchar(255) default null comment '异常告警';
alter table `hz_st_ex_task` add column `video_start_time` datetime default null comment '视频录制开始时间';
alter table `hz_st_ex_task` add column `video_end_time` datetime default null comment '视频录制开始时间';
alter table `hz_st_ex_task` add column `video_url` varchar(255) default null comment '手动录制视频地址';
alter table `hz_st_ex_task` add column `hik_video_task_id` varchar(50) default null comment '海康录制视频任务ID';
-- 巡检计划模板表
CREATE TABLE `hz_st_re_plan_template` (
`ID` bigint(64) NOT NULL COMMENT 'ID',
`CODE` varchar(18) DEFAULT NULL COMMENT '计划编码',
`NAME` varchar(128) DEFAULT NULL COMMENT '计划名称',
`START_TIME` date DEFAULT NULL COMMENT '计划开始时间',
`END_TIME` date DEFAULT NULL COMMENT '计划结束时间',
`TYPE` char(1) DEFAULT NULL COMMENT '计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式',
`METHOD` char(1) DEFAULT '0' COMMENT '派发方式:0 抢占模式 1 并发模式',
`CYCLE` char(1) DEFAULT NULL COMMENT '计划周期 0: 从不 1:每天 2:每月 3:每季度 5:每年 4:每周',
`APPROVER` bigint(20) DEFAULT NULL COMMENT '审批人',
`APPROVE_TIME` datetime DEFAULT NULL COMMENT '审批时间 ',
`FROM_SOURCE` char(2) DEFAULT NULL COMMENT '计划来源 1巡检 2点检',
`CREATE_USER` bigint(64) DEFAULT NULL COMMENT '创建人',
`CREATE_DEPT` bigint(64) DEFAULT NULL COMMENT '创建部门',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(64) DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`STATUS` int(2) DEFAULT '6' COMMENT '计划状态 0:待审核-->1:已审核-->2:派发中-->3:暂停-->4:结束-->5审核不通过-->6待提交',
`IS_DELETED` int(2) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`TENANT_ID` varchar(12) DEFAULT '000000' COMMENT '租户',
`TASK_FLG` tinyint(4) DEFAULT '0' COMMENT '是否立即生产任务 1-是 0-否',
`ROUTE_DATA` text COMMENT '巡检路线数据',
`ROUTE_ID` bigint(20) DEFAULT NULL COMMENT '巡检路线ID字段',
`ROUTE_NAME` varchar(255) DEFAULT NULL COMMENT '路线名称',
`START_REMIND` int(11) DEFAULT NULL COMMENT '开始前提醒(分钟)',
`END_REMIND` int(11) DEFAULT NULL COMMENT '结束前提醒(分钟)',
`TASK_TIMES_A_DAY` int(11) DEFAULT NULL COMMENT '一天任务次数',
`EXEC_TIME_JSON` text COMMENT '任务执行时间json数据',
`AI_CHECK_ITEMS` varchar(255) DEFAULT NULL COMMENT '开始任务时AI检测项 来自数据字段表: beginCheckType 多个检测项直接通过隔开',
`AUTO_VIDEO` varchar(255) DEFAULT '0' COMMENT '巡检类型标识: 0普通巡检 1视频自动巡检 2机器人巡检',
`PLAN_TYPE` varchar(20) DEFAULT 'common' COMMENT '计划类型 common常规任务 temporary临时任务',
`TASK_CONTENT` text COMMENT '临时任务的巡检任务内容',
`message_template_id` bigint(20) DEFAULT NULL COMMENT '消息模板ID',
`ENABLE` tinyint(2) DEFAULT NULL COMMENT '是否启用',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检计划模板表(专供演示数据使用)';
-- 巡检任务模板表
CREATE TABLE `hz_st_ex_task_template` (
`ID` bigint(20) NOT NULL COMMENT 'ID',
`PLAN_ID` bigint(20) DEFAULT NULL COMMENT '计划ID',
`TYPE` char(1) DEFAULT NULL COMMENT '计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式',
`PLAN_NAME` varchar(128) DEFAULT NULL COMMENT '计划名称',
`BATCH_NUMBER` varchar(20) DEFAULT NULL COMMENT '任务批次号',
`CYCLE` char(1) DEFAULT NULL COMMENT '计划周期 0: 从不 1:每天 2:每月 3:每季度 5:每年 4:每周',
`METHOD` char(1) DEFAULT '0' COMMENT '派发方式:0 抢占模式 1 并发模式',
`PLAN_START_TIME` datetime DEFAULT NULL COMMENT '任务计划开始时间',
`PLAN_END_TIME` datetime DEFAULT NULL COMMENT '任务计划结束时间',
`START_TIME` datetime DEFAULT NULL COMMENT '任务实际开始时间',
`END_TIME` datetime DEFAULT NULL COMMENT '任务实际结束时间',
`KEEP_ON_RECORD` char(1) DEFAULT '0' COMMENT '巡检报备 0 未报备 1已报备',
`CREATE_USER` bigint(64) DEFAULT NULL COMMENT '创建人',
`CREATE_DEPT` bigint(64) DEFAULT NULL COMMENT '创建部门',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(64) DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`STATUS` int(2) DEFAULT '0' COMMENT '任务状态 0未开始 1进行中 2暂停 3已完成 4未完成',
`IS_DELETED` int(2) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`TENANT_ID` varchar(12) DEFAULT '000000' COMMENT '租户',
`AUTO_VIDEO` varchar(255) DEFAULT '0' COMMENT '巡检类型标识: 0普通巡检 1 视频自动巡检 2机器人巡检',
`TASK_CONTENT` text COMMENT '临时任务的巡检任务内容',
`PLAN_TYPE` varchar(20) DEFAULT 'common' COMMENT '计划类型common常规任务temporary临时任务',
`START_REMIND_FLAG` tinyint(1) DEFAULT '0' COMMENT '任务开始前 是否发送提醒短信 标识',
`END_REMIND_FLAG` tinyint(1) DEFAULT '0' COMMENT '任务结束前 是否发送提醒短信 标识',
`START_REMIND_TIME` datetime DEFAULT NULL COMMENT '开始前提醒时间',
`END_REMIND_TIME` datetime DEFAULT NULL COMMENT '结束前提醒时间',
`DUTY_ID` bigint(20) DEFAULT NULL COMMENT '值班ID',
`message_template_id` bigint(20) DEFAULT NULL COMMENT '消息模板ID',
`push_status` bigint(1) DEFAULT NULL COMMENT '推送状态',
`ENABLE` tinyint(2) DEFAULT NULL COMMENT '是否启用',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检任务模板表(专供演示数据使用)';
-- 巡检任务对象模板表
CREATE TABLE `hz_st_ex_object_template` (
`ID` bigint(64) NOT NULL,
`TASK_ID` bigint(20) NOT NULL COMMENT '任务ID',
`OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID',
`CODE` varchar(18) DEFAULT NULL COMMENT '对象编码',
`NAME` varchar(128) DEFAULT NULL COMMENT '对象名称',
`ADDRESS` varchar(128) DEFAULT NULL COMMENT '地理位置',
`LGTD` decimal(13,10) DEFAULT NULL COMMENT '经度(东经)',
`LTTD` decimal(12,10) DEFAULT NULL COMMENT '纬度(北纬)',
`DUPLICATE_RECORD` char(1) DEFAULT '0' COMMENT '是否重复记录 0 不允许 1允许',
`CREATE_USER` bigint(64) DEFAULT NULL COMMENT '创建人',
`CREATE_DEPT` bigint(64) DEFAULT NULL COMMENT '创建部门',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(64) DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`STATUS` int(2) DEFAULT '0' COMMENT '状态',
`IS_DELETED` int(2) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`TENANT_ID` varchar(12) DEFAULT '000000' COMMENT '租户',
`ENABLE` tinyint(2) DEFAULT NULL COMMENT '是否启用',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_task_id` (`TASK_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检任务对象模板表(专供演示数据使用)';
-- 巡检任务对象项目模板表
CREATE TABLE `hz_st_ex_object_project_template` (
`ID` bigint(64) NOT NULL,
`TASK_ID` bigint(64) NOT NULL COMMENT '任务ID',
`OBJECT_ID` bigint(64) NOT NULL COMMENT '对象ID',
`PROJECT_ID` bigint(64) NOT NULL COMMENT '项目ID',
`CODE` varchar(18) DEFAULT NULL COMMENT '目标编码',
`NAME` varchar(128) DEFAULT NULL COMMENT '目标名称',
`DESCRIPTION` varchar(512) DEFAULT NULL COMMENT '目标描述',
`CREATE_USER` bigint(64) DEFAULT NULL COMMENT '创建人',
`CREATE_DEPT` bigint(64) DEFAULT NULL COMMENT '创建部门',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(64) DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`STATUS` int(2) DEFAULT '0' COMMENT '状态',
`IS_DELETED` int(2) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`TENANT_ID` varchar(12) DEFAULT '000000' COMMENT '租户',
`ENABLE` tinyint(2) DEFAULT NULL COMMENT '是否启用',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_task_id` (`TASK_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检任务对象项目模板表(专供演示数据使用)';
CREATE TABLE `hz_st_ex_object_project_content_template` (
`ID` bigint(64) NOT NULL,
`TASK_ID` bigint(20) NOT NULL COMMENT '任务ID',
`OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID',
`PROJECT_ID` bigint(20) NOT NULL COMMENT '项目ID',
`CONTENT_ID` bigint(20) NOT NULL COMMENT '内容ID',
`CODE` varchar(18) DEFAULT NULL COMMENT '内容编码 由系统自动生成自动生成',
`NAME` varchar(128) DEFAULT NULL COMMENT '内容名称',
`AVAILABLE` char(1) DEFAULT '1' COMMENT '完成标识 0 不可用 1 可用',
`DESCRIPTION` varchar(512) DEFAULT NULL COMMENT '内容描述',
`CHECK_TYPE` char(2) DEFAULT NULL COMMENT '检测类型',
`RECORD_TYPE` char(1) DEFAULT NULL COMMENT '记录类型',
`CHECK_TYPE_SON` varchar(256) DEFAULT NULL COMMENT '存字典表key 检测类型子类 子类的子类通过-隔开例如:1-12',
`CREATE_USER` bigint(64) DEFAULT NULL COMMENT '创建人',
`CREATE_DEPT` bigint(64) DEFAULT NULL COMMENT '创建部门',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(64) DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`STATUS` int(2) DEFAULT '0' COMMENT '状态',
`IS_DELETED` int(2) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`TENANT_ID` varchar(12) DEFAULT '000000' COMMENT '租户',
`CLOCK_ID` bigint(20) DEFAULT NULL COMMENT '表针识别 表盘ID',
`CAMERA_ID` bigint(20) DEFAULT NULL COMMENT '视频巡检摄像机ID',
`CAMERA_ADDR` varchar(128) DEFAULT NULL COMMENT '开关/灯/表盘在摄像机可视面二维坐标位置 例如:2 1 表示第三行第二列 行列均从0开始记录 默认 0 0 如果有多张图则:0 0 1( 最后一位表示所在图片 最后一位1表示第二张图) 默认0 0 0',
`OTHER_PARAM` varchar(1024) DEFAULT NULL COMMENT '其他参数 例如多联断路器内断路器的个数',
`CHECK_VAL` varchar(512) DEFAULT NULL COMMENT '校验值 用来判断当前值是否正确:枚举数据通过 “ ”隔开 区间通过~隔开',
`DICT_TYPE` varchar(255) DEFAULT NULL COMMENT '记值方式为选择时选择值',
`ENABLE` tinyint(2) DEFAULT NULL COMMENT '是否启用',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_task_id` (`TASK_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检任务对象项目内容模板表(专供演示数据使用)';
-- 巡检情况列模板表
CREATE TABLE `hz_st_ex_event_template` (
`ID` bigint(20) NOT NULL COMMENT 'ID',
`TASK_ID` bigint(20) DEFAULT NULL COMMENT '任务ID',
`OBJECT_ID` bigint(20) DEFAULT NULL COMMENT '对象ID',
`PROJECT_ID` bigint(20) DEFAULT NULL COMMENT '项目ID',
`USER_ID` bigint(20) DEFAULT NULL COMMENT '事件登记人',
`CODE` varchar(18) DEFAULT NULL COMMENT '事件编号',
`TITLE` varchar(128) DEFAULT NULL COMMENT '事件标题',
`DESCRIPTION` varchar(1024) DEFAULT NULL COMMENT '事件描述',
`IS_PROBLEM` char(1) DEFAULT '0' COMMENT '是否问题 0:否 1 是 默认0',
`TYPE_BIG` char(10) DEFAULT NULL COMMENT '问题类型(大)',
`TYPE_SMALL` char(10) DEFAULT NULL COMMENT '问题类型(小)',
`LGTD` decimal(13,10) DEFAULT NULL COMMENT '经度(东经)',
`LTTD` decimal(12,10) DEFAULT NULL COMMENT '纬度(北纬)',
`ADDRESS` varchar(256) DEFAULT NULL COMMENT '事件地点',
`PROCESS_DEFINITION_ID` varchar(64) DEFAULT NULL COMMENT '流程定义id',
`PROCESS_INSTANCE_ID` varchar(64) DEFAULT NULL COMMENT '流程实例id',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`CREATE_USER` bigint(64) DEFAULT NULL,
`CREATE_DEPT` bigint(64) DEFAULT NULL COMMENT '创建部门',
`UPDATE_USER` bigint(64) DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`STATUS` int(2) DEFAULT '0' COMMENT '状态',
`IS_DELETED` int(2) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`TENANT_ID` varchar(12) DEFAULT NULL COMMENT '租户',
`ENABLE` tinyint(2) DEFAULT NULL COMMENT '是否启用',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_task_id` (`TASK_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检情况列模板表(专供演示数据使用)';
-- 巡检情况记录模板表
CREATE TABLE `hz_st_ex_event_record_template` (
`ID` bigint(64) NOT NULL,
`EVENT_ID` bigint(20) NOT NULL COMMENT '事件ID',
`OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID',
`PROJECT_ID` bigint(20) NOT NULL COMMENT '项目ID',
`CONTENT_ID` bigint(20) NOT NULL COMMENT '内容ID',
`CURRENT_STATUS` char(1) DEFAULT '1' COMMENT '内容当前状态 0 异常 1 正常 ',
`CURRENT_VALUE` varchar(512) DEFAULT NULL COMMENT '内容当前值',
`CURRENT_DESC` varchar(512) DEFAULT NULL COMMENT '内容当前描述',
`CODE` varchar(18) DEFAULT NULL COMMENT '内容编码:由系统自动生成自动生成',
`NAME` varchar(128) DEFAULT NULL COMMENT '内容名称',
`DESCRIPTION` varchar(512) DEFAULT NULL COMMENT '内容描述',
`RECORD_TYPE` char(1) DEFAULT NULL COMMENT '记录类型 0 不记录 1仅选择 2仅记值 3选择并记值',
`CHECK_TYPE` char(2) DEFAULT NULL COMMENT '检测类型 原来数据字典 暂时设计只支持99个类型',
`CREATE_USER` bigint(64) DEFAULT NULL COMMENT '创建人',
`CREATE_DEPT` bigint(64) DEFAULT NULL COMMENT '创建部门',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(64) DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`STATUS` int(2) DEFAULT NULL COMMENT '状态',
`IS_DELETED` int(2) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`TENANT_ID` varchar(12) DEFAULT '000000' COMMENT '租户',
`CHECK_TYPE_SON` varchar(256) DEFAULT NULL COMMENT '存字典表key 检测类型子类 子类的子类通过-隔开例如:1-12',
`FILE_URL` varchar(512) DEFAULT NULL COMMENT '文件地址',
`CAMERA_ADDR` varchar(256) DEFAULT NULL COMMENT '开关/灯/表盘在摄像机可视面二维坐标位置 例如:2 1 表示第三行第二列 行列均从0开始记录 默认 0 0 如果有多张图则:0 0 1( 最后一位表示所在图片 最后一位1表示第二张图) 默认0 0 0',
`OTHER_PARAM` varchar(1024) DEFAULT NULL COMMENT '其他参数 例如多联断路器内断路器的',
`CHECK_VAL` varchar(512) DEFAULT NULL COMMENT '校验值 用来判断当前值是否正确:枚举数据通过 隔开 区间通过 隔开',
`DICT_TYPE` varchar(255) DEFAULT NULL COMMENT '记值方式为选择时选择值',
`ENABLE` tinyint(2) DEFAULT NULL COMMENT '是否启用',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_event_id` (`EVENT_ID`) USING BTREE,
KEY `idx_is_deleted_tenant_id` (`IS_DELETED`,`TENANT_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检情况记录模板表(专供演示数据使用)';
Loading…
Cancel
Save