Browse Source

分析报告

zyg 1 year ago
parent
commit
784939c755

+ 2 - 2
hz-admin/src/main/resources/application-prod.yml

@@ -151,8 +151,8 @@ mybatis-plus:
   global-config:
     banner: false
   configuration:
-#    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 
 
 # PageHelper分页插件

+ 3 - 0
hz-business/src/main/java/com/hz/business/dto/AnalysisReportAddDto.java

@@ -39,6 +39,9 @@ public class AnalysisReportAddDto implements Serializable {
     @ApiModelProperty(value = "电池编号")
     private String sn;
 
+    @ApiModelProperty(value = "vin")
+    private String vin;
+
     @ApiModelProperty(value = "数据集id")
     private Long dataSetId;
 

+ 8 - 1
hz-business/src/main/java/com/hz/business/service/impl/AnalysisReportServiceImpl.java

@@ -560,8 +560,12 @@ public class AnalysisReportServiceImpl extends ServiceImpl<AnalysisReportMapper,
         String[] snss = null;
         if(StringUtils.isNotBlank(dto.getSn())){
             snss = dto.getSn().split(",");
+        }else{
+            snss = dto.getVin().split(",");
+            dto.setSn(dto.getVin());
         }
         HashSet<String> newSns = new HashSet<>();
+        HashSet<String> newVins = new HashSet<>();
         if(snss!=null){
             if(snss.length>1){
                 return null;
@@ -575,11 +579,13 @@ public class AnalysisReportServiceImpl extends ServiceImpl<AnalysisReportMapper,
                     if(one==null){
                         return null;
                     }else{
-                        newSns.add(one.getVin());
+                        newSns.add(one.getSn());
+                        newVins.add(one.getVin());
                     }
                 }
             }
             dto.setSn(newSns.toString().replace("[","").replace("]",""));
+            dto.setVin(newVins.toString().replace("[","").replace("]",""));
         }
         AnalysisReportResultVo vo = new AnalysisReportResultVo();
         AnalysisReport analysisReport = new AnalysisReport();
@@ -660,6 +666,7 @@ public class AnalysisReportServiceImpl extends ServiceImpl<AnalysisReportMapper,
             if (analysisReport.getCustomType() == 0) {
                 vo.setCustomType(0);
                 vo.setSn(analysisReport.getSn());
+                vo.setVin(analysisReport.getVin());
                 vo.setStartTime(analysisReport.getStartTime());
                 vo.setEndTime(analysisReport.getEndTime());
                 //0-电池

+ 9 - 5
hz-business/src/test/java/com/hz/TestLindorm.java

@@ -2,8 +2,10 @@ package com.hz;
 
 import com.hz.business.util.LindormUtil;
 import com.hz.business.util.PhoenixUtils;
+import com.hz.common.utils.ResultSetToJson;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
+import org.springframework.util.CollectionUtils;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -11,6 +13,8 @@ import java.sql.Statement;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 @Slf4j
 public class TestLindorm {
@@ -25,11 +29,11 @@ public class TestLindorm {
         try {
             Connection conn = PhoenixUtils.getConnection();
             Statement sta = conn.createStatement();
-            String sql = "select Time,CellVoltage,Info from vehicle_analysis.ods_signal_base where  SnKey<='1959277593_09SPE010DM0111C5S0000174_9223370353984375807' and  SnKey>='1959277593_09SPE010DM0111C5S0000174_9223370351305976807' order by SnKey desc  limit 10000";
-            ResultSet rs = sta.executeQuery(sql.toUpperCase());
-            while (rs.next()) {
-                System.out.println(rs.getString("SN"));
-                System.out.println(rs.getString("TIME"));
+            String sql = "select Time,Info,PackVoltage from vehicle_analysis.ods_signal_base where  SnKey<='2016423021_04QPE1201H951JC950000025_9223370351305975807' and  SnKey>='2016423021_04QPE1201H951JC950000025_9223370351046776807' order by SnKey desc  limit 10000 ";
+            ResultSet rs = sta.executeQuery(sql);
+            List<Map<String, Object>> mapList = ResultSetToJson.toListMap(rs, false);
+            if (!CollectionUtils.isEmpty(mapList)) {
+                System.out.println(rs.getString("PackVoltage"));
             }
             conn.close();
             sta.close();