Ver código fonte

执行日志导出接口

459242451@qq.com 3 anos atrás
pai
commit
7013bb8042

+ 276 - 276
ruoyi-admin/nacos/yjzh-sq.yaml

@@ -1,82 +1,82 @@
 # 项目相关配置
 ruoyi:
-  # 版本
-  version: ${ruoyi-vue-plus.version}
-  # 版权年份
-  copyrightYear: 2021
-  # 实例演示开关
-  demoEnabled: false
-  # 获取ip地址开关
-  addressEnabled: true
+    # 版本
+    version: ${ruoyi-vue-plus.version}
+    # 版权年份
+    copyrightYear: 2021
+    # 实例演示开关
+    demoEnabled: false
+    # 获取ip地址开关
+    addressEnabled: true
 
 # Spring配置
 spring:
-  application:
-    name: ${ruoyi.name}
-  # 资源信息
-  messages:
-    # 国际化资源文件路径
-    basename: i18n/messages
-#  profiles:
-#    active: dev
-  # 文件上传
-  servlet:
-    multipart:
-      # 单个文件大小
-      max-file-size: 10MB
-      # 设置总上传的文件大小
-      max-request-size: 20MB
-  # 服务模块
-  devtools:
-    restart:
-      # 热部署开关
-      enabled: true
-  # 与vue整合部署使用
-  thymeleaf:
-    # 将系统模板放置到最前面 否则会与 springboot-admin 页面冲突
-    template-resolver-order: 1
-  jackson:
-    # 日期格式化
-    date-format: yyyy-MM-dd HH:mm:ss
-    serialization:
-      # 格式化输出
-      indent_output: false
-      # 忽略无法转换的对象
-      fail_on_empty_beans: false
-    deserialization:
-      # 允许对象忽略json中不存在的属性
-      fail_on_unknown_properties: false
+    application:
+        name: ${ruoyi.name}
+    # 资源信息
+    messages:
+        # 国际化资源文件路径
+        basename: i18n/messages
+    #  profiles:
+    #    active: dev
+    # 文件上传
+    servlet:
+        multipart:
+            # 单个文件大小
+            max-file-size: 10MB
+            # 设置总上传的文件大小
+            max-request-size: 20MB
+    # 服务模块
+    devtools:
+        restart:
+            # 热部署开关
+            enabled: true
+    # 与vue整合部署使用
+    thymeleaf:
+        # 将系统模板放置到最前面 否则会与 springboot-admin 页面冲突
+        template-resolver-order: 1
+    jackson:
+        # 日期格式化
+        date-format: yyyy-MM-dd HH:mm:ss
+        serialization:
+            # 格式化输出
+            indent_output: false
+            # 忽略无法转换的对象
+            fail_on_empty_beans: false
+        deserialization:
+            # 允许对象忽略json中不存在的属性
+            fail_on_unknown_properties: false
 
 captcha:
-  # 页面 <参数设置> 可开启关闭 验证码校验
-  # 验证码类型 math 数组计算 char 字符验证
-  type: MATH
-  # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
-  category: CIRCLE
-  # 数字验证码位数
-  numberLength: 1
-  # 字符验证码长度
-  charLength: 4
+    # 页面 <参数设置> 可开启关闭 验证码校验
+    # 验证码类型 math 数组计算 char 字符验证
+    type: MATH
+    # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
+    category: CIRCLE
+    # 数字验证码位数
+    numberLength: 1
+    # 字符验证码长度
+    charLength: 4
 
 # 开发环境配置
 server:
-  servlet:
-    # 应用的访问路径
-    context-path: /api
-  # undertow 配置
-  undertow:
-    # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
-    max-http-post-size: -1
-    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
-    # 每块buffer的空间大小,越小的空间被利用越充分
-    buffer-size: 512
-    # 是否分配的直接内存
-    direct-buffers: true
-    threads:
-      # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
-      io: 8
-      # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
-      worker: 256
+    servlet:
+        # 应用的访问路径
+        context-path: /api
+    # undertow 配置
+    undertow:
+        # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
+        max-http-post-size: -1
+        # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
+        # 每块buffer的空间大小,越小的空间被利用越充分
+        buffer-size: 512
+        # 是否分配的直接内存
+        direct-buffers: true
+        threads:
+            # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
+            io: 8
+            # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
+            worker: 256
 #  # tomcat 配置
 #  tomcat:
 #    # tomcat的URI编码
@@ -88,244 +88,244 @@ server:
 
 # 日志配置
 logging:
-  level:
-#    com.ruoyi: @logging.level@
-    com.ruoyi: debug
-    org.springframework: warn
-  config: classpath:logback.xml
+    level:
+        #    com.ruoyi: @logging.level@
+        com.ruoyi: debug
+        org.springframework: warn
+    config: classpath:logback.xml
 
 # token配置
 token:
-  # 令牌自定义标识
-  header: Authorization
-  # 令牌密钥
-  secret: abcdefghijklmnopqrstuvwxyz
-  # 令牌有效期(默认120分钟)
-  expireTime: 120
+    # 令牌自定义标识
+    header: Authorization
+    # 令牌密钥
+    secret: abcdefghijklmnopqrstuvwxyz
+    # 令牌有效期(默认120分钟)
+    expireTime: 120
 
 # 重复提交
 repeat-submit:
-  # 全局间隔时间(毫秒)
-  intervalTime: 1000
+    # 全局间隔时间(毫秒)
+    intervalTime: 1000
 
 # MyBatisPlus配置
 # https://baomidou.com/config/
 mybatis-plus:
-  # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
-  # 例如 com.**.**.mapper
-  mapperPackage: com.ruoyi.**.mapper
-  # 对应的 XML 文件位置
-  mapperLocations: classpath*:mapper/**/*Mapper.xml
-  # 实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.ruoyi.**.domain
-  # 针对 typeAliasesPackage,如果配置了该属性,则仅仅会扫描路径下以该类作为父类的域对象
-  #typeAliasesSuperType: Class<?>
-  # 如果配置了该属性,SqlSessionFactoryBean 会把该包下面的类注册为对应的 TypeHandler
-  #typeHandlersPackage: null
-  # 如果配置了该属性,会将路径下的枚举类进行注入,让实体类字段能够简单快捷的使用枚举属性
-  #typeEnumsPackage: null
-  # 启动时是否检查 MyBatis XML 文件的存在,默认不检查
-  checkConfigLocation: false
-  # 通过该属性可指定 MyBatis 的执行器,MyBatis 的执行器总共有三种:
-  # SIMPLE:该执行器类型不做特殊的事情,为每个语句的执行创建一个新的预处理语句(PreparedStatement)
-  # REUSE:该执行器类型会复用预处理语句(PreparedStatement)
-  # BATCH:该执行器类型会批量执行所有的更新语句
-  executorType: SIMPLE
-  configuration:
-    # 自动驼峰命名规则(camel case)映射
-    # 如果您的数据库命名符合规则无需使用 @TableField 注解指定数据库字段名
-    mapUnderscoreToCamelCase: true
-    # 默认枚举处理类,如果配置了该属性,枚举将统一使用指定处理器进行处理
-    # org.apache.ibatis.type.EnumTypeHandler : 存储枚举的名称
-    # org.apache.ibatis.type.EnumOrdinalTypeHandler : 存储枚举的索引
-    # com.baomidou.mybatisplus.extension.handlers.MybatisEnumTypeHandler : 枚举类需要实现IEnum接口或字段标记@EnumValue注解.
-    defaultEnumTypeHandler: org.apache.ibatis.type.EnumTypeHandler
-    # 当设置为 true 的时候,懒加载的对象可能被任何懒属性全部加载,否则,每个属性都按需加载。需要和 lazyLoadingEnabled 一起使用。
-    aggressiveLazyLoading: true
-    # MyBatis 自动映射策略
-    # NONE:不启用自动映射
-    # PARTIAL:只对非嵌套的 resultMap 进行自动映射
-    # FULL:对所有的 resultMap 都进行自动映射
-    autoMappingBehavior: PARTIAL
-    # MyBatis 自动映射时未知列或未知属性处理策
-    # NONE:不做任何处理 (默认值)
-    # WARNING:以日志的形式打印相关警告信息
-    # FAILING:当作映射失败处理,并抛出异常和详细信息
-    autoMappingUnknownColumnBehavior: NONE
-    # Mybatis一级缓存,默认为 SESSION
-    # SESSION session级别缓存,同一个session相同查询语句不会再次查询数据库
-    # STATEMENT 关闭一级缓存
-    localCacheScope: SESSION
-    # 开启Mybatis二级缓存,默认为 true
-    cacheEnabled: false
-    # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
-    # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
-    # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
-    logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
-  global-config:
-    # 是否打印 Logo banner
-    banner: false
-    # 是否初始化 SqlRunner
-    enableSqlRunner: false
-    dbConfig:
-      # 主键类型
-      # AUTO 数据库ID自增
-      # NONE 空
-      # INPUT 用户输入ID
-      # ASSIGN_ID 全局唯一ID
-      # ASSIGN_UUID 全局唯一ID UUID
-      idType: ASSIGN_ID
-      # 表名前缀
-      tablePrefix: null
-      # 字段 format,例: %s,(对主键无效)
-      columnFormat: null
-      # 表名是否使用驼峰转下划线命名,只对表名生效
-      tableUnderline: true
-      # 大写命名,对表名和字段名均生效
-      capitalMode: false
-      # 全局的entity的逻辑删除字段属性名
-      logicDeleteField: null
-      # 逻辑已删除值
-      logicDeleteValue: 1
-      # 逻辑未删除值
-      logicNotDeleteValue: 0
-      # 字段验证策略之 insert,在 insert 的时候的字段验证策略
-      # IGNORED 忽略判断
-      # NOT_NULL 非NULL判断
-      # NOT_EMPTY 非空判断(只对字符串类型字段,其他类型字段依然为非NULL判断)
-      # DEFAULT 默认的,一般只用于注解里
-      # NEVER 不加入 SQL
-      insertStrategy: NOT_NULL
-      # 字段验证策略之 update,在 update 的时候的字段验证策略
-      updateStrategy: NOT_NULL
-      # 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
-      where-strategy: NOT_NULL
+    # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
+    # 例如 com.**.**.mapper
+    mapperPackage: com.ruoyi.**.mapper
+    # 对应的 XML 文件位置
+    mapperLocations: classpath*:mapper/**/*Mapper.xml
+    # 实体扫描,多个package用逗号或者分号分隔
+    typeAliasesPackage: com.ruoyi.**.domain
+    # 针对 typeAliasesPackage,如果配置了该属性,则仅仅会扫描路径下以该类作为父类的域对象
+    #typeAliasesSuperType: Class<?>
+    # 如果配置了该属性,SqlSessionFactoryBean 会把该包下面的类注册为对应的 TypeHandler
+    #typeHandlersPackage: null
+    # 如果配置了该属性,会将路径下的枚举类进行注入,让实体类字段能够简单快捷的使用枚举属性
+    #typeEnumsPackage: null
+    # 启动时是否检查 MyBatis XML 文件的存在,默认不检查
+    checkConfigLocation: false
+    # 通过该属性可指定 MyBatis 的执行器,MyBatis 的执行器总共有三种:
+    # SIMPLE:该执行器类型不做特殊的事情,为每个语句的执行创建一个新的预处理语句(PreparedStatement)
+    # REUSE:该执行器类型会复用预处理语句(PreparedStatement)
+    # BATCH:该执行器类型会批量执行所有的更新语句
+    executorType: SIMPLE
+    configuration:
+        # 自动驼峰命名规则(camel case)映射
+        # 如果您的数据库命名符合规则无需使用 @TableField 注解指定数据库字段名
+        mapUnderscoreToCamelCase: true
+        # 默认枚举处理类,如果配置了该属性,枚举将统一使用指定处理器进行处理
+        # org.apache.ibatis.type.EnumTypeHandler : 存储枚举的名称
+        # org.apache.ibatis.type.EnumOrdinalTypeHandler : 存储枚举的索引
+        # com.baomidou.mybatisplus.extension.handlers.MybatisEnumTypeHandler : 枚举类需要实现IEnum接口或字段标记@EnumValue注解.
+        defaultEnumTypeHandler: org.apache.ibatis.type.EnumTypeHandler
+        # 当设置为 true 的时候,懒加载的对象可能被任何懒属性全部加载,否则,每个属性都按需加载。需要和 lazyLoadingEnabled 一起使用。
+        aggressiveLazyLoading: true
+        # MyBatis 自动映射策略
+        # NONE:不启用自动映射
+        # PARTIAL:只对非嵌套的 resultMap 进行自动映射
+        # FULL:对所有的 resultMap 都进行自动映射
+        autoMappingBehavior: PARTIAL
+        # MyBatis 自动映射时未知列或未知属性处理策
+        # NONE:不做任何处理 (默认值)
+        # WARNING:以日志的形式打印相关警告信息
+        # FAILING:当作映射失败处理,并抛出异常和详细信息
+        autoMappingUnknownColumnBehavior: NONE
+        # Mybatis一级缓存,默认为 SESSION
+        # SESSION session级别缓存,同一个session相同查询语句不会再次查询数据库
+        # STATEMENT 关闭一级缓存
+        localCacheScope: SESSION
+        # 开启Mybatis二级缓存,默认为 true
+        cacheEnabled: false
+        # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
+        # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
+        # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
+        logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+    global-config:
+        # 是否打印 Logo banner
+        banner: false
+        # 是否初始化 SqlRunner
+        enableSqlRunner: false
+        dbConfig:
+            # 主键类型
+            # AUTO 数据库ID自增
+            # NONE 空
+            # INPUT 用户输入ID
+            # ASSIGN_ID 全局唯一ID
+            # ASSIGN_UUID 全局唯一ID UUID
+            idType: ASSIGN_ID
+            # 表名前缀
+            tablePrefix: null
+            # 字段 format,例: %s,(对主键无效)
+            columnFormat: null
+            # 表名是否使用驼峰转下划线命名,只对表名生效
+            tableUnderline: true
+            # 大写命名,对表名和字段名均生效
+            capitalMode: false
+            # 全局的entity的逻辑删除字段属性名
+            logicDeleteField: null
+            # 逻辑已删除值
+            logicDeleteValue: 1
+            # 逻辑未删除值
+            logicNotDeleteValue: 0
+            # 字段验证策略之 insert,在 insert 的时候的字段验证策略
+            # IGNORED 忽略判断
+            # NOT_NULL 非NULL判断
+            # NOT_EMPTY 非空判断(只对字符串类型字段,其他类型字段依然为非NULL判断)
+            # DEFAULT 默认的,一般只用于注解里
+            # NEVER 不加入 SQL
+            insertStrategy: NOT_NULL
+            # 字段验证策略之 update,在 update 的时候的字段验证策略
+            updateStrategy: NOT_NULL
+            # 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
+            where-strategy: NOT_NULL
 
 # Swagger配置
 swagger:
-  # 是否开启swagger
-  enabled: true
-  # 请求前缀
-  pathMapping: /dev-api
-  # 标题
-  title: '标题:${ruoyi.name}后台管理系统_接口文档'
-  # 描述
-  description: ''
-  # 版本
-  version: '版本号: ${ruoyi-vue-plus.version}'
-  # 作者信息
-  contact:
-    name: 新通智能
-    email:
-    url:
+    # 是否开启swagger
+    enabled: true
+    # 请求前缀
+    pathMapping: /dev-api
+    # 标题
+    title: '标题:${ruoyi.name}后台管理系统_接口文档'
+    # 描述
+    description: ''
+    # 版本
+    version: '版本号: ${ruoyi-vue-plus.version}'
+    # 作者信息
+    contact:
+        name: 新通智能
+        email:
+        url:
 
 # 防止XSS攻击
 xss:
-  # 过滤开关
-  enabled: true
-  # 排除链接(多个用逗号分隔)
-  excludes: /system/notice
-  # 匹配链接
-  urlPatterns: /system/*,/monitor/*,/tool/*
+    # 过滤开关
+    enabled: true
+    # 排除链接(多个用逗号分隔)
+    excludes: /system/notice
+    # 匹配链接
+    urlPatterns: /system/*,/monitor/*,/tool/*
 
 # 全局线程池相关配置
 thread-pool:
-  # 是否开启线程池
-  enabled: false
-  # 核心线程池大小
-  corePoolSize: 8
-  # 最大可创建的线程数
-  maxPoolSize: 16
-  # 队列最大长度
-  queueCapacity: 128
-  # 线程池维护线程所允许的空闲时间
-  keepAliveSeconds: 300
-  # 线程池对拒绝任务(无线程可用)的处理策略
-  # CALLER_RUNS_POLICY 等待
-  # DISCARD_OLDEST_POLICY 放弃最旧的
-  # DISCARD_POLICY 丢弃
-  # ABORT_POLICY 中止
-  rejectedExecutionHandler: CALLER_RUNS_POLICY
+    # 是否开启线程池
+    enabled: false
+    # 核心线程池大小
+    corePoolSize: 8
+    # 最大可创建的线程数
+    maxPoolSize: 16
+    # 队列最大长度
+    queueCapacity: 128
+    # 线程池维护线程所允许的空闲时间
+    keepAliveSeconds: 300
+    # 线程池对拒绝任务(无线程可用)的处理策略
+    # CALLER_RUNS_POLICY 等待
+    # DISCARD_OLDEST_POLICY 放弃最旧的
+    # DISCARD_POLICY 丢弃
+    # ABORT_POLICY 中止
+    rejectedExecutionHandler: CALLER_RUNS_POLICY
 
 # feign 相关配置
 feign:
-  # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
-  # 例如 com.**.**.feign
-  package: com.ruoyi.**.feign
-  # 开启压缩
-  compression:
-    request:
-      enabled: true
-    response:
-      enabled: true
-  okhttp:
-    enabled: true
-  circuitbreaker:
-    enabled: true
+    # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
+    # 例如 com.**.**.feign
+    package: com.ruoyi.**.feign
+    # 开启压缩
+    compression:
+        request:
+            enabled: true
+        response:
+            enabled: true
+    okhttp:
+        enabled: true
+    circuitbreaker:
+        enabled: true
 
 --- # redisson 缓存配置
 redisson:
-  cacheGroup:
-    # 用例: @Cacheable(cacheNames="groupId", key="#XXX") 方可使用缓存组配置
-    - groupId: redissonCacheMap
-      # 组过期时间(脚本监控)
-      ttl: 60000
-      # 组最大空闲时间(脚本监控)
-      maxIdleTime: 60000
-      # 组最大长度
-      maxSize: 0
-    - groupId: testCache
-      ttl: 1000
-      maxIdleTime: 500
+    cacheGroup:
+        # 用例: @Cacheable(cacheNames="groupId", key="#XXX") 方可使用缓存组配置
+        -   groupId: redissonCacheMap
+            # 组过期时间(脚本监控)
+            ttl: 60000
+            # 组最大空闲时间(脚本监控)
+            maxIdleTime: 60000
+            # 组最大长度
+            maxSize: 0
+        -   groupId: testCache
+            ttl: 1000
+            maxIdleTime: 500
 
 --- # 分布式锁 lock4j 全局配置
 lock4j:
-  # 获取分布式锁超时时间,默认为 3000 毫秒
-  acquire-timeout: 3000
-  # 分布式锁的超时时间,默认为 30 毫秒
-  expire: 30000
+    # 获取分布式锁超时时间,默认为 3000 毫秒
+    acquire-timeout: 3000
+    # 分布式锁的超时时间,默认为 30 毫秒
+    expire: 30000
 
 --- # Actuator 监控端点的配置项
 management:
-  endpoints:
-    web:
-      # Actuator 提供的 API 接口的根目录。默认为 /actuator
-      base-path: /actuator
-#      exposure:
-#        # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
-#        # 生产环境不建议放开所有 根据项目需求放开即可
-#        include: @endpoints.include@
-  endpoint:
-    logfile:
-      external-file: ./logs/sys-console.log
+    endpoints:
+        web:
+            # Actuator 提供的 API 接口的根目录。默认为 /actuator
+            base-path: /actuator
+    #      exposure:
+    #        # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
+    #        # 生产环境不建议放开所有 根据项目需求放开即可
+    #        include: @endpoints.include@
+    endpoint:
+        logfile:
+            external-file: ./logs/sys-console.log
 
 --- # 定时任务配置
 spring:
-  quartz:
-    scheduler-name: RuoyiScheduler
-    startup-delay: 1s
-    overwrite-existing-jobs: true
-    auto-startup: true
-    job-store-type: jdbc
-    properties:
-      org:
-        quartz:
-          # Scheduler 相关配置
-          scheduler:
-            instanceName: RuoyiScheduler
-            instanceId: AUTO
-          # 线程池相关配置
-          threadPool:
-            class: org.quartz.simpl.SimpleThreadPool
-            threadCount: 20
-            threadPriority: 5
-          # JobStore 集群配置
-          jobStore:
-            class: org.quartz.impl.jdbcjobstore.JobStoreTX
-            isClustered: true
-            clusterCheckinInterval: 15000
-            txIsolationLevelSerializable: true
-            misfireThreshold: 60000
-            tablePrefix: QRTZ_
-            # sqlserver 启用
-            # selectWithLockSQL: SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?
+    quartz:
+        scheduler-name: RuoyiScheduler
+        startup-delay: 1s
+        overwrite-existing-jobs: true
+        auto-startup: true
+        job-store-type: jdbc
+        properties:
+            org:
+                quartz:
+                    # Scheduler 相关配置
+                    scheduler:
+                        instanceName: RuoyiScheduler
+                        instanceId: AUTO
+                    # 线程池相关配置
+                    threadPool:
+                        class: org.quartz.simpl.SimpleThreadPool
+                        threadCount: 20
+                        threadPriority: 5
+                    # JobStore 集群配置
+                    jobStore:
+                        class: org.quartz.impl.jdbcjobstore.JobStoreTX
+                        isClustered: true
+                        clusterCheckinInterval: 15000
+                        txIsolationLevelSerializable: true
+                        misfireThreshold: 60000
+                        tablePrefix: QRTZ_
+                        # sqlserver 启用
+                        # selectWithLockSQL: SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?

+ 37 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentController.java

@@ -399,6 +399,43 @@ public class IncidentController extends BaseController {
         }
     }
 
+    @ApiOperation("事件执行日志导出")
+    @GetMapping("/processDownload")
+    public void processDownload(@RequestParam String id, HttpServletRequest request, HttpServletResponse response) {
+        // id为事件id
+        Map<String, Object> map = new HashMap<>();
+        IncidentVo incidentVo = iIncidentService.queryById(id);
+        if (incidentVo != null) {
+            map.put("name", incidentVo.getName());
+            // 查询处置过程
+            List<IncidentProcess> incidentProcess = processService.list(Wrappers.<IncidentProcess>lambdaQuery()
+                .eq(IncidentProcess::getIncidentId, id).orderByAsc(IncidentProcess::getCreateTime));
+            for (IncidentProcess process : incidentProcess) {
+                process.setCreateTimeText(DateUtil.formatDateTime(process.getCreateTime()));
+            }
+            map.put("process", incidentProcess);
+        }
+
+        String fileName = "incident_log_" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + ".docx";
+        try {
+            XWPFDocument doc = WordExportUtil.exportWord07(
+                "word/incidentProcess.docx", map);
+            FileOutputStream fos = new FileOutputStream(ExcelUtil.getAbsoluteFile(fileName));
+            doc.write(fos);
+            // 设置强制下载不打开
+            response.setContentType("application/force-download");
+            // 设置文件名
+            response.addHeader("Content-Disposition", "attachment;fileName=" + fileName);
+            OutputStream out = response.getOutputStream();
+            doc.write(out);
+            out.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            delFileWord(ExcelUtil.getAbsoluteFile(fileName));
+        }
+    }
+
     @ApiOperation("复制事件应急方案")
     @RepeatSubmit()
     @PostMapping("/copyTask")

BIN
ruoyi-admin/src/main/resources/word/incidentProcess.docx


+ 12 - 0
ruoyi-admin/src/main/resources/word/test.html

@@ -0,0 +1,12 @@
+<html>
+
+<head>
+    
+</head>
+
+
+<body>
+    <table style="font-size: 3vw;"><tr><td style="color: darkgray;width: 20%;vertical-align: top;">事件类型</td><td style="text-align:left;">水路运输</td></tr><tr><td style="color: darkgray;width: 20%;vertical-align: top;">事件等级</td><td style="text-align:left;">Ⅲ</td></tr><tr><td style="color: darkgray;width: 20%;vertical-align: top;">事件时间</td><td style="text-align:left;">2022-03-25 14:47:44</td></tr><tr><td style="color: darkgray;width: 20%;vertical-align: top;">事件地点</td><td style="text-align:left;">江苏省宿迁市宿城区黄海路60号宿迁市宿城区中港雅典城幼儿园</td></tr><tr><td style="color: darkgray;width: 20%;vertical-align: top;">事件来源</td><td style="text-align:left;">宿迁交通APP</td></tr><tr><td style="color: darkgray;width: 20%;vertical-align: top;">上报人员</td><td style="text-align:left;">执法检查1</td></tr><tr><td style="color: darkgray;width: 20%;vertical-align: top;">联系电话</td><td style="text-align:left;"></td></tr><tr><td style="color: darkgray;width: 20%;vertical-align: top;">上报单位</td><td style="text-align:left;">执法指挥中心</td></tr></table>
+</body>
+
+</html>

+ 3 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/IncidentProcess.java

@@ -58,6 +58,9 @@ public class IncidentProcess implements Serializable {
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;
 
+    @TableField(exist = false)
+    private String createTimeText;
+
     /**
      * 过程创建人
      */