diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java index a78b0e9..aca3fab 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java +++ b/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 public enum FuncRouteEnum { - OPEN_SCADA("open_scada","打开实时画面"), + OPEN_CANVAS("open_canvas","打开实时画面"), OPEN_VIDEO("open_video","打开视频监控"), DIAGNOSE("diagnose","智能诊断"), CHOOSE_STATION("choose_station","选择站点"), diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java index 7739800..90102a3 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java +++ b/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}) public R authentication(@RequestParam(required = false) @ApiParam("站点编号") String stationId, @RequestParam @ApiParam("用户ID") String userId, - @RequestParam(required = false) @ApiParam("菜单ID") String funcCode) { - return R.status(interactiveService.authentication(stationId,userId,funcCode)); + @RequestParam(required = false) @ApiParam("菜单ID") String func) { + return R.status(interactiveService.authentication(stationId,userId,func)); } @ApiOperation("获取问答sessionId") diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java index b85ad2f..40b06ea 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java @@ -30,7 +30,7 @@ public interface IInteractiveService { List getAnswerBySessionIds(String sessionIds); - Boolean authentication(String stationId, String userId, String funcCode); + Boolean authentication(String stationId, String userId, String func); Boolean removeSessionId(String sessionId); } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java index f59aefb..1c09556 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java +++ b/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 - public Boolean authentication(String stationId, String userId, String funcCode) { + public Boolean authentication(String stationId, String userId, String func) { // 站点鉴权 if(StringUtil.isNotBlank(stationId)) { List stations = this.getStationPermissionsById(userId).stream().map(DeptStationDTO::getStationId) @@ -204,9 +204,9 @@ public class InteractiveServiceImpl implements IInteractiveService { }); } // 菜单鉴权 - if(StringUtil.isNotBlank(funcCode) && StringUtil.isNotBlank(userId)) { - FunctionEntity function = functionService.getFunctionByCode(funcCode); - if(Func.isNotEmpty(function.getRoute()) && StringUtil.isNotBlank(function.getRoute())) { + if(StringUtil.isNotBlank(func) && StringUtil.isNotBlank(userId)) { + FunctionEntity function = functionService.getFunctionByCode(func); + if(Func.isNotEmpty(function) && Func.isNotEmpty(function.getRoute()) && StringUtil.isNotBlank(function.getRoute())) { R authenticationR = userClient.permissionMenuById(Long.valueOf(userId), function.getRoute()); Assert.isTrue(authenticationR.isSuccess() && authenticationR.getData(), () -> { throw new ServiceException("人员菜单鉴权失败!"); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java index 2ad7ae3..6c320a3 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java +++ b/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()); if(Func.isNotEmpty(routeEnum)) { switch(routeEnum) { - case OPEN_SCADA: + case OPEN_CANVAS: return this.getScadaExtra(args,function); default: break; @@ -53,7 +53,7 @@ public class JumpRouteJoinStrategy { // 跳转页面逻辑 ExtraVO extraVO = new ExtraVO(); extraVO.setImmediatelyJump(true); - extraVO.setFuncCode(FuncRouteEnum.OPEN_SCADA.getFuncCode()); + extraVO.setFuncCode(FuncRouteEnum.OPEN_CANVAS.getFuncCode()); Map params = this.scadaResolve(args); // 根据hz3000画面版本获取path Integer picResource = Integer.valueOf(params.get("picResource")); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java index 629d287..85affae 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java +++ b/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; } - //@XxlJob(SYNCHRONOUS_FAULT_INSTRUCT) String params - @Scheduled(cron = "0/10 * * * * ?") - public ReturnT synchronousFaultInstruct() { + @XxlJob(SYNCHRONOUS_FAULT_INSTRUCT) + public ReturnT synchronousFaultInstruct(String params) { Map request = new HashMap<>(2); // 获取站点列表 R> stationsR = stationClient.list(new StationEntity()); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java index 700e44b..bc475f7 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java +++ b/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 param = new HashMap<>(1); param.put("canvas_id",selection.getId()); 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); AnswerVO answerVO = new AnswerVO(); answerVO.setSessionId(sessionId);