yuanhao 2 jaren geleden
bovenliggende
commit
e0440d9325

+ 0 - 6
in-client-qn-ui/src/views/login/index.vue

@@ -1,11 +1,5 @@
 <template>
   <div class="login-container">
-    <el-alert
-      title="beautiful boys and girls欢迎加入vue-admin-beautifulQQ群:972435319"
-      type="success"
-      :closable="false"
-      style="position: fixed"
-    ></el-alert>
     <el-row>
       <el-col :xs="24" :sm="24" :md="12" :lg="16" :xl="16">
         <div style="color: transparent">占位符</div>

+ 0 - 43
in-client-qn/src/main/java/com/jiayue/insu/inclientqn/entity/InsuLog.java

@@ -1,43 +0,0 @@
-package com.jiayue.insu.inclientqn.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-/**
- * TODO
- *
- * @author xsl
- * @version 3.0
- */
-@Data
-@TableName("insu_log")
-public class InsuLog implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键ID
-     */
-    @TableId(type = IdType.AUTO)
-    private String id;
-    /**
-     * 类型
-     */
-    private String type;
-    /**
-     * 状态
-     */
-    private String status;
-    /**
-     * 生成时间
-     */
-    private Timestamp genTime;
-    /**
-     * 失败原因
-     */
-    private String failCause;
-}

+ 6 - 1
in-client-qn/src/main/java/com/jiayue/insu/inclientqn/job/ComPermissonJob.java

@@ -7,7 +7,12 @@ import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
-
+/**
+ * @description:  请求一体化 交互权限
+ * @author: yuanhao
+ * @createDate: 2022/6/17
+ * @version: 1.0
+ */
 public class ComPermissonJob implements Job {
 
     @Autowired

+ 23 - 2
in-client-qn/src/main/java/com/jiayue/insu/inclientqn/job/CorrforeDataJob.java

@@ -1,24 +1,45 @@
 package com.jiayue.insu.inclientqn.job;
 
+import cn.hutool.core.date.LocalDateTimeUtil;
+import com.jiayue.insu.inclientqn.constant.CommonStant;
+import com.jiayue.insu.inclientqn.entity.Record;
 import com.jiayue.insu.inclientqn.entity.Station;
+import com.jiayue.insu.inclientqn.inenum.StatusEnum;
 import com.jiayue.insu.inclientqn.service.CorrforeService;
 
+import com.jiayue.insu.inclientqn.service.RecordService;
 import com.jiayue.insu.inclientqn.service.StationService;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.time.LocalDateTime;
+/**
+ * @description:  请求一体化 修正数据
+ * @author: yuanhao
+ * @createDate: 2022/6/17
+ * @version: 1.0
+ */
 public class CorrforeDataJob implements Job {
     @Autowired
     private CorrforeService corrforeService;
     @Autowired
     private StationService stationService;
+    @Autowired
+    private RecordService recordService;
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        //查询是否有今天成功记录 (为提高稳定性,该定时任务采取在规定时间段内 重复循环执行的定时策略,故:需要查询是否存在成功记录)
+        Record successRecord = recordService.findTimeAndTypeAndState(
+                LocalDateTimeUtil.beginOfDay(LocalDateTime.now()),
+                CommonStant.RECORD_TYPE_PULL_CORRECT,
+                StatusEnum.SUCCESS.getCode());
 
-        Station station = stationService.findThis();
+        if(successRecord == null) {
+            Station station = stationService.findThis();
+            corrforeService.downLoadCorrforeData(station);
+        }
 
-        corrforeService.downLoadCorrforeData(station);
     }
 }

+ 24 - 2
in-client-qn/src/main/java/com/jiayue/insu/inclientqn/job/CorrforeFileJob.java

@@ -1,23 +1,45 @@
 package com.jiayue.insu.inclientqn.job;
 
+import cn.hutool.core.date.LocalDateTimeUtil;
+import com.jiayue.insu.inclientqn.constant.CommonStant;
+import com.jiayue.insu.inclientqn.entity.Record;
 import com.jiayue.insu.inclientqn.entity.Station;
+import com.jiayue.insu.inclientqn.inenum.StatusEnum;
 import com.jiayue.insu.inclientqn.service.CorrforeService;
+import com.jiayue.insu.inclientqn.service.RecordService;
 import com.jiayue.insu.inclientqn.service.StationService;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.time.LocalDateTime;
+/**
+ * @description:  请求嘉越云修正数据
+ * @author: yuanhao
+ * @createDate: 2022/6/17
+ * @version: 1.0
+ */
 public class CorrforeFileJob implements Job {
     @Autowired
     private CorrforeService corrforeService;
     @Autowired
     private StationService stationService;
+    @Autowired
+    private RecordService recordService;
+
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        //查询是否有今天成功记录 (为提高稳定性,该定时任务采取在规定时间段内 重复循环执行的定时策略,故:需要查询是否存在成功记录)
+        Record successRecord = recordService.findTimeAndTypeAndState(
+                LocalDateTimeUtil.beginOfDay(LocalDateTime.now()),
+                CommonStant.RECORD_TYPE_PULL_CORRECT_JY,
+                StatusEnum.SUCCESS.getCode());
 
-        Station station = stationService.findThis();
+        if (successRecord == null) {
+            Station station = stationService.findThis();
 
-        corrforeService.downLoadCorrforeFile(station);
+            corrforeService.downLoadCorrforeFile(station);
+        }
     }
 }

+ 0 - 16
in-client-qn/src/main/java/com/jiayue/insu/inclientqn/mapper/InsuLogMapper.java

@@ -1,16 +0,0 @@
-package com.jiayue.insu.inclientqn.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.jiayue.insu.inclientqn.entity.InsuLog;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 日志mapper
- *
- * @author xsl
- * @date 2022-04-12 19:33:02
- */
-@Mapper
-public interface InsuLogMapper extends BaseMapper<InsuLog> {
-
-}

+ 0 - 21
in-client-qn/src/main/java/com/jiayue/insu/inclientqn/service/InsuLogService.java

@@ -1,21 +0,0 @@
-package com.jiayue.insu.inclientqn.service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.jiayue.insu.inclientqn.entity.InsuLog;
-import com.jiayue.insu.inclientqn.mapper.InsuLogMapper;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @description: 日志服务类
- * @author: xsl
- * @createDate: 2022/6/1
- * @version: 1.0
- */
-@Service
-@Slf4j
-@RequiredArgsConstructor
-public class InsuLogService  extends ServiceImpl<InsuLogMapper, InsuLog> {
-
-}

+ 105 - 0
in-client-qn/src/main/resources/logback.xml

@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration scan="false" scanPeriod="60 seconds" debug="false"><!-- 这个是根配置文件,一定要有的
+                            scan:
+                                是当配置文件被修改后会被重新加载
+                            scanPeriod:
+                                设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,
+                                默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
+                            debug:
+                                当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。
+                                默认值为false。
+                             -->
+  <!-- 日志存放路径
+      下面的标签可以自己定义
+      name:相当于Map的key
+      value:就是map的value
+      ${catalina.base}是tomcat的当前路径
+      /logs:就是tomcat下的日志路径,
+      /ehrlog:如果没有目录会默认创建
+  -->
+  <property name="logbase" value="./logs/"/>
+  <!-- 时间戳:这个时间戳可以作为每日日志的名称 -->
+  <timestamp key="bySecond" datePattern="yyyy-MM-dd"/>
+  <!-- appender:
+      name相当于一个名称
+      class:确定要加载哪个类
+      encoder:一定要加 encoder ,
+      默认配置为PatternLayoutEncoder
+      patter:必填
+      ConsoleAppender:也明白是什么意思,就是输出在控制台上-->
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+      <charset>UTF-8</charset>
+    </encoder>
+  </appender>
+  <!-- 把日志存储
+      encoding:日志的编码
+      file:指定当前生成的日志文件名称
+      rollingPolicy:滚动策略
+      FileNamePattern:移动文件最后的名称,跟file标签结合使用,
+      比如file里面的内容是  1.txt
+      那么,FileNamePattern里面写的是2.txt,那么最后文件名就为2.txt
+      如果最后结尾是gz或者zip,那么,就会自动打成压缩包
+      -->
+  <appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <!-- 编码 -->
+    <!--<Encoding>UTF-8</Encoding>-->
+    <!-- 按照时间来 -->
+    <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+      <!--日志文件输出的文件名-->
+      <FileNamePattern>${logbase}/%d{yyyy-MM-dd}/in-client.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+      <!--日志文件保留天数-->
+      <MaxHistory>180</MaxHistory>
+      <maxFileSize>10MB</maxFileSize>
+      <totalSizeCap>1024MB</totalSizeCap>
+      <cleanHistoryOnStart>true</cleanHistoryOnStart>
+    </rollingPolicy>
+    <!-- 布局 -->
+    <encoder>
+      <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
+      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+      <charset>UTF-8</charset>
+    </encoder>
+    <append>false</append>
+  </appender>
+
+
+  <!-- <appender name="TunnelLogFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+     &lt;!&ndash; 编码 &ndash;&gt;
+     &lt;!&ndash;<Encoding>UTF-8</Encoding>&ndash;&gt;
+     &lt;!&ndash; 按照时间来 &ndash;&gt;
+     <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+       &lt;!&ndash;日志文件输出的文件名&ndash;&gt;
+       <FileNamePattern>D://testlog//#TunnelName#.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+       &lt;!&ndash;日志文件保留天数&ndash;&gt;
+       <MaxHistory>180</MaxHistory>
+       <maxFileSize>10MB</maxFileSize>
+       <totalSizeCap>1024MB</totalSizeCap>
+       <cleanHistoryOnStart>true</cleanHistoryOnStart>
+     </rollingPolicy>
+     &lt;!&ndash; 布局 &ndash;&gt;
+     <encoder>
+       &lt;!&ndash;格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符&ndash;&gt;
+       <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+       <charset>UTF-8</charset>
+     </encoder>
+     <append>false</append>
+   </appender>
+
+   <logger name="TunnelLogger" level="debug" additivity="true">
+     <appender-ref ref="TunnelLogFile"/>
+   </logger>-->
+
+  <logger name="com.jiayue" level="info" additivity="true">
+    <appender-ref ref="logFile"/>
+  </logger>
+  <logger name="org" level="info" additivity="true">
+    <appender-ref ref="logFile"/>
+  </logger>
+
+  <root level="info">
+    <appender-ref ref="STDOUT"/>
+  </root>
+</configuration>

+ 0 - 6
in-cloud-ui/src/views/login/index.vue

@@ -1,11 +1,5 @@
 <template>
   <div class="login-container">
-    <el-alert
-      title="beautiful boys and girls欢迎加入vue-admin-beautifulQQ群:972435319"
-      type="success"
-      :closable="false"
-      style="position: fixed"
-    ></el-alert>
     <el-row>
       <el-col :xs="24" :sm="24" :md="12" :lg="16" :xl="16">
         <div style="color: transparent">占位符</div>