Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 2 years ago
parent
commit
39a4fdcb2f
  1. 13
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/constants/FdpConstant.java
  2. 39
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/request/StationInfoReq.java
  3. 7
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/enume/StationEnumConstants.java
  4. 28
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/config/FdpUrlConfiguration.java
  5. 81
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpQuestionController.java
  6. 31
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/request/AnswerFormatReq.java
  7. 48
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/request/SubmitAnswerReq.java
  8. 38
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/response/DevsetAnswerResp.java
  9. 47
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/response/DevsetQuestionResp.java
  10. 72
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpQuestionService.java
  11. 199
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpQuestionServiceImpl.java
  12. 5
      hzims-service/equipment/src/main/resources/db/1.0.0_0831.sql
  13. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/DefaultRobotIdentifyTypeHandler.java
  14. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotDigitTypeHandler.java
  15. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotMeterTypeHandler.java
  16. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotSwitchHTypeHandler.java
  17. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotValueTypeHandler.java
  18. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotVoiceTypeHandler.java

13
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/constants/FdpConstant.java

@ -3,6 +3,19 @@ package com.hnac.hzims.fdp.constants;
import lombok.Getter;
public interface FdpConstant {
/**水电站**/
Integer HYDROELECTRIC_STATION = 1;
/**泵站**/
Integer PUMP_STATION = 2;
/**-----------------------------------------------------------------------------------------**/
/**公用设备**/
String COMMON_DEVICE_TYPE = "1";
/**机组设备**/
String SET_DEVICE_TYPE = "2";
/**-----------------------------------------------------------------------------------------**/
enum FdpTaskStatusEnum{
/**
* 未开始

39
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/request/StationInfoReq.java

@ -0,0 +1,39 @@
package com.hnac.hzims.fdp.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 10:03
*/
@Data
@EqualsAndHashCode
@ApiModel("FDP站点信息请求")
@Builder
public class StationInfoReq implements Serializable {
@ApiModelProperty(value = "站点类型",required = true)
@NotNull(message = "站点类型不能为空")
private Integer type;
@ApiModelProperty("站点ID")
@NotNull(message = "站点ID不能为空")
private String stationId;
@ApiModelProperty("站点名称")
@NotNull(message = "站点名称不能为空")
private String stationName;
@ApiModelProperty("站点描述")
private String stationDesc;
}

7
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/enume/StationEnumConstants.java

@ -39,7 +39,12 @@ public interface StationEnumConstants {
/**
* 充电站
*/
STATION_TYPE_7(7, "充电站");
STATION_TYPE_7(7, "充电站"),
/**
* 泵站
*/
STATION_TYPE_8(8, "泵站");
@Getter
private int status;
@Getter

28
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/config/FdpUrlConfiguration.java

@ -21,4 +21,32 @@ public class FdpUrlConfiguration {
/**fdp监测点与数据平台监测点绑定关系推送**/
private String setDataLink;
/**提交站点消息**/
private String submitStationInfo;
/**删除站点信息**/
private String deleteStationInfo;
/**获取机组问题**/
private String getDevsetQuestion;
/**获取站点问题**/
private String getStationQuestion;
/**提交机组问题的答案**/
private String submitDevsetAnswer;
/**提交站点问题的答案**/
private String submitStationAnswer;
/**实例化站点图谱**/
private String generateGraphInstance;
/**按物模型实例编号获取问题答案**/
private String getInstanceAnswer;
/**按物模型实例编号删除问题答案**/
private String deleteInstanceAnswer;
}

81
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpQuestionController.java

@ -0,0 +1,81 @@
package com.hnac.hzims.fdp.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.fdp.request.SubmitAnswerReq;
import com.hnac.hzims.fdp.response.DevsetQuestionResp;
import com.hnac.hzims.fdp.service.IFdpQuestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 11:52
*/
@RestController
@RequestMapping("/fdp/question")
@AllArgsConstructor
@Api(value = "智能诊断接站问答",tags = "智能诊断接站问答")
public class FdpQuestionController extends BladeController {
private final IFdpQuestionService fdpQuestionService;
@GetMapping("/submitStationInfo")
@ApiOperation("提交站点信息")
@ApiOperationSupport(order = 1)
public R<Boolean> submitStationInfo(@RequestParam @ApiParam(value = "站点编码",required = true) String stationCode, @RequestParam(required = false) @ApiParam(value = "描述") String stationDesc) {
return R.status(fdpQuestionService.submitStationInfo(stationCode,stationDesc));
}
@DeleteMapping("/deleteStationInfo/{stationCode}")
@ApiOperation("删除站点信息")
@ApiOperationSupport(order = 2)
public R<Boolean> deleteStationInfo(@PathVariable @ApiParam(value = "站点编码",required = true) String stationCode) {
return R.status(fdpQuestionService.deleteStationInfo(stationCode));
}
@GetMapping("/getDevsetQuestion")
@ApiOperation("获取设备推送Fdp问题")
@ApiOperationSupport(order = 3)
public R<List<DevsetQuestionResp>> getDevsetQuestion(@RequestParam @ApiParam(value = "设备类型,1:公用;2:机组",required = true) String deviceType,
@RequestParam @ApiParam(value = "站点类型",required = true) Integer stationType) {
return R.data(fdpQuestionService.getDevsetQuestion(deviceType,stationType));
}
@PostMapping("/submitDeviceAnswer")
@ApiOperation("提交设备问题答案")
@ApiOperationSupport(order = 4)
public R<Boolean> submitDeviceAnswer(@RequestBody @Validated SubmitAnswerReq submitAnswerReq) {
return R.data(fdpQuestionService.submitDeviceAnswer(submitAnswerReq));
}
@GetMapping("/generateGraphInstance")
@ApiOperation("实例化站点图谱")
@ApiOperationSupport(order = 5)
public R<Boolean> generateGraphInstance(@RequestParam @ApiParam(value = "站点类型",required = true)Integer stationType,@RequestParam @ApiParam(value = "站点编码",required = true) String stationId) {
return R.data(fdpQuestionService.generateGraphInstance(stationType,stationId));
}
@DeleteMapping("/deleteInstanceAnswer/{instanceId}")
@ApiOperation("删除站点信息")
@ApiOperationSupport(order = 6)
public R<Boolean> deleteInstanceAnswer(@PathVariable @ApiParam("物模型实例编号") String instanceId) {
return R.status(fdpQuestionService.deleteInstanceAnswer(instanceId));
}
@GetMapping("/getInstanceAnswer/{instanceId}")
@ApiOperation("删除站点信息")
@ApiOperationSupport(order = 7)
public R<List<JSONObject>> getInstanceAnswer(@PathVariable @ApiParam("物模型实例编号") String instanceId) {
return R.data(fdpQuestionService.getInstanceAnswer(instanceId));
}
}

31
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/request/AnswerFormatReq.java

@ -0,0 +1,31 @@
package com.hnac.hzims.fdp.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 16:12
*/
@Data
@ApiModel("提交答案格式")
@EqualsAndHashCode
public class AnswerFormatReq implements Serializable {
@ApiModelProperty(value = "问题ID",required = true)
@NotNull
private String questionId;
@ApiModelProperty(value = "答案ID,选择题需要传多选题答案ID用逗号分隔")
private String answerId;
@ApiModelProperty("答案内容,填空题需要传")
private String inputValue;
}

48
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/request/SubmitAnswerReq.java

@ -0,0 +1,48 @@
package com.hnac.hzims.fdp.request;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
import javax.xml.soap.Name;
import java.io.Serializable;
import java.util.List;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 16:19
*/
@ApiModel("提交答案")
@Data
@EqualsAndHashCode
public class SubmitAnswerReq implements Serializable {
@ApiModelProperty(value = "站点类型",required = true)
@NotNull
private Integer stationType;
private Integer type;
@ApiModelProperty(value = "站点ID",required = true)
@NotNull
private String stationId;
@ApiModelProperty(value = "",required = true)
private String index;
@ApiModelProperty(value = "物模型ID",required = true)
private String instanceId;
@ApiModelProperty(value = "设备类型",required = true)
@NotNull
private String deviceType;
@ApiModelProperty(value = "站点问题数据",required = true)
@JSONField(name = "data")
private List<AnswerFormatReq> answerFormatList;
}

38
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/response/DevsetAnswerResp.java

@ -0,0 +1,38 @@
package com.hnac.hzims.fdp.response;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 14:40
*/
@Data
@EqualsAndHashCode
@ApiModel("机组问题答案")
public class DevsetAnswerResp implements Serializable {
@ApiModelProperty("答案ID")
@JSONField(name = "AID")
private String aId;
@ApiModelProperty("答案名称")
@JSONField(name = "ANAME")
private String aName;
@ApiModelProperty("是否默认选中。0为不选中,1为选中")
@JSONField(name = "ADEFAULT")
private Integer aDefault;
@ApiModelProperty("选中该答案需要继续回答的问题数组")
@JSONField(name = "QUESTION")
private List<DevsetQuestionResp> question;
}

47
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/response/DevsetQuestionResp.java

@ -0,0 +1,47 @@
package com.hnac.hzims.fdp.response;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 14:35
*/
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
@Data
@EqualsAndHashCode
@ApiModel("机组问题")
public class DevsetQuestionResp implements Serializable {
@ApiModelProperty("问题ID")
@JSONField(name = "ID")
private String id;
@ApiModelProperty("问题名称")
@JSONField(name = "NAME")
private String name;
@ApiModelProperty("问题描述")
@JSONField(name = "INFO")
private String info;
@ApiModelProperty("问题类型。当前有“单选”、“多选”、“参数填空”、“数量填空”")
@JSONField(name = "QTYPE")
private String qType;
@ApiModelProperty("问题的父答案ID")
@JSONField(name = "FAID")
private String parentId;
@ApiModelProperty("问题的答案列表")
@JSONField(name = "ANSWER")
private List<DevsetAnswerResp> answer;
}

72
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpQuestionService.java

@ -0,0 +1,72 @@
package com.hnac.hzims.fdp.service;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.fdp.request.SubmitAnswerReq;
import com.hnac.hzims.fdp.response.DevsetQuestionResp;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 10:18
*/
public interface IFdpQuestionService {
/**
* 提交站点信息
* @param stationCode 站点编码
* @param stationDesc 站点描述
* @return
*/
boolean submitStationInfo(String stationCode,String stationDesc);
/**
* 删除站点信息
* @param stationId 站点编码
* @return
*/
boolean deleteStationInfo(String stationId);
/**
* 获取设备推送Fdp问题
* @param deviceType 设备类型
* @param stationType 站点类型
* @return
*/
List<DevsetQuestionResp> getDevsetQuestion(String deviceType, Integer stationType);
/**
* 提交设备问题答案
* @param submitAnswerReq 提交答案
* @return
*/
boolean submitDeviceAnswer(@RequestBody SubmitAnswerReq submitAnswerReq);
/**
* 实例化站点图谱
* @param stationType 站点类型
* @param stationId 站点编码
* @return
*/
boolean generateGraphInstance(Integer stationType,String stationId);
/**
* 按物模型实例编号删除问题答案
* @param instanceId 物模型实例编号
* @return
*/
boolean deleteInstanceAnswer(String instanceId);
/**
* 按物模型实例编号获取问题答案
* @param instanceId 物模型实例编号
* @return
*/
List<JSONObject> getInstanceAnswer(String instanceId);
}

199
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpQuestionServiceImpl.java

@ -0,0 +1,199 @@
package com.hnac.hzims.fdp.service.impl;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.hnac.hzims.fdp.config.FdpUrlConfiguration;
import com.hnac.hzims.fdp.constants.FdpConstant;
import com.hnac.hzims.fdp.request.StationInfoReq;
import com.hnac.hzims.fdp.request.SubmitAnswerReq;
import com.hnac.hzims.fdp.response.DevsetQuestionResp;
import com.hnac.hzims.fdp.service.IFdpQuestionService;
import com.hnac.hzims.operational.station.StationConstants;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.enume.StationEnumConstants;
import com.hnac.hzims.operational.station.feign.IStationClient;
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.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 10:18
*/
@Service
@AllArgsConstructor
@Slf4j
public class FdpQuestionServiceImpl implements IFdpQuestionService {
private final IStationClient stationClient;
private final FdpUrlConfiguration fdpUrlConfiguration;
private final BladeLogger logger;
@Override
public boolean submitStationInfo(String stationCode, String stationDesc) {
R<StationEntity> stationResult = stationClient.getStationByCode(stationCode);
if(stationResult.isSuccess()) {
StationEntity stationEntity = stationResult.getData();
StationInfoReq infoReq = StationInfoReq.builder()
.stationId(stationCode)
.stationName(stationEntity.getName())
.type(this.getStationType(stationEntity.getType()))
.stationDesc(Optional.ofNullable(stationDesc).orElse(""))
.build();
if(Func.isNotEmpty(infoReq.getType())) {
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getSubmitStationInfo())
.body(JSON.toJSONString(infoReq))
.execute();
if(httpResponse.getStatus() == HttpServletResponse.SC_OK &&
"1".equals(JSONObject.parseObject(httpResponse.body()).getString("success"))) {
return true;
}
else {
throw new ServiceException("Fdp信息站点信息失败!");
}
}
}
return false;
}
@Override
public boolean deleteStationInfo(String stationId) {
HttpResponse response = HttpRequest.post(fdpUrlConfiguration.getDeleteStationInfo()).body(JSON.toJSONString(
new HashMap<String, String>(1) {{
put("stationId", stationId);
}}
)).execute();
if(response.getStatus() == HttpServletResponse.SC_OK &&
"1".equals(JSONObject.parseObject(response.body()).getString("success"))) {
return true;
}
else {
throw new ServiceException("Fdp删除站点信息失败!");
}
}
@Override
public List<DevsetQuestionResp> getDevsetQuestion(String deviceType, Integer stationType) {
List<DevsetQuestionResp> result = Lists.newArrayList();
String getQuestionUrl = "";
switch(deviceType) {
case FdpConstant.COMMON_DEVICE_TYPE:
getQuestionUrl = fdpUrlConfiguration.getGetStationQuestion();
break;
case FdpConstant.SET_DEVICE_TYPE:
getQuestionUrl = fdpUrlConfiguration.getGetDevsetQuestion();
break;
default:
break;
}
if(StringUtil.isNotBlank(getQuestionUrl)) {
HttpResponse response = HttpRequest.post(getQuestionUrl).body(JSON.toJSONString(
new HashMap<String, Integer>(1) {{
put("type", getStationType(stationType));
}}
)).execute();
if(response.getStatus() == HttpServletResponse.SC_OK &&
"1".equals(JSONObject.parseObject(response.body()).getString("success"))) {
JSONObject responseJSON = JSONObject.parseObject(response.body());
result = JSONArray.parseArray(responseJSON.getString("data"), DevsetQuestionResp.class);
}
}
return result;
}
@Override
public boolean submitDeviceAnswer(SubmitAnswerReq submitAnswerReq) {
String submitAnswerUrl = "";
switch(submitAnswerReq.getDeviceType()) {
case FdpConstant.COMMON_DEVICE_TYPE:
submitAnswerUrl = fdpUrlConfiguration.getSubmitStationAnswer();
break;
case FdpConstant.SET_DEVICE_TYPE:
submitAnswerUrl = fdpUrlConfiguration.getSubmitDevsetAnswer();
break;
default:
break;
}
if(StringUtil.isNotBlank(submitAnswerUrl)) {
submitAnswerReq.setType(this.getStationType(submitAnswerReq.getStationType()));
HttpResponse response = HttpRequest.post(submitAnswerUrl).body(JSON.toJSONString(submitAnswerReq)).execute();
return response.getStatus() == HttpServletResponse.SC_OK &&
"1".equals(JSONObject.parseObject(response.body()).getString("success"));
}
return false;
}
@Override
public boolean generateGraphInstance(Integer stationType, String stationId) {
Integer type = this.getStationType(stationType);
if(Func.isNotEmpty(type)) {
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getGenerateGraphInstance()).body(JSON.toJSONString(
new HashMap<String,Object>(){{
put("type",type);
put("stationId",stationId);
}}
)).execute();
return httpResponse.getStatus() == HttpServletResponse.SC_OK &&
"1".equals(JSONObject.parseObject(httpResponse.body()).getString("success"));
}
return false;
}
@Override
public boolean deleteInstanceAnswer(String instanceId) {
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getDeleteInstanceAnswer()).body(JSON.toJSONString(
new HashMap<String, String>(1) {{
put("instanceId", instanceId);
}}
)).execute();
return httpResponse.getStatus() == HttpServletResponse.SC_OK &&
"1".equals(JSONObject.parseObject(httpResponse.body()).getString("success"));
}
@Override
public List<JSONObject> getInstanceAnswer(String instanceId) {
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getGetInstanceAnswer()).body(
JSON.toJSONString(
new HashMap<String,String>(1){{
put("instanceId",instanceId);
}}
)
).execute();
JSONObject responseObject = JSONObject.parseObject(httpResponse.body());
if(httpResponse.getStatus() == HttpServletResponse.SC_OK &&
"1".equals(responseObject.getString("success"))) {
return JSONArray.parseArray(JSON.toJSONString(responseObject),JSONObject.class);
}
return Lists.newArrayList();
}
/**
* 根据站点类型获取Fdp的站点类型
* @param stationType 站点管理站点类型
* @return Fdp站点类型
*/
private Integer getStationType(Integer stationType) {
if(StationEnumConstants.StationTypeEnum.STATION_TYPE_0.getStatus() == stationType) {
return FdpConstant.HYDROELECTRIC_STATION;
}
else if(StationEnumConstants.StationTypeEnum.STATION_TYPE_8.getStatus() == stationType) {
return FdpConstant.PUMP_STATION;
}
return null;
}
}

5
hzims-service/equipment/src/main/resources/db/1.0.0_0831.sql

@ -1,5 +0,0 @@
ALTER TABLE hzims_fdp_device ADD FATHER_ID VARCHAR(40) COMMENT '智能诊断-PID';
ALTER TABLE hzims_em_info ADD HOME_PAGE_DISPLAY CHAR(2) DEFAULT '0' COMMENT '首页展示:0否,1是';
UPDATE `hzims_em_info` SET HOME_PAGE_DISPLAY = 1 WHERE NUMBER IN ('HZ111','HZ112','HZ113','HZ121','HZ122','HZ123','HZ131','HZ132');

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/DefaultRobotIdentifyTypeHandler.java

@ -46,9 +46,9 @@ public class DefaultRobotIdentifyTypeHandler implements IRobotIdentifyTypeHandle
recordVo.setTenantId(tenantId);
recordVo.setContentId(content.getId());
String addr = content.getCameraAddr();
recordVo.setFileUrl(picUrl);
if(Func.isNotEmpty(switchs)){
for (RobotAiSwitchReturn re : switchs) {
recordVo.setFileUrl(picUrl);
if(addr.trim().equals(re.getRowindex() + AIContants.COMMA + re.getColindex())){
recordVo.setCurrentValue(String.valueOf(re.getState()));
recordVo.setCurrentStatus(setCurrentStatus(String.valueOf(re.getState()), content.getCheckVal()));

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotDigitTypeHandler.java

@ -32,9 +32,9 @@ public class RobotDigitTypeHandler implements IRobotIdentifyTypeHandler<RobotIde
recordVo.setTenantId(tenantId);
recordVo.setContentId(content.getId());
String addr = content.getCameraAddr();
recordVo.setFileUrl(picUrl);
if(Func.isNotEmpty(digits)){
for (RobotAiDigitReturn re : digits) {
recordVo.setFileUrl(picUrl);
if(addr.trim().equals(re.getRowindex() + AIContants.COMMA + re.getColindex())){
recordVo.setCurrentValue(re.getClassname()/Math.pow(10, Double.valueOf(content.getOtherParam())) + "");
recordVo.setCurrentStatus(setCurrentStatus(recordVo.getCurrentValue(), content.getCheckVal()));

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotMeterTypeHandler.java

@ -92,10 +92,9 @@ public class RobotMeterTypeHandler implements IRobotIdentifyTypeHandler<RobotIde
} else {
throw new ServiceException("表针识别表盘类型数据录入错误 —— 刻度对应值 字段 : " + clockType.getScaleValues());
}
recordVo.setFileUrl(picUrl);
if(Func.isNotEmpty(meter)){
for (RobotAiMeterReturn re : meter) {
recordVo.setFileUrl(picUrl);
if(addr.trim().equals(re.getRowindex() + AIContants.COMMA + re.getColindex())){
/** TODO 暂时只做了一个指针的情况*/
recordVo.setCurrentValue(re.getPointer().get(0).getDegree() * ratio + " " + clockType.getUnit());

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotSwitchHTypeHandler.java

@ -66,9 +66,9 @@ public class RobotSwitchHTypeHandler implements IRobotIdentifyTypeHandler<RobotI
recordVo.setTenantId(tenantId);
recordVo.setContentId(content.getId());
String addr = content.getCameraAddr();
recordVo.setFileUrl(picUrl);
if(Func.isNotEmpty(switchs)){
for (RobotAiSwitchHReturn re : switchs) {
recordVo.setFileUrl(picUrl);
if(addr.trim().equals(re.getRowindex() + AIContants.COMMA + re.getColindex())){
recordVo.setCurrentValue(re.getState());
recordVo.setCurrentStatus(setCurrentStatus(re.getState(), content.getCheckVal()));

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotValueTypeHandler.java

@ -29,9 +29,9 @@ public class RobotValueTypeHandler implements IRobotIdentifyTypeHandler<RobotIde
recordVo.setTenantId(tenantId);
recordVo.setContentId(content.getId());
String addr = content.getCameraAddr();
recordVo.setFileUrl(picUrl);
if(Func.isNotEmpty(values)){
for (RobotAiValueReturn re : values) {
recordVo.setFileUrl(picUrl);
if(addr.trim().equals(re.getRowindex() + AIContants.COMMA + re.getColindex())){
recordVo.setCurrentValue(re.getValue() + "");
recordVo.setCurrentStatus(setCurrentStatus(recordVo.getCurrentValue(), content.getCheckVal()));

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotVoiceTypeHandler.java

@ -27,9 +27,9 @@ public class RobotVoiceTypeHandler implements IRobotIdentifyTypeHandler<RobotIde
EventRecordAddVO recordVo = new EventRecordAddVO();
recordVo.setTenantId(tenantId);
recordVo.setContentId(content.getId());
recordVo.setFileUrl(picUrl);
if(Func.isNotEmpty(switchs)){
for (RobotAiSwitchReturn re : switchs) {
recordVo.setFileUrl(picUrl);
recordVo.setCurrentStatus(TaskContants.CurrentStatusEnum.normal.getType());
}
}

Loading…
Cancel
Save