Browse Source

add:遥控鉴权接口

zhongwei
haungxing 6 months ago
parent
commit
05282c062e
  1. 4
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java
  2. 7
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/AuthenticationService.java
  3. 39
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataItemVO.java
  4. 28
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java

4
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java

@ -49,8 +49,8 @@ public class InteractiveController {
public R authentication(@RequestParam(required = false) @ApiParam("站点编号") String stationId,
@RequestParam @ApiParam("用户ID") String userId,
@RequestParam(required = false) @ApiParam("菜单ID") String func,
@RequestParam(required = false) @ApiParam("会话ID")String sessionId) {
return R.status(interactiveService.authentication(stationId,userId,func,sessionId));
@RequestParam(required = false) @ApiParam("会话ID")String askId) {
return R.status(interactiveService.authentication(stationId,userId,func,askId));
}
@ApiOperation("获取问答sessionId")

7
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/AuthenticationService.java

@ -1,5 +1,6 @@
package com.hnac.hzims.bigmodel.interactive.service.impl;
import com.google.common.collect.Lists;
import com.hnac.hzims.bigmodel.entity.FunctionEntity;
import com.hnac.hzims.bigmodel.function.service.IFunctionService;
import com.hnac.hzims.bigmodel.interactive.constants.ProjectRemoteTypeEnum;
@ -77,11 +78,11 @@ public class AuthenticationService {
*/
public void remoteAuthentication(String stationId, String userId,String sessionId) {
// 查询数据平台站点是否可被遥控
Result<ProjectVO> projectR = projectClient.getProjectByPid(stationId);
Assert.isTrue(projectR.isSuccess() && Func.isNotEmpty(projectR.getData()),() -> {
Result<List<ProjectVO>> projectR = projectClient.getProjectIds(Lists.newArrayList(stationId));
Assert.isTrue(projectR.isSuccess() && CollectionUtil.isNotEmpty(projectR.getData()) && projectR.getData().size() == 1,() -> {
throw new ServiceException("未查询到站点,鉴权失败!");
});
ProjectVO project = projectR.getData();
ProjectVO project = projectR.getData().get(0);
if(ProjectRemoteTypeEnum.NOT_ALLOW.getCtrlType().equals(project.getCtrlType())) {
// 不允许发送遥控
throw new ServiceException("该站点不允许发送遥控指令,校验失败!");

39
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataItemVO.java

@ -0,0 +1,39 @@
package com.hnac.hzims.bigmodel.interactive.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: huangxing
* @Date: 2024/05/22 10:20
*/
@Data
public class DataItemVO implements Serializable {
private String name;
@JSONField(name = "id")
private String attrId;
@JSONField(name = "param_name")
private String attrName;
@JSONField(name = "device_name")
private String deviceName;
@JSONField(name = "device_id")
private String deviceId;
@JSONField(name = "station_id")
private String projectId;
@JSONField(name = "station_name")
private String projectName;
private String signage;
private String units;
}

28
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java

@ -0,0 +1,28 @@
package com.hnac.hzims.bigmodel.interactive.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
/**
* @Author: huangxing
* @Date: 2024/05/22 10:28
*/
@Data
public class DataVO implements Serializable {
/**数据查询类型:实时、历史**/
private String type;
private String startTime;
private String endTime;
/**包括:"其它"、"最大值"、"最小值"、"总和值"、"平均值"**/
private String method;
/**实时数据结果集**/
private Map<String,Object> real;
}
Loading…
Cancel
Save