mirror of https://gitee.com/y_project/RuoYi.git
短信对接
parent
46f199145f
commit
8d75f9f3e7
|
@ -147,7 +147,7 @@
|
|||
</plugin> -->
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<!-- <resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
|
@ -155,7 +155,7 @@
|
|||
<exclude>*.xml</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
</resources>-->
|
||||
</build>
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.ruoyi.system.domain.vo.TronInfoVO;
|
|||
import com.ruoyi.system.service.IApiService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
@ -27,5 +28,10 @@ public class ApiController {
|
|||
return R.ok(tronInfoVO);
|
||||
}
|
||||
|
||||
@GetMapping("/transferusdt/{amount}")
|
||||
public R<String> transferusdt(@PathVariable("amount") String amount) throws Exception {
|
||||
String txid = apiService.transferusdt(amount);
|
||||
return R.ok(txid);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,124 @@
|
|||
package com.ruoyi.web.controller.sms;
|
||||
|
||||
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.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SmsChannelTbl;
|
||||
import com.ruoyi.system.service.ISmsChannelTblService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 短信渠道管理Controller
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-05-28
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/sms/channel")
|
||||
public class SmsChannelTblController extends BaseController
|
||||
{
|
||||
private String prefix = "sms/channel";
|
||||
|
||||
@Autowired
|
||||
private ISmsChannelTblService smsChannelTblService;
|
||||
|
||||
@RequiresPermissions("sms:channel:view")
|
||||
@GetMapping()
|
||||
public String channel()
|
||||
{
|
||||
return prefix + "/channel";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询短信渠道管理列表
|
||||
*/
|
||||
@RequiresPermissions("sms:channel:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SmsChannelTbl smsChannelTbl)
|
||||
{
|
||||
startPage();
|
||||
List<SmsChannelTbl> list = smsChannelTblService.selectSmsChannelTblList(smsChannelTbl);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出短信渠道管理列表
|
||||
*/
|
||||
@RequiresPermissions("sms:channel:export")
|
||||
@Log(title = "短信渠道管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SmsChannelTbl smsChannelTbl)
|
||||
{
|
||||
List<SmsChannelTbl> list = smsChannelTblService.selectSmsChannelTblList(smsChannelTbl);
|
||||
ExcelUtil<SmsChannelTbl> util = new ExcelUtil<SmsChannelTbl>(SmsChannelTbl.class);
|
||||
return util.exportExcel(list, "短信渠道管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增短信渠道管理
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存短信渠道管理
|
||||
*/
|
||||
@RequiresPermissions("sms:channel:add")
|
||||
@Log(title = "短信渠道管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(SmsChannelTbl smsChannelTbl)
|
||||
{
|
||||
return toAjax(smsChannelTblService.insertSmsChannelTbl(smsChannelTbl));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改短信渠道管理
|
||||
*/
|
||||
@RequiresPermissions("sms:channel:edit")
|
||||
@GetMapping("/edit/{idSmsChannel}")
|
||||
public String edit(@PathVariable("idSmsChannel") Long idSmsChannel, ModelMap mmap)
|
||||
{
|
||||
SmsChannelTbl smsChannelTbl = smsChannelTblService.selectSmsChannelTblByIdSmsChannel(idSmsChannel);
|
||||
mmap.put("smsChannelTbl", smsChannelTbl);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存短信渠道管理
|
||||
*/
|
||||
@RequiresPermissions("sms:channel:edit")
|
||||
@Log(title = "短信渠道管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(SmsChannelTbl smsChannelTbl)
|
||||
{
|
||||
return toAjax(smsChannelTblService.updateSmsChannelTbl(smsChannelTbl));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除短信渠道管理
|
||||
*/
|
||||
@RequiresPermissions("sms:channel:remove")
|
||||
@Log(title = "短信渠道管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(smsChannelTblService.deleteSmsChannelTblByIdSmsChannels(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
package com.ruoyi.web.controller.sms;
|
||||
|
||||
|
||||
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.SmsTaskTbl;
|
||||
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.ISmsTaskTblService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* WS短信任务配置Controller
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-06-01
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/sms/task")
|
||||
public class SmsTaskTblController extends BaseController
|
||||
{
|
||||
private String prefix = "sms/task";
|
||||
|
||||
@Autowired
|
||||
private ISmsTaskTblService smsTaskTblService;
|
||||
|
||||
@RequiresPermissions("sms:task:view")
|
||||
@GetMapping()
|
||||
public String task()
|
||||
{
|
||||
return prefix + "/task";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询WS短信任务配置列表
|
||||
*/
|
||||
@RequiresPermissions("sms:task:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
startPage();
|
||||
List<SmsTaskTbl> list = smsTaskTblService.selectSmsTaskTblList(smsTaskTbl);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出WS短信任务配置列表
|
||||
*/
|
||||
@RequiresPermissions("sms:task:export")
|
||||
@Log(title = "WS短信任务配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
List<SmsTaskTbl> list = smsTaskTblService.selectSmsTaskTblList(smsTaskTbl);
|
||||
ExcelUtil<SmsTaskTbl> util = new ExcelUtil<SmsTaskTbl>(SmsTaskTbl.class);
|
||||
return util.exportExcel(list, "WS短信任务配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增WS短信任务配置
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存WS短信任务配置
|
||||
*/
|
||||
@RequiresPermissions("sms:task:add")
|
||||
@Log(title = "WS短信任务配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
return toAjax(smsTaskTblService.insertSmsTaskTbl(smsTaskTbl));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改WS短信任务配置
|
||||
*/
|
||||
@RequiresPermissions("sms:task:edit")
|
||||
@GetMapping("/edit/{idSmsTask}")
|
||||
public String edit(@PathVariable("idSmsTask") Long idSmsTask, ModelMap mmap)
|
||||
{
|
||||
SmsTaskTbl smsTaskTbl = smsTaskTblService.selectSmsTaskTblByIdSmsTask(idSmsTask);
|
||||
mmap.put("smsTaskTbl", smsTaskTbl);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存WS短信任务配置
|
||||
*/
|
||||
@RequiresPermissions("sms:task:edit")
|
||||
@Log(title = "WS短信任务配置", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
return toAjax(smsTaskTblService.updateSmsTaskTbl(smsTaskTbl));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除WS短信任务配置
|
||||
*/
|
||||
@RequiresPermissions("sms:task:remove")
|
||||
@Log(title = "WS短信任务配置", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(smsTaskTblService.deleteSmsTaskTblByIdSmsTasks(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增短信渠道管理')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-channel-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">渠道id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="channelId" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">appid:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="appid" 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="secret" 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="publicKey" class="form-control" type="text">
|
||||
</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_sms_busi_type')}">
|
||||
<label th:each="dict : ${type}" class="check-box">
|
||||
<input name="smsBusiType" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "sms/channel"
|
||||
$("#form-channel-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-channel-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,119 @@
|
|||
<!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('短信渠道管理列表')" />
|
||||
</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>渠道id:</label>
|
||||
<input type="text" name="channelId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>appid:</label>
|
||||
<input type="text" name="appid"/>
|
||||
</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="sms:channel:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="sms:channel:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sms:channel:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="sms:channel: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('sms:channel:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('sms:channel:remove')}]];
|
||||
var smsBusiTypeDatas = [[${@dict.getType('sys_sms_busi_type')}]];
|
||||
var prefix = ctx + "sms/channel";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "短信渠道管理",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'idSmsChannel',
|
||||
title: '主键',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'channelId',
|
||||
title: '渠道id'
|
||||
},
|
||||
{
|
||||
field: 'appid',
|
||||
title: 'appid'
|
||||
},
|
||||
{
|
||||
field: 'secret',
|
||||
title: '口令'
|
||||
},
|
||||
{
|
||||
field: 'publicKey',
|
||||
title: '公钥',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'smsBusiType',
|
||||
title: '短信支持类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabels(smsBusiTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
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.idSmsChannel + '\')"><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.idSmsChannel + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改短信渠道管理')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-channel-edit" th:object="${smsChannelTbl}">
|
||||
<input name="idSmsChannel" th:field="*{idSmsChannel}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">渠道id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="channelId" th:field="*{channelId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">appid:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="appid" th:field="*{appid}" 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="secret" th:field="*{secret}" 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="publicKey" th:field="*{publicKey}" class="form-control" type="text">
|
||||
</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_sms_busi_type')}">
|
||||
<label th:each="dict : ${type}" class="check-box">
|
||||
<input name="smsBusiType" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" th:attr="checked=${smsChannelTbl.smsBusiType.contains(dict.dictValue)?true:false}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "sms/channel";
|
||||
$("#form-channel-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-channel-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,122 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增WS短信任务配置')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
|
||||
<th:block th:include="include :: bootstrap-fileinput-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-task-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">任务名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="taskName" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">短信类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="smsBusiType" class="form-control m-b" th:with="type=${@dict.getType('sys_sms_busi_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">
|
||||
<input name="price" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="font-noraml col-sm-3 control-label">物料</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading" >
|
||||
<input id="singleFile" name="file" type="file">
|
||||
</div>
|
||||
<input type="hidden" name="fileName" id="fileName">
|
||||
<input type="hidden" name="filePath" id="filePath">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">任务开始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="taskBeginTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text" required>
|
||||
<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">
|
||||
<select name="smsContentType" class="form-control m-b" th:with="type=${@dict.getType('sys_sms_content_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">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_sms_task_status')}">
|
||||
<input type="radio" th:id="${'taskStatus_' + dict.dictCode}" name="taskStatus" th:value="${dict.dictValue}" th:checked="${dict.default}">
|
||||
<label th:for="${'taskStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "sms/task"
|
||||
$("#form-task-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-task-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='taskBeginTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd hh:ii:ss",
|
||||
// minView: "second",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
// 单图上传
|
||||
$("#singleFile").fileinput({
|
||||
uploadUrl: ctx + 'common/upload',
|
||||
maxFileCount: 1,
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
var rsp = data.response;
|
||||
$("#filePath").val(rsp.url);
|
||||
$("#fileName").val(rsp.originalFilename);
|
||||
// log.info("return url:" + rsp.url)
|
||||
// log.info("reutrn fileName:" + rsp.fileName)
|
||||
// log.info("reutrn newFileName:" + rsp.newFileName)
|
||||
// log.info("return originalFilename:" + rsp.originalFilename)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
$("#filePath").val('');
|
||||
$("#fileName").val('');
|
||||
}).on('filecleared', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
$("#filePath").val('');
|
||||
$("#fileName").val('');
|
||||
}).on('filedeleted', function (event, vKey, jqXHR, extraData) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
$("#filePath").val('');
|
||||
$("#fileName").val('');
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改WS短信任务配置')" />
|
||||
<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-task-edit" th:object="${smsTaskTbl}">
|
||||
<input name="idSmsTask" th:field="*{idSmsTask}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">任务名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="taskName" th:field="*{taskName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">短信类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="smsBusiType" class="form-control m-b" th:with="type=${@dict.getType('sys_sms_busi_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{smsBusiType}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">单价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="price" th:field="*{price}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">任务开始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="taskBeginTime" th:value="${#dates.format(smsTaskTbl.taskBeginTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
|
||||
<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">
|
||||
<select name="smsContentType" class="form-control m-b" th:with="type=${@dict.getType('sys_sms_content_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{smsContentType}"></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_sms_task_status')}">
|
||||
<input type="radio" th:id="${'taskStatus_' + dict.dictCode}" name="taskStatus" th:value="${dict.dictValue}" th:field="*{taskStatus}">
|
||||
<label th:for="${'taskStatus_' + 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">
|
||||
<input name="successRate" th:field="*{successRate}" 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="issueCount" th:field="*{issueCount}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "sms/task";
|
||||
$("#form-task-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-task-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='taskBeginTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,167 @@
|
|||
<!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('WS短信任务配置列表')" />
|
||||
</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>
|
||||
<input type="text" name="taskName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>任务状态:</label>
|
||||
<select name="taskStatus" th:with="type=${@dict.getType('sys_sms_task_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="sms:task:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="sms:task:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sms:task:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="sms:task: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('sms:task:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('sms:task:remove')}]];
|
||||
var smsBusiTypeDatas = [[${@dict.getType('sys_sms_busi_type')}]];
|
||||
var smsContentTypeDatas = [[${@dict.getType('sys_sms_content_type')}]];
|
||||
var taskStatusDatas = [[${@dict.getType('sys_sms_task_status')}]];
|
||||
var prefix = ctx + "sms/task";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "WS短信任务配置",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'idSmsTask',
|
||||
title: '主键',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'taskName',
|
||||
title: '任务名称'
|
||||
},
|
||||
{
|
||||
field: 'smsBusiType',
|
||||
title: '短信类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(smsBusiTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'price',
|
||||
title: '单价'
|
||||
},
|
||||
{
|
||||
field: 'taskBeginTime',
|
||||
title: '任务开始时间'
|
||||
},
|
||||
{
|
||||
field: 'fileName',
|
||||
title: '物料名称',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'filePath',
|
||||
title: '物料文件下载地址',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'smsContentType',
|
||||
title: '内容类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(smsContentTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'taskStatus',
|
||||
title: '任务状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(taskStatusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'successRate',
|
||||
title: '成功数'
|
||||
},
|
||||
{
|
||||
field: 'issueCount',
|
||||
title: '物料总数'
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建者'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
field: 'updateBy',
|
||||
title: '更新者',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
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.idSmsTask + '\')"><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.idSmsTask + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,212 @@
|
|||
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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* WS短信任务配置对象 sms_task_tbl
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-06-01
|
||||
*/
|
||||
public class SmsTaskTbl extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long idSmsTask;
|
||||
|
||||
/** 任务名称 */
|
||||
@Excel(name = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
/** 短信类型 */
|
||||
@Excel(name = "短信类型")
|
||||
private String smsBusiType;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 任务开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "任务开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date taskBeginTime;
|
||||
|
||||
/** 物料名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String fileName;
|
||||
|
||||
/** 物料文件下载地址 */
|
||||
@Excel(name = "物料文件下载地址")
|
||||
private String filePath;
|
||||
|
||||
/** 物料文件MD5值 */
|
||||
private String fileMd5;
|
||||
|
||||
/** 任务文本内容base64加密字符串 */
|
||||
private String context;
|
||||
|
||||
/** 内容类型 */
|
||||
@Excel(name = "内容类型")
|
||||
private String smsContentType;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
/** 成功数 */
|
||||
@Excel(name = "成功数")
|
||||
private String successRate;
|
||||
|
||||
/** 物料总数 */
|
||||
@Excel(name = "物料总数")
|
||||
private Long issueCount;
|
||||
|
||||
public void setIdSmsTask(Long idSmsTask)
|
||||
{
|
||||
this.idSmsTask = idSmsTask;
|
||||
}
|
||||
|
||||
public Long getIdSmsTask()
|
||||
{
|
||||
return idSmsTask;
|
||||
}
|
||||
public void setTaskName(String taskName)
|
||||
{
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskName()
|
||||
{
|
||||
return taskName;
|
||||
}
|
||||
public void setSmsBusiType(String smsBusiType)
|
||||
{
|
||||
this.smsBusiType = smsBusiType;
|
||||
}
|
||||
|
||||
public String getSmsBusiType()
|
||||
{
|
||||
return smsBusiType;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setTaskBeginTime(Date taskBeginTime)
|
||||
{
|
||||
this.taskBeginTime = taskBeginTime;
|
||||
}
|
||||
|
||||
public Date getTaskBeginTime()
|
||||
{
|
||||
return taskBeginTime;
|
||||
}
|
||||
public void setFileName(String fileName)
|
||||
{
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileName()
|
||||
{
|
||||
return fileName;
|
||||
}
|
||||
public void setFilePath(String filePath)
|
||||
{
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getFilePath()
|
||||
{
|
||||
return filePath;
|
||||
}
|
||||
public void setFileMd5(String fileMd5)
|
||||
{
|
||||
this.fileMd5 = fileMd5;
|
||||
}
|
||||
|
||||
public String getFileMd5()
|
||||
{
|
||||
return fileMd5;
|
||||
}
|
||||
public void setContext(String context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public String getContext()
|
||||
{
|
||||
return context;
|
||||
}
|
||||
public void setSmsContentType(String smsContentType)
|
||||
{
|
||||
this.smsContentType = smsContentType;
|
||||
}
|
||||
|
||||
public String getSmsContentType()
|
||||
{
|
||||
return smsContentType;
|
||||
}
|
||||
public void setTaskStatus(String taskStatus)
|
||||
{
|
||||
this.taskStatus = taskStatus;
|
||||
}
|
||||
|
||||
public String getTaskStatus()
|
||||
{
|
||||
return taskStatus;
|
||||
}
|
||||
public void setSuccessRate(String successRate)
|
||||
{
|
||||
this.successRate = successRate;
|
||||
}
|
||||
|
||||
public String getSuccessRate()
|
||||
{
|
||||
return successRate;
|
||||
}
|
||||
public void setIssueCount(Long issueCount)
|
||||
{
|
||||
this.issueCount = issueCount;
|
||||
}
|
||||
|
||||
public Long getIssueCount()
|
||||
{
|
||||
return issueCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("idSmsTask", getIdSmsTask())
|
||||
.append("taskName", getTaskName())
|
||||
.append("smsBusiType", getSmsBusiType())
|
||||
.append("price", getPrice())
|
||||
.append("taskBeginTime", getTaskBeginTime())
|
||||
.append("fileName", getFileName())
|
||||
.append("filePath", getFilePath())
|
||||
.append("fileMd5", getFileMd5())
|
||||
.append("context", getContext())
|
||||
.append("smsContentType", getSmsContentType())
|
||||
.append("taskStatus", getTaskStatus())
|
||||
.append("successRate", getSuccessRate())
|
||||
.append("issueCount", getIssueCount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 短信渠道管理对象 sms_channel_tbl
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-05-28
|
||||
*/
|
||||
public class SmsChannelTbl extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long idSmsChannel;
|
||||
|
||||
/** 渠道id */
|
||||
@Excel(name = "渠道id")
|
||||
private String channelId;
|
||||
|
||||
/** appid */
|
||||
@Excel(name = "appid")
|
||||
private String appid;
|
||||
|
||||
/** 口令 */
|
||||
@Excel(name = "口令")
|
||||
private String secret;
|
||||
|
||||
/** 公钥 */
|
||||
@Excel(name = "公钥")
|
||||
private String publicKey;
|
||||
|
||||
/** 短信支持类型 */
|
||||
@Excel(name = "短信支持类型")
|
||||
private String smsBusiType;
|
||||
|
||||
public void setIdSmsChannel(Long idSmsChannel)
|
||||
{
|
||||
this.idSmsChannel = idSmsChannel;
|
||||
}
|
||||
|
||||
public Long getIdSmsChannel()
|
||||
{
|
||||
return idSmsChannel;
|
||||
}
|
||||
public void setChannelId(String channelId)
|
||||
{
|
||||
this.channelId = channelId;
|
||||
}
|
||||
|
||||
public String getChannelId()
|
||||
{
|
||||
return channelId;
|
||||
}
|
||||
public void setAppid(String appid)
|
||||
{
|
||||
this.appid = appid;
|
||||
}
|
||||
|
||||
public String getAppid()
|
||||
{
|
||||
return appid;
|
||||
}
|
||||
public void setSecret(String secret)
|
||||
{
|
||||
this.secret = secret;
|
||||
}
|
||||
|
||||
public String getSecret()
|
||||
{
|
||||
return secret;
|
||||
}
|
||||
public void setPublicKey(String publicKey)
|
||||
{
|
||||
this.publicKey = publicKey;
|
||||
}
|
||||
|
||||
public String getPublicKey()
|
||||
{
|
||||
return publicKey;
|
||||
}
|
||||
public void setSmsBusiType(String smsBusiType)
|
||||
{
|
||||
this.smsBusiType = smsBusiType;
|
||||
}
|
||||
|
||||
public String getSmsBusiType()
|
||||
{
|
||||
return smsBusiType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("idSmsChannel", getIdSmsChannel())
|
||||
.append("channelId", getChannelId())
|
||||
.append("appid", getAppid())
|
||||
.append("secret", getSecret())
|
||||
.append("publicKey", getPublicKey())
|
||||
.append("smsBusiType", getSmsBusiType())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -202,6 +202,9 @@ public class Usdt2TrxTransferHandler {
|
|||
|
||||
usdtExchangeInfoMapper.insertUsdtExchangeInfo(usdtExchangeInfo);
|
||||
|
||||
if (oneUsdtToTrxPair == null){
|
||||
return;
|
||||
}
|
||||
doSendTgNotice(oneUsdtToTrxPair.getFirst(), from, trxValue, transferValue, txId);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.system.domain.SmsChannelTbl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 短信渠道管理Mapper接口
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-05-28
|
||||
*/
|
||||
public interface SmsChannelTblMapper
|
||||
{
|
||||
/**
|
||||
* 查询短信渠道管理
|
||||
*
|
||||
* @param idSmsChannel 短信渠道管理主键
|
||||
* @return 短信渠道管理
|
||||
*/
|
||||
public SmsChannelTbl selectSmsChannelTblByIdSmsChannel(Long idSmsChannel);
|
||||
|
||||
/**
|
||||
* 查询短信渠道管理列表
|
||||
*
|
||||
* @param smsChannelTbl 短信渠道管理
|
||||
* @return 短信渠道管理集合
|
||||
*/
|
||||
public List<SmsChannelTbl> selectSmsChannelTblList(SmsChannelTbl smsChannelTbl);
|
||||
|
||||
/**
|
||||
* 新增短信渠道管理
|
||||
*
|
||||
* @param smsChannelTbl 短信渠道管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmsChannelTbl(SmsChannelTbl smsChannelTbl);
|
||||
|
||||
/**
|
||||
* 修改短信渠道管理
|
||||
*
|
||||
* @param smsChannelTbl 短信渠道管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSmsChannelTbl(SmsChannelTbl smsChannelTbl);
|
||||
|
||||
/**
|
||||
* 删除短信渠道管理
|
||||
*
|
||||
* @param idSmsChannel 短信渠道管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmsChannelTblByIdSmsChannel(Long idSmsChannel);
|
||||
|
||||
/**
|
||||
* 批量删除短信渠道管理
|
||||
*
|
||||
* @param idSmsChannels 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmsChannelTblByIdSmsChannels(String[] idSmsChannels);
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SmsTaskTbl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* WS短信任务配置Mapper接口
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-06-01
|
||||
*/
|
||||
public interface SmsTaskTblMapper
|
||||
{
|
||||
/**
|
||||
* 查询WS短信任务配置
|
||||
*
|
||||
* @param idSmsTask WS短信任务配置主键
|
||||
* @return WS短信任务配置
|
||||
*/
|
||||
public SmsTaskTbl selectSmsTaskTblByIdSmsTask(Long idSmsTask);
|
||||
|
||||
/**
|
||||
* 查询WS短信任务配置列表
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return WS短信任务配置集合
|
||||
*/
|
||||
public List<SmsTaskTbl> selectSmsTaskTblList(SmsTaskTbl smsTaskTbl);
|
||||
|
||||
/**
|
||||
* 新增WS短信任务配置
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmsTaskTbl(SmsTaskTbl smsTaskTbl);
|
||||
|
||||
/**
|
||||
* 修改WS短信任务配置
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSmsTaskTbl(SmsTaskTbl smsTaskTbl);
|
||||
|
||||
/**
|
||||
* 删除WS短信任务配置
|
||||
*
|
||||
* @param idSmsTask WS短信任务配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmsTaskTblByIdSmsTask(Long idSmsTask);
|
||||
|
||||
/**
|
||||
* 批量删除WS短信任务配置
|
||||
*
|
||||
* @param idSmsTasks 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmsTaskTblByIdSmsTasks(String[] idSmsTasks);
|
||||
}
|
|
@ -61,7 +61,7 @@ public interface IAccountAddressInfoService
|
|||
*/
|
||||
public int deleteAccountAddressInfoByIdAccoutAddressInfo(Long idAccoutAddressInfo);
|
||||
|
||||
Object selectAccountAddressInfoAll(String busiType);
|
||||
List<AccountAddressInfo> selectAccountAddressInfoAll(String busiType);
|
||||
|
||||
String getDecryptPrivateKey(String address) throws Exception;
|
||||
|
||||
|
|
|
@ -5,4 +5,5 @@ import com.ruoyi.system.domain.vo.TronInfoVO;
|
|||
public interface IApiService {
|
||||
TronInfoVO getTronInfo() throws Exception;
|
||||
|
||||
String transferusdt(String amount) throws Exception;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SmsTaskTbl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* WS短信任务配置Service接口
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-06-01
|
||||
*/
|
||||
public interface ISmsTaskTblService
|
||||
{
|
||||
/**
|
||||
* 查询WS短信任务配置
|
||||
*
|
||||
* @param idSmsTask WS短信任务配置主键
|
||||
* @return WS短信任务配置
|
||||
*/
|
||||
public SmsTaskTbl selectSmsTaskTblByIdSmsTask(Long idSmsTask);
|
||||
|
||||
/**
|
||||
* 查询WS短信任务配置列表
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return WS短信任务配置集合
|
||||
*/
|
||||
public List<SmsTaskTbl> selectSmsTaskTblList(SmsTaskTbl smsTaskTbl);
|
||||
|
||||
/**
|
||||
* 新增WS短信任务配置
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmsTaskTbl(SmsTaskTbl smsTaskTbl);
|
||||
|
||||
/**
|
||||
* 修改WS短信任务配置
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSmsTaskTbl(SmsTaskTbl smsTaskTbl);
|
||||
|
||||
/**
|
||||
* 批量删除WS短信任务配置
|
||||
*
|
||||
* @param idSmsTasks 需要删除的WS短信任务配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmsTaskTblByIdSmsTasks(String idSmsTasks);
|
||||
|
||||
/**
|
||||
* 删除WS短信任务配置信息
|
||||
*
|
||||
* @param idSmsTask WS短信任务配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmsTaskTblByIdSmsTask(Long idSmsTask);
|
||||
}
|
|
@ -4,21 +4,30 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.core.domain.entity.AccountAddressInfo;
|
||||
import com.ruoyi.common.utils.DictUtils;
|
||||
import com.ruoyi.common.utils.encrpt.Dt;
|
||||
import com.ruoyi.system.domain.vo.TransactionLogVO;
|
||||
import com.ruoyi.system.domain.vo.TronInfoVO;
|
||||
import com.ruoyi.system.handler.Usdt2TrxTransferHandler;
|
||||
import com.ruoyi.system.mapper.TrxExchangeInfoMapper;
|
||||
import com.ruoyi.system.service.IAccountAddressInfoService;
|
||||
import com.ruoyi.system.service.IApiService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.tron.trident.core.ApiWrapper;
|
||||
import org.tron.trident.core.contract.Contract;
|
||||
import org.tron.trident.core.contract.Trc20Contract;
|
||||
import org.tron.trident.utils.Convert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@Service
|
||||
public class ApiServiceImpl implements IApiService {
|
||||
private static final Logger log = LoggerFactory.getLogger(ApiServiceImpl.class);
|
||||
@Autowired
|
||||
private IAccountAddressInfoService accountAddressInfoService;
|
||||
@Autowired
|
||||
|
@ -26,6 +35,7 @@ public class ApiServiceImpl implements IApiService {
|
|||
@Autowired
|
||||
private TrxExchangeInfoMapper trxExchangeInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public TronInfoVO getTronInfo() throws Exception {
|
||||
TronInfoVO tronInfoVO = new TronInfoVO();
|
||||
|
@ -81,4 +91,26 @@ public class ApiServiceImpl implements IApiService {
|
|||
|
||||
return tronInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String transferusdt(String usdtAmount) throws Exception {
|
||||
AccountAddressInfo accountAddressInfo = accountAddressInfoService.selectAccountAddressInfoAll("usdt2Trx").get(0);
|
||||
|
||||
String decryptPrivateKey = Dt.decrypt(accountAddressInfo.getEncryptPrivateKey(), accountAddressInfo.getEncryptKey());
|
||||
|
||||
ApiWrapper apiWrapper = ApiWrapper.ofMainnet(decryptPrivateKey, "1608bf34-16ea-4c91-8432-99513336f391");
|
||||
|
||||
Contract contract = apiWrapper.getContract("TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t");
|
||||
Trc20Contract token = new Trc20Contract(contract, accountAddressInfo.getAddress()
|
||||
, apiWrapper);
|
||||
|
||||
BigInteger sumAmountValue = Convert.toSun(usdtAmount, Convert.Unit.TRX).toBigInteger();
|
||||
log.info("sumAmountValue:{}", sumAmountValue);
|
||||
BigInteger fee = Convert.toSun("100", Convert.Unit.TRX).toBigInteger();
|
||||
log.info("fee:{}", fee);
|
||||
String txid = token.transfer("TTPH84DVkQ2Z2anFNvMeQDvmk48uDRZBXp",sumAmountValue.longValue(),0,"备注",fee.longValue());
|
||||
|
||||
return txid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SmsTaskTbl;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.mapper.SmsTaskTblMapper;
|
||||
import com.ruoyi.system.service.ISmsTaskTblService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* WS短信任务配置Service业务层处理
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-06-01
|
||||
*/
|
||||
@Service
|
||||
public class SmsTaskTblServiceImpl implements ISmsTaskTblService
|
||||
{
|
||||
@Autowired
|
||||
private SmsTaskTblMapper smsTaskTblMapper;
|
||||
|
||||
/**
|
||||
* 查询WS短信任务配置
|
||||
*
|
||||
* @param idSmsTask WS短信任务配置主键
|
||||
* @return WS短信任务配置
|
||||
*/
|
||||
@Override
|
||||
public SmsTaskTbl selectSmsTaskTblByIdSmsTask(Long idSmsTask)
|
||||
{
|
||||
return smsTaskTblMapper.selectSmsTaskTblByIdSmsTask(idSmsTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询WS短信任务配置列表
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return WS短信任务配置
|
||||
*/
|
||||
@Override
|
||||
public List<SmsTaskTbl> selectSmsTaskTblList(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
return smsTaskTblMapper.selectSmsTaskTblList(smsTaskTbl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增WS短信任务配置
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSmsTaskTbl(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
smsTaskTbl.setCreateTime(DateUtils.getNowDate());
|
||||
return smsTaskTblMapper.insertSmsTaskTbl(smsTaskTbl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改WS短信任务配置
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSmsTaskTbl(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
smsTaskTbl.setUpdateTime(DateUtils.getNowDate());
|
||||
return smsTaskTblMapper.updateSmsTaskTbl(smsTaskTbl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除WS短信任务配置
|
||||
*
|
||||
* @param idSmsTasks 需要删除的WS短信任务配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSmsTaskTblByIdSmsTasks(String idSmsTasks)
|
||||
{
|
||||
return smsTaskTblMapper.deleteSmsTaskTblByIdSmsTasks(Convert.toStrArray(idSmsTasks));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除WS短信任务配置信息
|
||||
*
|
||||
* @param idSmsTask WS短信任务配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSmsTaskTblByIdSmsTask(Long idSmsTask)
|
||||
{
|
||||
return smsTaskTblMapper.deleteSmsTaskTblByIdSmsTask(idSmsTask);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
<?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.SmsChannelTblMapper">
|
||||
|
||||
<resultMap type="SmsChannelTbl" id="SmsChannelTblResult">
|
||||
<result property="idSmsChannel" column="id_sms_channel" />
|
||||
<result property="channelId" column="channel_id" />
|
||||
<result property="appid" column="appid" />
|
||||
<result property="secret" column="secret" />
|
||||
<result property="publicKey" column="publicKey" />
|
||||
<result property="smsBusiType" column="sms_busi_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSmsChannelTblVo">
|
||||
select id_sms_channel, channel_id, appid, secret, publicKey, sms_busi_type, create_by, create_time, update_by, update_time from sms_channel_tbl
|
||||
</sql>
|
||||
|
||||
<select id="selectSmsChannelTblList" parameterType="SmsChannelTbl" resultMap="SmsChannelTblResult">
|
||||
<include refid="selectSmsChannelTblVo"/>
|
||||
<where>
|
||||
<if test="channelId != null and channelId != ''"> and channel_id = #{channelId}</if>
|
||||
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
|
||||
<if test="secret != null and secret != ''"> and secret = #{secret}</if>
|
||||
<if test="publicKey != null and publicKey != ''"> and publicKey = #{publicKey}</if>
|
||||
<if test="smsBusiType != null and smsBusiType != ''"> and sms_busi_type = #{smsBusiType}</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="selectSmsChannelTblByIdSmsChannel" parameterType="Long" resultMap="SmsChannelTblResult">
|
||||
<include refid="selectSmsChannelTblVo"/>
|
||||
where id_sms_channel = #{idSmsChannel}
|
||||
</select>
|
||||
|
||||
<insert id="insertSmsChannelTbl" parameterType="SmsChannelTbl" useGeneratedKeys="true" keyProperty="idSmsChannel">
|
||||
insert into sms_channel_tbl
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="channelId != null">channel_id,</if>
|
||||
<if test="appid != null">appid,</if>
|
||||
<if test="secret != null">secret,</if>
|
||||
<if test="publicKey != null">publicKey,</if>
|
||||
<if test="smsBusiType != null">sms_busi_type,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="channelId != null">#{channelId},</if>
|
||||
<if test="appid != null">#{appid},</if>
|
||||
<if test="secret != null">#{secret},</if>
|
||||
<if test="publicKey != null">#{publicKey},</if>
|
||||
<if test="smsBusiType != null">#{smsBusiType},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSmsChannelTbl" parameterType="SmsChannelTbl">
|
||||
update sms_channel_tbl
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="channelId != null">channel_id = #{channelId},</if>
|
||||
<if test="appid != null">appid = #{appid},</if>
|
||||
<if test="secret != null">secret = #{secret},</if>
|
||||
<if test="publicKey != null">publicKey = #{publicKey},</if>
|
||||
<if test="smsBusiType != null">sms_busi_type = #{smsBusiType},</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>
|
||||
</trim>
|
||||
where id_sms_channel = #{idSmsChannel}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSmsChannelTblByIdSmsChannel" parameterType="Long">
|
||||
delete from sms_channel_tbl where id_sms_channel = #{idSmsChannel}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSmsChannelTblByIdSmsChannels" parameterType="String">
|
||||
delete from sms_channel_tbl where id_sms_channel in
|
||||
<foreach item="idSmsChannel" collection="array" open="(" separator="," close=")">
|
||||
#{idSmsChannel}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,119 @@
|
|||
<?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.SmsTaskTblMapper">
|
||||
|
||||
<resultMap type="SmsTaskTbl" id="SmsTaskTblResult">
|
||||
<result property="idSmsTask" column="id_sms_task" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="smsBusiType" column="sms_busi_type" />
|
||||
<result property="price" column="price" />
|
||||
<result property="taskBeginTime" column="task_begin_time" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="fileMd5" column="file_md5" />
|
||||
<result property="context" column="context" />
|
||||
<result property="smsContentType" column="sms_content_type" />
|
||||
<result property="taskStatus" column="task_status" />
|
||||
<result property="successRate" column="success_rate" />
|
||||
<result property="issueCount" column="issue_count" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSmsTaskTblVo">
|
||||
select id_sms_task, task_name, sms_busi_type, price, task_begin_time, file_name, file_path, file_md5, context, sms_content_type, task_status, success_rate, issue_count, create_by, create_time, update_by, update_time from sms_task_tbl
|
||||
</sql>
|
||||
|
||||
<select id="selectSmsTaskTblList" parameterType="SmsTaskTbl" resultMap="SmsTaskTblResult">
|
||||
<include refid="selectSmsTaskTblVo"/>
|
||||
<where>
|
||||
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus}</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="selectSmsTaskTblByIdSmsTask" parameterType="Long" resultMap="SmsTaskTblResult">
|
||||
<include refid="selectSmsTaskTblVo"/>
|
||||
where id_sms_task = #{idSmsTask}
|
||||
</select>
|
||||
|
||||
<insert id="insertSmsTaskTbl" parameterType="SmsTaskTbl" useGeneratedKeys="true" keyProperty="idSmsTask">
|
||||
insert into sms_task_tbl
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">task_name,</if>
|
||||
<if test="smsBusiType != null">sms_busi_type,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="taskBeginTime != null">task_begin_time,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="filePath != null">file_path,</if>
|
||||
<if test="fileMd5 != null">file_md5,</if>
|
||||
<if test="context != null">context,</if>
|
||||
<if test="smsContentType != null">sms_content_type,</if>
|
||||
<if test="taskStatus != null">task_status,</if>
|
||||
<if test="successRate != null">success_rate,</if>
|
||||
<if test="issueCount != null">issue_count,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">#{taskName},</if>
|
||||
<if test="smsBusiType != null">#{smsBusiType},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="taskBeginTime != null">#{taskBeginTime},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
<if test="fileMd5 != null">#{fileMd5},</if>
|
||||
<if test="context != null">#{context},</if>
|
||||
<if test="smsContentType != null">#{smsContentType},</if>
|
||||
<if test="taskStatus != null">#{taskStatus},</if>
|
||||
<if test="successRate != null">#{successRate},</if>
|
||||
<if test="issueCount != null">#{issueCount},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSmsTaskTbl" parameterType="SmsTaskTbl">
|
||||
update sms_task_tbl
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
|
||||
<if test="smsBusiType != null">sms_busi_type = #{smsBusiType},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="taskBeginTime != null">task_begin_time = #{taskBeginTime},</if>
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
<if test="filePath != null">file_path = #{filePath},</if>
|
||||
<if test="fileMd5 != null">file_md5 = #{fileMd5},</if>
|
||||
<if test="context != null">context = #{context},</if>
|
||||
<if test="smsContentType != null">sms_content_type = #{smsContentType},</if>
|
||||
<if test="taskStatus != null">task_status = #{taskStatus},</if>
|
||||
<if test="successRate != null">success_rate = #{successRate},</if>
|
||||
<if test="issueCount != null">issue_count = #{issueCount},</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>
|
||||
</trim>
|
||||
where id_sms_task = #{idSmsTask}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSmsTaskTblByIdSmsTask" parameterType="Long">
|
||||
delete from sms_task_tbl where id_sms_task = #{idSmsTask}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSmsTaskTblByIdSmsTasks" parameterType="String">
|
||||
delete from sms_task_tbl where id_sms_task in
|
||||
<foreach item="idSmsTask" collection="array" open="(" separator="," close=")">
|
||||
#{idSmsTask}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue