mirror of https://gitee.com/y_project/RuoYi.git
ws短信功能上线
parent
1e43bf254b
commit
bbda646777
|
@ -5,12 +5,17 @@ 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.domain.vo.BatchUpdateSmsVO;
|
||||
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.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -75,6 +80,23 @@ public class WSSmsTaskTblController extends BaseController
|
|||
return prefix + "/add";
|
||||
}
|
||||
|
||||
@GetMapping("/update/{ids}")
|
||||
public String update(@PathVariable("ids") String ids, ModelMap mmap)
|
||||
{
|
||||
mmap.put("ids", ids);
|
||||
return prefix + "/update";
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@RequiresPermissions("sms:task:ws:edit")
|
||||
@Log(title = "WS短信任务配置", businessType = BusinessType.UPDATE)
|
||||
@ResponseBody
|
||||
public AjaxResult update(BatchUpdateSmsVO batchUpdateSmsVO)
|
||||
{
|
||||
smsTaskTblService.updateBatchUpdateSmsVO(batchUpdateSmsVO);
|
||||
return toAjax(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存WS短信任务配置
|
||||
*/
|
||||
|
@ -100,6 +122,20 @@ public class WSSmsTaskTblController extends BaseController
|
|||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
|
||||
@RequiresPermissions("sms:task:ws:export")
|
||||
@GetMapping("/exportTaskDetail/{idSmsTask}")
|
||||
public ResponseEntity<byte[]> exportTaskDetail(@PathVariable("idSmsTask") Long idSmsTask)
|
||||
{
|
||||
byte[] report = smsTaskTblService.getReport(idSmsTask);
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
headers.setContentDispositionFormData("attachment", "sample.xlsx");
|
||||
|
||||
return new ResponseEntity<>(report, headers, HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存WS短信任务配置
|
||||
*/
|
||||
|
@ -123,4 +159,13 @@ public class WSSmsTaskTblController extends BaseController
|
|||
{
|
||||
return toAjax(smsTaskTblService.deleteSmsTaskTblByIdSmsTasks(ids));
|
||||
}
|
||||
|
||||
|
||||
@RequiresPermissions("sms:task:ws:edit")
|
||||
@Log(title = "租户", businessType = BusinessType.ACTIVE_DATA)
|
||||
@PostMapping( "/completeTask")
|
||||
@ResponseBody
|
||||
public AjaxResult completeTask(String ids) throws Exception {
|
||||
return toAjax(smsTaskTblService.complete(ids));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -392,6 +392,33 @@ var table = {
|
|||
$.modal.closeLoading();
|
||||
});
|
||||
});
|
||||
}, exportExcelTaskDetail: function(formId) {
|
||||
|
||||
table.set();
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请至少选择一条记录");
|
||||
return;
|
||||
}
|
||||
var url = table.options.exportTaskDetailUrl.replace("{id}", rows.join());
|
||||
$.modal.loading("正在导出数据,请稍候...");
|
||||
window.location.href = url;
|
||||
$.modal.closeLoading();
|
||||
|
||||
},completeTask: function(formId) {
|
||||
|
||||
table.set();
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请至少选择一条记录");
|
||||
return;
|
||||
}
|
||||
$.modal.confirm("确认强制完成选中的" + rows.length + "条数据吗?", function() {
|
||||
var url = table.options.completeTaskUrl;
|
||||
var data = { "ids": rows.join() };
|
||||
$.operate.submit(url, "post", "json", data);
|
||||
});
|
||||
|
||||
},
|
||||
// 下载模板
|
||||
importTemplate: function() {
|
||||
|
@ -1198,6 +1225,20 @@ var table = {
|
|||
$.modal.open("修改" + table.options.modalName, $.operate.editUrl(id));
|
||||
}
|
||||
},
|
||||
editStatus: function(id) {
|
||||
table.set();
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请至少选择一条记录");
|
||||
return;
|
||||
}
|
||||
let rowIds = rows.join();
|
||||
$.modal.open("添加" + table.options.modalName, $.operate.editStatusUrl(rowIds));
|
||||
},
|
||||
editStatusUrl: function(ids) {
|
||||
var url = $.common.isEmpty(ids) ? table.options.updateStatusUrl.replace("{ids}", "") : table.options.updateStatusUrl.replace("{ids}", ids);
|
||||
return url;
|
||||
},
|
||||
// 修改信息,以tab页展现
|
||||
editTab: function(id) {
|
||||
table.set();
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<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')}">
|
||||
|
@ -58,7 +58,7 @@
|
|||
<label th:for="${'taskStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -37,18 +37,24 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="sms:task:add">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="sms:task:ws: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 class="btn btn-primary multiple disabled" onclick="$.operate.editStatus()" shiro:hasPermission="sms:task:ws:edit">
|
||||
<i class="fa fa-edit"></i> 批量修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sms:task:remove">
|
||||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sms:task:ws:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="sms:task:export">
|
||||
</a>-->
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="sms:task:ws:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
<a class="btn btn-warning single disabled" onclick="$.table.exportExcelTaskDetail()" shiro:hasPermission="sms:task:ws:export">
|
||||
<i class="fa fa-edit"></i> 下载任务明细
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.table.completeTask()" shiro:hasPermission="sms:task:ws:export">
|
||||
<i class="fa fa-edit"></i> 强制完成
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
|
@ -57,8 +63,8 @@
|
|||
</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 editFlag = [[${@permission.hasPermi('sms:task:ws:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('sms:task:ws: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')}]];
|
||||
|
@ -69,8 +75,11 @@
|
|||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
updateStatusUrl: prefix + "/update/{ids}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
exportTaskDetailUrl: prefix + "/exportTaskDetail/{id}",
|
||||
completeTaskUrl: prefix + "/completeTask",
|
||||
modalName: "WS短信任务配置",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
|
@ -84,12 +93,25 @@
|
|||
field: 'taskName',
|
||||
title: '任务名称'
|
||||
},
|
||||
{
|
||||
field: 'totalCount',
|
||||
title: '总量'
|
||||
},{
|
||||
field: 'successCount',
|
||||
title: '成功个数'
|
||||
|
||||
},{
|
||||
field: 'preSummary',
|
||||
title: '预估金额'
|
||||
|
||||
},
|
||||
{
|
||||
field: 'smsBusiType',
|
||||
title: '短信类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(smsBusiTypeDatas, value);
|
||||
}
|
||||
},
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'price',
|
||||
|
@ -99,6 +121,10 @@
|
|||
field: 'taskBeginTime',
|
||||
title: '任务开始时间'
|
||||
},
|
||||
{
|
||||
field: 'completeTime',
|
||||
title: '任务完成时间'
|
||||
},
|
||||
{
|
||||
field: 'fileName',
|
||||
title: '物料名称',
|
||||
|
@ -114,7 +140,8 @@
|
|||
title: '内容类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(smsContentTypeDatas, value);
|
||||
}
|
||||
},
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'taskStatus',
|
||||
|
@ -125,15 +152,18 @@
|
|||
},
|
||||
{
|
||||
field: 'successRate',
|
||||
title: '成功数'
|
||||
title: '成功率',
|
||||
visible: false
|
||||
},
|
||||
|
||||
{
|
||||
field: 'issueCount',
|
||||
title: '物料总数'
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建者'
|
||||
title: '创建者',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
<!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" />
|
||||
<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-task-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">修改种类:</label>
|
||||
<div class="col-sm-8" th:with="type=${@dict.getType('sys_sms_edit_type')}">
|
||||
<select id="editSmsType" name="editSmsType" 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 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" >
|
||||
<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_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>
|
||||
<input type="hidden" name="ids" th:value="${ids}">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js" />
|
||||
<th:block th:include="include :: select2-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "sms/task/ws"
|
||||
$("#form-task-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/update", $('#form-task-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='taskBeginTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd hh:ii:ss",
|
||||
// minView: "second",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
|
||||
$(function() {
|
||||
$('#editSmsType').select2({
|
||||
placeholder: "请选择种类",
|
||||
allowClear: true
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -13,7 +13,7 @@ import java.util.Date;
|
|||
* WS短信任务配置对象 sms_task_tbl
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-06-27
|
||||
* @date 2024-07-04
|
||||
*/
|
||||
public class SmsTaskTbl extends BaseEntity
|
||||
{
|
||||
|
@ -42,11 +42,20 @@ public class SmsTaskTbl extends BaseEntity
|
|||
@Excel(name = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 预估金额 */
|
||||
@Excel(name = "预估金额")
|
||||
private BigDecimal preSummary;
|
||||
|
||||
/** 任务开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "任务开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "任务开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date taskBeginTime;
|
||||
|
||||
/** 任务完成时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "任务完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date completeTime;
|
||||
|
||||
/** 物料名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String fileName;
|
||||
|
@ -71,9 +80,17 @@ public class SmsTaskTbl extends BaseEntity
|
|||
@Excel(name = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
/** 成功率 */
|
||||
@Excel(name = "成功率")
|
||||
private String successRate;
|
||||
|
||||
/** 成功数 */
|
||||
@Excel(name = "成功数")
|
||||
private String successRate;
|
||||
private Long successCount;
|
||||
|
||||
/** 总数 */
|
||||
@Excel(name = "总数")
|
||||
private Long totalCount;
|
||||
|
||||
/** 物料总数 */
|
||||
@Excel(name = "物料总数")
|
||||
|
@ -137,6 +154,15 @@ public class SmsTaskTbl extends BaseEntity
|
|||
{
|
||||
return price;
|
||||
}
|
||||
public void setPreSummary(BigDecimal preSummary)
|
||||
{
|
||||
this.preSummary = preSummary;
|
||||
}
|
||||
|
||||
public BigDecimal getPreSummary()
|
||||
{
|
||||
return preSummary;
|
||||
}
|
||||
public void setTaskBeginTime(Date taskBeginTime)
|
||||
{
|
||||
this.taskBeginTime = taskBeginTime;
|
||||
|
@ -146,6 +172,15 @@ public class SmsTaskTbl extends BaseEntity
|
|||
{
|
||||
return taskBeginTime;
|
||||
}
|
||||
public void setCompleteTime(Date completeTime)
|
||||
{
|
||||
this.completeTime = completeTime;
|
||||
}
|
||||
|
||||
public Date getCompleteTime()
|
||||
{
|
||||
return completeTime;
|
||||
}
|
||||
public void setFileName(String fileName)
|
||||
{
|
||||
this.fileName = fileName;
|
||||
|
@ -209,6 +244,24 @@ public class SmsTaskTbl extends BaseEntity
|
|||
{
|
||||
return successRate;
|
||||
}
|
||||
public void setSuccessCount(Long successCount)
|
||||
{
|
||||
this.successCount = successCount;
|
||||
}
|
||||
|
||||
public Long getSuccessCount()
|
||||
{
|
||||
return successCount;
|
||||
}
|
||||
public void setTotalCount(Long totalCount)
|
||||
{
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public Long getTotalCount()
|
||||
{
|
||||
return totalCount;
|
||||
}
|
||||
public void setIssueCount(Long issueCount)
|
||||
{
|
||||
this.issueCount = issueCount;
|
||||
|
@ -237,7 +290,9 @@ public class SmsTaskTbl extends BaseEntity
|
|||
.append("taskId", getTaskId())
|
||||
.append("channelId", getChannelId())
|
||||
.append("price", getPrice())
|
||||
.append("preSummary", getPreSummary())
|
||||
.append("taskBeginTime", getTaskBeginTime())
|
||||
.append("completeTime", getCompleteTime())
|
||||
.append("fileName", getFileName())
|
||||
.append("filePath", getFilePath())
|
||||
.append("fileMd5", getFileMd5())
|
||||
|
@ -245,6 +300,8 @@ public class SmsTaskTbl extends BaseEntity
|
|||
.append("smsContentType", getSmsContentType())
|
||||
.append("taskStatus", getTaskStatus())
|
||||
.append("successRate", getSuccessRate())
|
||||
.append("successCount", getSuccessCount())
|
||||
.append("totalCount", getTotalCount())
|
||||
.append("issueCount", getIssueCount())
|
||||
.append("userId", getUserId())
|
||||
.append("createBy", getCreateBy())
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.common.core.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BatchUpdateSmsVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String editSmsType;
|
||||
|
||||
/** 任务开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date taskBeginTime;
|
||||
|
||||
/** 任务状态 */
|
||||
private String taskStatus;
|
||||
|
||||
private String ids;
|
||||
}
|
|
@ -2,9 +2,11 @@ package com.ruoyi.common.core.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TgPremiumOrderInfoMultiVO {
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class TgPremiumOrderInfoMultiVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String tgPremiumOrderInfo;
|
||||
|
||||
private String isJoindNow;
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component("getSmsDetailTask")
|
||||
public class GetSmsDetailTask {
|
||||
@Autowired
|
||||
private SmsTaskTblMapper smsTaskTblMapper;
|
||||
|
||||
@Autowired
|
||||
private GetSmsDetailTaskHandler getSmsDetailTaskHandler;
|
||||
|
||||
public void doGetSmsDetailTask() {
|
||||
List<SmsTaskTbl> smsTaskTblList = smsTaskTblMapper.selectSmsTaskTblListNotComplete();
|
||||
|
||||
getSmsDetailTaskHandler.doGetSmsDetailTask(smsTaskTblList);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,13 +1,25 @@
|
|||
package com.ruoyi.system.api;
|
||||
|
||||
import com.ruoyi.system.api.entity.U02cx.GetTokenRequest;
|
||||
import com.ruoyi.system.api.entity.U02cx.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public interface IU02cxApi {
|
||||
|
||||
String getToken(GetTokenRequest getTokenRequest);
|
||||
|
||||
|
||||
Long addTask(String requestBody, String token, String appId) throws IOException;
|
||||
Long addTask(BaseRequestBO baseRequestBO) throws IOException;
|
||||
|
||||
|
||||
void updateTaskStatus(BaseRequestBO baseRequestBO);
|
||||
|
||||
void updateTask(BaseRequestBO baseRequestBO);
|
||||
|
||||
void completeByBatch(BatchTaskIdsRequest batchTaskIdsRequest);
|
||||
|
||||
List<TaskDetailResponse> getTaskList(BatchTaskIdsRequest batchTaskIdsRequest);
|
||||
|
||||
byte[] getReport(GetReportRequest getReportRequest);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.ruoyi.system.api.entity.U02cx;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BaseRequestBO implements Serializable {
|
||||
|
||||
private final static long serialVersionUID = 1L;
|
||||
|
||||
private String encryptedData;
|
||||
private String token;
|
||||
private String appId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.system.api.entity.U02cx;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BatchTaskIdsRequest extends BaseRequestBO{
|
||||
|
||||
private List<Long> taskIds;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.system.api.entity.U02cx;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class GetReportRequest extends BaseRequestBO{
|
||||
|
||||
private Long taskId;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.system.api.entity.U02cx;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class GetTaskListResponse extends U02cxCommonResponse{
|
||||
|
||||
private List<TaskDetailResponse> data;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.ruoyi.system.api.entity.U02cx;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TaskDetailResponse implements Serializable {
|
||||
|
||||
private String userName;
|
||||
private String createTime;
|
||||
private long taskId;
|
||||
private String taskName;
|
||||
private double price;
|
||||
private BigDecimal preSummary;
|
||||
private int issueCount;
|
||||
private String taskStatus;
|
||||
private String successRate;
|
||||
private String taskBeginTime;
|
||||
private String completeTime;
|
||||
private String screenFlag;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.ruoyi.system.api.entity.U02cx;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UpdateTaskRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Long taskId;
|
||||
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 任务开始时间 格式 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String taskBeginTime;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ruoyi.system.api.entity.U02cx;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UpdateTaskStatusRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long taskId;
|
||||
|
||||
private Integer taskStatus;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.ruoyi.system.api.entity.U02cx;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UpdateTaskStatusResponse extends U02cxCommonResponse {
|
||||
|
||||
private Long taskId;
|
||||
|
||||
}
|
|
@ -3,19 +3,20 @@ package com.ruoyi.system.api.impl;
|
|||
import com.google.common.base.Preconditions;
|
||||
import com.ruoyi.common.utils.http.RestTemplateUtils;
|
||||
import com.ruoyi.system.api.IU02cxApi;
|
||||
import com.ruoyi.system.api.entity.U02cx.AddTaskResponse;
|
||||
import com.ruoyi.system.api.entity.U02cx.ApiConstants;
|
||||
import com.ruoyi.system.api.entity.U02cx.GetTokenRequest;
|
||||
import com.ruoyi.system.api.entity.U02cx.GetTokenResponse;
|
||||
import com.ruoyi.system.api.entity.U02cx.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class U02cxApiImpl implements IU02cxApi {
|
||||
|
||||
|
||||
|
@ -35,26 +36,127 @@ public class U02cxApiImpl implements IU02cxApi {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Long addTask(String requestBody, String token, String appId) throws IOException {
|
||||
public Long addTask(BaseRequestBO baseRequestBO) throws IOException {
|
||||
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
httpHeaders.setAccept(Arrays.asList(MediaType.APPLICATION_JSON_UTF8));
|
||||
httpHeaders.add("appId",appId);
|
||||
httpHeaders.add("token",token);
|
||||
httpHeaders.add("appId", baseRequestBO.getAppId());
|
||||
httpHeaders.add("token", baseRequestBO.getToken());
|
||||
|
||||
ResponseEntity<AddTaskResponse> responseEntity = RestTemplateUtils.post("http://cot5b.u02cx.com:20086/whatsApi/api/task/addTask", httpHeaders, requestBody, AddTaskResponse.class);
|
||||
ResponseEntity<AddTaskResponse> responseEntity = RestTemplateUtils.post("http://cot5b.u02cx.com:20086/whatsApi/api/task/addTask", httpHeaders, baseRequestBO.getEncryptedData(), AddTaskResponse.class);
|
||||
Preconditions.checkState(responseEntity.getStatusCode().is2xxSuccessful(), "addTask failed");
|
||||
|
||||
AddTaskResponse addTaskResponse = responseEntity.getBody();
|
||||
Preconditions.checkNotNull(addTaskResponse, "addTaskResponse is null");
|
||||
|
||||
int status = addTaskResponse.getStatus();
|
||||
Preconditions.checkState(0 == status, "addTask failed:" + ApiConstants.returnCodeMap.get(status)+",msg:"+addTaskResponse.getMsg());
|
||||
|
||||
|
||||
Preconditions.checkState(0 == status, "addTask failed:" + ApiConstants.returnCodeMap.get(status) + ",msg:" + addTaskResponse.getMsg());
|
||||
|
||||
return addTaskResponse.getTaskId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTaskStatus(BaseRequestBO baseRequestBO) {
|
||||
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
httpHeaders.setAccept(Arrays.asList(MediaType.APPLICATION_JSON_UTF8));
|
||||
httpHeaders.add("appId", baseRequestBO.getAppId());
|
||||
httpHeaders.add("token", baseRequestBO.getToken());
|
||||
|
||||
ResponseEntity<UpdateTaskStatusResponse> responseEntity = RestTemplateUtils.post("http://cot5b.u02cx.com:20086/whatsApi/api/task/updateTaskStatus", httpHeaders, baseRequestBO.getEncryptedData(), UpdateTaskStatusResponse.class);
|
||||
Preconditions.checkState(responseEntity.getStatusCode().is2xxSuccessful(), "updateTaskStatus failed");
|
||||
|
||||
UpdateTaskStatusResponse updateTaskStatusResponse = responseEntity.getBody();
|
||||
Preconditions.checkNotNull(updateTaskStatusResponse, "updateTaskStatusResponse is null");
|
||||
|
||||
int status = updateTaskStatusResponse.getStatus();
|
||||
Preconditions.checkState(0 == status, "updateTaskStatus failed:" + ApiConstants.returnCodeMap.get(status) + ",msg:" + updateTaskStatusResponse.getMsg());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTask(BaseRequestBO baseRequestBO) {
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
httpHeaders.setAccept(Arrays.asList(MediaType.APPLICATION_JSON_UTF8));
|
||||
httpHeaders.add("appId", baseRequestBO.getAppId());
|
||||
httpHeaders.add("token", baseRequestBO.getToken());
|
||||
|
||||
ResponseEntity<UpdateTaskStatusResponse> responseEntity = RestTemplateUtils.post("http://cot5b.u02cx.com:20086/whatsApi/api/task/updateTask", httpHeaders, baseRequestBO.getEncryptedData(), UpdateTaskStatusResponse.class);
|
||||
Preconditions.checkState(responseEntity.getStatusCode().is2xxSuccessful(), "updateTask failed");
|
||||
|
||||
UpdateTaskStatusResponse updateTaskStatusResponse = responseEntity.getBody();
|
||||
Preconditions.checkNotNull(updateTaskStatusResponse, "updateTaskResponse is null");
|
||||
|
||||
int status = updateTaskStatusResponse.getStatus();
|
||||
Preconditions.checkState(0 == status, "updateTask failed:" + ApiConstants.returnCodeMap.get(status) + ",msg:" + updateTaskStatusResponse.getMsg());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void completeByBatch(BatchTaskIdsRequest batchTaskIdsRequest){
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
httpHeaders.setAccept(Arrays.asList(MediaType.APPLICATION_JSON_UTF8));
|
||||
httpHeaders.add("appId", batchTaskIdsRequest.getAppId());
|
||||
httpHeaders.add("token", batchTaskIdsRequest.getToken());
|
||||
|
||||
ResponseEntity<UpdateTaskStatusResponse> responseEntity = RestTemplateUtils.post("http://cot5b.u02cx.com:20086/whatsApi/api/report/completeByBatch", httpHeaders, batchTaskIdsRequest, UpdateTaskStatusResponse.class);
|
||||
Preconditions.checkState(responseEntity.getStatusCode().is2xxSuccessful(), "completeByBatch failed");
|
||||
|
||||
UpdateTaskStatusResponse updateTaskStatusResponse = responseEntity.getBody();
|
||||
Preconditions.checkNotNull(updateTaskStatusResponse, "completeByBatchResponse is null");
|
||||
|
||||
int status = updateTaskStatusResponse.getStatus();
|
||||
Preconditions.checkState(0 == status, "completeByBatch failed:" + ApiConstants.returnCodeMap.get(status) + ",msg:" + updateTaskStatusResponse.getMsg());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<TaskDetailResponse> getTaskList(BatchTaskIdsRequest batchTaskIdsRequest){
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
httpHeaders.setAccept(Arrays.asList(MediaType.APPLICATION_JSON_UTF8));
|
||||
httpHeaders.add("appId", batchTaskIdsRequest.getAppId());
|
||||
httpHeaders.add("token", batchTaskIdsRequest.getToken());
|
||||
|
||||
ResponseEntity<GetTaskListResponse> responseEntity = RestTemplateUtils.post("http://cot5b.u02cx.com:20086/whatsApi/api/report/getTaskList", httpHeaders, batchTaskIdsRequest, GetTaskListResponse.class);
|
||||
Preconditions.checkState(responseEntity.getStatusCode().is2xxSuccessful(), "getTaskList failed");
|
||||
|
||||
GetTaskListResponse getTaskListResponse = responseEntity.getBody();
|
||||
Preconditions.checkNotNull(getTaskListResponse, "getTaskListResponse is null");
|
||||
|
||||
int status = getTaskListResponse.getStatus();
|
||||
Preconditions.checkState(0 == status, "getTaskList failed:" + ApiConstants.returnCodeMap.get(status) + ",msg:" + getTaskListResponse.getMsg());
|
||||
return getTaskListResponse.getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getReport(GetReportRequest getReportRequest){
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
httpHeaders.setAccept(Arrays.asList(MediaType.APPLICATION_JSON_UTF8));
|
||||
httpHeaders.add("appId", getReportRequest.getAppId());
|
||||
httpHeaders.add("token", getReportRequest.getToken());
|
||||
|
||||
ResponseEntity<byte[]> response = RestTemplateUtils.post("http://cot5b.u02cx.com:20086/whatsApi/api/report/getReport", httpHeaders, getReportRequest, byte[].class);
|
||||
// 处理响应
|
||||
if (response.getStatusCode() == HttpStatus.OK) {
|
||||
byte[] responseBody = response.getBody();
|
||||
return responseBody;
|
||||
} else if (response.getStatusCode() == HttpStatus.FORBIDDEN) {
|
||||
// 假设错误信息是JSON格式
|
||||
String errorMsg = new String(response.getBody());
|
||||
log.error("请求失败: " + errorMsg);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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,84 @@
|
|||
package com.ruoyi.system.handler;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.common.core.domain.entity.SmsTaskTbl;
|
||||
import com.ruoyi.system.api.IU02cxApi;
|
||||
import com.ruoyi.system.api.entity.U02cx.BatchTaskIdsRequest;
|
||||
import com.ruoyi.system.api.entity.U02cx.GetTokenRequest;
|
||||
import com.ruoyi.system.api.entity.U02cx.TaskDetailResponse;
|
||||
import com.ruoyi.system.domain.SmsChannelTbl;
|
||||
import com.ruoyi.system.mapper.SmsChannelTblMapper;
|
||||
import com.ruoyi.system.mapper.SmsTaskTblMapper;
|
||||
import com.ruoyi.system.util.RsaUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class GetSmsDetailTaskHandler {
|
||||
|
||||
@Autowired
|
||||
private IU02cxApi iu02cxApi;
|
||||
@Autowired
|
||||
private SmsChannelTblMapper smsChannelTblMapper;
|
||||
|
||||
@Autowired
|
||||
private SmsTaskTblMapper smsTaskTblMapper;
|
||||
|
||||
public void doGetSmsDetailTask(List<SmsTaskTbl> smsTaskTblList) {
|
||||
List<Long> taskIds = smsTaskTblList.stream().filter(smsTaskTbl -> {
|
||||
return smsTaskTbl.getTaskId() != null;
|
||||
}).map(SmsTaskTbl::getTaskId).collect(Collectors.toList());
|
||||
SmsChannelTbl smsChannelTbl = smsChannelTblMapper.selectSmsChannelTblByIdSmsChannel(1L);
|
||||
|
||||
GetTokenRequest getTokenRequest = new GetTokenRequest();
|
||||
BeanUtils.copyProperties(smsChannelTbl, getTokenRequest);
|
||||
String token = iu02cxApi.getToken(getTokenRequest);
|
||||
|
||||
|
||||
|
||||
String jsonStr = JSONUtil.toJsonStr(taskIds);
|
||||
log.debug("jsonStr:{}", jsonStr);
|
||||
String encryptedData = RsaUtils.encryptData(jsonStr, smsChannelTbl.getPublicKey());
|
||||
|
||||
BatchTaskIdsRequest batchTaskIdsRequest = new BatchTaskIdsRequest();
|
||||
batchTaskIdsRequest.setTaskIds(taskIds)
|
||||
.setToken(token)
|
||||
.setAppId(smsChannelTbl.getAppId())
|
||||
.setEncryptedData(encryptedData);
|
||||
|
||||
List<TaskDetailResponse> taskList = iu02cxApi.getTaskList(batchTaskIdsRequest);
|
||||
taskList.stream()
|
||||
.forEach(taskDetailResponse -> {
|
||||
SmsTaskTbl smsTaskTbl = new SmsTaskTbl();
|
||||
smsTaskTbl.setTaskId(taskDetailResponse.getTaskId());
|
||||
if (taskDetailResponse.getCompleteTime()!=null ){
|
||||
smsTaskTbl.setCompleteTime(DateUtil.parse(taskDetailResponse.getCompleteTime()));
|
||||
}
|
||||
|
||||
String successRate = taskDetailResponse.getSuccessRate();
|
||||
if (successRate != null){
|
||||
smsTaskTbl.setSuccessRate(successRate);
|
||||
String[] split = successRate.split("/");
|
||||
smsTaskTbl.setSuccessCount(Long.parseLong(split[0]));
|
||||
smsTaskTbl.setTotalCount(Long.parseLong(split[1]));
|
||||
}
|
||||
BigDecimal preSummary = taskDetailResponse.getPreSummary();
|
||||
if (preSummary != null){
|
||||
smsTaskTbl.setPreSummary(preSummary);
|
||||
}
|
||||
smsTaskTbl.setIssueCount(Long.valueOf(taskDetailResponse.getIssueCount()));
|
||||
smsTaskTbl.setTaskStatus(taskDetailResponse.getTaskStatus());
|
||||
smsTaskTbl.setUpdateBy("system");
|
||||
smsTaskTblMapper.updateSmsTaskTblByTaskId(smsTaskTbl);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SmsTaskTbl;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -60,4 +61,10 @@ public interface SmsTaskTblMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSmsTaskTblByIdSmsTasks(String[] idSmsTasks);
|
||||
|
||||
List<SmsTaskTbl> selectSmsTaskTblListNotComplete();
|
||||
|
||||
void updateSmsTaskTblByTaskId(SmsTaskTbl smsTaskTbl);
|
||||
|
||||
List<SmsTaskTbl> selectSmsTaskTbl(@Param("idsList") List<String> idsList);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SmsTaskTbl;
|
||||
import com.ruoyi.common.core.domain.vo.BatchUpdateSmsVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -60,4 +61,10 @@ public interface ISmsTaskTblService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSmsTaskTblByIdSmsTask(Long idSmsTask);
|
||||
|
||||
void updateBatchUpdateSmsVO(BatchUpdateSmsVO batchUpdateSmsVO);
|
||||
|
||||
byte[] getReport(Long idSmsTask);
|
||||
|
||||
int complete(String ids);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.domain.entity.SmsTaskTbl;
|
||||
import com.ruoyi.common.core.domain.vo.BatchUpdateSmsVO;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.system.api.IU02cxApi;
|
||||
import com.ruoyi.system.api.entity.U02cx.AddTaskRequest;
|
||||
import com.ruoyi.system.api.entity.U02cx.GetTokenRequest;
|
||||
import com.ruoyi.system.api.entity.U02cx.*;
|
||||
import com.ruoyi.system.domain.SmsChannelTbl;
|
||||
import com.ruoyi.system.handler.GetSmsDetailTaskHandler;
|
||||
import com.ruoyi.system.mapper.SmsChannelTblMapper;
|
||||
import com.ruoyi.system.mapper.SmsTaskTblMapper;
|
||||
import com.ruoyi.system.service.ISmsTaskTblService;
|
||||
|
@ -19,17 +21,18 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* WS短信任务配置Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author dorion
|
||||
* @date 2024-06-01
|
||||
*/
|
||||
@Service
|
||||
public class SmsTaskTblServiceImpl implements ISmsTaskTblService
|
||||
{
|
||||
public class SmsTaskTblServiceImpl implements ISmsTaskTblService {
|
||||
private static final Logger log = LoggerFactory.getLogger(SmsTaskTblServiceImpl.class);
|
||||
@Autowired
|
||||
private SmsTaskTblMapper smsTaskTblMapper;
|
||||
|
@ -40,39 +43,40 @@ public class SmsTaskTblServiceImpl implements ISmsTaskTblService
|
|||
@Autowired
|
||||
private IU02cxApi u02cxApi;
|
||||
|
||||
@Autowired
|
||||
private GetSmsDetailTaskHandler smsDetailTaskHandler;
|
||||
|
||||
/**
|
||||
* 查询WS短信任务配置
|
||||
*
|
||||
*
|
||||
* @param idSmsTask WS短信任务配置主键
|
||||
* @return WS短信任务配置
|
||||
*/
|
||||
@Override
|
||||
public SmsTaskTbl selectSmsTaskTblByIdSmsTask(Long idSmsTask)
|
||||
{
|
||||
public SmsTaskTbl selectSmsTaskTblByIdSmsTask(Long idSmsTask) {
|
||||
return smsTaskTblMapper.selectSmsTaskTblByIdSmsTask(idSmsTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询WS短信任务配置列表
|
||||
*
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return WS短信任务配置
|
||||
*/
|
||||
@Override
|
||||
public List<SmsTaskTbl> selectSmsTaskTblList(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
@DataScope(userAlias = "u")
|
||||
public List<SmsTaskTbl> selectSmsTaskTblList(SmsTaskTbl smsTaskTbl) {
|
||||
return smsTaskTblMapper.selectSmsTaskTblList(smsTaskTbl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增WS短信任务配置
|
||||
*
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSmsTaskTbl(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
public int insertSmsTaskTbl(SmsTaskTbl smsTaskTbl) {
|
||||
log.info("insertSmsTaskTbl:{}", smsTaskTbl.toString());
|
||||
SmsChannelTbl smsChannelTbl = smsChannelTblMapper.selectSmsChannelTblByIdSmsChannel(1L);
|
||||
|
||||
|
@ -83,13 +87,13 @@ public class SmsTaskTblServiceImpl implements ISmsTaskTblService
|
|||
log.debug("token:{}", token);
|
||||
AddTaskRequest addTaskRequest = new AddTaskRequest();
|
||||
addTaskRequest.setTaskName(smsTaskTbl.getTaskName())
|
||||
.setPrice(smsTaskTbl.getPrice())
|
||||
.setTaskBeginTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",smsTaskTbl.getTaskBeginTime()))
|
||||
.setFileName(smsTaskTbl.getFileName())
|
||||
.setFilePath(smsTaskTbl.getFilePath())
|
||||
.setFileMd5(smsTaskTbl.getFileMd5())
|
||||
.setContext(smsTaskTbl.getContext())
|
||||
.setType(Integer.parseInt(smsTaskTbl.getSmsContentType()));
|
||||
.setPrice(smsTaskTbl.getPrice())
|
||||
.setTaskBeginTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", smsTaskTbl.getTaskBeginTime()))
|
||||
.setFileName(smsTaskTbl.getFileName())
|
||||
.setFilePath(smsTaskTbl.getFilePath())
|
||||
.setFileMd5(smsTaskTbl.getFileMd5())
|
||||
.setContext(smsTaskTbl.getContext())
|
||||
.setType(Integer.parseInt(smsTaskTbl.getSmsContentType()));
|
||||
try {
|
||||
// 将公钥字符串转换为 PublicKey 对象
|
||||
// 使用公钥加密数据
|
||||
|
@ -97,7 +101,12 @@ public class SmsTaskTblServiceImpl implements ISmsTaskTblService
|
|||
log.debug("jsonStr:{}", jsonStr);
|
||||
// String encryptedData = EncryptionUtils.encrypt(jsonStr, publicKey);
|
||||
String encryptedData = RsaUtils.encryptData(jsonStr, smsChannelTbl.getPublicKey());
|
||||
Long taskId = u02cxApi.addTask(encryptedData,token,smsChannelTbl.getAppId());
|
||||
|
||||
BaseRequestBO baseRequestBO = new BaseRequestBO();
|
||||
baseRequestBO.setEncryptedData(encryptedData)
|
||||
.setAppId(smsChannelTbl.getAppId())
|
||||
.setToken(token);
|
||||
Long taskId = u02cxApi.addTask(baseRequestBO);
|
||||
|
||||
smsTaskTbl.setTaskId(taskId);
|
||||
smsTaskTbl.setChannelId(smsChannelTbl.getChannelId());
|
||||
|
@ -106,51 +115,214 @@ public class SmsTaskTblServiceImpl implements ISmsTaskTblService
|
|||
String loginName = ShiroUtils.getLoginName();
|
||||
smsTaskTbl.setCreateBy(loginName);
|
||||
smsTaskTbl.setUpdateBy(loginName);
|
||||
smsTaskTbl.setTaskStatus("0");
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return smsTaskTblMapper.insertSmsTaskTbl(smsTaskTbl);
|
||||
}
|
||||
int i = smsTaskTblMapper.insertSmsTaskTbl(smsTaskTbl);
|
||||
|
||||
String taskStatus = smsTaskTbl.getTaskStatus();
|
||||
if ("1".equals(taskStatus)) {
|
||||
UpdateTaskStatusRequest updateTaskStatusRequest = new UpdateTaskStatusRequest();
|
||||
updateTaskStatusRequest.setTaskId(smsTaskTbl.getTaskId())
|
||||
.setTaskStatus(Integer.parseInt(smsTaskTbl.getTaskStatus()));
|
||||
String jsonStr = JSONUtil.toJsonStr(updateTaskStatusRequest);
|
||||
log.debug("jsonStr:{}", jsonStr);
|
||||
String encryptedData = RsaUtils.encryptData(jsonStr, smsChannelTbl.getPublicKey());
|
||||
|
||||
BaseRequestBO baseRequestBO = new BaseRequestBO();
|
||||
baseRequestBO.setEncryptedData(encryptedData)
|
||||
.setAppId(smsChannelTbl.getAppId())
|
||||
.setToken(token);
|
||||
u02cxApi.updateTaskStatus(baseRequestBO);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改WS短信任务配置
|
||||
*
|
||||
*
|
||||
* @param smsTaskTbl WS短信任务配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSmsTaskTbl(SmsTaskTbl smsTaskTbl)
|
||||
{
|
||||
public int updateSmsTaskTbl(SmsTaskTbl smsTaskTbl) {
|
||||
smsTaskTbl.setUpdateTime(DateUtils.getNowDate());
|
||||
return smsTaskTblMapper.updateSmsTaskTbl(smsTaskTbl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除WS短信任务配置
|
||||
*
|
||||
*
|
||||
* @param idSmsTasks 需要删除的WS短信任务配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSmsTaskTblByIdSmsTasks(String idSmsTasks)
|
||||
{
|
||||
public int deleteSmsTaskTblByIdSmsTasks(String idSmsTasks) {
|
||||
return smsTaskTblMapper.deleteSmsTaskTblByIdSmsTasks(Convert.toStrArray(idSmsTasks));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除WS短信任务配置信息
|
||||
*
|
||||
*
|
||||
* @param idSmsTask WS短信任务配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSmsTaskTblByIdSmsTask(Long idSmsTask)
|
||||
{
|
||||
public int deleteSmsTaskTblByIdSmsTask(Long idSmsTask) {
|
||||
return smsTaskTblMapper.deleteSmsTaskTblByIdSmsTask(idSmsTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBatchUpdateSmsVO(BatchUpdateSmsVO batchUpdateSmsVO) {
|
||||
String editSmsTypes = batchUpdateSmsVO.getEditSmsType();
|
||||
// String[] split = editSmsTypes.split(",");
|
||||
// List<String> editSmsTypeList = Arrays.asList(split);
|
||||
String ids = batchUpdateSmsVO.getIds();
|
||||
// String[] idArray = ids.split(",");
|
||||
SmsChannelTbl smsChannelTbl = smsChannelTblMapper.selectSmsChannelTblByIdSmsChannel(1L);
|
||||
|
||||
GetTokenRequest getTokenRequest = new GetTokenRequest();
|
||||
BeanUtils.copyProperties(smsChannelTbl, getTokenRequest);
|
||||
String token = u02cxApi.getToken(getTokenRequest);
|
||||
|
||||
List<String> idsList = Arrays.asList(ids.split(","));
|
||||
List<SmsTaskTbl> smsTaskTblList = smsTaskTblMapper.selectSmsTaskTbl(idsList);
|
||||
|
||||
List<String> editSmsTypeList = Arrays.asList(editSmsTypes.split(","));
|
||||
if (editSmsTypeList.contains("task_status")){
|
||||
String taskStatus = batchUpdateSmsVO.getTaskStatus();
|
||||
|
||||
String taskStatusName = taskStatus.equals("0") ? "关闭" : "开启";
|
||||
smsTaskTblList.stream().filter(smsTaskTbl -> smsTaskTbl.getTaskStatus().equals(taskStatus))
|
||||
.forEach(smsTaskTbl -> {
|
||||
throw new RuntimeException(smsTaskTbl.getTaskName()+"状态已经是:[ "+ taskStatusName+" ],不能修改,请重新选择");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
for (SmsTaskTbl smsTaskTbl : smsTaskTblList) {
|
||||
if (editSmsTypeList.contains("task_status")){
|
||||
UpdateTaskStatusRequest updateTaskStatusRequest = new UpdateTaskStatusRequest();
|
||||
updateTaskStatusRequest.setTaskId(smsTaskTbl.getTaskId())
|
||||
.setTaskStatus(Integer.parseInt(batchUpdateSmsVO.getTaskStatus()));
|
||||
String jsonStr = JSONUtil.toJsonStr(updateTaskStatusRequest);
|
||||
log.debug("jsonStr:{}", jsonStr);
|
||||
String encryptedData = RsaUtils.encryptData(jsonStr, smsChannelTbl.getPublicKey());
|
||||
|
||||
BaseRequestBO baseRequestBO = new BaseRequestBO();
|
||||
baseRequestBO.setEncryptedData(encryptedData)
|
||||
.setAppId(smsChannelTbl.getAppId())
|
||||
.setToken(token);
|
||||
u02cxApi.updateTaskStatus(baseRequestBO);
|
||||
smsTaskTbl.setTaskStatus(batchUpdateSmsVO.getTaskStatus());
|
||||
}
|
||||
|
||||
if (editSmsTypeList.contains("begin_time")){
|
||||
UpdateTaskRequest updateTaskRequest = new UpdateTaskRequest();
|
||||
updateTaskRequest.setTaskId(smsTaskTbl.getTaskId())
|
||||
.setTaskBeginTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", batchUpdateSmsVO.getTaskBeginTime()));
|
||||
String jsonStr = JSONUtil.toJsonStr(updateTaskRequest);
|
||||
log.debug("jsonStr:{}", jsonStr);
|
||||
String encryptedData = RsaUtils.encryptData(jsonStr, smsChannelTbl.getPublicKey());
|
||||
|
||||
BaseRequestBO baseRequestBO = new BaseRequestBO();
|
||||
baseRequestBO.setEncryptedData(encryptedData)
|
||||
.setAppId(smsChannelTbl.getAppId())
|
||||
.setToken(token);
|
||||
u02cxApi.updateTask(baseRequestBO);
|
||||
smsTaskTbl.setTaskBeginTime(batchUpdateSmsVO.getTaskBeginTime());
|
||||
}
|
||||
|
||||
smsTaskTblMapper.updateSmsTaskTbl(smsTaskTbl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// for (String id : idArray) {
|
||||
// SmsTaskTbl smsTaskTbl = smsTaskTblMapper.selectSmsTaskTblByIdSmsTask(Long.valueOf(id));
|
||||
//
|
||||
// for (String editSmsType : editSmsTypeList) {
|
||||
// if (editSmsType.equals("task_status")){
|
||||
// UpdateTaskStatusRequest updateTaskStatusRequest = new UpdateTaskStatusRequest();
|
||||
// updateTaskStatusRequest.setTaskId(smsTaskTbl.getTaskId())
|
||||
// .setTaskStatus(Integer.parseInt(batchUpdateSmsVO.getTaskStatus()));
|
||||
// String jsonStr = JSONUtil.toJsonStr(updateTaskStatusRequest);
|
||||
// log.debug("jsonStr:{}", jsonStr);
|
||||
// String encryptedData = RsaUtils.encryptData(jsonStr, smsChannelTbl.getPublicKey());
|
||||
//
|
||||
// BaseRequestBO baseRequestBO = new BaseRequestBO();
|
||||
// baseRequestBO.setEncryptedData(encryptedData)
|
||||
// .setAppId(smsChannelTbl.getAppId())
|
||||
// .setToken(token);
|
||||
// u02cxApi.updateTaskStatus(baseRequestBO);
|
||||
// smsTaskTbl.setTaskStatus(batchUpdateSmsVO.getTaskStatus());
|
||||
// }else if (editSmsType.equals("begin_time")){
|
||||
//
|
||||
// UpdateTaskRequest updateTaskRequest = new UpdateTaskRequest();
|
||||
// updateTaskRequest.setTaskId(smsTaskTbl.getTaskId())
|
||||
// .setTaskBeginTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", batchUpdateSmsVO.getTaskBeginTime()));
|
||||
// String jsonStr = JSONUtil.toJsonStr(updateTaskRequest);
|
||||
// log.debug("jsonStr:{}", jsonStr);
|
||||
// String encryptedData = RsaUtils.encryptData(jsonStr, smsChannelTbl.getPublicKey());
|
||||
//
|
||||
// BaseRequestBO baseRequestBO = new BaseRequestBO();
|
||||
// baseRequestBO.setEncryptedData(encryptedData)
|
||||
// .setAppId(smsChannelTbl.getAppId())
|
||||
// .setToken(token);
|
||||
// u02cxApi.updateTask(baseRequestBO);
|
||||
// smsTaskTbl.setTaskBeginTime(batchUpdateSmsVO.getTaskBeginTime());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// smsTaskTblMapper.updateSmsTaskTbl(smsTaskTbl);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getReport(Long idSmsTask) {
|
||||
SmsTaskTbl smsTaskTbl = smsTaskTblMapper.selectSmsTaskTblByIdSmsTask(idSmsTask);
|
||||
SmsChannelTbl smsChannelTbl = smsChannelTblMapper.selectSmsChannelTblByIdSmsChannel(1L);
|
||||
|
||||
GetTokenRequest getTokenRequest = new GetTokenRequest();
|
||||
BeanUtils.copyProperties(smsChannelTbl, getTokenRequest);
|
||||
String token = u02cxApi.getToken(getTokenRequest);
|
||||
|
||||
|
||||
GetReportRequest getReportRequest = new GetReportRequest();
|
||||
getReportRequest.setTaskId(smsTaskTbl.getTaskId())
|
||||
.setToken(token)
|
||||
.setAppId(smsChannelTbl.getAppId());
|
||||
byte[] report = u02cxApi.getReport(getReportRequest);
|
||||
return report;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int complete(String ids) {
|
||||
|
||||
List<String> idsList = Arrays.asList(ids.split(","));
|
||||
List<SmsTaskTbl> smsTaskTblList = smsTaskTblMapper.selectSmsTaskTbl(idsList);
|
||||
|
||||
SmsChannelTbl smsChannelTbl = smsChannelTblMapper.selectSmsChannelTblByIdSmsChannel(1L);
|
||||
|
||||
GetTokenRequest getTokenRequest = new GetTokenRequest();
|
||||
BeanUtils.copyProperties(smsChannelTbl, getTokenRequest);
|
||||
String token = u02cxApi.getToken(getTokenRequest);
|
||||
|
||||
List<Long> taskIds = smsTaskTblList.stream().map(SmsTaskTbl::getTaskId).collect(Collectors.toList());
|
||||
|
||||
BatchTaskIdsRequest batchTaskIdsRequest = new BatchTaskIdsRequest();
|
||||
batchTaskIdsRequest.setTaskIds(taskIds)
|
||||
.setToken(token)
|
||||
.setAppId(smsChannelTbl.getAppId());
|
||||
u02cxApi.completeByBatch(batchTaskIdsRequest);
|
||||
|
||||
smsDetailTaskHandler.doGetSmsDetailTask(smsTaskTblList);
|
||||
|
||||
return smsTaskTblList.size();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"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" />
|
||||
|
@ -11,7 +12,9 @@
|
|||
<result property="taskId" column="task_id" />
|
||||
<result property="channelId" column="channel_id" />
|
||||
<result property="price" column="price" />
|
||||
<result property="preSummary" column="pre_summary" />
|
||||
<result property="taskBeginTime" column="task_begin_time" />
|
||||
<result property="completeTime" column="complete_time" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="fileMd5" column="file_md5" />
|
||||
|
@ -19,6 +22,8 @@
|
|||
<result property="smsContentType" column="sms_content_type" />
|
||||
<result property="taskStatus" column="task_status" />
|
||||
<result property="successRate" column="success_rate" />
|
||||
<result property="successCount" column="success_count" />
|
||||
<result property="totalCount" column="total_count" />
|
||||
<result property="issueCount" column="issue_count" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
|
@ -28,18 +33,20 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectSmsTaskTblVo">
|
||||
select id_sms_task, task_name, sms_busi_type, task_id, channel_id, price, task_begin_time, file_name, file_path, file_md5, context, sms_content_type, task_status, success_rate, issue_count, user_id, create_by, create_time, update_by, update_time from sms_task_tbl
|
||||
select id_sms_task, task_name, sms_busi_type, task_id, channel_id, price, pre_summary, task_begin_time, complete_time, file_name, file_path, file_md5, context, sms_content_type, task_status, success_rate, success_count, total_count, issue_count, s.user_id, s.create_by, s.create_time, s.update_by, s.update_time from sms_task_tbl s
|
||||
</sql>
|
||||
|
||||
<select id="selectSmsTaskTblList" parameterType="SmsTaskTbl" resultMap="SmsTaskTblResult">
|
||||
<include refid="selectSmsTaskTblVo"/>
|
||||
<where>
|
||||
left join sys_user u on s.user_id = u.user_id
|
||||
<where> 1=1
|
||||
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="smsBusiType != null and smsBusiType != ''"> and sms_busi_type = #{smsBusiType}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus}</if>
|
||||
<if test="userId != null and userId != ''"> and user_id = #{userId}</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>
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectSmsTaskTblByIdSmsTask" parameterType="Long" resultMap="SmsTaskTblResult">
|
||||
|
@ -47,6 +54,7 @@
|
|||
where id_sms_task = #{idSmsTask}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertSmsTaskTbl" parameterType="SmsTaskTbl" useGeneratedKeys="true" keyProperty="idSmsTask">
|
||||
insert into sms_task_tbl
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -55,7 +63,9 @@
|
|||
<if test="taskId != null">task_id,</if>
|
||||
<if test="channelId != null">channel_id,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="preSummary != null">pre_summary,</if>
|
||||
<if test="taskBeginTime != null">task_begin_time,</if>
|
||||
<if test="completeTime != null">complete_time,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="filePath != null">file_path,</if>
|
||||
<if test="fileMd5 != null">file_md5,</if>
|
||||
|
@ -63,6 +73,8 @@
|
|||
<if test="smsContentType != null">sms_content_type,</if>
|
||||
<if test="taskStatus != null">task_status,</if>
|
||||
<if test="successRate != null">success_rate,</if>
|
||||
<if test="successCount != null">success_count,</if>
|
||||
<if test="totalCount != null">total_count,</if>
|
||||
<if test="issueCount != null">issue_count,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
|
@ -76,7 +88,9 @@
|
|||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="channelId != null">#{channelId},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="preSummary != null">#{preSummary},</if>
|
||||
<if test="taskBeginTime != null">#{taskBeginTime},</if>
|
||||
<if test="completeTime != null">#{completeTime},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
<if test="fileMd5 != null">#{fileMd5},</if>
|
||||
|
@ -84,6 +98,8 @@
|
|||
<if test="smsContentType != null">#{smsContentType},</if>
|
||||
<if test="taskStatus != null">#{taskStatus},</if>
|
||||
<if test="successRate != null">#{successRate},</if>
|
||||
<if test="successCount != null">#{successCount},</if>
|
||||
<if test="totalCount != null">#{totalCount},</if>
|
||||
<if test="issueCount != null">#{issueCount},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
|
@ -101,7 +117,9 @@
|
|||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="channelId != null">channel_id = #{channelId},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="preSummary != null">pre_summary = #{preSummary},</if>
|
||||
<if test="taskBeginTime != null">task_begin_time = #{taskBeginTime},</if>
|
||||
<if test="completeTime != null">complete_time = #{completeTime},</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>
|
||||
|
@ -109,6 +127,8 @@
|
|||
<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="successCount != null">success_count = #{successCount},</if>
|
||||
<if test="totalCount != null">total_count = #{totalCount},</if>
|
||||
<if test="issueCount != null">issue_count = #{issueCount},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
|
@ -130,4 +150,45 @@
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectSmsTaskTblListNotComplete" resultMap="SmsTaskTblResult">
|
||||
<include refid="selectSmsTaskTblVo"/>
|
||||
where complete_time is null
|
||||
</select>
|
||||
|
||||
<update id="updateSmsTaskTblByTaskId">
|
||||
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="channelId != null">channel_id = #{channelId},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="preSummary != null">pre_summary = #{preSummary},</if>
|
||||
<if test="taskBeginTime != null">task_begin_time = #{taskBeginTime},</if>
|
||||
<if test="completeTime != null">complete_time = #{completeTime},</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="successCount != null">success_count = #{successCount},</if>
|
||||
<if test="totalCount != null">total_count = #{totalCount},</if>
|
||||
<if test="issueCount != null">issue_count = #{issueCount},</if>
|
||||
<if test="userId != null">user_id = #{userId},</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 task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<select id="selectSmsTaskTbl" resultMap="SmsTaskTblResult">
|
||||
<include refid="selectSmsTaskTblVo"/>
|
||||
WHERE id_sms_task IN
|
||||
<foreach item="id" collection="idsList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue