浏览代码

事件中心视频下载

majunqi 1 年之前
父节点
当前提交
ec0e60784b
共有 18 个文件被更改,包括 1480 次插入3 次删除
  1. 51 0
      event-ui/src/api/event/downloads/downloads.js
  2. 381 0
      event-ui/src/views/event/downloads/index.vue
  3. 6 1
      event-ui/src/views/event/eventcatalogue/index.vue
  4. 119 0
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTDownloadsController.java
  5. 17 2
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTEventcatalogueController.java
  6. 159 0
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/domain/CentereventTDownloads.java
  7. 67 0
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CentereventTDownloadsMapper.java
  8. 2 0
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CentereventTEventcatalogueMapper.java
  9. 67 0
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICentereventTDownloadsService.java
  10. 108 0
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTDownloadsServiceImpl.java
  11. 28 0
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTEventcatalogueServiceImpl.java
  12. 44 0
      src/main/java/com/sooka/sponest/event/urge/domain/EventDown.java
  13. 35 0
      src/main/java/com/sooka/sponest/event/urge/listener/EventDownListener.java
  14. 14 0
      src/main/java/com/sooka/sponest/event/urge/service/EventDownService.java
  15. 63 0
      src/main/java/com/sooka/sponest/event/urge/service/impl/EventDownServiceImpl.java
  16. 126 0
      src/main/java/com/sooka/sponest/event/utils/ScheduleTaskUtil.java
  17. 53 0
      src/main/resources/mapper/centereventteventcatalogue/CentereventTEventcatalogueMapper.xml
  18. 140 0
      src/main/resources/mapper/download/CentereventTDownloadsMapper.xml

+ 51 - 0
event-ui/src/api/event/downloads/downloads.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request'
+
+// 查询【请填写功能名称】列表
+export function listDownloads(query) {
+  return request({
+    url: '/center-event/downloads/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询【请填写功能名称】详细
+export function getDownloads(id) {
+  return request({
+    url: '/center-event/downloads/' + id,
+    method: 'get'
+  })
+}
+
+// 新增【请填写功能名称】
+export function addDownloads(data) {
+  return request({
+    url: '/center-event/downloads',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改【请填写功能名称】
+export function updateDownloads(data) {
+  return request({
+    url: '/center-event/downloads',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除【请填写功能名称】
+export function delDownloads(id) {
+  return request({
+    url: '/center-event/downloads/' + id,
+    method: 'delete'
+  })
+}
+//下载事件的视频
+export function eventhandleDownload(id) {
+  return request({
+    url: 'center-event/eventcatalogue/eventhandleDownload/' + id,
+    method: 'get'
+  })
+}

+ 381 - 0
event-ui/src/views/event/downloads/index.vue

@@ -0,0 +1,381 @@
+<template>
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+<!--                        <el-form-item label="事件编码" prop="eventCode">-->
+<!--                            <el-input-->
+<!--                                    v-model="queryParams.eventCode"-->
+<!--                                    placeholder="请输入事件编码"-->
+<!--                                    clearable-->
+<!--                                    size="small"-->
+<!--                                    @keyup.enter.native="handleQuery"-->
+<!--                            />-->
+<!--                        </el-form-item>-->
+                        <el-form-item label="事件名称" prop="eventName">
+                            <el-input
+                                    v-model="queryParams.eventName"
+                                    placeholder="请输入事件名称"
+                                    clearable
+                                    size="small"
+                                    @keyup.enter.native="handleQuery"
+                            />
+                        </el-form-item>
+<!--                        <el-form-item label="视频路径" prop="path">-->
+<!--                            <el-input-->
+<!--                                    v-model="queryParams.path"-->
+<!--                                    placeholder="请输入视频路径"-->
+<!--                                    clearable-->
+<!--                                    size="small"-->
+<!--                                    @keyup.enter.native="handleQuery"-->
+<!--                            />-->
+<!--                        </el-form-item>-->
+<!--                        <el-form-item label="视频下载是否成功" prop="flag">-->
+<!--                            <el-input-->
+<!--                                    v-model="queryParams.flag"-->
+<!--                                    placeholder="请输入视频下载是否成功"-->
+<!--                                    clearable-->
+<!--                                    size="small"-->
+<!--                                    @keyup.enter.native="handleQuery"-->
+<!--                            />-->
+<!--                        </el-form-item>-->
+<!--                        <el-form-item label="失败原因" prop="reason">-->
+<!--                            <el-input-->
+<!--                                    v-model="queryParams.reason"-->
+<!--                                    placeholder="请输入失败原因"-->
+<!--                                    clearable-->
+<!--                                    size="small"-->
+<!--                                    @keyup.enter.native="handleQuery"-->
+<!--                            />-->
+<!--                        </el-form-item>-->
+<!--                        <el-form-item label="创建人名称" prop="createName">-->
+<!--                            <el-input-->
+<!--                                    v-model="queryParams.createName"-->
+<!--                                    placeholder="请输入创建人名称"-->
+<!--                                    clearable-->
+<!--                                    size="small"-->
+<!--                                    @keyup.enter.native="handleQuery"-->
+<!--                            />-->
+<!--                        </el-form-item>-->
+<!--                        <el-form-item label="更新人名称" prop="updateName">-->
+<!--                            <el-input-->
+<!--                                    v-model="queryParams.updateName"-->
+<!--                                    placeholder="请输入更新人名称"-->
+<!--                                    clearable-->
+<!--                                    size="small"-->
+<!--                                    @keyup.enter.native="handleQuery"-->
+<!--                            />-->
+<!--                        </el-form-item>-->
+            <el-form-item>
+                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            </el-form-item>
+        </el-form>
+
+        <el-row :gutter="10" class="mb8">
+<!--            <el-col :span="1.5">-->
+<!--                <el-button-->
+<!--                        type="primary"-->
+<!--                        plain-->
+<!--                        icon="el-icon-plus"-->
+<!--                        size="mini"-->
+<!--                        @click="handleAdd"-->
+<!--                        v-hasPermi="['event:downloads:add']"-->
+<!--                >新增</el-button>-->
+<!--            </el-col>-->
+<!--            <el-col :span="1.5">-->
+<!--                <el-button-->
+<!--                        type="success"-->
+<!--                        plain-->
+<!--                        icon="el-icon-edit"-->
+<!--                        size="mini"-->
+<!--                        :disabled="single"-->
+<!--                        @click="handleUpdate"-->
+<!--                        v-hasPermi="['event:downloads:edit']"-->
+<!--                >修改</el-button>-->
+<!--            </el-col>-->
+<!--            <el-col :span="1.5">-->
+<!--                <el-button-->
+<!--                        type="danger"-->
+<!--                        plain-->
+<!--                        icon="el-icon-delete"-->
+<!--                        size="mini"-->
+<!--                        :disabled="multiple"-->
+<!--                        @click="handleDelete"-->
+<!--                        v-hasPermi="['event:downloads:remove']"-->
+<!--                >删除</el-button>-->
+<!--            </el-col>-->
+<!--            <el-col :span="1.5">-->
+<!--                <el-button-->
+<!--                        type="warning"-->
+<!--                        plain-->
+<!--                        icon="el-icon-download"-->
+<!--                        size="mini"-->
+<!--                        @click="handleExport"-->
+<!--                        v-hasPermi="['event:downloads:export']"-->
+<!--                >导出</el-button>-->
+<!--            </el-col>-->
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
+
+        <el-table v-loading="loading" :data="downloadsList" @selection-change="handleSelectionChange">
+            <el-table-column  width="55" align="center" />
+<!--                    <el-table-column label="${comment}" align="center" prop="id" />-->
+<!--                    <el-table-column label="事件编码" align="center" prop="eventCode" />-->
+                    <el-table-column label="事件名称" align="center" prop="eventName" />
+<!--                    <el-table-column label="视频路径" align="center" prop="path" />-->
+          <el-table-column label="视频下载状态" align="center" prop="flag">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.downloads_status" :value="scope.row.flag"/>
+            </template>
+          </el-table-column>
+                    <el-table-column label="失败原因" align="center" prop="reason" />
+<!--                    <el-table-column label="创建人名称" align="center" prop="createName" />-->
+<!--                    <el-table-column label="更新人名称" align="center" prop="updateName" />-->
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                  <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)"
+                              v-if="scope.row.flag == '1'">视频查看
+                  </el-button>
+                    <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-edit"
+                            @click="handleDownload(scope.row)"
+                             v-if="scope.row.flag == '0' && scope.row.reason !='该时段未查询到录像信息'"
+                    >下载</el-button>
+<!--                    <el-button-->
+<!--                            size="mini"-->
+<!--                            type="text"-->
+<!--                            icon="el-icon-delete"-->
+<!--                            @click="handleDelete(scope.row)"-->
+<!--                            v-hasPermi="['event:downloads:remove']"-->
+<!--                    >删除</el-button>-->
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <pagination
+                v-show="total>0"
+                :total="total"
+                :page.sync="queryParams.pageNum"
+                :limit.sync="queryParams.pageSize"
+                @pagination="getList"
+        />
+
+<!--      <el-dialog title="视频预览" :visible.sync="showTcPlayer" width="40%" customClass="customWidthMp4">-->
+<!--        <TcPlayer ref="TcPlayer" :playVideo="playVideo" :widthHeigt="[100,100]"></TcPlayer>-->
+<!--      </el-dialog>-->
+      <el-dialog :visible.sync="showTcPlayer" height="40%" width="40%" title="视频预览" @close="closeDialog">
+        <div style="height:400px;text-align:center">
+          <video
+            width="100%"
+            height="100%"
+            :src="playVideo"
+            controls="controls"
+            ref="video"
+          ></video>
+        </div>
+      </el-dialog>
+
+        <!-- 添加或修改【请填写功能名称】对话框 -->
+        <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+            <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+                                <el-form-item label="事件编码" prop="eventCode">
+                                    <el-input v-model="form.eventCode" placeholder="请输入事件编码" />
+                                </el-form-item>
+                                <el-form-item label="事件名称" prop="eventName">
+                                    <el-input v-model="form.eventName" placeholder="请输入事件名称" />
+                                </el-form-item>
+                                <el-form-item label="视频路径" prop="path">
+                                    <el-input v-model="form.path" placeholder="请输入视频路径" />
+                                </el-form-item>
+                                <el-form-item label="视频下载是否成功" prop="flag">
+                                    <el-input v-model="form.flag" placeholder="请输入视频下载是否成功" />
+                                </el-form-item>
+                                <el-form-item label="失败原因" prop="reason">
+                                    <el-input v-model="form.reason" placeholder="请输入失败原因" />
+                                </el-form-item>
+                                <el-form-item label="创建人名称" prop="createName">
+                                    <el-input v-model="form.createName" placeholder="请输入创建人名称" />
+                                </el-form-item>
+                                <el-form-item label="更新人名称" prop="updateName">
+                                    <el-input v-model="form.updateName" placeholder="请输入更新人名称" />
+                                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="submitForm">确 定</el-button>
+                <el-button @click="cancel">取 消</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import { listDownloads, getDownloads, delDownloads, addDownloads, updateDownloads,eventhandleDownload } from "@/api/event/downloads/downloads";
+    import TcPlayer from '@/components/TcPlayer'; // 视频预览
+    export default {
+        name: "Downloads",
+      components: {TcPlayer},
+        dicts: ['downloads_status'],
+        data() {
+            return {
+                // 遮罩层
+                loading: true,
+                // 选中数组
+                ids: [],
+                // 非单个禁用
+                single: true,
+                // 非多个禁用
+                multiple: true,
+                // 显示搜索条件
+                showSearch: true,
+                // 总条数
+                total: 0,
+                // 【请填写功能名称】表格数据
+                    downloadsList: [],
+                // 弹出层标题
+                title: "",
+                // 是否显示弹出层
+                showTcPlayer: false,//视频预览弹窗
+                playVideo: '',//视频预览地址
+                open: false,
+                // 查询参数
+                queryParams: {
+                    pageNum: 1,
+                    pageSize: 10,
+                    eventCode: null,
+                    eventName: null,
+                    path: null,
+                    flag: null,
+                    reason: null,
+                    createName: null,
+                    updateName: null,
+        },
+            // 表单参数
+            form: {},
+            // 表单校验
+            rules: {
+            }
+        };
+        },
+        created() {
+            this.getList();
+        },
+        methods: {
+            /** 查询【请填写功能名称】列表 */
+            getList() {
+                this.loading = true;
+                listDownloads(this.queryParams).then(response => {
+                    this.downloadsList = response.rows;
+                    this.total = response.total;
+                    this.loading = false;
+                });
+            },
+            // 取消按钮
+            cancel() {
+                this.open = false;
+                this.reset();
+            },
+            handleDetail(row) {
+              this.showTcPlayer = true;
+                this.playVideo = row.path;
+            },
+          handleDownload(row) {
+            const id = row.eventCode
+            eventhandleDownload(id).then(response => {
+              if(response.data.code == 200){
+                this.$modal.msgSuccess("下载成功");
+              }else{
+                this.$modal.msgError(response.data.msg);
+              }
+
+            });
+          },
+            // 表单重置
+            reset() {
+                this.form = {
+                        id: null,
+                        eventCode: null,
+                        eventName: null,
+                        path: null,
+                        flag: null,
+                        reason: null,
+                        createBy: null,
+                        createName: null,
+                        createTime: null,
+                        updateBy: null,
+                        updateName: null,
+                        updateTime: null
+            };
+                this.resetForm("form");
+            },
+            /** 搜索按钮操作 */
+            handleQuery() {
+                this.queryParams.pageNum = 1;
+                this.getList();
+            },
+            /** 重置按钮操作 */
+            resetQuery() {
+                this.resetForm("queryForm");
+                this.handleQuery();
+            },
+            // 多选框选中数据
+            handleSelectionChange(selection) {
+                this.ids = selection.map(item => item.id)
+                this.single = selection.length!==1
+                this.multiple = !selection.length
+            },
+            /** 新增按钮操作 */
+            handleAdd() {
+                this.reset();
+                this.open = true;
+                this.title = "添加【请填写功能名称】";
+            },
+            /** 修改按钮操作 */
+            handleUpdate(row) {
+                this.reset();
+                const id = row.id || this.ids
+                getDownloads(id).then(response => {
+                    this.form = response.data;
+                    this.open = true;
+                    this.title = "修改【请填写功能名称】";
+                });
+            },
+            /** 提交按钮 */
+            submitForm() {
+                this.$refs["form"].validate(valid => {
+                    if (valid) {
+                        if (this.form.id != null) {
+                            updateDownloads(this.form).then(response => {
+                                this.$modal.msgSuccess("修改成功");
+                                this.open = false;
+                                this.getList();
+                            });
+                        } else {
+                            addDownloads(this.form).then(response => {
+                                this.$modal.msgSuccess("新增成功");
+                                this.open = false;
+                                this.getList();
+                            });
+                        }
+                    }
+                });
+            },
+            /** 删除按钮操作 */
+            handleDelete(row) {
+                const ids = row.id || this.ids;
+                this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项?').then(function() {
+                    return delDownloads(ids);
+                }).then(() => {
+                    this.getList();
+                    this.$modal.msgSuccess("删除成功");
+                }).catch(() => {});
+            },
+    /** 导出按钮操作 */
+    handleExport() {
+        this.download('event/downloads/export', {
+            ...this.queryParams
+        }, `downloads_${new Date().getTime()}.xlsx`)
+    }
+    }
+    };
+</script>

+ 6 - 1
event-ui/src/views/event/eventcatalogue/index.vue

@@ -684,7 +684,12 @@
         }
         const id = row.id || this.ids
         eventhandleDownload(id).then(response => {
-          this.$modal.msgSuccess("下载成功");
+           if(response.data.code == 200){
+             this.$modal.msgSuccess("下载成功");
+           }else{
+             this.$modal.msgError(response.data.msg);
+           }
+
         });
       },
       flValue() {

+ 119 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTDownloadsController.java

@@ -0,0 +1,119 @@
+package com.sooka.sponest.event.centereventteventcatalogue.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.core.utils.SpringUtils;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.system.api.RemoteConfigService;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
+import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
+import com.sooka.sponest.event.utils.EventConstants;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author ruoyi
+ * @date 2023-09-12
+ */
+@RestController
+@RequestMapping("/downloads")
+public class CentereventTDownloadsController extends BaseController
+{
+    @Autowired
+    private ICentereventTDownloadsService centereventTDownloadsService;
+
+/**
+ * 查询【请填写功能名称】列表
+ */
+@RequiresPermissions("event:downloads:list")
+@GetMapping("/list")
+    public TableDataInfo list(CentereventTDownloads centereventTDownloads)
+    {
+        startPage();
+        List<CentereventTDownloads> list = centereventTDownloadsService.selectCentereventTDownloadsList(centereventTDownloads);
+
+        if (StringUtils.isNotEmpty(list)) {
+            String prefix = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey(EventConstants.FILE_PREFIX_LOCAL).getData();
+            list.forEach(item -> {
+                 if("1".equals(item.getFlag())){
+                     item.setPath(prefix + item.getPath());
+                 }
+            });
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @RequiresPermissions("event:downloads:export")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CentereventTDownloads centereventTDownloads)
+    {
+        List<CentereventTDownloads> list = centereventTDownloadsService.selectCentereventTDownloadsList(centereventTDownloads);
+        ExcelUtil<CentereventTDownloads> util = new ExcelUtil<CentereventTDownloads>(CentereventTDownloads.class);
+        util.exportExcel(response, list, "【请填写功能名称】数据");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @RequiresPermissions("event:downloads:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return AjaxResult.success(centereventTDownloadsService.selectCentereventTDownloadsById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @RequiresPermissions("event:downloads:add")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CentereventTDownloads centereventTDownloads)
+    {
+        return toAjax(centereventTDownloadsService.insertCentereventTDownloads(centereventTDownloads));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @RequiresPermissions("event:downloads:edit")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CentereventTDownloads centereventTDownloads)
+    {
+        return toAjax(centereventTDownloadsService.updateCentereventTDownloads(centereventTDownloads));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @RequiresPermissions("event:downloads:remove")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(centereventTDownloadsService.deleteCentereventTDownloadsByIds(ids));
+    }
+}

+ 17 - 2
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTEventcatalogueController.java

@@ -17,8 +17,10 @@ import com.ruoyi.system.api.RemoteConfigService;
 import com.ruoyi.system.api.RemoteDeptService;
 import com.ruoyi.system.api.RemoteUserService;
 import com.ruoyi.system.api.domain.SysUser;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.CentereventtDeptEventBO;
+import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
 import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTEventcatalogueService;
 import com.sooka.sponest.event.centereventteventtype.domain.CentereventTEventtype;
 import com.sooka.sponest.event.centereventteventtype.service.ICentereventTEventtypeService;
@@ -71,6 +73,9 @@ public class CentereventTEventcatalogueController extends BaseController {
     @Autowired
     private RemoteDataService remoteDataService;
 
+    @Autowired
+    private ICentereventTDownloadsService centereventTDownloadsService;
+
     /**
      * 查询事件目录列表
      */
@@ -356,7 +361,17 @@ public class CentereventTEventcatalogueController extends BaseController {
      */
     @Log(title = "事件视频下载", businessType = BusinessType.OTHER)
     @GetMapping("/eventhandleDownload/{id}")
-    public R eventhandleDownload(@PathVariable("id") String id) {
-        return centereventTEventcatalogueService.eventhandleDownload(id);
+    public AjaxResult eventhandleDownload(@PathVariable("id") String id) {
+        //校验 已下载不让重复下载
+        CentereventTDownloads centereventTDownloads=new CentereventTDownloads();
+        centereventTDownloads.setEventCode(id);
+        centereventTDownloads.setFlag("1");
+        List<CentereventTDownloads> downloadsList = centereventTDownloadsService.selectCentereventTDownloadsList(centereventTDownloads);
+        if(null != downloadsList && downloadsList.size() > 0){
+           return  AjaxResult.error("已下载的视频,不能重复下载!");
+        }else{
+            return AjaxResult.success(centereventTEventcatalogueService.eventhandleDownload(id));
+        }
+
     }
 }

+ 159 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/domain/CentereventTDownloads.java

@@ -0,0 +1,159 @@
+package com.sooka.sponest.event.centereventteventcatalogue.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】对象 centerevent_t_downloads
+ *
+ * @author ruoyi
+ * @date 2023-09-12
+ */
+public class CentereventTDownloads extends BaseEntity
+        {
+private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private String id;
+
+    /** 事件编码 */
+            @Excel(name = "事件编码")
+    private String eventCode;
+
+    /** 事件名称 */
+            @Excel(name = "事件名称")
+    private String eventName;
+
+    /** 视频路径 */
+            @Excel(name = "视频路径")
+    private String path;
+
+    /** 视频下载是否成功 */
+            @Excel(name = "视频下载是否成功")
+    private String flag;
+
+    /** 失败原因 */
+            @Excel(name = "失败原因")
+    private String reason;
+
+    /** 创建人名称 */
+            @Excel(name = "创建人名称")
+    private String createName;
+
+    /** 更新人名称 */
+            @Excel(name = "更新人名称")
+    private String updateName;
+
+    private String logId;
+
+            public String getAttachPath() {
+                return attachPath;
+            }
+
+            public void setAttachPath(String attachPath) {
+                this.attachPath = attachPath;
+            }
+
+            private String attachPath;
+
+            public String getLogId() {
+                return logId;
+            }
+
+            public void setLogId(String logId) {
+                this.logId = logId;
+            }
+
+            public void setId(String id)
+            {
+            this.id = id;
+            }
+
+    public String getId()
+            {
+            return id;
+            }
+    public void setEventCode(String eventCode)
+            {
+            this.eventCode = eventCode;
+            }
+
+    public String getEventCode()
+            {
+            return eventCode;
+            }
+    public void setEventName(String eventName)
+            {
+            this.eventName = eventName;
+            }
+
+    public String getEventName()
+            {
+            return eventName;
+            }
+    public void setPath(String path)
+            {
+            this.path = path;
+            }
+
+    public String getPath()
+            {
+            return path;
+            }
+    public void setFlag(String flag)
+            {
+            this.flag = flag;
+            }
+
+    public String getFlag()
+            {
+            return flag;
+            }
+    public void setReason(String reason)
+            {
+            this.reason = reason;
+            }
+
+    public String getReason()
+            {
+            return reason;
+            }
+    public void setCreateName(String createName)
+            {
+            this.createName = createName;
+            }
+
+    public String getCreateName()
+            {
+            return createName;
+            }
+    public void setUpdateName(String updateName)
+            {
+            this.updateName = updateName;
+            }
+
+    public String getUpdateName()
+            {
+            return updateName;
+            }
+
+@Override
+public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("eventCode", getEventCode())
+            .append("eventName", getEventName())
+            .append("path", getPath())
+            .append("flag", getFlag())
+            .append("reason", getReason())
+            .append("createBy", getCreateBy())
+            .append("createName", getCreateName())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateName", getUpdateName())
+            .append("updateTime", getUpdateTime())
+        .toString();
+        }
+        }

+ 67 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CentereventTDownloadsMapper.java

@@ -0,0 +1,67 @@
+package com.sooka.sponest.event.centereventteventcatalogue.mapper;
+
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
+import com.sooka.sponest.event.remoteapi.domain.CenterdataTAttach;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-09-12
+ */
+public interface CentereventTDownloadsMapper
+{
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public CentereventTDownloads selectCentereventTDownloadsById(String id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<CentereventTDownloads> selectCentereventTDownloadsList(CentereventTDownloads centereventTDownloads);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertCentereventTDownloads(CentereventTDownloads centereventTDownloads);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateCentereventTDownloads(CentereventTDownloads centereventTDownloads);
+
+    /**
+     * 删除【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteCentereventTDownloadsById(String id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCentereventTDownloadsByIds(String[] ids);
+
+    List<CentereventTDownloads> validDownloadIs();
+
+    CentereventTDownloads validDownloadIsOne(String logId);
+}

+ 2 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CentereventTEventcatalogueMapper.java

@@ -62,4 +62,6 @@ public interface CentereventTEventcatalogueMapper {
     List<EventReminder> getReminderTime(@Param("isUrged") String isUrged, @Param("eventStatusValue") String eventStatusValue);
 
     CentereventTEventcatalogue mqtest(@Param("start") String start, @Param("end") String end, @Param("limit") int limit);
+
+    List<CentereventTEventcatalogue>  getbeforedateDownload();
 }

+ 67 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICentereventTDownloadsService.java

@@ -0,0 +1,67 @@
+package com.sooka.sponest.event.centereventteventcatalogue.service;
+
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
+import com.sooka.sponest.event.remoteapi.domain.CenterdataTAttach;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2023-09-12
+ */
+public interface ICentereventTDownloadsService
+{
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public CentereventTDownloads selectCentereventTDownloadsById(String id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<CentereventTDownloads> selectCentereventTDownloadsList(CentereventTDownloads centereventTDownloads);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertCentereventTDownloads(CentereventTDownloads centereventTDownloads);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateCentereventTDownloads(CentereventTDownloads centereventTDownloads);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    public int deleteCentereventTDownloadsByIds(String[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteCentereventTDownloadsById(String id);
+
+    List<CentereventTDownloads> validDownloadIs();
+
+    CentereventTDownloads validDownloadIsOne(String logId);
+}

+ 108 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTDownloadsServiceImpl.java

@@ -0,0 +1,108 @@
+package com.sooka.sponest.event.centereventteventcatalogue.service.impl;
+
+import java.util.List;
+        import com.ruoyi.common.core.utils.DateUtils;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
+import com.sooka.sponest.event.centereventteventcatalogue.mapper.CentereventTDownloadsMapper;
+import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
+import com.sooka.sponest.event.remoteapi.domain.CenterdataTAttach;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-09-12
+ */
+@Service
+public class CentereventTDownloadsServiceImpl implements ICentereventTDownloadsService
+{
+    @Autowired
+    private CentereventTDownloadsMapper centereventTDownloadsMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public CentereventTDownloads selectCentereventTDownloadsById(String id)
+    {
+        return centereventTDownloadsMapper.selectCentereventTDownloadsById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<CentereventTDownloads> selectCentereventTDownloadsList(CentereventTDownloads centereventTDownloads)
+    {
+        return centereventTDownloadsMapper.selectCentereventTDownloadsList(centereventTDownloads);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertCentereventTDownloads(CentereventTDownloads centereventTDownloads)
+    {
+                centereventTDownloads.setCreateTime(DateUtils.getNowDate());
+            return centereventTDownloadsMapper.insertCentereventTDownloads(centereventTDownloads);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param centereventTDownloads 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateCentereventTDownloads(CentereventTDownloads centereventTDownloads)
+    {
+                centereventTDownloads.setUpdateTime(DateUtils.getNowDate());
+
+        return centereventTDownloadsMapper.updateCentereventTDownloads(centereventTDownloads);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCentereventTDownloadsByIds(String[] ids)
+    {
+        return centereventTDownloadsMapper.deleteCentereventTDownloadsByIds(ids);
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCentereventTDownloadsById(String id)
+    {
+        return centereventTDownloadsMapper.deleteCentereventTDownloadsById(id);
+    }
+
+    @Override
+    public List<CentereventTDownloads> validDownloadIs() {
+        return centereventTDownloadsMapper.validDownloadIs();
+    }
+
+    @Override
+    public CentereventTDownloads validDownloadIsOne(String logId) {
+        return centereventTDownloadsMapper.validDownloadIsOne(logId);
+    }
+}

+ 28 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTEventcatalogueServiceImpl.java

@@ -16,10 +16,12 @@ import com.ruoyi.system.api.domain.SysDept;
 import com.ruoyi.system.api.domain.SysUser;
 import com.sooka.sponest.event.centereventtdeptevent.domain.CentereventDeptEvent;
 import com.sooka.sponest.event.centereventtdeptevent.service.ICentereventDeptEventService;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.CentereventtDeptEventBO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.LatLng;
 import com.sooka.sponest.event.centereventteventcatalogue.mapper.CentereventTEventcatalogueMapper;
+import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
 import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTEventcatalogueService;
 import com.sooka.sponest.event.centereventteventtype.domain.CentereventTEventtype;
 import com.sooka.sponest.event.centereventteventtype.service.ICentereventTEventtypeService;
@@ -35,8 +37,10 @@ import com.sooka.sponest.event.centereventtregionalflag.domain.RegionalFlag;
 import com.sooka.sponest.event.centereventtregionalflag.mapper.CentereventTRegionalFlagMapper;
 import com.sooka.sponest.event.remoteapi.RemoteDataService;
 import com.sooka.sponest.event.remoteapi.domain.CenterdataTAttach;
+import com.sooka.sponest.event.urge.domain.EventDown;
 import com.sooka.sponest.event.urge.domain.EventReminder;
 import com.sooka.sponest.event.urge.domain.EventUrge;
+import com.sooka.sponest.event.urge.service.EventDownService;
 import com.sooka.sponest.event.urge.service.EventUrgeService;
 import com.sooka.sponest.event.utils.EventProducerUtil;
 import com.sooka.sponest.event.utils.RemoteApiUtil;
@@ -90,6 +94,12 @@ public class CentereventTEventcatalogueServiceImpl extends BaseService implement
     @Autowired
     private EventUrgeService eventUrgeService;
 
+    @Autowired
+    private EventDownService eventDownService;
+
+    @Autowired
+    private ICentereventTDownloadsService centereventTDownloadsService;
+
     @DataScopeMutiDept(deptAlias = "c")
     @Override
     public List<CentereventTEventcatalogue> listByPc(CentereventTEventcatalogue centereventTEventcatalogue) {
@@ -647,6 +657,24 @@ public class CentereventTEventcatalogueServiceImpl extends BaseService implement
             centereventTFireLog.setOperation("bus_oper_type_1");
             centereventTFireLog.setOperationType("log_oper_type_1");
             centereventTFireLogService.insertCentereventTFireLog(centereventTFireLog);
+            CentereventTDownloads centereventTDownloads=new CentereventTDownloads();
+            centereventTDownloads.setId(IdUtils.simpleUUID());
+            centereventTDownloads.setEventCode(eventcatalogue.getEventCode());
+            centereventTDownloads.setEventName(eventcatalogue.getEventName());
+            centereventTDownloads.setLogId(uuid);
+            centereventTDownloadsService.insertCentereventTDownloads(centereventTDownloads);
+            Map<String,Object> maps=new HashMap<>();
+            maps.put("LogId",uuid);
+            applicationContext.publishEvent(new EventDown(eventDownService,maps));
+        }else{
+            //失败
+            CentereventTDownloads centereventTDownloads=new CentereventTDownloads();
+            centereventTDownloads.setId(IdUtils.simpleUUID());
+            centereventTDownloads.setEventCode(eventcatalogue.getEventCode());
+            centereventTDownloads.setEventName(eventcatalogue.getEventName());
+            centereventTDownloads.setFlag("0");
+            centereventTDownloads.setReason(result.getMsg());//失败原因
+            centereventTDownloadsService.insertCentereventTDownloads(centereventTDownloads);
         }
         return result;
     }

+ 44 - 0
src/main/java/com/sooka/sponest/event/urge/domain/EventDown.java

@@ -0,0 +1,44 @@
+package com.sooka.sponest.event.urge.domain;
+
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
+import com.sooka.sponest.event.urge.service.EventDownService;
+import com.sooka.sponest.event.urge.service.EventUrgeService;
+import lombok.Data;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Observable;
+
+/**
+ * @Auther: mjq
+ * @Date: 2023/9/13 - 09 - 13 - 14:11
+ * @Description: com.sooka.sponest.event.urge.domain
+ * @version: 1.0
+ */
+@Data
+@Component
+public class EventDown extends ApplicationEvent {
+    public EventDown() {
+        super(new EventDownService() {
+
+            @Override
+            public void update(Observable o, Object arg) {
+                throw new UnsupportedOperationException();
+            }
+
+            @Override
+            public void toVoidDownLoad(Map<String,Object> map) {
+                throw new UnsupportedOperationException();
+            }
+        });
+    }
+    private EventDownService eventDownService;
+    private Map<String,Object> map =new HashMap();
+    public EventDown(EventDownService source, Map<String,Object> maps) {
+        super(source);
+        this.eventDownService = source;
+        this.map = maps;
+    }
+}

+ 35 - 0
src/main/java/com/sooka/sponest/event/urge/listener/EventDownListener.java

@@ -0,0 +1,35 @@
+package com.sooka.sponest.event.urge.listener;
+
+import com.sooka.sponest.event.urge.domain.EventDown;
+import com.sooka.sponest.event.urge.domain.EventUrge;
+import com.sooka.sponest.event.urge.service.EventDownService;
+import com.sooka.sponest.event.urge.service.EventUrgeService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.ApplicationListener;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Auther: mjq
+ * @Date: 2023/9/13 - 09 - 13 - 14:16
+ * @Description: com.sooka.sponest.event.urge.listener
+ * @version: 1.0
+ */
+@Component
+public class EventDownListener implements ApplicationListener {
+    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private EventDownService eventDownService;
+    @Async
+    @Override
+    public void onApplicationEvent(ApplicationEvent event) {
+        if (event.getSource() instanceof EventDownService) {
+            EventDown u = (EventDown) event;
+            eventDownService.toVoidDownLoad(u.getMap());
+        }
+    }
+}

+ 14 - 0
src/main/java/com/sooka/sponest/event/urge/service/EventDownService.java

@@ -0,0 +1,14 @@
+package com.sooka.sponest.event.urge.service;
+
+import java.util.Map;
+import java.util.Observer;
+
+/**
+ * @Auther: mjq
+ * @Date: 2023/9/13 - 09 - 13 - 14:05
+ * @Description: com.sooka.sponest.event.urge.service
+ * @version: 1.0
+ */
+public interface EventDownService extends Observer {
+    void toVoidDownLoad(Map<String,Object> maps);
+}

+ 63 - 0
src/main/java/com/sooka/sponest/event/urge/service/impl/EventDownServiceImpl.java

@@ -0,0 +1,63 @@
+package com.sooka.sponest.event.urge.service.impl;
+
+import com.dahuatech.hutool.core.map.MapUtil;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
+import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
+import com.sooka.sponest.event.urge.service.EventDownService;
+import org.apache.commons.collections4.MapUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Observable;
+
+/**
+ * @Auther: mjq
+ * @Date: 2023/9/13 - 09 - 13 - 14:06
+ * @Description: com.sooka.sponest.event.urge.service.impl
+ * @version: 1.0
+ */
+@Service
+@EnableAsync
+public class EventDownServiceImpl implements EventDownService, ApplicationRunner {
+
+    private final Logger logger = LoggerFactory.getLogger(EventDownServiceImpl.class);
+    @Autowired
+    private ICentereventTDownloadsService centereventTDownloadsService;
+    @Override
+    public void run(ApplicationArguments args) throws Exception {
+
+    }
+
+    @Override
+    public void toVoidDownLoad(Map<String,Object> maps) {
+        logger.info("===========================>");
+        try {
+            Thread.sleep(300000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        //视频下载日志表 视频下载成功  定时任务结束回调,检验是否真的成功
+        CentereventTDownloads down= centereventTDownloadsService.validDownloadIsOne(MapUtils.getString(maps,"LogId"));
+        if(StringUtils.isNotEmpty(down.getAttachPath())){
+            down.setFlag("1");
+            down.setPath(down.getAttachPath());
+        }else{
+            down.setFlag("0");
+            down.setReason("视频在下载过程中失败!");
+        }
+        centereventTDownloadsService.updateCentereventTDownloads(down);
+    }
+
+    @Override
+    public void update(Observable o, Object arg) {
+
+    }
+}

+ 126 - 0
src/main/java/com/sooka/sponest/event/utils/ScheduleTaskUtil.java

@@ -0,0 +1,126 @@
+package com.sooka.sponest.event.utils;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.SpringUtils;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
+import com.ruoyi.common.redis.service.RedisService;
+import com.ruoyi.common.security.utils.SecurityUtils;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
+import com.sooka.sponest.event.centereventteventcatalogue.mapper.CentereventTEventcatalogueMapper;
+import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
+import com.sooka.sponest.event.centereventtfirelog.domain.CentereventTFireLog;
+import com.sooka.sponest.event.centereventtfirelog.service.ICentereventTFireLogService;
+import com.sooka.sponest.message.api.RemoteMonitorService;
+import org.apache.commons.lang3.time.FastDateFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @Auther: mjq
+ * @Date: 2023/9/12 - 09 - 12 - 10:08
+ * @Description: com.sooka.sponest.event.utils
+ * @version: 1.0
+ */
+@Configuration
+@EnableScheduling
+//@RestController
+//@RequestMapping("/testload")
+public class ScheduleTaskUtil {
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+    private static FastDateFormat simpleDateFormat = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss");
+
+    @Autowired
+    private CentereventTEventcatalogueMapper centereventTEventcatalogueMapper;
+
+    @Autowired
+    private RemoteMonitorService remoteMonitorService;
+
+    @Autowired
+    private ICentereventTFireLogService centereventTFireLogService;
+
+    @Autowired
+    private ICentereventTDownloadsService centereventTDownloadsService;
+
+    static final String DOWN_LOCK = "downlod:lock";
+    static final String VALUE_LOCK = "valueLock";
+    @Scheduled(cron = "0 0 1 * * ?")
+    //@GetMapping("/down")
+    public void runTask() throws Exception {
+        logger.info("执行定时任务开始=>{}", DateUtils.dateTimeNow());
+        // 读取缓存
+        RedisService redis = SpringUtils.getBean(RedisService.class);
+        String lock = redis.getCacheObject(DOWN_LOCK);
+        if (StringUtils.isBlank(lock)) {
+            //redis.setCacheObject(DOWN_LOCK, VALUE_LOCK);
+            redis.setCacheObject(DOWN_LOCK,VALUE_LOCK, (long) 3600 * 12, TimeUnit.SECONDS);
+            List<CentereventTEventcatalogue> eventcatalogues = centereventTEventcatalogueMapper.getbeforedateDownload();
+             for (CentereventTEventcatalogue eventcatalogue : eventcatalogues){
+                 String busIndex = "bus_indx_other";// 其他
+                 if ("1".equals(eventcatalogue.getEventType())) {
+                     busIndex = "bus_indx_forest";// 火情
+                 }
+                 String uuid = IdUtils.simpleUUID();
+                 R result = remoteMonitorService.getPlaybackByTime(uuid, busIndex, eventcatalogue.getCreateBy(),
+                         DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.subtractTime(eventcatalogue.getReportTime(), -2)),
+                         DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.subtractTime(eventcatalogue.getReportTime(), 1)));
+                 if (200 == result.getCode()) {
+                     //成功
+                     CentereventTFireLog centereventTFireLog = new CentereventTFireLog();
+                     centereventTFireLog.setId(uuid);
+                     centereventTFireLog.setEventCode(eventcatalogue.getEventCode());
+                     centereventTFireLog.setLogContent(SecurityUtils.getLoginUser().getSysUser().getNickName() + "下载该事件视频。");
+                     centereventTFireLog.setOperation("bus_oper_type_1");
+                     centereventTFireLog.setOperationType("log_oper_type_1");
+                     centereventTFireLogService.insertCentereventTFireLog(centereventTFireLog);
+                     CentereventTDownloads centereventTDownloads=new CentereventTDownloads();
+                     centereventTDownloads.setId(IdUtils.simpleUUID());
+                     centereventTDownloads.setEventCode(eventcatalogue.getEventCode());
+                     centereventTDownloads.setEventName(eventcatalogue.getEventName());
+                     centereventTDownloads.setLogId(uuid);
+                     centereventTDownloadsService.insertCentereventTDownloads(centereventTDownloads);
+                     //TimeUnit.MINUTES.sleep(5);//延时5分钟在调取
+                     Thread.sleep(300000);
+                 }else{
+                     //失败
+                     CentereventTDownloads centereventTDownloads=new CentereventTDownloads();
+                     centereventTDownloads.setId(IdUtils.simpleUUID());
+                     centereventTDownloads.setEventCode(eventcatalogue.getEventCode());
+                     centereventTDownloads.setEventName(eventcatalogue.getEventName());
+                     centereventTDownloads.setFlag("0");
+                     centereventTDownloads.setReason(result.getMsg());//失败原因
+                     centereventTDownloadsService.insertCentereventTDownloads(centereventTDownloads);
+                 }
+
+             }
+                //视频下载日志表 视频下载成功  定时任务结束回调,检验是否真的成功
+          List<CentereventTDownloads>  downloadsList= centereventTDownloadsService.validDownloadIs();
+             for (CentereventTDownloads down:downloadsList){
+                 if(StringUtils.isNotEmpty(down.getAttachPath())){
+                     down.setFlag("1");
+                     down.setPath(down.getAttachPath());
+                 }else{
+                     down.setFlag("0");
+                     down.setReason("视频在下载过程中失败!");
+                 }
+                 centereventTDownloadsService.updateCentereventTDownloads(down);
+             }
+        }
+        //redis.deleteObject(DOWN_LOCK);
+        //redis.setCacheObject(DOWN_LOCK, (long) 3600 * 12, TimeUnit.SECONDS);
+        logger.info("执行定时任务结束=====>{}", DateUtils.dateTimeNow());
+    }
+}

+ 53 - 0
src/main/resources/mapper/centereventteventcatalogue/CentereventTEventcatalogueMapper.xml

@@ -300,4 +300,57 @@
         where a.create_time between #{start} and #{end}
         limit #{limit}, 1
     </select>
+    <select id="getbeforedateDownload" resultMap="CentereventTEventcatalogueResult">
+
+        SELECT
+            a.id,
+            a.event_code,
+            a.event_type,
+            a.event_type_xl,
+            a.event_name,
+            a.event_description,
+            a.report_source,
+            a.longitude,
+            a.latitude,
+            a.reportor,
+            a.report_time,
+            a.is_urged,
+            a.event_status,
+            a.event_status_value,
+            a.create_by,
+            a.create_name,
+            a.create_time,
+            a.update_by,
+            a.update_name,
+            a.update_time,
+            a.data_status,
+            a.dept_id,
+            a.dept_name,
+            IFNULL( a.version, 0 ) version,
+            a.urge_count,
+            a.address,
+            a.escalation,
+            a.is_examine
+        FROM
+            centerevent_t_eventcatalogue a
+        WHERE
+             event_status_value NOT IN ( 'forest_event_status_3', 'forest_event_status_4' )
+             AND
+						report_source = 'reporting_source_1'
+            AND event_code IN (
+            SELECT
+                l.event_code
+            FROM
+                centerevent_t_fire_log l
+            WHERE
+                l.log_content LIKE '%确认该事件%'
+                    AND DATEDIFF( l.create_time, now( ) ) = - 1
+            AND l.event_code not IN  (
+            select  d.event_code from centerevent_t_downloads d where d.flag='1'
+					 AND DATEDIFF( d.create_time, now( ) ) = - 1
+						)
+
+
+            )
+    </select>
 </mapper>

+ 140 - 0
src/main/resources/mapper/download/CentereventTDownloadsMapper.xml

@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.event.centereventteventcatalogue.mapper.CentereventTDownloadsMapper">
+    
+    <resultMap type="CentereventTDownloads" id="CentereventTDownloadsResult">
+        <result property="id"    column="id"    />
+        <result property="eventCode"    column="event_code"    />
+        <result property="eventName"    column="event_name"    />
+        <result property="path"    column="path"    />
+        <result property="flag"    column="flag"    />
+        <result property="reason"    column="reason"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createName"    column="create_name"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateName"    column="update_name"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="attachPath"    column="attachPath"    />
+    </resultMap>
+
+    <sql id="selectCentereventTDownloadsVo">
+        select id, event_code, event_name, path, flag, reason, create_by, create_name, create_time, update_by, update_name, update_time from centerevent_t_downloads
+    </sql>
+
+    <select id="selectCentereventTDownloadsList" parameterType="CentereventTDownloads" resultMap="CentereventTDownloadsResult">
+        <include refid="selectCentereventTDownloadsVo"/>
+        <where>  
+            <if test="eventCode != null  and eventCode != ''"> and event_code = #{eventCode}</if>
+            <if test="eventName != null  and eventName != ''"> and event_name like concat('%', #{eventName}, '%')</if>
+            <if test="path != null  and path != ''"> and path = #{path}</if>
+            <if test="flag != null  and flag != ''"> and flag = #{flag}</if>
+            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
+            <if test="createName != null  and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
+            <if test="updateName != null  and updateName != ''"> and update_name like concat('%', #{updateName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectCentereventTDownloadsById" parameterType="String" resultMap="CentereventTDownloadsResult">
+        <include refid="selectCentereventTDownloadsVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCentereventTDownloads" parameterType="CentereventTDownloads">
+        insert into centerevent_t_downloads
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="eventCode != null">event_code,</if>
+            <if test="eventName != null">event_name,</if>
+            <if test="path != null">path,</if>
+            <if test="flag != null">flag,</if>
+            <if test="reason != null">reason,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createName != null">create_name,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateName != null">update_name,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="logId != null">log_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="eventCode != null">#{eventCode},</if>
+            <if test="eventName != null">#{eventName},</if>
+            <if test="path != null">#{path},</if>
+            <if test="flag != null">#{flag},</if>
+            <if test="reason != null">#{reason},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createName != null">#{createName},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateName != null">#{updateName},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="logId != null">#{logId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCentereventTDownloads" parameterType="CentereventTDownloads">
+        update centerevent_t_downloads
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="eventCode != null">event_code = #{eventCode},</if>
+            <if test="eventName != null">event_name = #{eventName},</if>
+            <if test="path != null">path = #{path},</if>
+            <if test="flag != null">flag = #{flag},</if>
+            <if test="reason != null">reason = #{reason},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createName != null">create_name = #{createName},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateName != null">update_name = #{updateName},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCentereventTDownloadsById" parameterType="String">
+        delete from centerevent_t_downloads where id = #{id}
+    </delete>
+
+    <delete id="deleteCentereventTDownloadsByIds" parameterType="String">
+        delete from centerevent_t_downloads where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    <select id="validDownloadIs" resultMap="CentereventTDownloadsResult">
+
+        SELECT
+            id,
+            event_code,
+            event_name,
+            path,
+            flag,
+            reason,
+            ch.attach_path AS attachPath
+        FROM
+            centerevent_t_downloads
+            LEFT JOIN onest_data.centerdata_t_attach ch ON log_id = ch.bus_id
+        WHERE
+            flag IS NULL
+            AND DATEDIFF( create_time, now( ) ) = - 1
+
+    </select>
+    <select id="validDownloadIsOne" parameterType="string" resultMap="CentereventTDownloadsResult">
+            SELECT
+            id,
+            event_code,
+            event_name,
+            path,
+            flag,
+            reason,
+            ch.attach_path AS attachPath
+        FROM
+            centerevent_t_downloads
+            LEFT JOIN onest_data.centerdata_t_attach ch ON log_id = ch.bus_id
+        WHERE
+            log_id = #{logId}
+    </select>
+</mapper>