xushili 1 year ago
parent
commit
3984d252e3
29 changed files with 230 additions and 5 deletions
  1. 3 0
      clientside/build.gradle
  2. 41 0
      clientside/src/main/java/com/gyee/clientside/config/WebMvcConfig.java
  3. 13 0
      clientside/src/main/java/com/gyee/clientside/controller/HomeController.java
  4. 2 2
      clientside/src/main/resources/application.yml
  5. 1 0
      clientside/src/main/resources/static/assets/axios.1f49b28e.js
  6. 1 0
      clientside/src/main/resources/static/assets/axios.5fca160f.css
  7. 1 0
      clientside/src/main/resources/static/assets/el-progress.8c77f1e7.css
  8. 1 0
      clientside/src/main/resources/static/assets/el-select.754596eb.css
  9. 1 0
      clientside/src/main/resources/static/assets/el-tree.e6968073.css
  10. 1 0
      clientside/src/main/resources/static/assets/index.15f00eab.css
  11. 1 0
      clientside/src/main/resources/static/assets/index.2db0316f.js
  12. 1 0
      clientside/src/main/resources/static/assets/index.516d4e34.js
  13. 1 0
      clientside/src/main/resources/static/assets/index.5e19ab78.js
  14. 1 0
      clientside/src/main/resources/static/assets/index.665f04fc.css
  15. 1 0
      clientside/src/main/resources/static/assets/index.6dee49c0.css
  16. 1 0
      clientside/src/main/resources/static/assets/index.7c5bce25.css
  17. 1 0
      clientside/src/main/resources/static/assets/index.bcb96acb.js
  18. 1 0
      clientside/src/main/resources/static/assets/index.da732290.js
  19. 1 0
      clientside/src/main/resources/static/assets/routerViewss.379c9691.js
  20. 1 0
      clientside/src/main/resources/static/assets/tree.vue_vue&type=script&setup=true&name=search&lang.a44512a1.js
  21. 1 0
      clientside/src/main/resources/static/assets/vendor.8596e0db.css
  22. 48 0
      clientside/src/main/resources/static/assets/vendor.e280aae7.js
  23. BIN
      clientside/src/main/resources/static/favicon.ico
  24. 37 0
      clientside/src/main/resources/static/static/config/modeConfig.js
  25. 21 0
      clientside/src/main/resources/templates/index.html
  26. 41 0
      redisread/src/main/java/com/gyee/redisread/config/WebMvcConfig.java
  27. 1 1
      redisread/src/main/java/com/gyee/redisread/controller/RedisController.java
  28. 2 2
      redisread/src/main/java/com/gyee/redisread/task/TaskRedisRead.java
  29. 4 0
      redisread/src/main/resources/application.yml

+ 3 - 0
clientside/build.gradle

@@ -14,4 +14,7 @@ dependencies {
     implementation 'com.baomidou:mybatis-plus-boot-starter:3.5.3.1'
 
     implementation 'cn.hutool:hutool-jwt:5.8.16'
+
+    implementation 'org.springframework.boot:spring-boot-starter-web'
+    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
 }

+ 41 - 0
clientside/src/main/java/com/gyee/clientside/config/WebMvcConfig.java

@@ -0,0 +1,41 @@
+package com.gyee.clientside.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * 拦截器
+ */
+@Configuration
+public class WebMvcConfig implements  WebMvcConfigurer  {
+
+	/** 解决跨域问题 **/
+	@Override
+	public void addCorsMappings(CorsRegistry registry){
+		// 设置允许跨域的路由
+        registry.addMapping("/**")
+			// 设置允许跨域请求的域名
+			.allowedOriginPatterns("*")
+			// 是否允许证书
+			.allowCredentials(true)
+			// 设置允许的方法
+			.allowedMethods("GET", "POST", "DELETE", "PUT")
+			// 设置允许的header属性
+			.allowedHeaders("*")
+				// 跨域允许时间
+			.maxAge(3600);
+	}
+
+	/*@Override
+	public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+		//解决中文乱码
+		StringHttpMessageConverter converter1 = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+		converters.add(converter1);
+		//解决 添加解决中文乱码后 上述配置之后,返回json数据直接报错 500:no convertter for return value of type
+		MappingJackson2HttpMessageConverter converter2 = new MappingJackson2HttpMessageConverter();
+		converter2.setObjectMapper(new ObjectMapper());
+		converters.add(converter2);
+		WebMvcConfigurer.super.configureMessageConverters(converters);
+	}*/
+}

+ 13 - 0
clientside/src/main/java/com/gyee/clientside/controller/HomeController.java

@@ -0,0 +1,13 @@
+package com.gyee.clientside.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+public class HomeController {
+    @GetMapping
+    public String home(){
+        return "index";
+    }
+}

+ 2 - 2
clientside/src/main/resources/application.yml

@@ -33,8 +33,8 @@ spring:
 
 #适配器链接taos数据库配置信息
 taoscz:
-  #server_ip: 192.168.126.128
-  server_ip: 192.168.10.13
+  server_ip: 192.168.126.128
+  #server_ip: 192.168.10.13
   server_port: 6030
   #数据库名
   db_name: nxxny

File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/axios.1f49b28e.js


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/axios.5fca160f.css


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/el-progress.8c77f1e7.css


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/el-select.754596eb.css


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/el-tree.e6968073.css


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.15f00eab.css


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.2db0316f.js


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.516d4e34.js


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.5e19ab78.js


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.665f04fc.css


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.6dee49c0.css


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.7c5bce25.css


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.bcb96acb.js


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/index.da732290.js


+ 1 - 0
clientside/src/main/resources/static/assets/routerViewss.379c9691.js

@@ -0,0 +1 @@
+import{g as s,i as a,l as e,w as t,b as n,r as o,o as r,c as l,Q as u,k as c,R as i}from"./vendor.e280aae7.js";const d={class:"content"},m={__name:"routerViewss",setup(m){const p=n(),f=s((()=>p.state.tagsList.map((s=>s.name))));return s((()=>p.state.collapse)),(s,n)=>{const m=o("router-view");return r(),a("div",d,[e(m,null,{default:t((({Component:s})=>[(r(),l(i,{includes:c(f)},[(r(),l(u(s)))],1032,["includes"]))])),_:1})])}}};export default m;

File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/tree.vue_vue&type=script&setup=true&name=search&lang.a44512a1.js


File diff suppressed because it is too large
+ 1 - 0
clientside/src/main/resources/static/assets/vendor.8596e0db.css


File diff suppressed because it is too large
+ 48 - 0
clientside/src/main/resources/static/assets/vendor.e280aae7.js


BIN
clientside/src/main/resources/static/favicon.ico


+ 37 - 0
clientside/src/main/resources/static/static/config/modeConfig.js

@@ -0,0 +1,37 @@
+// 本地联调开关
+const localTest = false;
+
+// 服务器地址
+let baseURL = "/current/" // 正式环境
+
+// websocket 服务器地址
+let websocketUrl = null;
+
+// 3D 地球瓦片路径
+let tilesUrl = null;
+// 3D 地球最大支持放大到多少级
+const tilesMaxLevel = 18;
+
+// 适配器地址
+// const adapterUrl = "http://10.155.32.4:8011/";
+
+// 切换模块时是否提示当前模块名称(用于对内介绍项目时便捷显示模块名称)
+const showModuleName = 0;
+
+// if (localTest) {
+//     baseURL = "http://192.168.10.8:9002/" // 联机调试 
+// } else {
+//     baseURL = "http://10.155.32.14:9002/" // 正式环境
+    
+// }
+
+websocketUrl = (baseURL.replace(/http:\/\/|https:\/\//g, "")) + "gyee-websocket";
+
+window.__MODE__ = {
+    baseURL,
+    websocketUrl,
+    // adapterUrl,
+    tilesUrl,
+    tilesMaxLevel,
+    showModuleName
+};

+ 21 - 0
clientside/src/main/resources/templates/index.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="zh">
+
+<head>
+    <meta charset="UTF-8" />
+    <link rel="icon" href="./favicon.ico" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>发电能力分析平台</title>
+    <script src="./static/config/modeConfig.js"></script>
+<script type="module" crossorigin src="./assets/index.2db0316f.js"></script>
+  <link rel="modulepreload" href="./assets/vendor.e280aae7.js">
+  <link rel="stylesheet" href="./assets/vendor.8596e0db.css">
+  <link rel="stylesheet" href="./assets/index.665f04fc.css">
+</head>
+
+<body>
+    <div id="app"></div>
+    
+</body>
+
+</html>

+ 41 - 0
redisread/src/main/java/com/gyee/redisread/config/WebMvcConfig.java

@@ -0,0 +1,41 @@
+package com.gyee.redisread.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * 拦截器
+ */
+@Configuration
+public class WebMvcConfig implements  WebMvcConfigurer  {
+
+	/** 解决跨域问题 **/
+	@Override
+	public void addCorsMappings(CorsRegistry registry){
+		// 设置允许跨域的路由
+        registry.addMapping("/**")
+			// 设置允许跨域请求的域名
+			.allowedOriginPatterns("*")
+			// 是否允许证书
+			.allowCredentials(true)
+			// 设置允许的方法
+			.allowedMethods("GET", "POST", "DELETE", "PUT")
+			// 设置允许的header属性
+			.allowedHeaders("*")
+				// 跨域允许时间
+			.maxAge(3600);
+	}
+
+	/*@Override
+	public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+		//解决中文乱码
+		StringHttpMessageConverter converter1 = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+		converters.add(converter1);
+		//解决 添加解决中文乱码后 上述配置之后,返回json数据直接报错 500:no convertter for return value of type
+		MappingJackson2HttpMessageConverter converter2 = new MappingJackson2HttpMessageConverter();
+		converter2.setObjectMapper(new ObjectMapper());
+		converters.add(converter2);
+		WebMvcConfigurer.super.configureMessageConverters(converters);
+	}*/
+}

+ 1 - 1
redisread/src/main/java/com/gyee/redisread/controller/RedisController.java

@@ -19,7 +19,7 @@ public class RedisController {
 
 
     @GetMapping("/read/start")
-    private boolean taos2RedisStart() throws Exception {
+    private boolean taos2RedisStart() {
         return readRedisService.start();
     }
 

+ 2 - 2
redisread/src/main/java/com/gyee/redisread/task/TaskRedisRead.java

@@ -83,7 +83,7 @@ public class TaskRedisRead implements Runnable {
                     sb.append(pointid).append(" VALUES (").append(ts).append(",").append(bl).append(") ");*/
                 }
                 sb2str = sb.toString();
-                if ("INSERT INTO ;".equals(sb2str)) return;
+                if ("INSERT INTO ".equals(sb2str)) return;
                 for (String taosUrl : redisConfig.getTaosUrls().split(",")) {
                     redis2TaosApi.putSql(URI.create(taosUrl), sb2str);
                 }
@@ -115,7 +115,7 @@ public class TaskRedisRead implements Runnable {
                     sb.append(pointid).append(" VALUES (").append(ts).append(",").append(val).append(") ");*/
                 }
                 sb2str = sb.toString();
-                if ("INSERT INTO ;".equals(sb2str)) return;
+                if ("INSERT INTO ".equals(sb2str)) return;
                 for (String taosUrl : redisConfig.getTaosUrls().split(",")) {
                     redis2TaosApi.putSql(URI.create(taosUrl), sb2str);
                 }

+ 4 - 0
redisread/src/main/resources/application.yml

@@ -4,6 +4,10 @@ server:
 spring:
   application:
     name: redisread
+  thymeleaf:
+    prefix: classpath:/templates/
+    mode: HTML5
+    cache: false
 
 redis:
   host: 192.168.126.128