hfxc226 2 жил өмнө
parent
commit
9e04f230a2

+ 1 - 0
platform-common/src/main/java/com/platform/common/util/DateUtils.java

@@ -22,6 +22,7 @@ import java.util.*;
 @UtilityClass
 public class DateUtils {
     public final static String PATTERN_YMD_HMS = "yyyy-MM-dd HH:mm:ss";
+    public final static String PATTERN_HMS = "HH:mm:ss";
     public final static String PATTERN_YM = "yyyy-MM";
     public final static String PATTERN_YMD = "yyyy-MM-dd";
     public final static String PATTERN_YMD_DOT = "yyyy.MM.dd";

+ 1 - 1
platform-opc/src/main/java/com/platform/opc/servie/OpcTaskService.java

@@ -161,7 +161,7 @@ public class OpcTaskService {
                 remoteOpcLog.setDay(localDateTime.getDayOfMonth());
                 // remoteOpcLog.setHour(localDateTime.getHour());
                 // remoteOpcLog.setMinute(localDateTime.getMinute());
-                remoteOpcLog.setRemark(result.getTime() + "," + result.getValue() + ";");
+                remoteOpcLog.setRemark(localDateTime.getHour() + ":" + localDateTime.getMinute() + ":" + localDateTime.getSecond() + ":" + "," + result.getValue() + ";");
                 remoteOpcLogList.add(remoteOpcLog);
                 //log.info("id: " + result.getId() + ", value: " + result.getValue() + ", time: " + result.getTime());
             }

+ 1 - 1
platform-rest/src/main/resources/application-dev.yml

@@ -34,7 +34,7 @@ spring:
     password:
     port: 6379
     host: localhost
-    database: 11
+    database: 1
   servlet:
     multipart:
       maxFileSize: "100MB"

+ 1 - 1
platform-rest/src/main/resources/application-test.yml

@@ -19,7 +19,7 @@ spring:
     password:
     port: 6379
     host: localhost
-    database: 4
+    database: 1
   servlet:
     multipart:
       maxFileSize: "100MB"

+ 5 - 5
platform-service/src/main/java/com/platform/service/remote/impl/RemoteOpcLogServiceImpl.java

@@ -79,7 +79,7 @@ public class RemoteOpcLogServiceImpl extends BaseServiceImpl<RemoteOpcLogMapper,
     public List<RemoteOpcLogHistoryVO> selectListHistory(RemoteOpcLogDTO remoteOpcLogDTO) {
         List<RemoteOpcLogHistoryVO> voList = new ArrayList<>();
         LocalDateTime createdTimeEnd = remoteOpcLogDTO.getCreatedTimeEnd();
-        String timeA = DateUtils.dateToString(createdTimeEnd);
+        String timeA = DateUtils.dateToString(createdTimeEnd, DateUtils.PATTERN_HMS);
         int year = createdTimeEnd.getYear();
         int month = createdTimeEnd.getMonthValue();
         int day = createdTimeEnd.getDayOfMonth();
@@ -95,16 +95,16 @@ public class RemoteOpcLogServiceImpl extends BaseServiceImpl<RemoteOpcLogMapper,
             String timeB = null;
             if (remoteOpcLogDTO.getSearchType() == 1) {// 1小时
                 LocalDateTime createdTimeStart = createdTimeEnd.plusHours(-1);
-                timeB = DateUtils.dateToString(createdTimeStart);
+                timeB = DateUtils.dateToString(createdTimeStart, DateUtils.PATTERN_HMS);
             } else if (remoteOpcLogDTO.getSearchType() == 2) {// 2小时
                 LocalDateTime createdTimeStart = createdTimeEnd.plusHours(-2);
-                timeB = DateUtils.dateToString(createdTimeStart);
+                timeB = DateUtils.dateToString(createdTimeStart, DateUtils.PATTERN_HMS);
             } else if (remoteOpcLogDTO.getSearchType() == 3) {// 3小时
                 LocalDateTime createdTimeStart = createdTimeEnd.plusHours(-3);
-                timeB = DateUtils.dateToString(createdTimeStart);
+                timeB = DateUtils.dateToString(createdTimeStart, DateUtils.PATTERN_HMS);
             } else {// 1小时 默认
                 LocalDateTime createdTimeStart = createdTimeEnd.plusHours(-1);
-                timeB = DateUtils.dateToString(createdTimeStart);
+                timeB = DateUtils.dateToString(createdTimeStart, DateUtils.PATTERN_HMS);
             }
             RemoteOpcLogVO vo = remoteOpcLogList.get(0);
             String result = vo.getRemark();