Browse Source

fix:open_scada修改为open_canvas

zhongwei
haungxing 7 months ago
parent
commit
27e18383a6
  1. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java
  2. 4
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java
  3. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java
  4. 8
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java
  5. 4
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java
  6. 5
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java
  7. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java

@ -12,7 +12,7 @@ import java.util.Optional;
*/ */
@AllArgsConstructor @AllArgsConstructor
public enum FuncRouteEnum { public enum FuncRouteEnum {
OPEN_SCADA("open_scada","打开实时画面"), OPEN_CANVAS("open_canvas","打开实时画面"),
OPEN_VIDEO("open_video","打开视频监控"), OPEN_VIDEO("open_video","打开视频监控"),
DIAGNOSE("diagnose","智能诊断"), DIAGNOSE("diagnose","智能诊断"),
CHOOSE_STATION("choose_station","选择站点"), CHOOSE_STATION("choose_station","选择站点"),

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

@ -48,8 +48,8 @@ public class InteractiveController {
@RequestMapping(value = "/authentication",method = {RequestMethod.GET,RequestMethod.POST}) @RequestMapping(value = "/authentication",method = {RequestMethod.GET,RequestMethod.POST})
public R authentication(@RequestParam(required = false) @ApiParam("站点编号") String stationId, public R authentication(@RequestParam(required = false) @ApiParam("站点编号") String stationId,
@RequestParam @ApiParam("用户ID") String userId, @RequestParam @ApiParam("用户ID") String userId,
@RequestParam(required = false) @ApiParam("菜单ID") String funcCode) { @RequestParam(required = false) @ApiParam("菜单ID") String func) {
return R.status(interactiveService.authentication(stationId,userId,funcCode)); return R.status(interactiveService.authentication(stationId,userId,func));
} }
@ApiOperation("获取问答sessionId") @ApiOperation("获取问答sessionId")

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java

@ -30,7 +30,7 @@ public interface IInteractiveService {
List<AnswerVO> getAnswerBySessionIds(String sessionIds); List<AnswerVO> getAnswerBySessionIds(String sessionIds);
Boolean authentication(String stationId, String userId, String funcCode); Boolean authentication(String stationId, String userId, String func);
Boolean removeSessionId(String sessionId); Boolean removeSessionId(String sessionId);
} }

8
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java

@ -194,7 +194,7 @@ public class InteractiveServiceImpl implements IInteractiveService {
} }
@Override @Override
public Boolean authentication(String stationId, String userId, String funcCode) { public Boolean authentication(String stationId, String userId, String func) {
// 站点鉴权 // 站点鉴权
if(StringUtil.isNotBlank(stationId)) { if(StringUtil.isNotBlank(stationId)) {
List<String> stations = this.getStationPermissionsById(userId).stream().map(DeptStationDTO::getStationId) List<String> stations = this.getStationPermissionsById(userId).stream().map(DeptStationDTO::getStationId)
@ -204,9 +204,9 @@ public class InteractiveServiceImpl implements IInteractiveService {
}); });
} }
// 菜单鉴权 // 菜单鉴权
if(StringUtil.isNotBlank(funcCode) && StringUtil.isNotBlank(userId)) { if(StringUtil.isNotBlank(func) && StringUtil.isNotBlank(userId)) {
FunctionEntity function = functionService.getFunctionByCode(funcCode); FunctionEntity function = functionService.getFunctionByCode(func);
if(Func.isNotEmpty(function.getRoute()) && StringUtil.isNotBlank(function.getRoute())) { if(Func.isNotEmpty(function) && Func.isNotEmpty(function.getRoute()) && StringUtil.isNotBlank(function.getRoute())) {
R<Boolean> authenticationR = userClient.permissionMenuById(Long.valueOf(userId), function.getRoute()); R<Boolean> authenticationR = userClient.permissionMenuById(Long.valueOf(userId), function.getRoute());
Assert.isTrue(authenticationR.isSuccess() && authenticationR.getData(), () -> { Assert.isTrue(authenticationR.isSuccess() && authenticationR.getData(), () -> {
throw new ServiceException("人员菜单鉴权失败!"); throw new ServiceException("人员菜单鉴权失败!");

4
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java

@ -40,7 +40,7 @@ public class JumpRouteJoinStrategy {
FuncRouteEnum routeEnum = FuncRouteEnum.getEnumByFuncCode(function.getCode()); FuncRouteEnum routeEnum = FuncRouteEnum.getEnumByFuncCode(function.getCode());
if(Func.isNotEmpty(routeEnum)) { if(Func.isNotEmpty(routeEnum)) {
switch(routeEnum) { switch(routeEnum) {
case OPEN_SCADA: case OPEN_CANVAS:
return this.getScadaExtra(args,function); return this.getScadaExtra(args,function);
default: default:
break; break;
@ -53,7 +53,7 @@ public class JumpRouteJoinStrategy {
// 跳转页面逻辑 // 跳转页面逻辑
ExtraVO extraVO = new ExtraVO(); ExtraVO extraVO = new ExtraVO();
extraVO.setImmediatelyJump(true); extraVO.setImmediatelyJump(true);
extraVO.setFuncCode(FuncRouteEnum.OPEN_SCADA.getFuncCode()); extraVO.setFuncCode(FuncRouteEnum.OPEN_CANVAS.getFuncCode());
Map<String, String> params = this.scadaResolve(args); Map<String, String> params = this.scadaResolve(args);
// 根据hz3000画面版本获取path // 根据hz3000画面版本获取path
Integer picResource = Integer.valueOf(params.get("picResource")); Integer picResource = Integer.valueOf(params.get("picResource"));

5
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java

@ -193,9 +193,8 @@ public class InteractiveSchedule {
return ReturnT.SUCCESS; return ReturnT.SUCCESS;
} }
//@XxlJob(SYNCHRONOUS_FAULT_INSTRUCT) String params @XxlJob(SYNCHRONOUS_FAULT_INSTRUCT)
@Scheduled(cron = "0/10 * * * * ?") public ReturnT synchronousFaultInstruct(String params) {
public ReturnT synchronousFaultInstruct() {
Map<String,Object> request = new HashMap<>(2); Map<String,Object> request = new HashMap<>(2);
// 获取站点列表 // 获取站点列表
R<List<StationEntity>> stationsR = stationClient.list(new StationEntity()); R<List<StationEntity>> stationsR = stationClient.list(new StationEntity());

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java

@ -147,7 +147,7 @@ public class InteractiveHandler extends TextWebSocketHandler {
Map<String,String> param = new HashMap<>(1); Map<String,String> param = new HashMap<>(1);
param.put("canvas_id",selection.getId()); param.put("canvas_id",selection.getId());
IFunctionService functionService = SpringUtil.getBean(IFunctionService.class); IFunctionService functionService = SpringUtil.getBean(IFunctionService.class);
FunctionEntity function = functionService.getFunctionByCode("open_scada"); FunctionEntity function = functionService.getFunctionByCode(FuncRouteEnum.OPEN_CANVAS.getFuncCode());
ExtraVO scadaExtra = strategy.getScadaExtra(param, function); ExtraVO scadaExtra = strategy.getScadaExtra(param, function);
AnswerVO answerVO = new AnswerVO(); AnswerVO answerVO = new AnswerVO();
answerVO.setSessionId(sessionId); answerVO.setSessionId(sessionId);

Loading…
Cancel
Save