Преглед изворни кода

es巡检查询条件修改

xlr пре 1 недеља
родитељ
комит
c20a87fff0

+ 0 - 154
tofly-zhongmou-gas/.idea/workspace.xml

@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="AutoImportSettings">
-    <option name="autoReloadType" value="SELECTIVE" />
-  </component>
-  <component name="ChangeListManager">
-    <list default="true" id="a3c354df-9411-456c-badb-f3e22b208c6d" name="更改" comment="">
-      <change beforePath="$PROJECT_DIR$/../tofly-dlrq-gas/service/zmourq/src/main/java/com/tofly/zmrq/mapper/StatisticsScadaMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/../tofly-dlrq-gas/service/zmourq/src/main/java/com/tofly/zmrq/mapper/StatisticsScadaMapper.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-    </list>
-    <option name="SHOW_DIALOG" value="false" />
-    <option name="HIGHLIGHT_CONFLICTS" value="true" />
-    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
-    <option name="LAST_RESOLUTION" value="IGNORE" />
-  </component>
-  <component name="Git.Settings">
-    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
-  </component>
-  <component name="MarkdownSettingsMigration">
-    <option name="stateVersion" value="1" />
-  </component>
-  <component name="MavenImportPreferences">
-    <option name="generalSettings">
-      <MavenGeneralSettings>
-        <option name="localRepository" value="D:\work\java\project\gasNew\repgas" />
-        <option name="mavenHome" value="$PROJECT_DIR$/../../../../config/apache-maven-3.6.0" />
-        <option name="userSettingsFile" value="D:\work\java\config\apache-maven-3.6.0\conf\settings.xml" />
-      </MavenGeneralSettings>
-    </option>
-  </component>
-  <component name="ProjectColorInfo">{
-  &quot;associatedIndex&quot;: 5
-}</component>
-  <component name="ProjectId" id="2i5aDwWN83kDmGYRvqgZAOdaoB3" />
-  <component name="ProjectViewState">
-    <option name="hideEmptyMiddlePackages" value="true" />
-    <option name="showLibraryContents" value="true" />
-  </component>
-  <component name="PropertiesComponent">{
-  &quot;keyToString&quot;: {
-    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
-    &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
-    &quot;last_opened_file_path&quot;: &quot;D:/work/java/project/gasNew/tofly-gas/tofly-zhongming-gas&quot;,
-    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
-    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
-    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
-    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
-    &quot;project.structure.last.edited&quot;: &quot;项目&quot;,
-    &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
-    &quot;project.structure.side.proportion&quot;: &quot;0.0&quot;,
-    &quot;settings.editor.selected.configurable&quot;: &quot;MavenSettings&quot;,
-    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
-  }
-}</component>
-  <component name="RunManager" selected="Spring Boot.AuthApplication">
-    <configuration name="AuthApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-auth" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.auth.AuthApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="BaseApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="base-service" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.base.BaseApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="ConfigApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-config" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.config.ConfigApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="EurekaServerApp" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-eureka" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.eureka.EurekaServerApp" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="GetWayAppliction" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-getway" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.getway.GetWayAppliction" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="MonitorApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="monitor-center" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.monitor.MonitorApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="ZmrqApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-zmourq" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.zmrq.ZmrqApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="ZmrqCarApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-zmourqcar" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.zmrqcar.ZmrqCarApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="ZmrqGpsApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-zmourqgps" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.zmrqGps.ZmrqGpsApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="ZmrqScadaApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-zmourqscada" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.zmrqScada.ZmrqScadaApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-    <configuration name="ZmrqScheduleApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
-      <module name="tofly-zmourqchedule" />
-      <option name="SPRING_BOOT_MAIN_CLASS" value="com.tofly.zmrqSchedule.ZmrqScheduleApplication" />
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
-  </component>
-  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
-  <component name="TaskManager">
-    <task active="true" id="Default" summary="默认任务">
-      <changelist id="a3c354df-9411-456c-badb-f3e22b208c6d" name="更改" comment="" />
-      <created>1718782775894</created>
-      <option name="number" value="Default" />
-      <option name="presentableId" value="Default" />
-      <updated>1718782775894</updated>
-      <workItem from="1718782777157" duration="2023000" />
-      <workItem from="1718786635326" duration="607000" />
-      <workItem from="1719383336428" duration="311000" />
-      <workItem from="1723431520448" duration="851000" />
-      <workItem from="1723432384075" duration="1655000" />
-    </task>
-    <servers />
-  </component>
-  <component name="TypeScriptGeneratedFilesManager">
-    <option name="version" value="3" />
-  </component>
-</project>

+ 3 - 0
tofly-zhongmou-gas/service/zmourqGps/src/main/java/com/tofly/zmrqGps/entity/EsQuery.java

@@ -32,4 +32,7 @@ public class EsQuery {
 
     @ApiModelProperty(value = "公司ID")
     private Long companyId;
+
+    @ApiModelProperty(value = "是否有效")
+    private Integer isvalid;
 }

+ 21 - 1
tofly-zhongmou-gas/service/zmourqGps/src/main/java/com/tofly/zmrqGps/util/EsQueryUtil.java

@@ -33,6 +33,12 @@ public class EsQueryUtil {
             queryBuilder.minimumShouldMatch("100%");
             qb.filter(queryBuilder);
         }
+        if (esQuery.getIsvalid() != null) {
+            MatchQueryBuilder queryBuilder = QueryBuilders.matchQuery("isvalid", esQuery.getIsvalid());
+            queryBuilder.minimumShouldMatch("100%");
+            qb.filter(queryBuilder);
+        }
+
         QueryBuilder[] queryBuilders = new QueryBuilder[2];
         queryBuilders[0] = rangeQueryBuilder;
         queryBuilders[1] = qb;
@@ -41,9 +47,18 @@ public class EsQueryUtil {
         orderItem.setColumn("gpstime");
         orderItem.setAsc(false);
         if (esQuery.getIsAsc() != null){
-            orderItem.setAsc(true);
+            orderItem.setAsc(esQuery.getIsAsc());
         }
         page.addOrder(orderItem);
+
+        OrderItem orderItem1 = new OrderItem();
+        orderItem1.setColumn("checkTime");
+        orderItem1.setAsc(false);
+        if (esQuery.getIsAsc() != null){
+            orderItem1.setAsc(esQuery.getIsAsc());
+        }
+        page.addOrder(orderItem1);
+
         return queryBuilders;
     }
 
@@ -66,6 +81,11 @@ public class EsQueryUtil {
             queryBuilder.minimumShouldMatch("100%");
             qb.filter(queryBuilder);
         }
+        if (esQuery.getIsvalid() != null) {
+            MatchQueryBuilder queryBuilder = QueryBuilders.matchQuery("isvalid", esQuery.getIsvalid());
+            queryBuilder.minimumShouldMatch("100%");
+            qb.filter(queryBuilder);
+        }
         QueryBuilder[] queryBuilders = new QueryBuilder[2];
         queryBuilders[0] = rangeQueryBuilder;
         queryBuilders[1] = qb;