diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index c724f7288..352868a03 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -147,7 +147,7 @@ --> ${project.artifactId} - + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ApiController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ApiController.java index 2db230ad0..234504d15 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ApiController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ApiController.java @@ -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 transferusdt(@PathVariable("amount") String amount) throws Exception { + String txid = apiService.transferusdt(amount); + return R.ok(txid); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/sms/SmsChannelTblController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/sms/SmsChannelTblController.java new file mode 100644 index 000000000..6ce0e2b09 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/sms/SmsChannelTblController.java @@ -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 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 list = smsChannelTblService.selectSmsChannelTblList(smsChannelTbl); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/sms/SmsTaskTblController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/sms/SmsTaskTblController.java new file mode 100644 index 000000000..4d5af500d --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/sms/SmsTaskTblController.java @@ -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 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 list = smsTaskTblService.selectSmsTaskTblList(smsTaskTbl); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/ruoyi-admin/src/main/resources/templates/sms/channel/add.html b/ruoyi-admin/src/main/resources/templates/sms/channel/add.html new file mode 100644 index 000000000..f82fec1ae --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/sms/channel/add.html @@ -0,0 +1,57 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/sms/channel/channel.html b/ruoyi-admin/src/main/resources/templates/sms/channel/channel.html new file mode 100644 index 000000000..54d7e8a21 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/sms/channel/channel.html @@ -0,0 +1,119 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • + +
  • + + + - + +
  • + +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/sms/channel/edit.html b/ruoyi-admin/src/main/resources/templates/sms/channel/edit.html new file mode 100644 index 000000000..4e88e155f --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/sms/channel/edit.html @@ -0,0 +1,58 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/sms/task/add.html b/ruoyi-admin/src/main/resources/templates/sms/task/add.html new file mode 100644 index 000000000..7d3c74cef --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/sms/task/add.html @@ -0,0 +1,122 @@ + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/sms/task/edit.html b/ruoyi-admin/src/main/resources/templates/sms/task/edit.html new file mode 100644 index 000000000..d273802d8 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/sms/task/edit.html @@ -0,0 +1,92 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/sms/task/task.html b/ruoyi-admin/src/main/resources/templates/sms/task/task.html new file mode 100644 index 000000000..6152aef07 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/sms/task/task.html @@ -0,0 +1,167 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SmsTaskTbl.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SmsTaskTbl.java new file mode 100644 index 000000000..7fd81c5a8 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SmsTaskTbl.java @@ -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(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/bot/TgLongPollingBot.java b/ruoyi-system/src/main/java/com/ruoyi/system/bot/TgLongPollingBot.java index f4e4f247b..34bebe21d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/bot/TgLongPollingBot.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/bot/TgLongPollingBot.java @@ -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 { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SmsChannelTbl.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SmsChannelTbl.java new file mode 100644 index 000000000..85250c08a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SmsChannelTbl.java @@ -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(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/handler/Usdt2TrxTransferHandler.java b/ruoyi-system/src/main/java/com/ruoyi/system/handler/Usdt2TrxTransferHandler.java index 412571670..bf0307c03 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/handler/Usdt2TrxTransferHandler.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/handler/Usdt2TrxTransferHandler.java @@ -202,6 +202,9 @@ public class Usdt2TrxTransferHandler { usdtExchangeInfoMapper.insertUsdtExchangeInfo(usdtExchangeInfo); + if (oneUsdtToTrxPair == null){ + return; + } doSendTgNotice(oneUsdtToTrxPair.getFirst(), from, trxValue, transferValue, txId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SmsChannelTblMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SmsChannelTblMapper.java new file mode 100644 index 000000000..d6abcdaef --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SmsChannelTblMapper.java @@ -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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SmsTaskTblMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SmsTaskTblMapper.java new file mode 100644 index 000000000..5e6bf6ce5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SmsTaskTblMapper.java @@ -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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IAccountAddressInfoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IAccountAddressInfoService.java index d37b18e8f..bc8f2d129 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IAccountAddressInfoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IAccountAddressInfoService.java @@ -61,7 +61,7 @@ public interface IAccountAddressInfoService */ public int deleteAccountAddressInfoByIdAccoutAddressInfo(Long idAccoutAddressInfo); - Object selectAccountAddressInfoAll(String busiType); + List selectAccountAddressInfoAll(String busiType); String getDecryptPrivateKey(String address) throws Exception; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IApiService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IApiService.java index 6d9f2b632..09283d726 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IApiService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IApiService.java @@ -5,4 +5,5 @@ import com.ruoyi.system.domain.vo.TronInfoVO; public interface IApiService { TronInfoVO getTronInfo() throws Exception; + String transferusdt(String amount) throws Exception; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISmsTaskTblService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISmsTaskTblService.java new file mode 100644 index 000000000..7e56d46e7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISmsTaskTblService.java @@ -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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ApiServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ApiServiceImpl.java index 9a8e8f40c..4b1b6a261 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ApiServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ApiServiceImpl.java @@ -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; + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SmsTaskTblServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SmsTaskTblServiceImpl.java new file mode 100644 index 000000000..11fb19b72 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SmsTaskTblServiceImpl.java @@ -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 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); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/sms/SmsChannelTblMapper.xml b/ruoyi-system/src/main/resources/mapper/sms/SmsChannelTblMapper.xml new file mode 100644 index 000000000..6c7693874 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/sms/SmsChannelTblMapper.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + select id_sms_channel, channel_id, appid, secret, publicKey, sms_busi_type, create_by, create_time, update_by, update_time from sms_channel_tbl + + + + + + + + insert into sms_channel_tbl + + channel_id, + appid, + secret, + publicKey, + sms_busi_type, + create_by, + create_time, + update_by, + update_time, + + + #{channelId}, + #{appid}, + #{secret}, + #{publicKey}, + #{smsBusiType}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update sms_channel_tbl + + channel_id = #{channelId}, + appid = #{appid}, + secret = #{secret}, + publicKey = #{publicKey}, + sms_busi_type = #{smsBusiType}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id_sms_channel = #{idSmsChannel} + + + + delete from sms_channel_tbl where id_sms_channel = #{idSmsChannel} + + + + delete from sms_channel_tbl where id_sms_channel in + + #{idSmsChannel} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/sms/SmsTaskTblMapper.xml b/ruoyi-system/src/main/resources/mapper/sms/SmsTaskTblMapper.xml new file mode 100644 index 000000000..2ca9872f0 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/sms/SmsTaskTblMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into sms_task_tbl + + 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, + + + #{taskName}, + #{smsBusiType}, + #{price}, + #{taskBeginTime}, + #{fileName}, + #{filePath}, + #{fileMd5}, + #{context}, + #{smsContentType}, + #{taskStatus}, + #{successRate}, + #{issueCount}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update sms_task_tbl + + task_name = #{taskName}, + sms_busi_type = #{smsBusiType}, + price = #{price}, + task_begin_time = #{taskBeginTime}, + file_name = #{fileName}, + file_path = #{filePath}, + file_md5 = #{fileMd5}, + context = #{context}, + sms_content_type = #{smsContentType}, + task_status = #{taskStatus}, + success_rate = #{successRate}, + issue_count = #{issueCount}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id_sms_task = #{idSmsTask} + + + + delete from sms_task_tbl where id_sms_task = #{idSmsTask} + + + + delete from sms_task_tbl where id_sms_task in + + #{idSmsTask} + + + + \ No newline at end of file