Browse Source

#master代码

zhongwei
yang_shj 5 months ago
parent
commit
b5f071cff9
  1. 5
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java
  2. 5
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java
  3. 24
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/GenerationDeviceVo.java
  4. 19
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/GenerationReportTimeVo.java
  5. 24
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/GenerationReportVo.java
  6. 127
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationRelation.java
  7. 31
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/ai/vo/RemoteControlDTO.java
  8. 8
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java
  9. 5
      hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
  10. 4
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java
  11. 22
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java
  12. 6
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/IRobotService.java
  13. 73
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotServiceImpl.java
  14. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/GenerationReportController.java
  15. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IGenerationReportService.java
  16. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationRelationController.java
  17. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java
  18. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationRelationMapper.java
  19. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationVideoTypeService.java
  20. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java

5
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java

@ -87,6 +87,8 @@ public interface IEmInfoClient {
String RIDE_DEVICES = API_PREFIX + "/rideDevices"; String RIDE_DEVICES = API_PREFIX + "/rideDevices";
String CREWS_DEVICES = API_PREFIX + "/crewsDevices";
@PostMapping(DETAIL) @PostMapping(DETAIL)
EmInfoEntity getByCode(@RequestParam("code") String id); EmInfoEntity getByCode(@RequestParam("code") String id);
@ -176,4 +178,7 @@ public interface IEmInfoClient {
@GetMapping(RIDE_DEVICES) @GetMapping(RIDE_DEVICES)
List<RideDeviceVo> rideDevices(@RequestParam("deptIds") List<Long> deptIds); List<RideDeviceVo> rideDevices(@RequestParam("deptIds") List<Long> deptIds);
@GetMapping(CREWS_DEVICES)
List<EmInfoEntity> crewsDevices(@RequestParam("refDept") Long refDept);
} }

5
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java

@ -120,4 +120,9 @@ public class IEmInfoClientBack implements IEmInfoClient {
public List<RideDeviceVo> rideDevices(List<Long> longs) { public List<RideDeviceVo> rideDevices(List<Long> longs) {
return new ArrayList<>(); return new ArrayList<>();
} }
@Override
public List<EmInfoEntity> crewsDevices(Long refDept) {
return new ArrayList<>();
}
} }

24
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/GenerationDeviceVo.java

@ -0,0 +1,24 @@
package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
*/
@Data
@ApiModel("发电量报表")
public class GenerationDeviceVo {
@ApiModelProperty("设备编号")
private String deviceCode;
@ApiModelProperty("设备名称")
private String deviceName;
@ApiModelProperty("属性时间范围统计数据")
private List<GenerationReportVo> attributes;
}

19
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/GenerationReportTimeVo.java

@ -0,0 +1,19 @@
package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
@ApiModel("发电量报表")
public class GenerationReportTimeVo {
@ApiModelProperty("时间")
private String time;
@ApiModelProperty("值")
private Double value;
}

24
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/GenerationReportVo.java

@ -0,0 +1,24 @@
package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
*/
@Data
@ApiModel("发电量报表")
public class GenerationReportVo {
@ApiModelProperty("属性")
private String attribute;
@ApiModelProperty("属性名称")
private String attributeName;
@ApiModelProperty("属性时间范围统计数据")
private List<GenerationReportTimeVo> times;
}

127
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationRelation.java

@ -0,0 +1,127 @@
package com.hnac.hzims.operational.station.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 站点和霍山生态流量电站的关联关系表
* @author tanghaihao
* @date 2023年10月08日 13:58
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("station_relation")
public class StationRelation implements Serializable {
private static final long serialVersionUID=1L;
/**
* ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 站点编码
*/
@TableField("station_code")
private String stationCode;
/**
* 站点名称
*/
@TableField(exist = false)
private String stationName;
/**
* 设备编码
*/
@TableField("device_code")
private String deviceCode;
/**
* 设备名称
*/
@TableField(exist = false)
private String deviceName;
/**
* 核定流量
*/
@TableField("flow_value")
private String flowValue;
/**
* 低级告警负责人id
*/
@TableField("low_soe_user_id")
private String lowSoeUserId;
/**
* 低级告警电话号码
*/
@TableField("low_soe_phone")
private String lowSoePhone;
/**
* 中级告警负责人id
*/
@TableField("middle_soe_user_id")
private String middleSoeUserId;
/**
* 中级告警电话号码
*/
@TableField("middle_soe_phone")
private String middleSoePhone;
/**
* 高级告警负责人id
*/
@TableField("high_soe_user_id")
private String highSoeUserId;
/**
* 高级告警电话号码
*/
@TableField("high_soe_phone")
private String highSoePhone;
/**
* 当日是否发送预警
*/
@TableField("send_warning")
private Integer sendWarning;
/**
* 当日是否发送告警
*/
@TableField("send_soe")
private Integer sendSoe;
/**
* 创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 更新时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
/**
* 逻辑删除
*/
@TableField("is_deleted")
private Integer isDeleted;
}

31
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/ai/vo/RemoteControlDTO.java

@ -0,0 +1,31 @@
package com.hnac.hzinfo.inspect.ai.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.Map;
@Data
public class RemoteControlDTO {
@ApiModelProperty("站点编号")
@NotBlank
private String stationCode;
@ApiModelProperty("设备编码")
@NotBlank
private String deviceCode;
@ApiModelProperty("功能标识")
@NotBlank
private String signage;
@ApiModelProperty("参数列表")
@NotBlank
private Map<String, Object> params;
@ApiModelProperty("机器码")
@NotBlank
private String machineCode;
}

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

@ -48,6 +48,14 @@ public class TaskEntity extends TenantEntity {
@ApiModelProperty(value = "计划名称") @ApiModelProperty(value = "计划名称")
@QueryField(condition = SqlCondition.LIKE) @QueryField(condition = SqlCondition.LIKE)
private String planName; private String planName;
/**
* 路线名称
*/
@ApiModelProperty(value = "路线名称")
@QueryField(condition = SqlCondition.LIKE)
private String routeName;
/** /**
* 任务批次号 * 任务批次号
*/ */

5
hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java

@ -74,6 +74,11 @@ public class TicketProcessConstant {
* 风险排查标识 * 风险排查标识
*/ */
public static final String HAZARD_RISK = "hazard_risk"; public static final String HAZARD_RISK = "hazard_risk";
/**
* 线下操作票标识
*/
public static final String OFFLINE_OPERATION_TICKET = "OperationTicketOffline";
/**项目经理**/ /**项目经理**/
public static final String PROJECT_MANAGER = "projectManager"; public static final String PROJECT_MANAGER = "projectManager";
} }

4
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java

@ -3,8 +3,6 @@ package com.hnac.hzims.middle.processflow.strategy.abstracts;
import com.hnac.hzims.middle.processflow.entity.ProcessDict; import com.hnac.hzims.middle.processflow.entity.ProcessDict;
import com.hnac.hzims.middle.processflow.service.ProcessDictService; import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.service.ProcessService; import com.hnac.hzims.middle.processflow.strategy.service.ProcessService;
import com.hnac.hzims.operational.access.constants.AccessConstants;
import com.hnac.hzims.operational.duty.constant.DutyRecProcessConstant;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -18,13 +16,11 @@ import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient; import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.DEAL_ALARM;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.PROJECT_MANAGER; import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.PROJECT_MANAGER;
/** /**

22
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java

@ -1,32 +1,28 @@
package com.hnac.hzinfo.inspect.ai.controller; package com.hnac.hzinfo.inspect.ai.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzinfo.inspect.Constants; import com.hnac.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.ai.dto.robot.RobotInstanceDTO; import com.hnac.hzinfo.inspect.ai.dto.robot.RobotInstanceDTO;
import com.hnac.hzinfo.inspect.ai.entity.RobotEntity;
import com.hnac.hzinfo.inspect.ai.service.IRobotService;
import com.hnac.hzinfo.inspect.ai.vo.RemoteControlDTO; import com.hnac.hzinfo.inspect.ai.vo.RemoteControlDTO;
import com.hnac.hzinfo.inspect.ai.vo.robot.RobotAiReturnData;
import com.hnac.hzinfo.inspect.ai.vo.robot.RobotRealDataVO; import com.hnac.hzinfo.inspect.ai.vo.robot.RobotRealDataVO;
import com.hnac.hzinfo.inspect.ai.vo.robot.RobotServerTaskParam;
import com.hnac.hzinfo.inspect.obj.utils.CodeUtils; import com.hnac.hzinfo.inspect.obj.utils.CodeUtils;
import com.hnac.hzinfo.log.annotation.Business; import com.hnac.hzinfo.log.annotation.Business;
import com.hnac.hzinfo.log.annotation.Operate; import com.hnac.hzinfo.log.annotation.Operate;
import com.hnac.hzinfo.log.contants.BusinessType; import com.hnac.hzinfo.log.contants.BusinessType;
import com.hnac.hzinfo.log.contants.Risk; import com.hnac.hzinfo.log.contants.Risk;
import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient; import io.swagger.annotations.Api;
import com.hnac.hzinfo.sdk.v5.device.vo.VirtualDeviceDTO; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.*; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import javax.validation.Valid;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.oss.OssTemplate;
import org.springblade.core.oss.model.BladeFile; import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -35,12 +31,10 @@ import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import com.hnac.hzinfo.inspect.ai.entity.RobotEntity;
import com.hnac.hzinfo.inspect.ai.service.IRobotService;
import javax.validation.Valid;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;

6
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/IRobotService.java

@ -1,16 +1,12 @@
package com.hnac.hzinfo.inspect.ai.service; package com.hnac.hzinfo.inspect.ai.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import com.hnac.hzinfo.inspect.ai.dto.robot.RobotInstanceDTO; import com.hnac.hzinfo.inspect.ai.dto.robot.RobotInstanceDTO;
import com.hnac.hzinfo.inspect.ai.entity.RobotEntity;
import com.hnac.hzinfo.inspect.ai.vo.RemoteControlDTO; import com.hnac.hzinfo.inspect.ai.vo.RemoteControlDTO;
import com.hnac.hzinfo.inspect.ai.vo.RobotVO; import com.hnac.hzinfo.inspect.ai.vo.RobotVO;
import com.hnac.hzinfo.inspect.ai.vo.robot.RobotRealDataVO; import com.hnac.hzinfo.inspect.ai.vo.robot.RobotRealDataVO;
import com.hnac.hzinfo.sdk.v5.device.vo.VirtualDeviceDTO;
import com.hnac.hzinfo.inspect.ai.entity.RobotEntity;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import java.util.List; import java.util.List;

73
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotServiceImpl.java

@ -1,46 +1,48 @@
package com.hnac.hzinfo.inspect.ai.service.impl; package com.hnac.hzinfo.inspect.ai.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.inspect.ai.dto.robot.RobotInstanceDTO; import com.hnac.hzinfo.inspect.ai.dto.robot.RobotInstanceDTO;
import com.hnac.hzinfo.inspect.ai.entity.RobotEntity;
import com.hnac.hzinfo.inspect.ai.mapper.RobotMapper;
import com.hnac.hzinfo.inspect.ai.service.IRobotService;
import com.hnac.hzinfo.inspect.ai.vo.RemoteControlDTO;
import com.hnac.hzinfo.inspect.ai.vo.RobotVO; import com.hnac.hzinfo.inspect.ai.vo.RobotVO;
import com.hnac.hzinfo.inspect.ai.vo.robot.RobotRealDataVO; import com.hnac.hzinfo.inspect.ai.vo.robot.RobotRealDataVO;
import com.hnac.hzinfo.inspect.ai.wrapper.RobotWrapper; import com.hnac.hzinfo.inspect.ai.wrapper.RobotWrapper;
import com.hnac.hzinfo.inspect.constants.ParamConstants; import com.hnac.hzinfo.inspect.constants.ParamConstants;
import com.hnac.hzinfo.inspect.task.TaskContants;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.service.ITaskService;
import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.control.ControlClient;
import com.hnac.hzinfo.sdk.v5.control.dto.ControlDTO;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient; import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient;
import com.hnac.hzinfo.sdk.v5.device.po.DeviceRealDataPO; import com.hnac.hzinfo.sdk.v5.device.po.DeviceRealDataPO;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceAttrVO; import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceAttrVO;
import com.hnac.hzinfo.sdk.v5.device.vo.RealDataRedisVO; import com.hnac.hzinfo.sdk.v5.device.vo.RealDataRedisVO;
import com.hnac.hzinfo.sdk.v5.device.vo.VirtualDeviceDTO; import com.hnac.hzinfo.sdk.v5.device.vo.VirtualDeviceDTO;
import com.hnac.hzinfo.sdk.v5.project.ProjectClient;
import com.hnac.hzinfo.sdk.v5.project.vo.ProjectVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzinfo.inspect.ai.entity.RobotEntity;
import com.hnac.hzinfo.inspect.ai.mapper.RobotMapper;
import com.hnac.hzinfo.inspect.ai.service.IRobotService;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.*;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.ParamCache; import org.springblade.system.cache.ParamCache;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -54,8 +56,9 @@ import java.util.stream.Collectors;
public class RobotServiceImpl extends ServiceImpl<RobotMapper, RobotEntity> implements IRobotService { public class RobotServiceImpl extends ServiceImpl<RobotMapper, RobotEntity> implements IRobotService {
private final DeviceClient deviceClient; private final DeviceClient deviceClient;
private final IAnalyseDataSearchClient analyseDataSearchClient;
private final DeviceDataClient deviceDataClient; private final DeviceDataClient deviceDataClient;
private final ControlClient controlClient;
private final ProjectClient projectClient;
/** /**
* 根据用户id 获取 机器人信息 * 根据用户id 获取 机器人信息
@ -75,10 +78,19 @@ public class RobotServiceImpl extends ServiceImpl<RobotMapper, RobotEntity> impl
@Override @Override
public Boolean generateDeviceInstance(RobotInstanceDTO device) { public Boolean generateDeviceInstance(RobotInstanceDTO device) {
if(deviceClient.isDeviceCodeExist(device.getDeviceCode()).isSuccess()) { // fixme 响应接口变化了
if("true".equals(deviceClient.isDeviceCodeExist(device.getDeviceCode()).getData())) {
throw new ServiceException("该机器人已经创建过设备实例,无需再创建!"); throw new ServiceException("该机器人已经创建过设备实例,无需再创建!");
} }
else { else {
Result<List<ProjectVO>> projectVOResult = projectClient.getProjectIds(Collections.singletonList(device.getStationCode()));
Assert.isTrue(projectVOResult.isSuccess(),() -> {
throw new ServiceException("获取站点信息失败!");
});
List<ProjectVO> projectVOList = projectVOResult.getData();
if (projectVOList==null||projectVOList.isEmpty()){
throw new ServiceException("数据平台不存在该站点信息!");
}
String modelSignage = ParamCache.getValue(ParamConstants.ROBOT_MODEL_CODE); String modelSignage = ParamCache.getValue(ParamConstants.ROBOT_MODEL_CODE);
device.setModelSignage(Func.isNotEmpty(device.getModelSignage()) ? device.getModelSignage() : modelSignage); device.setModelSignage(Func.isNotEmpty(device.getModelSignage()) ? device.getModelSignage() : modelSignage);
VirtualDeviceDTO req = BeanUtil.copy(device, VirtualDeviceDTO.class); VirtualDeviceDTO req = BeanUtil.copy(device, VirtualDeviceDTO.class);
@ -118,6 +130,7 @@ public class RobotServiceImpl extends ServiceImpl<RobotMapper, RobotEntity> impl
Optional<DeviceInstanceAttrVO> attrOptional = paramDeviceAttrR.getData().stream().filter(deviceAttr -> k.getValue().getN().equals(deviceAttr.getName())).findFirst(); Optional<DeviceInstanceAttrVO> attrOptional = paramDeviceAttrR.getData().stream().filter(deviceAttr -> k.getValue().getN().equals(deviceAttr.getName())).findFirst();
data.setModelClassifyId(attrOptional.get().getModelClassifyId()); data.setModelClassifyId(attrOptional.get().getModelClassifyId());
data.setModelClassifyName(attrOptional.get().getModelClassifyName()); data.setModelClassifyName(attrOptional.get().getModelClassifyName());
data.setUnits(attrOptional.get().getUnits());
return data; return data;
})).collect(Collectors.toList()); })).collect(Collectors.toList());
return result.stream().collect(Collectors.groupingBy(RobotRealDataVO::getModelClassifyName)); return result.stream().collect(Collectors.groupingBy(RobotRealDataVO::getModelClassifyName));
@ -134,7 +147,7 @@ public class RobotServiceImpl extends ServiceImpl<RobotMapper, RobotEntity> impl
Result<Map<String, Object>> deviceSoeDataResult = deviceDataClient.getDeviceSoeData(robot.getStationCode(), 1, robotCode, null, Result<Map<String, Object>> deviceSoeDataResult = deviceDataClient.getDeviceSoeData(robot.getStationCode(), 1, robotCode, null,
startTime, endTime, true, query.getCurrent(), query.getSize()); startTime, endTime, true, query.getCurrent(), query.getSize());
Assert.isTrue(deviceSoeDataResult.isSuccess(), () -> { Assert.isTrue(deviceSoeDataResult.isSuccess(), () -> {
throw new ServiceException("获取机器人告警信息失败!"); throw new ServiceException(deviceSoeDataResult.getMsg());
}); });
Map<String, Object> deviceSoeData = deviceSoeDataResult.getData(); Map<String, Object> deviceSoeData = deviceSoeDataResult.getData();
IPage result = Condition.getPage(query); IPage result = Condition.getPage(query);
@ -143,5 +156,31 @@ public class RobotServiceImpl extends ServiceImpl<RobotMapper, RobotEntity> impl
return result; return result;
} }
@Override
public Object remoteControl(RemoteControlDTO dto) {
ControlDTO controlDTO=new ControlDTO();
BeanUtil.copy(dto,controlDTO);
controlDTO.setProjectId(dto.getStationCode());
controlDTO.setOperator(String.valueOf(AuthUtil.getUserId()));
Result<Object> result = controlClient.sendToDevice(controlDTO);
Assert.isTrue(result.isSuccess(),()->{
throw new ServiceException("修改遥控失败!");
});
RobotEntity robotEntity = this.getOne(new LambdaQueryWrapper<RobotEntity>().eq(RobotEntity::getCode, dto.getDeviceCode()));
//机器人停机任务置为未完成
List<String> taskStatus = Arrays.asList(TaskContants.TaskStatusEnum.INIT_STATUS.getStatus(), TaskContants.TaskStatusEnum.UNDERWAY_STATUS.getStatus(), TaskContants.TaskStatusEnum.PAUSE_STATUS.getStatus());
ITaskService taskService = SpringUtil.getBean(ITaskService.class);
List<TaskEntity> robotTaskEntities=taskService.getListByUserIdAndStatus(robotEntity.getUserId(),taskStatus,DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME));
if (!robotTaskEntities.isEmpty()){
robotTaskEntities.forEach(item->item.setStatus(Integer.valueOf(TaskContants.TaskStatusEnum.UNFINISH_STATUS.getStatus())));
taskService.saveOrUpdateBatch(robotTaskEntities);
}
return result.getData();
}
} }

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/GenerationReportController.java

@ -2,8 +2,6 @@ package com.hnac.hzims.operational.report.controller;
import com.hnac.hzims.operational.report.service.IGenerationReportService; import com.hnac.hzims.operational.report.service.IGenerationReportService;
import com.hnac.hzims.operational.report.vo.GenerationDeviceVo; import com.hnac.hzims.operational.report.vo.GenerationDeviceVo;
import com.hnac.hzims.operational.report.vo.GenerationReportTimeVo;
import com.hnac.hzims.operational.report.vo.GenerationReportVo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IGenerationReportService.java

@ -1,7 +1,6 @@
package com.hnac.hzims.operational.report.service; package com.hnac.hzims.operational.report.service;
import com.hnac.hzims.operational.report.vo.GenerationDeviceVo; import com.hnac.hzims.operational.report.vo.GenerationDeviceVo;
import com.hnac.hzims.operational.report.vo.GenerationReportVo;
import java.util.List; import java.util.List;

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationRelationController.java

@ -84,7 +84,7 @@ public class StationRelationController {
wrapper.and(item -> item.eq(StationRelation::getStationCode, stationRelation.getStationCode()) wrapper.and(item -> item.eq(StationRelation::getStationCode, stationRelation.getStationCode())
.or().eq(StationRelation::getDeviceCode, stationRelation.getDeviceCode())); .or().eq(StationRelation::getDeviceCode, stationRelation.getDeviceCode()));
wrapper.eq(StationRelation::getIsDeleted, 0); wrapper.eq(StationRelation::getIsDeleted, 0);
int count = stationRelationService.count(wrapper); long count = stationRelationService.count(wrapper);
if (count > 0) { if (count > 0) {
return R.fail("站点关联关系已存在"); return R.fail("站点关联关系已存在");
} }
@ -100,7 +100,7 @@ public class StationRelationController {
.or().eq(StationRelation::getDeviceCode, stationRelation.getDeviceCode())); .or().eq(StationRelation::getDeviceCode, stationRelation.getDeviceCode()));
wrapper.eq(StationRelation::getIsDeleted, 0); wrapper.eq(StationRelation::getIsDeleted, 0);
wrapper.ne(StationRelation::getId, stationRelation.getId()); wrapper.ne(StationRelation::getId, stationRelation.getId());
int count = stationRelationService.count(wrapper); long count = stationRelationService.count(wrapper);
if (count > 0) { if (count > 0) {
return R.fail("站点关联关系已存在"); return R.fail("站点关联关系已存在");
} }

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java

@ -1,6 +1,5 @@
package com.hnac.hzims.operational.station.controller; package com.hnac.hzims.operational.station.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -31,7 +30,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -44,7 +42,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationRelationMapper.java

@ -3,6 +3,9 @@ package com.hnac.hzims.operational.station.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.station.entity.StationRelation; import com.hnac.hzims.operational.station.entity.StationRelation;
/**
* @author ysj
*/
public interface StationRelationMapper extends BaseMapper<StationRelation> { public interface StationRelationMapper extends BaseMapper<StationRelation> {
} }

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationVideoTypeService.java

@ -11,12 +11,8 @@ import com.hnac.hzims.operational.station.response.HikMonitorResp;
import com.hnac.hzims.operational.station.vo.HikVideoAreaTreeVO; import com.hnac.hzims.operational.station.vo.HikVideoAreaTreeVO;
import com.hnac.hzims.operational.station.vo.StationVideoTypeVO; import com.hnac.hzims.operational.station.vo.StationVideoTypeVO;
import com.hnac.hzims.operational.station.vo.VideoMonitorVO; import com.hnac.hzims.operational.station.vo.VideoMonitorVO;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springframework.web.bind.annotation.RequestParam;
import java.sql.Wrapper;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -78,11 +74,13 @@ public interface IStationVideoTypeService extends IService<StationVideoTypeEntit
*/ */
Map<String,Object> getWsUrlByPointCode(String pointCodes,String host,String appKey,String appSecret,Integer streamType); Map<String,Object> getWsUrlByPointCode(String pointCodes,String host,String appKey,String appSecret,Integer streamType);
List<HikVideoAreaTreeVO> getHikVideoAreaTree();
Map getVideoPointByRegion(Long refDept,String regionCode); Map getVideoPointByRegion(Long refDept,String regionCode);
List<StationVideoTypeVO> stationVideos(StationVideoTypeDTO param); List<StationVideoTypeVO> stationVideos(StationVideoTypeDTO param);
List<StationVideoTypeVO> videoTypes(StationVideoTypeEntity param); List<StationVideoTypeVO> videoTypes(StationVideoTypeEntity param);
List<HikVideoAreaTreeVO> getHikVideoAreaTree(Long platformId);
List<StationVideoTypeEntity> getVideoByPointCodes(String pointCodes);
} }

18
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java

@ -2,13 +2,13 @@ package com.hnac.hzims.operational.station.service.impl;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.utils.HiKUtil; import com.hnac.hzims.common.utils.HiKUtil;
import com.hnac.hzims.operational.config.HikPathConfiguration; import com.hnac.hzims.operational.config.HikPathConfiguration;
import com.hnac.hzims.operational.station.StationConstants; import com.hnac.hzims.operational.station.StationConstants;
@ -29,8 +29,6 @@ import com.hnac.hzims.operational.station.wrapper.StationVideoTypeWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -44,7 +42,6 @@ import org.springframework.util.Assert;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -204,7 +201,6 @@ public class StationVideoTypeServiceImpl extends ServiceImpl<StationVideoTypeMap
throw new ServiceException("调用获取海康威视站点下监测点列表接口失败!"); throw new ServiceException("调用获取海康威视站点下监测点列表接口失败!");
}); });
List<HikMonitorResp> monitorList = JSONArray.parseArray(response.body(), HikMonitorResp.class); List<HikMonitorResp> monitorList = JSONArray.parseArray(response.body(), HikMonitorResp.class);
log.info("HikVideo:monitor:info",JSON.toJSONString(monitorList));
return monitorList.stream().collect(Collectors.groupingBy(HikMonitorResp::getDevice)); return monitorList.stream().collect(Collectors.groupingBy(HikMonitorResp::getDevice));
} }
@ -241,14 +237,15 @@ public class StationVideoTypeServiceImpl extends ServiceImpl<StationVideoTypeMap
} }
@Override @Override
public List<HikVideoAreaTreeVO> getHikVideoAreaTree() { public List<HikVideoAreaTreeVO> getHikVideoAreaTree(Long platformId) {
List<HikVideoAreaVO> hikVideoAreaList = hikVideoService.nodesByParams(null); List<HikVideoAreaVO> hikVideoAreaList = hikVideoService.nodesByParams(platformId,null);
Map<String, List<HikVideoAreaVO>> videoAreaMapByParent = hikVideoAreaList.stream().collect(Collectors.groupingBy(HikVideoAreaVO::getParentIndexCode)); Map<String, List<HikVideoAreaVO>> videoAreaMapByParent = hikVideoAreaList.stream().collect(Collectors.groupingBy(HikVideoAreaVO::getParentIndexCode));
List<HikVideoAreaVO> firstLevelArea = videoAreaMapByParent.get("-1"); List<HikVideoAreaVO> firstLevelArea = videoAreaMapByParent.get("-1");
List<HikVideoAreaTreeVO> result = firstLevelArea.stream().map(area -> this.generateAreaTree(videoAreaMapByParent, area)).collect(Collectors.toList()); List<HikVideoAreaTreeVO> result = firstLevelArea.stream().map(area -> this.generateAreaTree(videoAreaMapByParent, area)).collect(Collectors.toList());
return result; return result;
} }
@Override @Override
public Map getVideoPointByRegion(Long refDept, String regionCode) { public Map getVideoPointByRegion(Long refDept, String regionCode) {
LambdaQueryWrapper<StationVideoTypeEntity> queryWrapper = Wrappers.<StationVideoTypeEntity>lambdaQuery().select(StationVideoTypeEntity::getPointCode,StationVideoTypeEntity::getCreateDept).eq(StationVideoTypeEntity::getDeptId, refDept); LambdaQueryWrapper<StationVideoTypeEntity> queryWrapper = Wrappers.<StationVideoTypeEntity>lambdaQuery().select(StationVideoTypeEntity::getPointCode,StationVideoTypeEntity::getCreateDept).eq(StationVideoTypeEntity::getDeptId, refDept);
@ -372,4 +369,11 @@ public class StationVideoTypeServiceImpl extends ServiceImpl<StationVideoTypeMap
return videoMonitorVO; return videoMonitorVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@Override
public List<StationVideoTypeEntity> getVideoByPointCodes(String pointCodes) {
List<String> pointCodeList = Func.toStrList(",", pointCodes);
LambdaQueryWrapper<StationVideoTypeEntity> qw = Wrappers.<StationVideoTypeEntity>lambdaQuery().in(StationVideoTypeEntity::getPointCode, pointCodeList);
return this.list(qw);
}
} }

Loading…
Cancel
Save