Browse Source

设备查询BUG

lin 3 years ago
parent
commit
029406da6b

+ 4 - 4
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/DeviceMapper.xml

@@ -545,8 +545,8 @@
       <if test="dto.address != null and dto.address != ''">and rd.address LIKE concat('%',#{dto.address},'%') </if>
       <if test="dto.deviceStatus != null">and rd.device_status = #{dto.deviceStatus}</if>
       <if test="dto.valveStatus != null">and rd.valve_status = #{dto.deviceStatus}</if>
-      <if test="dto.startDate != null"> and rd.last_receive_time <![CDATA[ >= ]]> #{dto.startDate}</if>
-      <if test="dto.endDate != null"> and rd.last_receive_time <![CDATA[ <= ]]> #{dto.endDate}</if>
+      <if test="dto.startDate != null"> and rd.install_date <![CDATA[ >= ]]> #{dto.startDate}</if>
+      <if test="dto.endDate != null"> and rd.install_date <![CDATA[ <= ]]> #{dto.endDate}</if>
       <include refid="permissionCondition"/>
     </where>
     order by rd.create_date desc
@@ -566,8 +566,8 @@
       <if test="dto.address != null and dto.address != ''">and rd.address LIKE concat('%',#{dto.address},'%') </if>
       <if test="dto.deviceStatus != null">and rd.device_status = #{dto.deviceStatus}</if>
       <if test="dto.valveStatus != null">and rd.valve_status = #{dto.deviceStatus}</if>
-      <if test="dto.startDate != null"> and rd.last_receive_time <![CDATA[ >= ]]> #{dto.startDate}</if>
-      <if test="dto.endDate != null"> and rd.last_receive_time <![CDATA[ <= ]]> #{dto.endDate}</if>
+      <if test="dto.startDate != null"> and rd.install_date <![CDATA[ >= ]]> #{dto.startDate}</if>
+      <if test="dto.endDate != null"> and rd.install_date <![CDATA[ <= ]]> #{dto.endDate}</if>
       <include refid="permissionCondition"/>
     </where>
   </select>

+ 7 - 22
zoniot-rmcp/zoniot-rmcp-web/src/main/resources/logback-spring.xml

@@ -8,33 +8,18 @@
 
     <!-- 按照每天生成日志文件 -->
     <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
-            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
+        <encoder>
             <pattern>${FILE_LOG_PATTERN}</pattern>
         </encoder>
-        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
-            <!-- rollover daily -->
-            <fileNamePattern>${LOG_PATH}/${APPLICATION_NAME}-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
-            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
-            <maxFileSize>20MB</maxFileSize>
-            <maxHistory>60</maxHistory>
-            <totalSizeCap>20GB</totalSizeCap>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${LOG_PATH}/${APPLICATION_NAME}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <maxHistory>365</maxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>100MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
         </rollingPolicy>
-
     </appender>
 
-    <springProfile name="dev,test">
-        <logger name="com.zcxk" level="DEBUG"/>
-        <logger name="org.springframework" level="INFO"/>
-        <logger name="org.apache" level="INFO"/>
-    </springProfile>
-
-    <springProfile name="prop">
-        <logger name="com.zcxk" level="DEBUG"/>
-        <logger name="org.springframework" level="INFO"/>
-        <logger name="org.apache" level="INFO"/>
-    </springProfile>
-
     <root level="INFO">
         <appender-ref ref="CONSOLE"/>
         <appender-ref ref="FILE"/>

+ 5 - 0
zoniot-rmcp/zoniot-xxljob-client/src/main/java/com/zcxk/xxljob/service/impl/MeterReadRecordServiceImpl.java

@@ -250,6 +250,11 @@ public class MeterReadRecordServiceImpl implements MeterReadRecordService {
 
     private List<MeterReadRecordDetailDto> findMeterReadRecord(Integer readDate){
         List<AggregationOperation> commonOperations = new ArrayList<>();
+        // 1. 指定查询主文档
+        /*Criteria criteria = new Criteria();
+        criteria.and("status").is(1);
+        MatchOperation match = Aggregation.match(criteria);
+        commonOperations.add(match);*/
         // 2.拆开
         UnwindOperation unwind = Aggregation.unwind("data");
         commonOperations.add(unwind);