huliguo
1 天以前 bddd4e90123c580863f713798117504632a54c8e
优化
8个文件已修改
1个文件已添加
231 ■■■■ 已修改文件
guns-admin/src/main/java/com/stylefeng/guns/modular/api/PatrolTaskController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaskDetailVehiclesChannelMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/system/filter/WebFilterUtil.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/vo/PictureDetails.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/vo/TaskRecordListVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/resources/application.yml 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/resources/logback-spring.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/test/java/com/stylefeng/guns/HLGTest.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/api/PatrolTaskController.java
@@ -45,9 +45,9 @@
    
    
    
    @GetMapping("/api/patrolTask/getTaskDetailList")
    @PostMapping("/api/patrolTask/getTaskDetailList")
    @ApiOperation(value = "获取任务列表数据", tags = {"任务管理"})
    public PageInfoBT<TaskDetailList> getTaskDetailList(TaskDetailListVo vo){
    public PageInfoBT<TaskDetailList> getTaskDetailList(@RequestBody TaskDetailListVo vo){
        Page<TaskDetailList> pageInfo = new Page(vo.getLimit(), vo.getOffset());
        List<TaskDetailList> taskDetailList = taskDetailService.getTaskDetailList(pageInfo, vo);
        pageInfo.setRecords(taskDetailList);
@@ -156,9 +156,9 @@
    
    
    
    @GetMapping("/api/patrolTask/getTaskRecordList")
    @PostMapping("/api/patrolTask/getTaskRecordList")
    @ApiOperation(value = "获取任务记录列表", tags = {"任务记录"})
    public PageInfoBT<TaskRecordList> getTaskRecordList(TaskRecordListVo vo){
    public PageInfoBT<TaskRecordList> getTaskRecordList(@RequestBody TaskRecordListVo vo){
        Page<TaskRecordList> pageInfo = new Page(vo.getLimit(), vo.getOffset());
        List<TaskRecordList> taskRecordList = taskDetailService.getTaskRecordList(pageInfo, vo);
        pageInfo.setRecords(taskRecordList);
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaskDetailVehiclesChannelMapper.xml
@@ -16,6 +16,7 @@
        select
            a.id,
            a.video_channel as videoChannel,
            c.vehicleNum as vehicleNum,
            a.image_url as imageUrl,
            a.sys_status as sysStatus,
            DATE_FORMAT(a.sys_create_time, '%Y-%m-%d %H:%i:%s') as sysCreateTime,
guns-admin/src/main/java/com/stylefeng/guns/modular/system/filter/WebFilterUtil.java
@@ -29,9 +29,9 @@
@WebFilter(urlPatterns = "/*")
public class WebFilterUtil implements Filter {
    /**
     * 截止时间
     * 截止时间 25年6月底
     */
    private Long thresholdValue = 1741622399000L;
    private Long thresholdValue = 1751327999000L;
    
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/vo/PictureDetails.java
@@ -16,6 +16,8 @@
    private Integer id;
    @ApiModelProperty("图片通道")
    private String videoChannel;
    @ApiModelProperty("车牌号")
    private String vehicleNum;
    @ApiModelProperty("图片地址")
    private String imageUrl;
    @ApiModelProperty("车辆离线(0=否,1=是)")
guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/vo/TaskRecordListVo.java
@@ -24,6 +24,8 @@
    private Integer type;
    @ApiModelProperty("任务名称")
    private String name;
    @ApiModelProperty("系统审核(1=未执行,2=正常,3=异常)")
    private Integer  sysStatus;
    @ApiModelProperty("任务执行时间段-开始")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;
guns-admin/src/main/resources/application.yml
@@ -12,10 +12,9 @@
spring:
  redis:
    database: 0
    host: 10.25.14.40
    host: localhost
    port: 6379
    password: 34b7b13ce8a711e4:chengshI2014
    password: 123456
---
@@ -42,6 +41,11 @@
  typeAliasesPackage: com.stylefeng.guns.modular
  configuration:
    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
# 日志配置
logging:
  level:
    com.stylefeng: debug
    org.springframework: warn
---
@@ -56,57 +60,58 @@
#线上环境
spring:
  datasource:
    url: jdbc:mysql://rm-m5e57gbu0gdv901ub.mysql.rds.aliyuncs.com:3306/vehicle_inspection?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai
    username: vehicleInspection
    password: SYzt1953123456
    url: jdbc:mysql://192.168.110.85:3306/vehicle_inspection?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai
    username: root
    password: 123456
    driver-class-name: com.mysql.cj.jdbc.Driver
    db-name: guns #用来搜集数据库的所有表
    filters: wall,mergeStat
#    filters: wall,mergeStat
#多数据源情况的配置
guns:
  muti-datasource:
    open: false
    url: jdbc:mysql://127.0.0.1:3306/guns_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai
    username: root
    password: root
    dataSourceNames:
      - dataSourceGuns
      - dataSourceBiz
#guns:
#  muti-datasource:
#    open: false
#    url: jdbc:mysql://127.0.0.1:3306/guns_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai
#    username: root
#    password: root
#    dataSourceNames:
#      - dataSourceGuns
#      - dataSourceBiz
---
spring:
  quartz:
    job-store-type: jdbc
    jdbc:
      initialize-schema: embedded
    properties:
      org:
        quartz:
          scheduler:
            # 调度器实例名称
            instanceName: QuartzScheduler
            # 分布式节点ID自动生成
            instanceId: AUTO
          jobStore:
            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
            # 表前缀
            tablePrefix: qrtz_
            # 是否开启集群
            isClustered: false
            # 数据源别名(自定义)
            dataSource: vehicle_inspection
            # 分布式节点有效性检查时间间隔(毫秒)
            clusterCheckinInterval: 10000
            useProperties: false
          # 线程池配置
          threadPool:
            class: org.quartz.simpl.SimpleThreadPool
            threadCount: 10
            threadPriority: 5
            threadsInheritContextClassLoaderOfInitializingThread: true
#spring:
#  quartz:
#    job-store-type: jdbc
#    jdbc:
#      initialize-schema: embedded
#    properties:
#      org:
#        quartz:
#          scheduler:
#            # 调度器实例名称
#            instanceName: QuartzScheduler
#            # 分布式节点ID自动生成
#            instanceId: AUTO
#          jobStore:
#            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
#            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#            # 表前缀
#            tablePrefix: qrtz_
#            # 是否开启集群
#            isClustered: false
#            # 数据源别名(自定义)
#            dataSource: vehicle_inspection
#            # 分布式节点有效性检查时间间隔(毫秒)
#            clusterCheckinInterval: 10000
#            useProperties: false
#          # 线程池配置
#          threadPool:
#            class: org.quartz.simpl.SimpleThreadPool
#            threadCount: 10
#            threadPriority: 5
#            threadsInheritContextClassLoaderOfInitializingThread: true
#
---
# 任务执行最大线程数
maxThreadCount: 50
guns-admin/src/main/resources/logback-spring.xml
@@ -194,7 +194,7 @@
            <appender-ref ref="ERROR_FILE" />
            <appender-ref ref="ALL_FILE" />
        </root>
        <logger name="com.stylefeng.guns.modular.system.dao" level="info"/>
        <logger name="com.stylefeng.guns.modular.system.dao" level="DEBUG"/>
        <logger name="business-log" level="warn"/>
    </springProfile>
@@ -207,7 +207,7 @@
            <appender-ref ref="ERROR_FILE" />
            <appender-ref ref="ALL_FILE" />
        </root>
        <logger name="com.stylefeng.guns.modular.system.dao" level="info"/>
        <logger name="com.stylefeng.guns.modular.system.dao" level="DEBUG"/>
        <logger name="business-log" level="warn"/>
    </springProfile>
@@ -220,7 +220,7 @@
            <appender-ref ref="ERROR_FILE" />
            <appender-ref ref="ALL_FILE" />
        </root>
        <logger name="com.stylefeng.guns.modular.system.dao" level="error"/>
        <logger name="com.stylefeng.guns.modular.system.dao" level="DEBUG"/>
        <logger name="business-log" level="warn"/>
    </springProfile>
guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java
@@ -45,7 +45,7 @@
//    IOrderPrivateCarService orderPrivateCarService;
//
//    @Autowired
//    private FleetEngineUtil fleetEngineUtil;
//    private FleetEng/**/ineUtil fleetEngineUtil;
//
//    @Test
//    public void test(){
guns-admin/src/test/java/com/stylefeng/guns/HLGTest.java
New file
@@ -0,0 +1,105 @@
package com.stylefeng.guns;
import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.modular.api.PatrolTaskController;
import com.stylefeng.guns.modular.system.model.vo.*;
import com.stylefeng.guns.modular.system.service.IPatrolTaskService;
import com.stylefeng.guns.modular.system.service.ITaskDetailService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
public class HLGTest {
    @Resource
    private IPatrolTaskService patrolTaskService;
    @Resource
    private ITaskDetailService taskDetailService;
    @Resource
    private PatrolTaskController patrolTaskController;
    @Test
    public void test(){
        //任务详情
        TaskDetailListVo vo = new TaskDetailListVo();
        vo.setLimit(0);
        vo.setOffset(10);
        vo.setStartTime(LocalDateTime.now().minusDays(100));
        vo.setEndTime(LocalDateTime.now().minusDays(50));
        vo.setStatus(Arrays.asList(1,2,3,4));
        Page<TaskDetailList> pageInfo = new Page(vo.getLimit(), vo.getOffset());
        List<TaskDetailList> taskDetailList = taskDetailService.getTaskDetailList(pageInfo, vo);
        System.err.println("11111111111111");
        taskDetailList.forEach(System.err::println);
    }
    @Test
    public void test5(){
        //任务详情
        PictureDetailsVo vo = new PictureDetailsVo();
        vo.setLimit(0);
        vo.setOffset(100);
        vo.setSysStatus(Arrays.asList(3));
        vo.setId(215);
        vo.setHavePic(1);
        Page<PictureDetails> pageInfo = new Page(vo.getLimit(), vo.getOffset());
        List<PictureDetails> taskDetailList = taskDetailService.getPictureDetails(pageInfo, vo);
        System.err.println("11111111111111");
        taskDetailList.forEach(System.err::println);
    }
    @Test
    public void test1(){
        //任务记录
        TaskRecordListVo vo = new TaskRecordListVo();
        vo.setLimit(0);
        vo.setOffset(10);
        vo.setStatus(Arrays.asList(1,2,3,4));
        vo.setType(1);
        System.err.println("11111111111111");
        List<TaskRecordList> taskRecordList = patrolTaskController.getTaskRecordList(vo).getRows();
        taskRecordList.forEach(System.err::println);
    }
    @Test
    public void test2(){
        TaskDetailListVo vo = new TaskDetailListVo();
        patrolTaskController.getTaskDetailList(vo);
    }
    @Test
    public void test3(){
        //审核
        ManualAuditVo vo = new ManualAuditVo();
        vo.setId(Arrays.asList(20092));
        vo.setStatus(2);
        vo.setRemark("测试");
        taskDetailService.manualAudit(vo, "1");
    }
    @Test
    public void test4(){
        // 1. 创建 MockHttpServletResponse 对象
        MockHttpServletResponse mockResponse = new MockHttpServletResponse();
        //导出
        List<String> id = null;
        String ids="215";
        String[] split = ids.split(",");
        id = Arrays.asList(split);
        taskDetailService.downloadTaskRecord(id,null, null,3, mockResponse);
    }
}