Browse Source

1、excel导入异常,pom版本导致

dev
mh 4 months ago
parent
commit
d93f91037c
  1. 30
      algorithm/pom.xml
  2. 4
      algorithm/src/test/java/com/mh/algorithm/bpnn/bpnnTest.java
  3. 92
      algorithm/src/test/java/com/mh/algorithm/knn/knnTest.java
  4. 46
      common/pom.xml
  5. 26
      common/src/main/java/com/mh/common/annotation/SysLogger.java
  6. 84
      common/src/main/java/com/mh/common/utils/FileUtils.java
  7. 27
      pom.xml
  8. 50
      user-service/pom.xml
  9. 2
      user-service/src/main/java/com/mh/user/aspect/SysLogAspect.java
  10. 4
      user-service/src/main/java/com/mh/user/controller/BuildingController.java
  11. 8
      user-service/src/main/java/com/mh/user/controller/DeviceFloorController.java
  12. 4
      user-service/src/main/java/com/mh/user/controller/DeviceInstallController.java
  13. 6
      user-service/src/main/java/com/mh/user/job/DealDataJob.java
  14. 4
      user-service/src/main/java/com/mh/user/service/NowDataService.java
  15. 1
      user-service/src/main/java/com/mh/user/utils/CacheTools.java

30
algorithm/pom.xml

@ -46,7 +46,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version> <version>3.9.3</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -107,20 +107,20 @@
</executions> </executions>
</plugin> </plugin>
<!--签名插件--> <!--签名插件-->
<plugin> <!-- <plugin>-->
<groupId>org.apache.maven.plugins</groupId> <!-- <groupId>org.apache.maven.plugins</groupId>-->
<artifactId>maven-gpg-plugin</artifactId> <!-- <artifactId>maven-gpg-plugin</artifactId>-->
<version>1.4</version> <!-- <version>1.4</version>-->
<executions> <!-- <executions>-->
<execution> <!-- <execution>-->
<id>sign-artifacts</id> <!-- <id>sign-artifacts</id>-->
<phase>verify</phase> <!-- <phase>verify</phase>-->
<goals> <!-- <goals>-->
<goal>sign</goal> <!-- <goal>sign</goal>-->
</goals> <!-- </goals>-->
</execution> <!-- </execution>-->
</executions> <!-- </executions>-->
</plugin> <!-- </plugin>-->
<plugin> <plugin>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version> <version>2.3.1</version>

4
algorithm/src/test/java/com/mh/algorithm/bpnn/bpnnTest.java

@ -51,7 +51,7 @@ public class bpnnTest {
double correctRate = Double.valueOf(correct) / Double.valueOf(total); double correctRate = Double.valueOf(correct) / Double.valueOf(total);
System.out.println(correctRate); System.out.println(correctRate);
} }
/** /**
* 使用示例 * 使用示例
* @throws Exception * @throws Exception
@ -67,5 +67,5 @@ public class bpnnTest {
Matrix result = factory.computeBP(bpModel1, data); Matrix result = factory.computeBP(bpModel1, data);
CsvUtil.createCsvFile(null,result,"D:\\ljf\\my_pro\\top-algorithm-set-dev\\src\\computeResult.csv"); CsvUtil.createCsvFile(null,result,"D:\\ljf\\my_pro\\top-algorithm-set-dev\\src\\computeResult.csv");
} }
} }

92
algorithm/src/test/java/com/mh/algorithm/knn/knnTest.java

@ -1,46 +1,46 @@
package com.mh.algorithm.knn; //package com.mh.algorithm.knn;
//
import com.mh.algorithm.matrix.Matrix; //import com.mh.algorithm.matrix.Matrix;
import com.mh.algorithm.utils.CsvInfo; //import com.mh.algorithm.utils.CsvInfo;
import com.mh.algorithm.utils.CsvUtil; //import com.mh.algorithm.utils.CsvUtil;
import com.mh.algorithm.utils.DoubleUtil; //import com.mh.algorithm.utils.DoubleUtil;
import org.junit.Test; //import org.junit.Test;
//
/** ///**
* @program: top-algorithm-set // * @program: top-algorithm-set
* @description: // * @description:
* @author: Mr.Zhao // * @author: Mr.Zhao
* @create: 2020-10-26 22:04 // * @create: 2020-10-26 22:04
**/ // **/
public class knnTest { //public class knnTest {
@Test // @Test
public void test() throws Exception { // public void test() throws Exception {
// 训练集 // // 训练集
CsvInfo csvInfo = CsvUtil.getCsvInfo(false, "E:\\jarTest\\trainData.csv"); // CsvInfo csvInfo = CsvUtil.getCsvInfo(false, "E:\\jarTest\\trainData.csv");
Matrix trainSet = csvInfo.toMatrix(); // Matrix trainSet = csvInfo.toMatrix();
Matrix trainSetLabels = trainSet.getColOfIdx(trainSet.getMatrixColCount() - 1); // Matrix trainSetLabels = trainSet.getColOfIdx(trainSet.getMatrixColCount() - 1);
Matrix trainSetData = trainSet.subMatrix(0, trainSet.getMatrixRowCount(), 0, trainSet.getMatrixColCount() - 1); // Matrix trainSetData = trainSet.subMatrix(0, trainSet.getMatrixRowCount(), 0, trainSet.getMatrixColCount() - 1);
//
CsvInfo csvInfo1 = CsvUtil.getCsvInfo(false, "E:\\jarTest\\testData.csv"); // CsvInfo csvInfo1 = CsvUtil.getCsvInfo(false, "E:\\jarTest\\testData.csv");
Matrix testSet = csvInfo1.toMatrix(); // Matrix testSet = csvInfo1.toMatrix();
Matrix testSetData = trainSet.subMatrix(0, testSet.getMatrixRowCount(), 0, testSet.getMatrixColCount() - 1); // Matrix testSetData = trainSet.subMatrix(0, testSet.getMatrixRowCount(), 0, testSet.getMatrixColCount() - 1);
Matrix testSetLabels = trainSet.getColOfIdx(testSet.getMatrixColCount() - 1); // Matrix testSetLabels = trainSet.getColOfIdx(testSet.getMatrixColCount() - 1);
//
// 分类 // // 分类
long startTime = System.currentTimeMillis(); // long startTime = System.currentTimeMillis();
Matrix result = KNN.classify(testSetData, trainSetData, trainSetLabels, 5); // Matrix result = KNN.classify(testSetData, trainSetData, trainSetLabels, 5);
long endTime = System.currentTimeMillis(); // long endTime = System.currentTimeMillis();
System.out.println("run time:" + (endTime - startTime)); // System.out.println("run time:" + (endTime - startTime));
// 正确率 // // 正确率
Matrix error = result.subtract(testSetLabels); // Matrix error = result.subtract(testSetLabels);
int total = error.getMatrixRowCount(); // int total = error.getMatrixRowCount();
int correct = 0; // int correct = 0;
for (int i = 0; i < error.getMatrixRowCount(); i++) { // for (int i = 0; i < error.getMatrixRowCount(); i++) {
if (DoubleUtil.equals(error.getValOfIdx(i, 0), 0.0)) { // if (DoubleUtil.equals(error.getValOfIdx(i, 0), 0.0)) {
correct++; // correct++;
} // }
} // }
double correctRate = Double.valueOf(correct) / Double.valueOf(total); // double correctRate = Double.valueOf(correct) / Double.valueOf(total);
System.out.println("correctRate:"+ correctRate); // System.out.println("correctRate:"+ correctRate);
} // }
} //}

46
common/pom.xml

@ -34,13 +34,24 @@
<dependency> <dependency>
<groupId>com.github.pagehelper</groupId> <groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId> <artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.7</version> <version>2.1.0</version>
</dependency> <exclusions>
<!-- web --> <exclusion>
<dependency> <groupId>org.apache.logging.log4j</groupId>
<groupId>org.springframework.boot</groupId> <artifactId>log4j-api</artifactId>
<artifactId>spring-boot-starter-web</artifactId> </exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- commons-beanutils --> <!-- commons-beanutils -->
<dependency> <dependency>
<groupId>commons-beanutils</groupId> <groupId>commons-beanutils</groupId>
@ -59,32 +70,11 @@
<artifactId>commons-collections4</artifactId> <artifactId>commons-collections4</artifactId>
<version>4.4</version> <version>4.4</version>
</dependency> </dependency>
<!-- poi --> <!-- poi -->
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
<version>5.2.4</version> <version>4.1.2</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.13.3</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

26
common/src/main/java/com/mh/common/annotation/SysLogger.java

@ -1,13 +1,13 @@
package com.mh.common.annotation; //package com.mh.common.annotation;
//
import java.lang.annotation.*; //import java.lang.annotation.*;
//
/** ///**
* Created by fangzhipeng on 2017/7/12. // * Created by fangzhipeng on 2017/7/12.
*/ // */
@Target(ElementType.METHOD) //@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME) //@Retention(RetentionPolicy.RUNTIME)
@Documented //@Documented
public @interface SysLogger { //public @interface SysLogger {
String value() default ""; // String value() default "";
} //}

84
common/src/main/java/com/mh/common/utils/FileUtils.java

@ -1,42 +1,42 @@
package com.mh.common.utils; //package com.mh.common.utils;
//
import javax.servlet.http.HttpServletResponse; //import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream; //import java.io.BufferedInputStream;
import java.io.BufferedOutputStream; //import java.io.BufferedOutputStream;
import java.io.File; //import java.io.File;
import java.io.FileInputStream; //import java.io.FileInputStream;
import java.io.InputStream; //import java.io.InputStream;
//
/** ///**
* 文件相关操作 // * 文件相关操作
* @author Louis // * @author Louis
* @date Jan 14, 2019 // * @date Jan 14, 2019
*/ // */
public class FileUtils { //public class FileUtils {
//
/** // /**
* 下载文件 // * 下载文件
* @param response // * @param response
* @param file // * @param file
* @param newFileName // * @param newFileName
*/ // */
public static void downloadFile(HttpServletResponse response, File file, String newFileName) { // public static void downloadFile(HttpServletResponse response, File file, String newFileName) {
try { // try {
response.setHeader("Content-Disposition", "attachment; filename=" + new String(newFileName.getBytes("ISO-8859-1"), "UTF-8")); // response.setHeader("Content-Disposition", "attachment; filename=" + new String(newFileName.getBytes("ISO-8859-1"), "UTF-8"));
BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); // BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream());
InputStream is = new FileInputStream(file.getAbsolutePath()); // InputStream is = new FileInputStream(file.getAbsolutePath());
BufferedInputStream bis = new BufferedInputStream(is); // BufferedInputStream bis = new BufferedInputStream(is);
int length = 0; // int length = 0;
byte[] temp = new byte[1 * 1024 * 10]; // byte[] temp = new byte[1 * 1024 * 10];
while ((length = bis.read(temp)) != -1) { // while ((length = bis.read(temp)) != -1) {
bos.write(temp, 0, length); // bos.write(temp, 0, length);
} // }
bos.flush(); // bos.flush();
bis.close(); // bis.close();
bos.close(); // bos.close();
is.close(); // is.close();
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
} //}

27
pom.xml

@ -30,37 +30,10 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.jolokia</groupId> <groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId> <artifactId>jolokia-core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!-- 添加consul依赖-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-aop -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.rxtx</groupId> <groupId>org.rxtx</groupId>
<artifactId>rxtx</artifactId> <artifactId>rxtx</artifactId>

50
user-service/pom.xml

@ -35,34 +35,12 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId> <artifactId>spring-boot-starter-quartz</artifactId>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-config -->
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-config</artifactId>-->
<!-- <version>2.2.2.RELEASE</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- mybatis配置--> <!-- mybatis配置-->
<dependency> <dependency>
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.3.0</version> <version>2.3.0</version>
</dependency> </dependency>
<!-- &lt;!&ndash; mysql数据库链接&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>mysql</groupId>-->
<!-- <artifactId>mysql-connector-java</artifactId>-->
<!-- </dependency>-->
<!-- druid配置--> <!-- druid配置-->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
@ -74,11 +52,6 @@
<artifactId>mssql-jdbc</artifactId> <artifactId>mssql-jdbc</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-all</artifactId>-->
<!-- <version>5.0.0.Alpha2</version>-->
<!-- </dependency>-->
<!-- 登录验证码--> <!-- 登录验证码-->
<dependency> <dependency>
<groupId>com.github.penggle</groupId> <groupId>com.github.penggle</groupId>
@ -105,17 +78,22 @@
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
</dependency> </dependency>
<!-- 添加consul依赖--> <dependency>
<!-- <dependency>--> <groupId>io.springfox</groupId>
<!-- <groupId>org.springframework.cloud</groupId>--> <artifactId>springfox-swagger2</artifactId>
<!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>--> <version>${swagger.version}</version>
<!-- </dependency>--> </dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!--spring-boot-admin --> <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-aop -->
<dependency> <dependency>
<groupId>de.codecentric</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
<version>2.2.2</version> <version>2.2.5.RELEASE</version>
</dependency> </dependency>
<!-- Lombok--> <!-- Lombok-->
<dependency> <dependency>

2
user-service/src/main/java/com/mh/user/aspect/SysLogAspect.java

@ -16,6 +16,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -27,6 +28,7 @@ import java.util.Date;
*/ */
@Aspect @Aspect
@Component @Component
@Lazy(value = false)
public class SysLogAspect { public class SysLogAspect {
@Autowired @Autowired

4
user-service/src/main/java/com/mh/user/controller/BuildingController.java

@ -78,14 +78,14 @@ public class BuildingController {
// 删除多 // 删除多
@PostMapping(value="/deletes") @PostMapping(value="/deletes")
public HttpResult delete(@RequestBody List<BuildingEntity> records) { public HttpResult deleteDevices(@RequestBody List<BuildingEntity> records) {
return HttpResult.ok(buildingService.deleteBuilding(records)); return HttpResult.ok(buildingService.deleteBuilding(records));
} }
// 删除单个 // 删除单个
@SysLogger(title="楼栋信息",optDesc = "删除楼栋信息") @SysLogger(title="楼栋信息",optDesc = "删除楼栋信息")
@PostMapping(value="/delete") @PostMapping(value="/delete")
public HttpResult delete(@RequestParam String id ) { public HttpResult deleteDevice(@RequestParam String id ) {
return HttpResult.ok(buildingService.deleteBuilding(id)); return HttpResult.ok(buildingService.deleteBuilding(id));
} }

8
user-service/src/main/java/com/mh/user/controller/DeviceFloorController.java

@ -7,7 +7,6 @@ import com.mh.user.entity.*;
import com.mh.user.model.DeviceModel; import com.mh.user.model.DeviceModel;
import com.mh.user.service.BuildingService; import com.mh.user.service.BuildingService;
import com.mh.user.service.DeviceFloorService; import com.mh.user.service.DeviceFloorService;
import com.mh.user.service.DeviceInstallService;
import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@ -19,12 +18,9 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("floor") @RequestMapping("floor")
@ -87,9 +83,9 @@ public class DeviceFloorController {
} }
// 删除单个 // 删除单个
@SysLogger(title="楼面设备",optDesc = "删除楼面设备信息")
@PostMapping(value="/delete") @PostMapping(value="/delete")
public HttpResult delete(@RequestParam String id ) { @SysLogger(title="楼面设备",optDesc = "删除楼面设备信息")
public HttpResult deleteDevice(@RequestParam String id ) {
return HttpResult.ok(deviceFloorService.deleteDevice(id)); return HttpResult.ok(deviceFloorService.deleteDevice(id));
} }

4
user-service/src/main/java/com/mh/user/controller/DeviceInstallController.java

@ -92,14 +92,14 @@ public class DeviceInstallController {
// 删除多 // 删除多
@PostMapping(value="/deletes") @PostMapping(value="/deletes")
public HttpResult delete(@RequestBody List<DeviceInstallEntity> records) { public HttpResult deleteDevices(@RequestBody List<DeviceInstallEntity> records) {
return HttpResult.ok(deviceInstallService.deleteDevice(records)); return HttpResult.ok(deviceInstallService.deleteDevice(records));
} }
// 删除单个 // 删除单个
@SysLogger(title="基表信息",optDesc = "删除基表信息") @SysLogger(title="基表信息",optDesc = "删除基表信息")
@PostMapping(value="/delete") @PostMapping(value="/delete")
public HttpResult delete(@RequestParam String id ) { public HttpResult deleteDevice(@RequestParam String id ) {
return HttpResult.ok(deviceInstallService.deleteDevice(id)); return HttpResult.ok(deviceInstallService.deleteDevice(id));
} }

6
user-service/src/main/java/com/mh/user/job/DealDataJob.java

@ -50,7 +50,7 @@ public class DealDataJob {
/** /**
* 定时处理汇总数据每15分钟处理一次,十分钟(0 0/10 * * * ?) * 定时处理汇总数据每15分钟处理一次,十分钟(0 0/10 * * * ?)
*/ */
@Scheduled(cron = "0 0/15 * * * ?") // @Scheduled(cron = "0 0/15 * * * ?")
public void ProEnergy() { public void ProEnergy() {
try { try {
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:00:00"); SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
@ -73,7 +73,7 @@ public class DealDataJob {
/** /**
* 采集 * 采集
*/ */
@Scheduled(cron = "35 0/2 * * * ?") // @Scheduled(cron = "35 0/2 * * * ?")
// @Scheduled(cron = "0/10 * * * * ?") 0 0/5 * * * ? // @Scheduled(cron = "0/10 * * * * ?") 0 0/5 * * * ?
// @Scheduled(cron = "0 0/5 * * * ?") //5分钟 // @Scheduled(cron = "0 0/5 * * * ?") //5分钟
public void collect() { public void collect() {
@ -148,7 +148,7 @@ public class DealDataJob {
/** /**
* 定时处理数据每十五分钟处理一次 * 定时处理数据每十五分钟处理一次
*/ */
@Scheduled(cron = "0 0/15 * * * ?") // @Scheduled(cron = "0 0/15 * * * ?")
public void dealData() { public void dealData() {
try { try {
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();

4
user-service/src/main/java/com/mh/user/service/NowDataService.java

@ -1,6 +1,6 @@
package com.mh.user.service; package com.mh.user.service;
import com.mh.common.annotation.SysLogger; import com.mh.user.annotation.SysLogger;
import com.mh.user.entity.NowDataEntity; import com.mh.user.entity.NowDataEntity;
import com.mh.user.entity.PumpMinutesEntity; import com.mh.user.entity.PumpMinutesEntity;
import com.mh.user.entity.WaterLevelEntity; import com.mh.user.entity.WaterLevelEntity;
@ -86,7 +86,7 @@ public interface NowDataService {
void upTempSet2(String buildingId,String tempSet,String pumpID); void upTempSet2(String buildingId,String tempSet,String pumpID);
//查询每天24小时每个热泵温度变化情况 //查询每天24小时每个热泵温度变化情况
@SysLogger @SysLogger(optDesc = "查询每天24小时每个热泵温度变化情况",title = "查询每天24小时每个热泵温度变化情况")
List<WaterTempEntity> queryWaterTemp(String buildingID,String curDate,int page,int limit); List<WaterTempEntity> queryWaterTemp(String buildingID,String curDate,int page,int limit);
int queryWaterTempCount(String buildingID,String curDate); int queryWaterTempCount(String buildingID,String curDate);

1
user-service/src/main/java/com/mh/user/utils/CacheTools.java

@ -3,7 +3,6 @@ package com.mh.user.utils;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import io.micrometer.core.instrument.util.StringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.Objects; import java.util.Objects;

Loading…
Cancel
Save