mirror of https://gitee.com/y_project/RuoYi.git
tg消息管理功能
parent
3ae5fa0dc6
commit
56defd19f4
|
@ -154,7 +154,7 @@
|
|||
</plugin> -->
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<!-- <resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
|
@ -162,7 +162,7 @@
|
|||
<exclude>*.xml</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
</resources>-->
|
||||
</build>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,124 @@
|
|||
package com.ruoyi.web.controller.tg;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.TgMessageInfo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.service.ITgMessageInfoService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TG消息管理Controller
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tg/msg")
|
||||
public class TgMessageInfoController extends BaseController
|
||||
{
|
||||
private String prefix = "tg/msg";
|
||||
|
||||
@Autowired
|
||||
private ITgMessageInfoService tgMessageInfoService;
|
||||
|
||||
@RequiresPermissions("tg:msg:view")
|
||||
@GetMapping()
|
||||
public String msg()
|
||||
{
|
||||
return prefix + "/msg";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询TG消息管理列表
|
||||
*/
|
||||
@RequiresPermissions("tg:msg:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(TgMessageInfo tgMessageInfo)
|
||||
{
|
||||
startPage();
|
||||
List<TgMessageInfo> list = tgMessageInfoService.selectTgMessageInfoList(tgMessageInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出TG消息管理列表
|
||||
*/
|
||||
@RequiresPermissions("tg:msg:export")
|
||||
@Log(title = "TG消息管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(TgMessageInfo tgMessageInfo)
|
||||
{
|
||||
List<TgMessageInfo> list = tgMessageInfoService.selectTgMessageInfoList(tgMessageInfo);
|
||||
ExcelUtil<TgMessageInfo> util = new ExcelUtil<TgMessageInfo>(TgMessageInfo.class);
|
||||
return util.exportExcel(list, "TG消息管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增TG消息管理
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存TG消息管理
|
||||
*/
|
||||
@RequiresPermissions("tg:msg:add")
|
||||
@Log(title = "TG消息管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(TgMessageInfo tgMessageInfo)
|
||||
{
|
||||
return toAjax(tgMessageInfoService.insertTgMessageInfo(tgMessageInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改TG消息管理
|
||||
*/
|
||||
@RequiresPermissions("tg:msg:edit")
|
||||
@GetMapping("/edit/{idTgMessageInfo}")
|
||||
public String edit(@PathVariable("idTgMessageInfo") Long idTgMessageInfo, ModelMap mmap)
|
||||
{
|
||||
TgMessageInfo tgMessageInfo = tgMessageInfoService.selectTgMessageInfoByIdTgMessageInfo(idTgMessageInfo);
|
||||
mmap.put("tgMessageInfo", tgMessageInfo);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存TG消息管理
|
||||
*/
|
||||
@RequiresPermissions("tg:msg:edit")
|
||||
@Log(title = "TG消息管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(TgMessageInfo tgMessageInfo)
|
||||
{
|
||||
return toAjax(tgMessageInfoService.updateTgMessageInfo(tgMessageInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除TG消息管理
|
||||
*/
|
||||
@RequiresPermissions("tg:msg:remove")
|
||||
@Log(title = "TG消息管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(tgMessageInfoService.deleteTgMessageInfoByIdTgMessageInfos(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增TG消息管理')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
<th:block th:include="include :: select2-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-msg-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">消息内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="messageInfo" class="form-control" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">消息类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="messageType" class="form-control m-b" th:with="type=${@dict.getType('sys_tg_sms_msg_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">发送群组:</label>
|
||||
<div class="col-sm-8" th:with="type=${@dict.getType('sys_tg_chat_group_info')}">
|
||||
<!-- <label th:each="dict : ${type}" class="check-box">
|
||||
<input name="chatId" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}">
|
||||
</label>-->
|
||||
<select id="chatId" name="chatId" class="form-control select2-multiple" multiple required>
|
||||
<option th:each="dict : ${type}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行策略:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_tg_msg_exe_stragy')}">
|
||||
<input type="radio" th:id="${'executionStragy_' + dict.dictCode}" name="executionStragy" th:value="${dict.dictValue}" th:checked="${dict.default}" >
|
||||
<label th:for="${'executionStragy_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行周期:</label>
|
||||
<div class="col-sm-8">
|
||||
<span style="color: red">时分秒/H/M/S</span>
|
||||
<input name="intervalTime" class="form-control" placeholder="1H代表1小时执行一次" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">开始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="beginTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注信息:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: select2-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "tg/msg"
|
||||
$("#form-msg-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-msg-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='beginTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd hh:ii:ss",
|
||||
// minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,108 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改TG消息管理')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-msg-edit" th:object="${tgMessageInfo}">
|
||||
<input name="idTgMessageInfo" th:field="*{idTgMessageInfo}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">消息内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="messageInfo" class="form-control">[[*{messageInfo}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">消息类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="messageType" class="form-control m-b" th:with="type=${@dict.getType('sys_tg_sms_msg_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{messageType}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">tg会话id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="chatId" th:field="*{chatId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行周期:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="interval" th:field="*{interval}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">开始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="beginTime" th:value="${#dates.format(tgMessageInfo.beginTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">下次执行时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="nextRunTime" th:value="${#dates.format(tgMessageInfo.nextRunTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行策略:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_tg_msg_exe_stragy')}">
|
||||
<input type="radio" th:id="${'executionStragy_' + dict.dictCode}" name="executionStragy" th:value="${dict.dictValue}" th:field="*{executionStragy}">
|
||||
<label th:for="${'executionStragy_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_tg_sms_msg_status')}">
|
||||
<input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
||||
<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注信息:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "tg/msg";
|
||||
$("#form-msg-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-msg-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='beginTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$("input[name='nextRunTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,151 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('TG消息管理列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>消息类型:</label>
|
||||
<select name="messageType" th:with="type=${@dict.getType('sys_tg_sms_msg_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>任务状态:</label>
|
||||
<select name="status" th:with="type=${@dict.getType('sys_tg_sms_msg_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>创建时间:</label>
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="tg:msg:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="tg:msg:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="tg:msg:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="tg:msg:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('tg:msg:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('tg:msg:remove')}]];
|
||||
var messageTypeDatas = [[${@dict.getType('sys_tg_sms_msg_type')}]];
|
||||
var chatIdDatas = [[${@dict.getType('sys_tg_chat_group_info')}]];
|
||||
var executionStragyDatas = [[${@dict.getType('sys_tg_msg_exe_stragy')}]];
|
||||
var statusDatas = [[${@dict.getType('sys_tg_sms_msg_status')}]];
|
||||
var prefix = ctx + "tg/msg";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "TG消息管理",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'idTgMessageInfo',
|
||||
title: '主键',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'messageInfo',
|
||||
title: '消息内容'
|
||||
},
|
||||
{
|
||||
field: 'messageType',
|
||||
title: '消息类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(messageTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'chatId',
|
||||
title: 'tg会话id',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabels(chatIdDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'intervalTime',
|
||||
title: '执行周期'
|
||||
},
|
||||
{
|
||||
field: 'beginTime',
|
||||
title: '开始时间'
|
||||
},
|
||||
{
|
||||
field: 'nextRunTime',
|
||||
title: '下次执行时间',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'executionStragy',
|
||||
title: '执行策略',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(executionStragyDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '任务状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(statusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注信息'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.idTgMessageInfo + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.idTgMessageInfo + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,159 @@
|
|||
package com.ruoyi.common.core.domain.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* TG消息管理对象 tg_message_info
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public class TgMessageInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long idTgMessageInfo;
|
||||
|
||||
/** 消息内容 */
|
||||
@Excel(name = "消息内容")
|
||||
private String messageInfo;
|
||||
|
||||
/** 消息类型 */
|
||||
@Excel(name = "消息类型")
|
||||
private Long messageType;
|
||||
|
||||
/** tg会话id */
|
||||
@Excel(name = "tg会话id")
|
||||
private String chatId;
|
||||
|
||||
/** 执行周期 */
|
||||
@Excel(name = "执行周期")
|
||||
private String intervalTime;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date beginTime;
|
||||
|
||||
/** 下次执行时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次执行时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextRunTime;
|
||||
|
||||
/** 执行策略 */
|
||||
@Excel(name = "执行策略")
|
||||
private Long executionStragy;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态")
|
||||
private Long status;
|
||||
|
||||
public void setIdTgMessageInfo(Long idTgMessageInfo)
|
||||
{
|
||||
this.idTgMessageInfo = idTgMessageInfo;
|
||||
}
|
||||
|
||||
public Long getIdTgMessageInfo()
|
||||
{
|
||||
return idTgMessageInfo;
|
||||
}
|
||||
public void setMessageInfo(String messageInfo)
|
||||
{
|
||||
this.messageInfo = messageInfo;
|
||||
}
|
||||
|
||||
public String getMessageInfo()
|
||||
{
|
||||
return messageInfo;
|
||||
}
|
||||
public void setMessageType(Long messageType)
|
||||
{
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
public Long getMessageType()
|
||||
{
|
||||
return messageType;
|
||||
}
|
||||
public void setChatId(String chatId)
|
||||
{
|
||||
this.chatId = chatId;
|
||||
}
|
||||
|
||||
public String getChatId()
|
||||
{
|
||||
return chatId;
|
||||
}
|
||||
|
||||
public String getIntervalTime() {
|
||||
return intervalTime;
|
||||
}
|
||||
|
||||
public void setIntervalTime(String intervalTime) {
|
||||
this.intervalTime = intervalTime;
|
||||
}
|
||||
|
||||
public void setBeginTime(Date beginTime)
|
||||
{
|
||||
this.beginTime = beginTime;
|
||||
}
|
||||
|
||||
public Date getBeginTime()
|
||||
{
|
||||
return beginTime;
|
||||
}
|
||||
public void setNextRunTime(Date nextRunTime)
|
||||
{
|
||||
this.nextRunTime = nextRunTime;
|
||||
}
|
||||
|
||||
public Date getNextRunTime()
|
||||
{
|
||||
return nextRunTime;
|
||||
}
|
||||
public void setExecutionStragy(Long executionStragy)
|
||||
{
|
||||
this.executionStragy = executionStragy;
|
||||
}
|
||||
|
||||
public Long getExecutionStragy()
|
||||
{
|
||||
return executionStragy;
|
||||
}
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("idTgMessageInfo", getIdTgMessageInfo())
|
||||
.append("messageInfo", getMessageInfo())
|
||||
.append("messageType", getMessageType())
|
||||
.append("chatId", getChatId())
|
||||
.append("interval", getIntervalTime())
|
||||
.append("beginTime", getBeginTime())
|
||||
.append("nextRunTime", getNextRunTime())
|
||||
.append("executionStragy", getExecutionStragy())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.ruoyi.quartz.task;
|
|||
import com.ruoyi.common.core.domain.entity.SmsTaskTbl;
|
||||
import com.ruoyi.system.handler.GetSmsDetailTaskHandler;
|
||||
import com.ruoyi.system.mapper.SmsTaskTblMapper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -19,7 +20,8 @@ public class GetSmsDetailTask {
|
|||
public void doGetSmsDetailTask() {
|
||||
List<SmsTaskTbl> smsTaskTblList = smsTaskTblMapper.selectSmsTaskTblListNotComplete();
|
||||
|
||||
getSmsDetailTaskHandler.doGetSmsDetailTask(smsTaskTblList);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(smsTaskTblList)){
|
||||
getSmsDetailTaskHandler.doGetSmsDetailTask(smsTaskTblList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,12 +4,11 @@ import lombok.SneakyThrows;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.telegram.telegrambots.bots.TelegramLongPollingBot;
|
||||
import org.telegram.telegrambots.meta.api.objects.Update;
|
||||
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
|
||||
|
||||
@Component
|
||||
//@Component
|
||||
@Slf4j
|
||||
public class TgLongPollingBot extends TelegramLongPollingBot {
|
||||
|
||||
|
|
|
@ -152,8 +152,6 @@ public class TRX2EneryTransferHandler {
|
|||
.lcu("system").build();
|
||||
errorLogService.insertErrorLog(errorLog);
|
||||
|
||||
|
||||
|
||||
} finally {
|
||||
if (lock.isLocked()) {
|
||||
if (lock.isHeldByCurrentThread()) {
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.TgMessageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* TG消息管理Mapper接口
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public interface TgMessageInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询TG消息管理
|
||||
*
|
||||
* @param idTgMessageInfo TG消息管理主键
|
||||
* @return TG消息管理
|
||||
*/
|
||||
public TgMessageInfo selectTgMessageInfoByIdTgMessageInfo(Long idTgMessageInfo);
|
||||
|
||||
/**
|
||||
* 查询TG消息管理列表
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return TG消息管理集合
|
||||
*/
|
||||
public List<TgMessageInfo> selectTgMessageInfoList(TgMessageInfo tgMessageInfo);
|
||||
|
||||
/**
|
||||
* 新增TG消息管理
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTgMessageInfo(TgMessageInfo tgMessageInfo);
|
||||
|
||||
/**
|
||||
* 修改TG消息管理
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTgMessageInfo(TgMessageInfo tgMessageInfo);
|
||||
|
||||
/**
|
||||
* 删除TG消息管理
|
||||
*
|
||||
* @param idTgMessageInfo TG消息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTgMessageInfoByIdTgMessageInfo(Long idTgMessageInfo);
|
||||
|
||||
/**
|
||||
* 批量删除TG消息管理
|
||||
*
|
||||
* @param idTgMessageInfos 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTgMessageInfoByIdTgMessageInfos(String[] idTgMessageInfos);
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.TgMessageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* TG消息管理Service接口
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public interface ITgMessageInfoService
|
||||
{
|
||||
/**
|
||||
* 查询TG消息管理
|
||||
*
|
||||
* @param idTgMessageInfo TG消息管理主键
|
||||
* @return TG消息管理
|
||||
*/
|
||||
public TgMessageInfo selectTgMessageInfoByIdTgMessageInfo(Long idTgMessageInfo);
|
||||
|
||||
/**
|
||||
* 查询TG消息管理列表
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return TG消息管理集合
|
||||
*/
|
||||
public List<TgMessageInfo> selectTgMessageInfoList(TgMessageInfo tgMessageInfo);
|
||||
|
||||
/**
|
||||
* 新增TG消息管理
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTgMessageInfo(TgMessageInfo tgMessageInfo);
|
||||
|
||||
/**
|
||||
* 修改TG消息管理
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTgMessageInfo(TgMessageInfo tgMessageInfo);
|
||||
|
||||
/**
|
||||
* 批量删除TG消息管理
|
||||
*
|
||||
* @param idTgMessageInfos 需要删除的TG消息管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTgMessageInfoByIdTgMessageInfos(String idTgMessageInfos);
|
||||
|
||||
/**
|
||||
* 删除TG消息管理信息
|
||||
*
|
||||
* @param idTgMessageInfo TG消息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTgMessageInfoByIdTgMessageInfo(Long idTgMessageInfo);
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.TgMessageInfo;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.mapper.TgMessageInfoMapper;
|
||||
import com.ruoyi.system.service.ITgMessageInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TG消息管理Service业务层处理
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
@Service
|
||||
public class TgMessageInfoServiceImpl implements ITgMessageInfoService
|
||||
{
|
||||
@Autowired
|
||||
private TgMessageInfoMapper tgMessageInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询TG消息管理
|
||||
*
|
||||
* @param idTgMessageInfo TG消息管理主键
|
||||
* @return TG消息管理
|
||||
*/
|
||||
@Override
|
||||
public TgMessageInfo selectTgMessageInfoByIdTgMessageInfo(Long idTgMessageInfo)
|
||||
{
|
||||
return tgMessageInfoMapper.selectTgMessageInfoByIdTgMessageInfo(idTgMessageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询TG消息管理列表
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return TG消息管理
|
||||
*/
|
||||
@Override
|
||||
public List<TgMessageInfo> selectTgMessageInfoList(TgMessageInfo tgMessageInfo)
|
||||
{
|
||||
return tgMessageInfoMapper.selectTgMessageInfoList(tgMessageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增TG消息管理
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTgMessageInfo(TgMessageInfo tgMessageInfo)
|
||||
{
|
||||
tgMessageInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return tgMessageInfoMapper.insertTgMessageInfo(tgMessageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改TG消息管理
|
||||
*
|
||||
* @param tgMessageInfo TG消息管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTgMessageInfo(TgMessageInfo tgMessageInfo)
|
||||
{
|
||||
tgMessageInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return tgMessageInfoMapper.updateTgMessageInfo(tgMessageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除TG消息管理
|
||||
*
|
||||
* @param idTgMessageInfos 需要删除的TG消息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTgMessageInfoByIdTgMessageInfos(String idTgMessageInfos)
|
||||
{
|
||||
return tgMessageInfoMapper.deleteTgMessageInfoByIdTgMessageInfos(Convert.toStrArray(idTgMessageInfos));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除TG消息管理信息
|
||||
*
|
||||
* @param idTgMessageInfo TG消息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTgMessageInfoByIdTgMessageInfo(Long idTgMessageInfo)
|
||||
{
|
||||
return tgMessageInfoMapper.deleteTgMessageInfoByIdTgMessageInfo(idTgMessageInfo);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
<?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.ruoyi.system.mapper.TgMessageInfoMapper">
|
||||
|
||||
<resultMap type="TgMessageInfo" id="TgMessageInfoResult">
|
||||
<result property="idTgMessageInfo" column="id_tg_message_info" />
|
||||
<result property="messageInfo" column="message_info" />
|
||||
<result property="messageType" column="message_type" />
|
||||
<result property="chatId" column="chat_id" />
|
||||
<result property="intervalTime" column="interval_time" />
|
||||
<result property="beginTime" column="begin_time" />
|
||||
<result property="nextRunTime" column="next_run_time" />
|
||||
<result property="executionStragy" column="execution_stragy" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTgMessageInfoVo">
|
||||
select id_tg_message_info, message_info, message_type, chat_id, interval_time, begin_time, next_run_time, execution_stragy, status, create_by, create_time, update_by, update_time, remark from tg_message_info
|
||||
</sql>
|
||||
|
||||
<select id="selectTgMessageInfoList" parameterType="TgMessageInfo" resultMap="TgMessageInfoResult">
|
||||
<include refid="selectTgMessageInfoVo"/>
|
||||
<where>
|
||||
<if test="messageType != null "> and message_type = #{messageType}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTgMessageInfoByIdTgMessageInfo" parameterType="Long" resultMap="TgMessageInfoResult">
|
||||
<include refid="selectTgMessageInfoVo"/>
|
||||
where id_tg_message_info = #{idTgMessageInfo}
|
||||
</select>
|
||||
|
||||
<insert id="insertTgMessageInfo" parameterType="TgMessageInfo" useGeneratedKeys="true" keyProperty="idTgMessageInfo">
|
||||
insert into tg_message_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="messageInfo != null">message_info,</if>
|
||||
<if test="messageType != null">message_type,</if>
|
||||
<if test="chatId != null">chat_id,</if>
|
||||
<if test="intervalTime != null">interval_time,</if>
|
||||
<if test="beginTime != null">begin_time,</if>
|
||||
<if test="nextRunTime != null">next_run_time,</if>
|
||||
<if test="executionStragy != null">execution_stragy,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="messageInfo != null">#{messageInfo},</if>
|
||||
<if test="messageType != null">#{messageType},</if>
|
||||
<if test="chatId != null">#{chatId},</if>
|
||||
<if test="intervalTime != null">#{intervalTime},</if>
|
||||
<if test="beginTime != null">#{beginTime},</if>
|
||||
<if test="nextRunTime != null">#{nextRunTime},</if>
|
||||
<if test="executionStragy != null">#{executionStragy},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTgMessageInfo" parameterType="TgMessageInfo">
|
||||
update tg_message_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="messageInfo != null">message_info = #{messageInfo},</if>
|
||||
<if test="messageType != null">message_type = #{messageType},</if>
|
||||
<if test="chatId != null">chat_id = #{chatId},</if>
|
||||
<if test="intervalTime != null">interval_time = #{intervalTime},</if>
|
||||
<if test="beginTime != null">begin_time = #{beginTime},</if>
|
||||
<if test="nextRunTime != null">next_run_time = #{nextRunTime},</if>
|
||||
<if test="executionStragy != null">execution_stragy = #{executionStragy},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id_tg_message_info = #{idTgMessageInfo}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTgMessageInfoByIdTgMessageInfo" parameterType="Long">
|
||||
delete from tg_message_info where id_tg_message_info = #{idTgMessageInfo}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTgMessageInfoByIdTgMessageInfos" parameterType="String">
|
||||
delete from tg_message_info where id_tg_message_info in
|
||||
<foreach item="idTgMessageInfo" collection="array" open="(" separator="," close=")">
|
||||
#{idTgMessageInfo}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue