diff --git a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataItemVO.java b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataItemVO.java index 914f25b..15bb8c3 100644 --- a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataItemVO.java +++ b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataItemVO.java @@ -17,7 +17,7 @@ public class DataItemVO implements Serializable { @JSONField(name = "id") private String attrId; - @JSONField(name = "param_name") + @JSONField(name = "record_name") private String attrName; @JSONField(name = "device_name") @@ -32,6 +32,7 @@ public class DataItemVO implements Serializable { @JSONField(name = "station_name") private String projectName; + @JSONField(name = "record_id") private String signage; private String units; diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/service/HistoryDataService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/service/HistoryDataService.java index 4a3fc76..a9f854c 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/service/HistoryDataService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/service/HistoryDataService.java @@ -34,7 +34,7 @@ public class HistoryDataService { private final DeviceDataClient deviceDataClient; private final BladeLogger logger; - public static final int DATA_COUNT_MAX = 8000; + public static final int DATA_COUNT_MAX = 1000; public Result getPolymerizationData(HistoryDataSearchVO searchVO) { DataMethodEnum enumByMethod = DataMethodEnum.getEnumByMethod(searchVO.getMethod()); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/datasource/service/DataSourceService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/datasource/service/DataSourceService.java index 262d871..d858de3 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/datasource/service/DataSourceService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/datasource/service/DataSourceService.java @@ -8,6 +8,7 @@ import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; +import java.util.regex.Pattern; /** * @Author: huangxing @@ -20,6 +21,9 @@ public class DataSourceService { private final JdbcTemplate jdbcTemplate; + private static final Pattern UPDATE_PATTERN = Pattern.compile("^UPDATE\\s", Pattern.CASE_INSENSITIVE); + private static final Pattern DELETE_PATTERN = Pattern.compile("^DELETE\\s", Pattern.CASE_INSENSITIVE); + /** * 指定 * @param sql @@ -48,4 +52,11 @@ public class DataSourceService { } } + public static boolean isUpdateOrDelete(String sql) { + if (sql == null) { + return false; + } + return UPDATE_PATTERN.matcher(sql).find() || DELETE_PATTERN.matcher(sql).find(); + } + } 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 ef03d20..c3baac3 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 @@ -14,14 +14,14 @@ import java.util.Optional; public enum FuncRouteEnum { OPEN_CANVAS("open_canvas","打开实时画面",FunctionConstants.TypeEnum.JUMP), OPEN_VIDEO("open_video","打开视频监控",FunctionConstants.TypeEnum.PARAMS), - DIAGNOSE("diagnose","智能诊断",FunctionConstants.TypeEnum.PARAMS), + DIAGNOSE("result_diagnose","智能诊断",FunctionConstants.TypeEnum.PARAMS), CHOOSE_STATION("choose_station","选择站点",FunctionConstants.TypeEnum.CHOOSE), CHOOSE_VIDEO("choose_video","选择视频",FunctionConstants.TypeEnum.CHOOSE), CHOOSE_CANVAS("choose_canvas","选择画面",FunctionConstants.TypeEnum.CHOOSE), CHOOSE_FAULT("choose_fault","选择故障",FunctionConstants.TypeEnum.CHOOSE), CHOOSE_YK("choose_yk","选择遥控",FunctionConstants.TypeEnum.CHOOSE), CONFIRM_YK("confirm_yk","遥控确认", FunctionConstants.TypeEnum.PARAMS), - SHOW_PARAM("show_param","设备参数查询", FunctionConstants.TypeEnum.PARAMS), + SHOW_PARAM("result_record","设备参数查询", FunctionConstants.TypeEnum.PARAMS), CHOOSE_YC("choose_yc","选择遥测数据",FunctionConstants.TypeEnum.CHOOSE), HISTORY_DATA("history_data","查询历史数据",FunctionConstants.TypeEnum.CHART), ; 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 cc5cde6..6ca3031 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 @@ -46,6 +46,7 @@ import static com.hnac.hzims.bigmodel.schedule.XxlJobHandlerConstant.*; */ @Component @AllArgsConstructor +@Deprecated public class InteractiveSchedule { private final InteractiveWsService wsService; 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 d2e05d7..594981b 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 @@ -129,7 +129,7 @@ public class InteractiveHandler extends TextWebSocketHandler { IHznlmInvokeService invokeService = SpringUtil.getBean(IHznlmInvokeService.class); Map extra = messageContext.toJavaObject(Map.class); extra.put("func",extra.get("func")); - extra.put("data",messageContext.getObject("selection", JSONObject.class)); + extra.put("data",JSONObject.parseObject(JSON.toJSONString(extra.get("selection")))); invokeService.specialAsk(sessionId, (String) extra.get("userId"),extra); }