第一次提交,完成trx监控自动兑换能量

pull/520/head
dorion 2024-04-16 20:33:53 +08:00
parent 55913e8707
commit 244ceb4afc
96 changed files with 8387 additions and 1976 deletions

1
.github/FUNDING.yml vendored
View File

@ -1 +0,0 @@
custom: http://doc.ruoyi.vip/ruoyi/other/donate.html

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2018 RuoYi Copyright (c) 2024
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in

102
README.md
View File

@ -1,102 +0,0 @@
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-dd77653d7c9f197dd9d93684f3c8dcfbab6.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v4.7.8</h1>
<h4 align="center">基于SpringBoot开发的轻量级Java快速开发框架</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi/stargazers"><img src="https://gitee.com/y_project/RuoYi/badge/star.svg?theme=gvp"></a>
<a href="https://gitee.com/y_project/RuoYi"><img src="https://img.shields.io/badge/RuoYi-v4.7.8-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## 平台简介
一直想做一款后台管理系统看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序如网站管理后台网站会员中心CMSCRMOA。所有前端后台代码封装过后十分精简易上手出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
性别男,若依是给女儿取的名字(寓意:你若不离不弃,我必生死相依)
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 前后端分离版本,请移步[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 感谢 [hplus](https://gitee.com/hplus_admin/hplus) 后台主题 UI 框架。
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
7. 参数管理:对系统动态配置常用参数。
8. 通知公告:系统通知公告信息发布维护。
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
10. 登录日志:系统登录日志记录查询包含登录异常。
11. 在线用户:当前系统中活跃用户状态监控。
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
13. 代码生成前后端代码的生成java、html、xml、sql支持CRUD下载 。
14. 系统接口根据业务代码自动生成相关的api接口文档。
15. 服务监控监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 缓存监控:对系统的缓存查询,删除、清空等操作。
17. 在线构建器拖动表单元素生成相应的HTML代码。
18. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
## 在线体验
- admin/admin123
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
演示地址http://ruoyi.vip
文档地址http://doc.ruoyi.vip
## 演示图
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-42e518aa72a24d228427a1261cb3679f395.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-7f20dd0edba25e5187c5c4dd3ec7d3d9797.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-2dae3d87f6a8ca05057db059cd9a411d51d.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-ea4d98423471e55fba784694e45d12bd4bb.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-7f6c6e9f5873efca09bd2870ee8468b8fce.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c708b65f2c382a03f69fe1efa8d341e6cff.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-9ab586c47dd5c7b92bca0d727962c90e3b8.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-ef954122a2080e02013112db21754b955c6.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-088edb4d531e122415a1e2342bccb1a9691.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-f886fe19bd820c0efae82f680223cac196c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-c7a2eb71fa65d6e660294b4bccca613d638.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-e60137fb0787defe613bd83331dc4755a70.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-7c51c1b5758f0a0f92ed3c60469b7526f9f.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-15181aed45bb2461aa97b594cbf2f86ea5f.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-83326ad52ea63f67233d126226738054d98.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-3bd6d31e913b70df00107db51d64ef81df7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-70a2225836bc82042a6785edf6299e2586a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-0184d6ab01fdc6667a14327fcaf8b46345d.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-64d8086dc2c02c8f71170290482f7640098.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 若依交流群
QQ群 [![加入QQ群](https://img.shields.io/badge/已满-1389287-blue.svg)](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [![加入QQ群](https://img.shields.io/badge/已满-1679294-blue.svg)](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [![加入QQ群](https://img.shields.io/badge/已满-1529866-blue.svg)](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [![加入QQ群](https://img.shields.io/badge/已满-1772718-blue.svg)](https://jq.qq.com/?_wv=1027&k=5g75dCU) [![加入QQ群](https://img.shields.io/badge/已满-1366522-blue.svg)](https://jq.qq.com/?_wv=1027&k=58cPoHA) [![加入QQ群](https://img.shields.io/badge/已满-1382251-blue.svg)](https://jq.qq.com/?_wv=1027&k=5Ofd4Pb) [![加入QQ群](https://img.shields.io/badge/已满-1145125-blue.svg)](https://jq.qq.com/?_wv=1027&k=5yugASz) [![加入QQ群](https://img.shields.io/badge/已满-86752435-blue.svg)](https://jq.qq.com/?_wv=1027&k=5Rf3d2P) [![加入QQ群](https://img.shields.io/badge/已满-134072510-blue.svg)](https://jq.qq.com/?_wv=1027&k=5ZIjaeP) [![加入QQ群](https://img.shields.io/badge/已满-210336300-blue.svg)](https://jq.qq.com/?_wv=1027&k=5CJw1jY) [![加入QQ群](https://img.shields.io/badge/已满-339522636-blue.svg)](https://jq.qq.com/?_wv=1027&k=5omzbKc) [![加入QQ群](https://img.shields.io/badge/已满-130035985-blue.svg)](https://jq.qq.com/?_wv=1027&k=qPIKBb7s) [![加入QQ群](https://img.shields.io/badge/已满-143151071-blue.svg)](https://jq.qq.com/?_wv=1027&k=4NsjKbtU) [![加入QQ群](https://img.shields.io/badge/已满-158781320-blue.svg)](https://jq.qq.com/?_wv=1027&k=VD2pkz2G) [![加入QQ群](https://img.shields.io/badge/已满-201531282-blue.svg)](https://jq.qq.com/?_wv=1027&k=HlshFwkJ) [![加入QQ群](https://img.shields.io/badge/已满-101526938-blue.svg)](https://jq.qq.com/?_wv=1027&k=0ARRrO9V) [![加入QQ群](https://img.shields.io/badge/已满-264355400-blue.svg)](https://jq.qq.com/?_wv=1027&k=up9k3ZXJ) [![加入QQ群](https://img.shields.io/badge/已满-298522656-blue.svg)](https://jq.qq.com/?_wv=1027&k=540WfdEr) [![加入QQ群](https://img.shields.io/badge/已满-139845794-blue.svg)](https://jq.qq.com/?_wv=1027&k=ss91fC4t) [![加入QQ群](https://img.shields.io/badge/已满-185760789-blue.svg)](https://jq.qq.com/?_wv=1027&k=Cqd66IKe) [![加入QQ群](https://img.shields.io/badge/已满-175104288-blue.svg)](https://jq.qq.com/?_wv=1027&k=7FplYUnR) [![加入QQ群](https://img.shields.io/badge/174942938-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=lqMHu_5Fskm7H2S1vNAQTtzAUokVydwc&authKey=ptw0Fpch5pbNocML3CIJKKqZBaq2DI7cusKuzIgfMNiY3t9Pvd9hP%2BA8WYx3yaY1&noverify=0&group_code=174942938)

View File

@ -8,8 +8,8 @@
<version>4.7.8</version> <version>4.7.8</version>
<name>ruoyi</name> <name>ruoyi</name>
<url>http://www.ruoyi.vip</url> <!--<url>http://www.ruoyi.vip</url>-->
<description>若依管理系统</description> <description>后端管理系统</description>
<properties> <properties>
<ruoyi.version>4.7.8</ruoyi.version> <ruoyi.version>4.7.8</ruoyi.version>

View File

@ -77,6 +77,12 @@
<version>2.5.15</version> <version>2.5.15</version>
<configuration> <configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 --> <fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
@ -129,6 +135,17 @@
</plugin> --> </plugin> -->
</plugins> </plugins>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
<!-- <resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>*.yml</exclude>
<exclude>*.xml</exclude>
</excludes>
</resource>
</resources>-->
</build> </build>
</project> </project>

View File

@ -1,5 +1,6 @@
package com.ruoyi; package com.ruoyi;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
* @author ruoyi * @author ruoyi
*/ */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@MapperScan("com.ruoyi.system.mapper")
public class RuoYiApplication public class RuoYiApplication
{ {
public static void main(String[] args) public static void main(String[] args)

View File

@ -0,0 +1,122 @@
package com.ruoyi.web.controller.account;
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.AccountAddressInfo;
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.IAccountAddressInfoService;
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-04-13
*/
@Controller
@RequestMapping("/account/transfer")
public class AccountAddressInfoController extends BaseController
{
private String prefix = "account/transfer";
@Autowired
private IAccountAddressInfoService accountAddressInfoService;
@RequiresPermissions("account:transfer:view")
@GetMapping()
public String transfer()
{
return prefix + "/transfer";
}
/**
*
*/
@RequiresPermissions("account:transfer:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(AccountAddressInfo accountAddressInfo) throws Exception {
startPage();
List<AccountAddressInfo> list = accountAddressInfoService.selectAccountAddressInfoListByResouce(accountAddressInfo);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("account:transfer:export")
@Log(title = "出账账户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(AccountAddressInfo accountAddressInfo) throws Exception {
List<AccountAddressInfo> list = accountAddressInfoService.selectAccountAddressInfoListByResouce(accountAddressInfo);
ExcelUtil<AccountAddressInfo> util = new ExcelUtil<AccountAddressInfo>(AccountAddressInfo.class);
return util.exportExcel(list, "出账账户数据");
}
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("account:transfer:add")
@Log(title = "出账账户", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(AccountAddressInfo accountAddressInfo) throws Exception {
return toAjax(accountAddressInfoService.insertAccountAddressInfo(accountAddressInfo));
}
/**
*
*/
@RequiresPermissions("account:transfer:edit")
@GetMapping("/edit/{idAccoutAddressInfo}")
public String edit(@PathVariable("idAccoutAddressInfo") Long idAccoutAddressInfo, ModelMap mmap)
{
AccountAddressInfo accountAddressInfo = accountAddressInfoService.selectAccountAddressInfoByIdAccoutAddressInfo(idAccoutAddressInfo);
mmap.put("accountAddressInfo", accountAddressInfo);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("account:transfer:edit")
@Log(title = "出账账户", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(AccountAddressInfo accountAddressInfo) throws Exception {
return toAjax(accountAddressInfoService.updateAccountAddressInfo(accountAddressInfo));
}
/**
*
*/
@RequiresPermissions("account:transfer:remove")
@Log(title = "出账账户", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(accountAddressInfoService.deleteAccountAddressInfoByIdAccoutAddressInfos(ids));
}
}

View File

@ -0,0 +1,128 @@
package com.ruoyi.web.controller.account;
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.FreezeBalanceInfo;
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.IAccountAddressInfoService;
import com.ruoyi.system.service.IFreezeBalanceInfoService;
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-04-13
*/
@Controller
@RequestMapping("/account/freeze")
public class FreezeBalanceInfoController extends BaseController
{
private String prefix = "account/freeze";
@Autowired
private IFreezeBalanceInfoService freezeBalanceInfoService;
@Autowired
private IAccountAddressInfoService accountAddressInfoService;
@RequiresPermissions("account:freeze:view")
@GetMapping()
public String freeze()
{
return prefix + "/freeze";
}
/**
*
*/
@RequiresPermissions("account:freeze:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(FreezeBalanceInfo freezeBalanceInfo)
{
startPage();
List<FreezeBalanceInfo> list = freezeBalanceInfoService.selectFreezeBalanceInfoList(freezeBalanceInfo);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("account:freeze:export")
@Log(title = "抵押流水记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(FreezeBalanceInfo freezeBalanceInfo)
{
List<FreezeBalanceInfo> list = freezeBalanceInfoService.selectFreezeBalanceInfoList(freezeBalanceInfo);
ExcelUtil<FreezeBalanceInfo> util = new ExcelUtil<FreezeBalanceInfo>(FreezeBalanceInfo.class);
return util.exportExcel(list, "抵押流水记录数据");
}
/**
*
*/
@GetMapping("/add")
public String add(ModelMap mmap)
{
mmap.put("accountAddressList", accountAddressInfoService.selectAccountAddressInfoAll());
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("account:freeze:add")
@Log(title = "抵押流水记录", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(FreezeBalanceInfo freezeBalanceInfo) throws Exception {
return toAjax(freezeBalanceInfoService.insertFreezeBalanceInfo(freezeBalanceInfo));
}
/**
*
*/
@RequiresPermissions("account:freeze:edit")
@GetMapping("/edit/{idFreezeBalanceInfo}")
public String edit(@PathVariable("idFreezeBalanceInfo") Long idFreezeBalanceInfo, ModelMap mmap)
{
FreezeBalanceInfo freezeBalanceInfo = freezeBalanceInfoService.selectFreezeBalanceInfoByIdFreezeBalanceInfo(idFreezeBalanceInfo);
mmap.put("freezeBalanceInfo", freezeBalanceInfo);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("account:freeze:edit")
@Log(title = "抵押流水记录", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(FreezeBalanceInfo freezeBalanceInfo)
{
return toAjax(freezeBalanceInfoService.updateFreezeBalanceInfo(freezeBalanceInfo));
}
/**
*
*/
@RequiresPermissions("account:freeze:remove")
@Log(title = "抵押流水记录", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(freezeBalanceInfoService.deleteFreezeBalanceInfoByIdFreezeBalanceInfos(ids));
}
}

View File

@ -0,0 +1,129 @@
package com.ruoyi.web.controller.account;
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.MonitorAddressInfo;
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.IAccountAddressInfoService;
import com.ruoyi.system.service.IMonitorAddressInfoService;
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-04-13
*/
@Controller
@RequestMapping("/account/monitor")
public class MonitorAddressInfoController extends BaseController
{
private String prefix = "account/monitor";
@Autowired
private IMonitorAddressInfoService monitorAddressInfoService;
@Autowired
private IAccountAddressInfoService accountAddressInfoService;
@RequiresPermissions("account:monitor:view")
@GetMapping()
public String monitor()
{
return prefix + "/monitor";
}
/**
*
*/
@RequiresPermissions("account:monitor:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MonitorAddressInfo monitorAddressInfo)
{
startPage();
List<MonitorAddressInfo> list = monitorAddressInfoService.selectMonitorAddressInfoList(monitorAddressInfo);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("account:monitor:export")
@Log(title = "监听账户入账", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(MonitorAddressInfo monitorAddressInfo)
{
List<MonitorAddressInfo> list = monitorAddressInfoService.selectMonitorAddressInfoList(monitorAddressInfo);
ExcelUtil<MonitorAddressInfo> util = new ExcelUtil<MonitorAddressInfo>(MonitorAddressInfo.class);
return util.exportExcel(list, "监听账户入账数据");
}
/**
*
*/
@GetMapping("/add")
public String add(ModelMap mmap)
{
mmap.put("accountAddressList", accountAddressInfoService.selectAccountAddressInfoAll());
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("account:monitor:add")
@Log(title = "监听账户入账", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(MonitorAddressInfo monitorAddressInfo)
{
return toAjax(monitorAddressInfoService.insertMonitorAddressInfo(monitorAddressInfo));
}
/**
*
*/
@RequiresPermissions("account:monitor:edit")
@GetMapping("/edit/{idMonitorAddress}")
public String edit(@PathVariable("idMonitorAddress") Long idMonitorAddress, ModelMap mmap)
{
MonitorAddressInfo monitorAddressInfo = monitorAddressInfoService.selectMonitorAddressInfoByIdMonitorAddress(idMonitorAddress);
mmap.put("monitorAddressInfo", monitorAddressInfo);
mmap.put("accountAddressList", accountAddressInfoService.selectAccountAddressInfoAll());
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("account:monitor:edit")
@Log(title = "监听账户入账", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(MonitorAddressInfo monitorAddressInfo)
{
return toAjax(monitorAddressInfoService.updateMonitorAddressInfo(monitorAddressInfo));
}
/**
*
*/
@RequiresPermissions("account:monitor:remove")
@Log(title = "监听账户入账", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(monitorAddressInfoService.deleteMonitorAddressInfoByIdMonitorAddresss(ids));
}
}

View File

@ -0,0 +1,142 @@
package com.ruoyi.web.controller.account;
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.MonitorAddressInfo;
import com.ruoyi.common.core.domain.entity.TenantInfo;
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.IMonitorAddressInfoService;
import com.ruoyi.system.service.ITenantInfoService;
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-04-14
*/
@Controller
@RequestMapping("/account/tenant")
public class TenantInfoController extends BaseController
{
private String prefix = "account/tenant";
@Autowired
private ITenantInfoService tenantInfoService;
@Autowired
private IMonitorAddressInfoService monitorAddressInfoService;
@RequiresPermissions("account:tenant:view")
@GetMapping()
public String tenant()
{
return prefix + "/tenant";
}
/**
*
*/
@RequiresPermissions("account:tenant:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TenantInfo tenantInfo)
{
startPage();
List<TenantInfo> list = tenantInfoService.selectTenantInfoList(tenantInfo);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("account:tenant:export")
@Log(title = "租户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(TenantInfo tenantInfo)
{
List<TenantInfo> list = tenantInfoService.selectTenantInfoList(tenantInfo);
ExcelUtil<TenantInfo> util = new ExcelUtil<TenantInfo>(TenantInfo.class);
return util.exportExcel(list, "租户数据");
}
/**
*
*/
@GetMapping("/add")
public String add(ModelMap mmap)
{
List<MonitorAddressInfo> monitorAddressAccountList = monitorAddressInfoService.selectAllValidMonitorAddressAccount();
mmap.put("monitorAddressInfoList", monitorAddressAccountList);
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("account:tenant:add")
@Log(title = "租户", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TenantInfo tenantInfo)
{
return toAjax(tenantInfoService.insertTenantInfo(tenantInfo));
}
/**
*
*/
@RequiresPermissions("account:tenant:edit")
@GetMapping("/edit/{idTenantInfo}")
public String edit(@PathVariable("idTenantInfo") Long idTenantInfo, ModelMap mmap)
{
TenantInfo tenantInfo = tenantInfoService.selectTenantInfoByIdTenantInfo(idTenantInfo);
mmap.put("tenantInfo", tenantInfo);
List<MonitorAddressInfo> monitorAddressInfoList = monitorAddressInfoService.selectAllValidMonitorAddressAccount();
mmap.put("monitorAddressInfoList", monitorAddressInfoList);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("account:tenant:edit")
@Log(title = "租户", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TenantInfo tenantInfo)
{
return toAjax(tenantInfoService.updateTenantInfo(tenantInfo));
}
/**
*
*/
@RequiresPermissions("account:tenant:remove")
@Log(title = "租户", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(tenantInfoService.deleteTenantInfoByIdTenantInfos(ids));
}
@RequiresPermissions("account:tenant:add")
@Log(title = "租户", businessType = BusinessType.ACTIVE_DATA)
@PostMapping( "/activeData")
@ResponseBody
public AjaxResult activeData(String ids) throws Exception {
return toAjax(tenantInfoService.activeDataTenantInfoByIdTenantInfos(ids));
}
}

View File

@ -0,0 +1,128 @@
package com.ruoyi.web.controller.exchange;
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.TrxExchangeInfo;
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.TrxExchange;
import com.ruoyi.system.service.IAccountAddressInfoService;
import com.ruoyi.system.service.ITrxExchangeInfoService;
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;
/**
* trxController
*
* @author dorion
* @date 2024-04-13
*/
@Controller
@RequestMapping("/exchange/trx")
public class TrxExchangeInfoController extends BaseController
{
private String prefix = "exchange/trx";
@Autowired
private ITrxExchangeInfoService trxExchangeInfoService;
@Autowired
private IAccountAddressInfoService accountAddressInfoService;
@RequiresPermissions("exchange:trx:view")
@GetMapping()
public String trx()
{
return prefix + "/trx";
}
/**
* trx
*/
@RequiresPermissions("exchange:trx:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TrxExchangeInfo trxExchangeInfo)
{
startPage();
List<TrxExchangeInfo> list = trxExchangeInfoService.selectTrxExchangeInfoList(trxExchangeInfo);
return getDataTable(list);
}
/**
* trx
*/
@RequiresPermissions("exchange:trx:export")
@Log(title = "trx兑能量记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(TrxExchangeInfo trxExchangeInfo)
{
List<TrxExchangeInfo> list = trxExchangeInfoService.selectTrxExchangeInfoList(trxExchangeInfo);
ExcelUtil<TrxExchangeInfo> util = new ExcelUtil<TrxExchangeInfo>(TrxExchangeInfo.class);
return util.exportExcel(list, "trx兑能量记录数据");
}
/**
* trx
*/
@GetMapping("/add")
public String add(ModelMap mmap)
{ mmap.put("accountAddressList", accountAddressInfoService.selectAccountAddressInfoAll());
return prefix + "/add";
}
/**
* trx
*/
@RequiresPermissions("exchange:trx:add")
@Log(title = "trx兑能量记录", businessType = BusinessType.INSERT)
@PostMapping("/delegate")
@ResponseBody
public AjaxResult delegate(TrxExchange trxExchange) throws Exception {
return toAjax(trxExchangeInfoService.delegate(trxExchange,false));
}
/**
* trx
*/
@RequiresPermissions("exchange:trx:edit")
@GetMapping("/edit/{idTrxExchangeInfo}")
public String edit(@PathVariable("idTrxExchangeInfo") Long idTrxExchangeInfo, ModelMap mmap)
{
TrxExchangeInfo trxExchangeInfo = trxExchangeInfoService.selectTrxExchangeInfoByIdTrxExchangeInfo(idTrxExchangeInfo);
mmap.put("trxExchangeInfo", trxExchangeInfo);
return prefix + "/edit";
}
/**
* trx
*/
@RequiresPermissions("exchange:trx:edit")
@Log(title = "trx兑能量记录", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TrxExchangeInfo trxExchangeInfo)
{
return toAjax(trxExchangeInfoService.updateTrxExchangeInfo(trxExchangeInfo));
}
/**
* trx
*/
@RequiresPermissions("exchange:trx:remove")
@Log(title = "trx兑能量记录", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(trxExchangeInfoService.deleteTrxExchangeInfoByIdTrxExchangeInfos(ids));
}
}

View File

@ -0,0 +1,124 @@
package com.ruoyi.web.controller.monitor;
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.ErrorLog;
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.IErrorLogService;
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-04-14
*/
@Controller
@RequestMapping("/monitor/err")
public class ErrorLogController extends BaseController
{
private String prefix = "monitor/err";
@Autowired
private IErrorLogService errorLogService;
@RequiresPermissions("monitor:err:view")
@GetMapping()
public String err()
{
return prefix + "/err";
}
/**
*
*/
@RequiresPermissions("monitor:err:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ErrorLog errorLog)
{
startPage();
List<ErrorLog> list = errorLogService.selectErrorLogList(errorLog);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("monitor:err:export")
@Log(title = "错误日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ErrorLog errorLog)
{
List<ErrorLog> list = errorLogService.selectErrorLogList(errorLog);
ExcelUtil<ErrorLog> util = new ExcelUtil<ErrorLog>(ErrorLog.class);
return util.exportExcel(list, "错误日志数据");
}
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("monitor:err:add")
@Log(title = "错误日志", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ErrorLog errorLog)
{
return toAjax(errorLogService.insertErrorLog(errorLog));
}
/**
*
*/
@RequiresPermissions("monitor:err:edit")
@GetMapping("/edit/{idErrorLog}")
public String edit(@PathVariable("idErrorLog") Long idErrorLog, ModelMap mmap)
{
ErrorLog errorLog = errorLogService.selectErrorLogByIdErrorLog(idErrorLog);
mmap.put("errorLog", errorLog);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("monitor:err:edit")
@Log(title = "错误日志", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ErrorLog errorLog)
{
return toAjax(errorLogService.updateErrorLog(errorLog));
}
/**
*
*/
@RequiresPermissions("monitor:err:remove")
@Log(title = "错误日志", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(errorLogService.deleteErrorLogByIdErrorLogs(ids));
}
}

View File

@ -0,0 +1,105 @@
package com.ruoyi.web.core.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.listener.PatternTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import java.util.concurrent.CountDownLatch;
/**
* redis
*
* @author pangjianhui
*/
@Configuration
@EnableCaching
public class RedisConfig extends CachingConfigurerSupport {
@Bean
RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory,
MessageListenerAdapter listenerAdapter) {
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
container.setConnectionFactory(connectionFactory);
container.addMessageListener(listenerAdapter, new PatternTopic("chat"));
return container;
}
@Bean
MessageListenerAdapter listenerAdapter(Receiver receiver) {
return new MessageListenerAdapter(receiver, "receiveMessage");
}
@Bean
Receiver receiver(CountDownLatch latch) {
return new Receiver(latch);
}
@Bean
CountDownLatch latch() {
return new CountDownLatch(1);
}
@Bean
StringRedisTemplate template(RedisConnectionFactory connectionFactory) {
return new StringRedisTemplate(connectionFactory);
}
@Bean
@SuppressWarnings("all")
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
template.setConnectionFactory(factory);
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jackson2JsonRedisSerializer.setObjectMapper(om);
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
// key采用String的序列化方式
template.setKeySerializer(stringRedisSerializer);
// hash的key也采用String的序列化方式
template.setHashKeySerializer(stringRedisSerializer);
// value序列化方式采用jackson
template.setValueSerializer(jackson2JsonRedisSerializer);
// hash的value序列化方式采用jackson
template.setHashValueSerializer(jackson2JsonRedisSerializer);
template.afterPropertiesSet();
return template;
}
public class Receiver {
private CountDownLatch latch;
@Autowired
public Receiver(CountDownLatch latch) {
this.latch = latch;
}
public void receiveMessage(String message) {
latch.countDown();
}
}
}

View File

@ -6,9 +6,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://localhost:3306/tg_trx?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: password password: root
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

View File

@ -16,7 +16,7 @@ ruoyi:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为80 # 服务器的HTTP端口默认为80
port: 80 port: 8080
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /
@ -73,6 +73,28 @@ spring:
# 热部署开关 # 热部署开关
enabled: true enabled: true
redis:
# Redis数据库索引默认为0
database: 4
# Redis服务器地址
host: 127.0.0.1
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码默认为空
password: myredis
jedis:
pool:
# 连接池最大连接数(使用负值表示没有限制)
max-active: 8
# 连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1
# 连接池中的最大空闲连接
max-idle: 8
# 连接池中的最小空闲连接
min-idle: 0
# 连接超时时间(毫秒)
timeout: 2000
# MyBatis # MyBatis
mybatis: mybatis:
# 搜索指定包别名 # 搜索指定包别名
@ -81,6 +103,8 @@ mybatis:
mapperLocations: classpath*:mapper/**/*Mapper.xml mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件 # 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml configLocation: classpath:mybatis/mybatis-config.xml
configuration:
map-underscore-to-camel-case: true
# PageHelper分页插件 # PageHelper分页插件
pagehelper: pagehelper:
@ -140,3 +164,5 @@ xss:
swagger: swagger:
# 是否开启swagger # 是否开启swagger
enabled: true enabled: true

View File

@ -1103,6 +1103,19 @@ var table = {
} }
return url; return url;
}, },
//触发
activeData: function(id) {
table.set();
$.modal.confirm("确定手动发起" + table.options.modalName + "交易吗?", function() {
var url = $.common.isEmpty(id) ? table.options.activeDataUrl : table.options.activeDataUrl.replace("{id}", id);
if (table.options.type == table_type.bootstrapTreeTable) {
$.operate.get(url);
} else {
var data = { "ids": id };
$.operate.submit(url, "post", "json", data);
}
});
},
// 删除信息 // 删除信息
remove: function(id) { remove: function(id) {
table.set(); table.set();

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增抵押流水记录')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-freeze-add">
<div class="form-group">
<label class="col-sm-3 control-label">账户地址:</label>
<div class="col-sm-8">
<!-- <input name="address" class="form-control" type="text">-->
<select id="address" name="address" class="form-control " >
<option th:each="accountAddress:${accountAddressList}" th:value="${accountAddress.address}" th:text="${accountAddress.address}" ></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">抵押金额TRX</label>
<div class="col-sm-8">
<input name="freezeTrxAmount" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交换资源:</label>
<div class="col-sm-8">
<select class="form-control" name="exchangeResourceType" th:with="type=${@dict.getType('sys_trx_exchange')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "account/freeze"
$("#form-freeze-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-freeze-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改抵押流水记录')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-freeze-edit" th:object="${freezeBalanceInfo}">
<input name="idFreezeBalanceInfo" th:field="*{idFreezeBalanceInfo}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">账户地址:</label>
<div class="col-sm-8">
<input name="address" th:field="*{address}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">抵押金额trx</label>
<div class="col-sm-8">
<input name="freezeTrxAmount" th:field="*{freezeTrxAmount}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易id</label>
<div class="col-sm-8">
<input name="txId" th:field="*{txId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="fcd" th:value="${#dates.format(freezeBalanceInfo.fcd, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="lcd" th:value="${#dates.format(freezeBalanceInfo.lcd, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "account/freeze";
$("#form-freeze-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-freeze-edit').serialize());
}
}
$("input[name='fcd']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='lcd']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('抵押流水记录列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>账户地址:</label>
<input type="text" name="address"/>
</li>
<li>
<label>交易id</label>
<input type="text" name="txId"/>
</li>
<li>
<label>交换资源:</label>
<select class="form-control" name="exchangeResourceType" th:with="type=${@dict.getType('sys_trx_exchange')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>创建时间:</label>
<input type="text" class="time-input" placeholder="请选择创建时间" name="fcd"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="account:freeze:add">
<i class="fa fa-plus"></i> 添加
</a>
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="account:freeze:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="account:freeze:remove">
<i class="fa fa-remove"></i> 删除
</a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="account:freeze:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('account:freeze:edit')}]];
var removeFlag = [[${@permission.hasPermi('account:freeze:remove')}]];
var prefix = ctx + "account/freeze";
var datas = [[${@dict.getType('sys_trx_exchange')}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "抵押流水记录",
columns: [{
checkbox: true
},
{
field: 'idFreezeBalanceInfo',
title: '主键',
visible: false
},
{
field: 'address',
title: '账户地址'
},
{
field: 'freezeTrxAmount',
title: '抵押金额TRX'
},
{
field: 'exchangeResourceType',
title: '交换资源',
formatter: function(value, item, index) {
return $.table.selectDictLabel(datas, item.exchangeResourceType);
}
},
{
field: 'txId',
title: '交易id'
},
{
field: 'fcd',
title: '创建时间'
},
{
field: 'fcu',
title: '创建用户'
},
{
field: 'lcd',
title: '更新时间'
},
{
field: 'lcu',
title: '更新用户'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
/*actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.idFreezeBalanceInfo + '\')"><i class="fa fa-edit"></i>编辑</a> ');*/
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.idFreezeBalanceInfo + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增监听账户入账')"/>
<th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-monitor-add">
<div class="form-group">
<label class="col-sm-3 control-label">监听地址:</label>
<div class="col-sm-8">
<input name="monitorAddress" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">出账地址:</label>
<div class="col-sm-8">
<!-- <input name="accountAddress" class="form-control" type="text">-->
<select id="accountAddress" name="accountAddress" class="form-control " >
<option th:each="accountAddress:${accountAddressList}" th:value="${accountAddress.address}" th:text="${accountAddress.address}" ></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">单价:</label>
<div class="col-sm-8">
<input name="price" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">监听类型:</label>
<div class="col-sm-8">
<select class="form-control" name="monitorType" th:with="type=${@dict.getType('sys_monitor_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">API_KEY</label>
<div class="col-sm-8">
<select name="apiKey" class="form-control m-b" th:with="type=${@dict.getType('sys_tron_api_key')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var prefix = ctx + "account/monitor"
$("#form-monitor-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-monitor-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改监听账户入账')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-monitor-edit" th:object="${monitorAddressInfo}">
<input name="idMonitorAddress" th:field="*{idMonitorAddress}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">监听地址:</label>
<div class="col-sm-8">
<input name="monitorAddress" th:field="*{monitorAddress}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">出账地址:</label>
<div class="col-sm-8">
<!-- <input name="accountAddress" th:field="*{accountAddress}" class="form-control" type="text">-->
<select id="accountAddress" name="accountAddress" class="form-control " >
<option th:each="accountAddressInfo:${accountAddressList}" th:value="${accountAddressInfo.address}" th:text="${accountAddressInfo.address}" th:field="*{accountAddress}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">单价:</label>
<div class="col-sm-8">
<input name="price" th:field="*{price}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否有效:</label>
<div class="col-sm-8">
<select class="form-control" name="isValid" th:with="type=${@dict.getType('sys_yes_no')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isValid}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">监听类型:</label>
<div class="col-sm-8">
<select class="form-control" name="monitorType" th:with="type=${@dict.getType('sys_monitor_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{monitorType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">API_KEY</label>
<div class="col-sm-8">
<select name="apiKey" class="form-control m-b" th:with="type=${@dict.getType('sys_tron_api_key')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{apiKey}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "account/monitor";
$("#form-monitor-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-monitor-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('监听账户入账列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>监听地址:</label>
<input type="text" name="monitorAddress"/>
</li>
<li>
<label>出账地址:</label>
<input type="text" name="accountAddress"/>
</li>
<!-- <li>
<label>单位:</label>
<input type="text" name="price"/>
</li>-->
<li>
<label>是否有效:</label>
<select class="form-control" name="isValid" th:with="type=${@dict.getType('sys_yes_no')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>监听类型:</label>
<select class="form-control" name="monitorType" th:with="type=${@dict.getType('sys_monitor_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>创建时间:</label>
<input type="text" class="time-input" placeholder="请选择创建时间" name="fcd"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="account:monitor:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="account:monitor:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="account:monitor:remove">
<i class="fa fa-remove"></i> 删除
</a>
<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="account:monitor:export">
<i class="fa fa-download"></i> 导出
</a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('account:monitor:edit')}]];
var removeFlag = [[${@permission.hasPermi('account:monitor:remove')}]];
var prefix = ctx + "account/monitor";
var datas = [[${@dict.getType('sys_yes_no')}]];
var monitorTypeDatas = [[${@dict.getType('sys_monitor_type')}]];
var apiKeyDatas = [[${@dict.getType('sys_tron_api_key')}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "监听账户入账",
columns: [{
checkbox: true
},
{
field: 'idMonitorAddress',
title: '主键',
visible: false
},
{
field: 'monitorAddress',
title: '监听地址'
},
{
field: 'accountAddress',
title: '出账地址'
},
{
field: 'price',
title: '单价'
},
{
field: 'monitorType',
title: '监听类型',
formatter: function(value, item, index) {
return $.table.selectDictLabel(monitorTypeDatas, item.monitorType);
}
},
{
field: 'apiKey',
title: 'API_KEY',
formatter: function(value, row, index) {
return $.table.selectDictLabel(apiKeyDatas, value);
}
},
{
field: 'isValid',
title: '是否有效',
formatter: function(value, item, index) {
return $.table.selectDictLabel(datas, item.isValid);
}
},
{
field: 'fcd',
title: '创建时间'
},
{
field: 'fcu',
title: '创建用户'
},
{
field: 'lcd',
title: '更新时间'
},
{
field: 'lcu',
title: '更新用户'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.idMonitorAddress + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.idMonitorAddress + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增租户')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-tenant-add">
<div class="form-group">
<label class="col-sm-3 control-label">接收能量地址:</label>
<div class="col-sm-8">
<input name="receiverAddress" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">监控入账地址:</label>
<div class="col-sm-8">
<!-- <input name="accountAddress" class="form-control" type="text">-->
<select id="monitorAddress" name="monitorAddress" class="form-control " >
<option th:each="monitorAddressInfo:${monitorAddressInfoList}" th:value="${monitorAddressInfo.monitorAddress}" th:text="${monitorAddressInfo.monitorAddress}" ></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">单价:</label>
<div class="col-sm-8">
<input name="price" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">笔数:</label>
<div class="col-sm-8">
<select name="transferCount" class="form-control m-b" th:with="type=${@dict.getType('sys_transfer_number')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易单位:</label>
<div class="col-sm-8">
<select name="exchangeUnit" class="form-control m-b" th:with="type=${@dict.getType('sys_monitor_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">租期:</label>
<div class="col-sm-8">
<select name="period" class="form-control m-b" th:with="type=${@dict.getType('sys_lock_period_day')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "account/tenant"
$("#form-tenant-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-tenant-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改租户')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-tenant-edit" th:object="${tenantInfo}">
<input name="idTenantInfo" th:field="*{idTenantInfo}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">接收能量地址:</label>
<div class="col-sm-8">
<input name="receiverAddress" th:field="*{receiverAddress}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">监控入账地址:</label>
<div class="col-sm-8">
<!-- <input name="accountAddress" th:field="*{accountAddress}" class="form-control" type="text">-->
<select id="monitorAddress" name="monitorAddress" class="form-control " >
<option th:each="monitorAddressInfo:${monitorAddressInfoList}" th:value="${monitorAddressInfo.monitorAddress}" th:text="${monitorAddressInfo.monitorAddress}" th:field="*{monitorAddress}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">单价:</label>
<div class="col-sm-8">
<input name="price" th:field="*{price}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">笔数:</label>
<div class="col-sm-8">
<select name="transferCount" class="form-control m-b" th:with="type=${@dict.getType('sys_transfer_number')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{transferCount}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易单位:</label>
<div class="col-sm-8">
<select name="exchangeUnit" class="form-control m-b" th:with="type=${@dict.getType('sys_monitor_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{exchangeUnit}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易总额:</label>
<div class="col-sm-8">
<input name="exchangeAmount" th:field="*{exchangeAmount}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否到账:</label>
<div class="col-sm-8">
<select name="isPaid" class="form-control m-b" th:with="type=${@dict.getType('sys_is_paid')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isPaid}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">租期:</label>
<div class="col-sm-8">
<select name="period" class="form-control m-b" th:with="type=${@dict.getType('sys_lock_period_day')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{period}"></option>
</select>
</div>
</div>
<input name="fcd" th:value="${#dates.format(tenantInfo.fcd, 'yyyy-MM-dd HH:mm:ss')}" type="hidden">
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "account/tenant";
$("#form-tenant-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-tenant-edit').serialize());
}
}
$("input[name='finishTransferTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='fcd']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='lcd']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -0,0 +1,163 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('租户列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>接收能量地址:</label>
<input type="text" name="receiverAddress"/>
</li>
<li>
<label>出账账户地址:</label>
<input type="text" name="accountAddress"/>
</li>
<li>
<label>交易单位:</label>
<select name="exchangeUnit" th:with="type=${@dict.getType('sys_monitor_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>创建时间:</label>
<input type="text" class="time-input" placeholder="请选择创建时间" name="fcd"/>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="account:tenant:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="account:tenant:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="account:tenant:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="account:tenant:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('account:tenant:edit')}]];
var removeFlag = [[${@permission.hasPermi('account:tenant:remove')}]];
var transferCountDatas = [[${@dict.getType('sys_transfer_number')}]];
var exchangeUnitDatas = [[${@dict.getType('sys_monitor_type')}]];
var isPaidDatas = [[${@dict.getType('sys_is_paid')}]];
var periodDatas = [[${@dict.getType('sys_lock_period_day')}]];
var prefix = ctx + "account/tenant";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
activeDataUrl: prefix + "/activeData",
exportUrl: prefix + "/export",
modalName: "租户能量",
columns: [{
checkbox: true
},
{
field: 'idTenantInfo',
title: '主键',
visible: false
},
{
field: 'receiverAddress',
title: '接收能量地址'
},
{
field: 'monitorAddress',
title: '监控入账地址'
},
{
field: 'price',
title: '单价'
},
{
field: 'transferCount',
title: '笔数',
formatter: function(value, row, index) {
return $.table.selectDictLabel(transferCountDatas, value);
}
},
{
field: 'exchangeUnit',
title: '交易单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(exchangeUnitDatas, value);
}
},
{
field: 'exchangeAmount',
title: '交易总额'
},
{
field: 'isPaid',
title: '是否到账',
formatter: function(value, row, index) {
return $.table.selectDictLabel(isPaidDatas, value);
}
},
{
field: 'period',
title: '租期',
formatter: function(value, row, index) {
return $.table.selectDictLabel(periodDatas, value);
}
},
{
field: 'finishTransferTime',
title: '最终到期日期'
},
{
field: 'fcd',
title: '创建时间'
},
{
field: 'fcu',
title: '创建用户'
},
{
field: 'lcd',
title: '更新时间'
},
{
field: 'lcu',
title: '更新用户'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.idTenantInfo + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.idTenantInfo + '\')"><i class="fa fa-remove"></i>删除</a>&nbsp;');
actions.push('<a class="btn btn-warning btn-xs' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.activeData(\'' + row.idTenantInfo + '\')"><i class="fa fa-remove"></i>发起</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增出账账户')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-transfer-add">
<div class="form-group">
<label class="col-sm-3 control-label">地址:</label>
<div class="col-sm-8">
<input name="address" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">秘钥:</label>
<div class="col-sm-8">
<input name="encryptPrivateKey" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "account/transfer"
$("#form-transfer-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-transfer-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改出账账户')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-transfer-edit" th:object="${accountAddressInfo}">
<input name="idAccoutAddressInfo" th:field="*{idAccoutAddressInfo}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">地址:</label>
<div class="col-sm-8">
<input name="address" th:field="*{address}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">秘钥:</label>
<div class="col-sm-8">
<input name="encryptPrivateKey" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "account/transfer";
$("#form-transfer-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-transfer-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,145 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('出账账户列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>地址:</label>
<input type="text" name="address"/>
</li>
<!-- <li>
<label>加密之后的账户秘钥:</label>
<input type="text" name="encryptPrivateKey"/>
</li>
<li>
<label>用于解密加密之后的账户秘钥的秘钥:</label>
<input type="text" name="encryptKey"/>
</li>
<li>
<label>是否有效,用于逻辑删除:</label>
<input type="text" name="isValid"/>
</li>-->
<li>
<label>创建时间:</label>
<input type="text" class="time-input" placeholder="请选择创建时间" name="fcd"/>
</li>
<!-- <li>
<label>更新时间:</label>
<input type="text" class="time-input" placeholder="请选择更新时间" name="lcd"/>
</li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="account:transfer:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="account:transfer:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="account:transfer:remove">
<i class="fa fa-remove"></i> 删除
</a>
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="account:transfer:export">
<i class="fa fa-download"></i> 导出
</a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('account:transfer:edit')}]];
var removeFlag = [[${@permission.hasPermi('account:transfer:remove')}]];
var prefix = ctx + "account/transfer";
var datas = [[${@dict.getType('sys_yes_no')}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "出账账户",
columns: [{
checkbox: true
},
{
field: 'idAccoutAddressInfo',
title: '主键',
visible: false
},
{
field: 'address',
title: '地址'
},
/* {
field: 'encryptPrivateKey',
title: '秘钥'
},*/
{
field: 'isValid',
title: '是否有效',
formatter: function(value, item, index) {
return $.table.selectDictLabel(datas, item.isValid);
}
},{
field: 'netResource',
title: '带宽资源',
},{
field: 'energyResource',
title: '能量资源',
},{
field: 'totalFrozen',
title: '抵押资产TRX',
},{
field: 'trxBalance',
title: 'TRX余额',
},
{
field: 'fcd',
title: '创建时间'
},/*
{
field: 'fcu',
title: '创建用户'
},
{
field: 'lcd',
title: '更新时间'
},
{
field: 'lcu',
title: '更新用户'
},*/
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.idAccoutAddressInfo + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.idAccoutAddressInfo + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -19,18 +19,18 @@
<form id="form" action="#" class="wizard-big"> <form id="form" action="#" class="wizard-big">
<select class="form-control dual_select" multiple> <select class="form-control dual_select" multiple>
<option value="1">若依1</option> <option value="1">feeen1</option>
<option value="2">若依2</option> <option value="2">feeen2</option>
<option value="3">若依3</option> <option value="3">feeen3</option>
<option selected value="4">若依4</option> <option selected value="4">feeen4</option>
<option selected value="5">若依5</option> <option selected value="5">feeen5</option>
<option value="6">若依6</option> <option value="6">feeen6</option>
<option value="7">若依7</option> <option value="7">feeen7</option>
<option value="8">若依8</option> <option value="8">feeen8</option>
<option value="9">若依9</option> <option value="9">feeen9</option>
<option value="10">若依10</option> <option value="10">feeen10</option>
<option value="11">若依11</option> <option value="11">feeen11</option>
<option value="12">若依12</option> <option value="12">feeen12</option>
</select> </select>
</form> </form>
<hr> <hr>

View File

@ -14,7 +14,7 @@
</div> </div>
<div class="ibox-content no-padding"> <div class="ibox-content no-padding">
<div class="summernote"> <div class="summernote">
<h2>若依后台管理系统</h2> <h2>feeen后台管理系统</h2>
<p>ruoyi是一个完全响应式基于Bootstrap3.3.7最新版本开发的扁平化主题她采用了主流的左右两栏式布局使用了Html5+CSS3等现代技术她提供了诸多的强大的可以重新组合的UI组件并集成了最新的jQuery版本(v2.1.1)当然也集成了很多功能强大用途广泛的就jQuery插件她可以用于所有的Web应用程序<b>网站管理后台</b><b>网站会员中心</b><b>CMS</b><b>CRM</b><b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p> <p>ruoyi是一个完全响应式基于Bootstrap3.3.7最新版本开发的扁平化主题她采用了主流的左右两栏式布局使用了Html5+CSS3等现代技术她提供了诸多的强大的可以重新组合的UI组件并集成了最新的jQuery版本(v2.1.1)当然也集成了很多功能强大用途广泛的就jQuery插件她可以用于所有的Web应用程序<b>网站管理后台</b><b>网站会员中心</b><b>CMS</b><b>CRM</b><b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>
<p> <p>
<b>当前版本:</b>v4.7.8 <b>当前版本:</b>v4.7.8
@ -53,7 +53,7 @@
<div class="ibox-content" id="eg"> <div class="ibox-content" id="eg">
<div class="click2edit wrapper"> <div class="click2edit wrapper">
<h3>你好,若依 </h3> <h3>你好,feeen </h3>
<p>H+是一个完全响应式基于Bootstrap3.3.7最新版本开发的扁平化主题她采用了主流的左右两栏式布局使用了Html5+CSS3等现代技术她提供了诸多的强大的可以重新组合的UI组件并集成了最新的jQuery版本(v2.1.1)当然也集成了很多功能强大用途广泛的就jQuery插件她可以用于所有的Web应用程序<b>网站管理后台</b><b>网站会员中心</b><b>CMS</b><b>CRM</b><b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p> <p>H+是一个完全响应式基于Bootstrap3.3.7最新版本开发的扁平化主题她采用了主流的左右两栏式布局使用了Html5+CSS3等现代技术她提供了诸多的强大的可以重新组合的UI组件并集成了最新的jQuery版本(v2.1.1)当然也集成了很多功能强大用途广泛的就jQuery插件她可以用于所有的Web应用程序<b>网站管理后台</b><b>网站会员中心</b><b>CMS</b><b>CRM</b><b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>
<p> <p>
<b>当前版本:</b>v4.7.8 <b>当前版本:</b>v4.7.8

View File

@ -259,7 +259,7 @@
$("#button-open-16").click(function(){ $("#button-open-16").click(function(){
var json = { var json = {
"title": "若依相册", //相册标题 "title": "feeen相册", //相册标题
"id": 123, //相册id "id": 123, //相册id
"start": 0, //初始显示的图片序号默认0 "start": 0, //初始显示的图片序号默认0
"data": [ //相册包含的图片,数组格式 "data": [ //相册包含的图片,数组格式

View File

@ -0,0 +1,129 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增trx兑能量记录')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-trx-add">
<div class="form-group">
<label class="col-sm-3 control-label">交易账户:</label>
<div class="col-sm-8">
<input name="fromAddress" class="form-control" type="text">
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-3 control-label">转入账户:</label>
<div class="col-sm-8">
<input name="toAddress" class="form-control" type="text">
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">实际出账账户:</label>
<div class="col-sm-8">
<!-- <input name="accountAddress" class="form-control" type="text">-->
<select id="address" name="accountAddress" class="form-control " >
<option th:each="accountAddress:${accountAddressList}" th:value="${accountAddress.address}" th:text="${accountAddress.address}" ></option>
</select>
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-3 control-label">单位:</label>
<div class="col-sm-8">
<input name="price" class="form-control" type="text">
</div>
</div>-->
<!-- <div class="form-group">
<label class="col-sm-3 control-label">订单hash</label>
<div class="col-sm-8">
<input name="trxTxId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">转入金额:</label>
<div class="col-sm-8">
<input name="trxAmount" class="form-control" type="text">
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">笔数:</label>
<div class="col-sm-8">
<select class="form-control" name="transferNumber" th:with="type=${@dict.getType('sys_transfer_number')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-3 control-label">能量交易订单hash</label>
<div class="col-sm-8">
<input name="delegateTxId" class="form-control" type="text">
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">锁定周期:</label>
<!-- <div class="col-sm-8">
<input name="lockPeriod" class="form-control" type="text">
</div>-->
<div class="col-sm-8">
<select class="form-control" name="lockNum" th:with="type=${@dict.getType('sys_lock_period')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-3 control-label">回收资源交易id</label>
<div class="col-sm-8">
<input name="unDelegateTxId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="fcd" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建用户:</label>
<div class="col-sm-8">
<input name="fcu" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="lcd" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新用户:</label>
<div class="col-sm-8">
<input name="lcu" class="form-control" type="text">
</div>
</div>-->
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "exchange/trx"
$("#form-trx-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/delegate", $('#form-trx-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改trx兑能量记录')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-trx-edit" th:object="${trxExchangeInfo}">
<input name="idTrxExchangeInfo" th:field="*{idTrxExchangeInfo}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">资源委托状态:</label>
<div class="col-sm-8">
<!-- <input name="fromAddress" th:field="*{fromAddress}" class="form-control" type="text">-->
<select class="form-control" name="delegateStatus" th:with="type=${@dict.getType('sys_delegate_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{delegateStatus}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "exchange/trx";
$("#form-trx-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-trx-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,196 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('trx兑能量记录列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>交易账户:</label>
<input type="text" name="fromAddress"/>
</li>
<li>
<label>转入账户:</label>
<input type="text" name="toAddress"/>
</li>
<li>
<label>实际出账账户:</label>
<input type="text" name="accountAddress"/>
</li>
<li>
<label>TRX订单</label>
<input type="text" name="trxTxId"/>
</li>
<br/> <br/> <br/>
<!-- <li>
<label>能量交易订单:</label>
<input type="text" name="delegateTxId"/>
</li>-->
<li>
<label>资源委托状态:</label>
<select class="form-control" name="delegateStatus" th:with="type=${@dict.getType('sys_delegate_status')}">
<option value="">全部</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
</select>
</li>
<!--
<li>
<label>回收资源交易:</label>
<input type="text" name="unDelegateTxId"/>
</li>-->
<li>
<label>创建时间:</label>
<input type="text" class="time-input" placeholder="请选择创建时间" name="fcd"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="exchange:trx:add">
<i class="fa fa-plus"></i> 手动委托资源
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="exchange:trx:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="exchange:trx:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exchange:trx:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('exchange:trx:edit')}]];
var removeFlag = [[${@permission.hasPermi('exchange:trx:remove')}]];
var prefix = ctx + "exchange/trx";
var datas = [[${@dict.getType('sys_delegate_status')}]];
var tranferCountDatas = [[${@dict.getType('sys_transfer_number')}]];
var busiTypeDatas = [[${@dict.getType('sys_busi_type')}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "trx兑能量记录",
columns: [{
checkbox: true
},
{
field: 'idTrxExchangeInfo',
title: 'trx进账表',
visible: false
},
{
field: 'fromAddress',
title: '交易账户'
},
{
field: 'toAddress',
title: '转入账户'
},
{
field: 'accountAddress',
title: '实际出账账户'
},
{
field: 'price',
title: '单价'
},
{
field: 'trxTxId',
title: 'TRX订单'
},
{
field: 'tranferCount',
title: '笔数',
formatter: function(value, row, index) {
return $.table.selectDictLabel(tranferCountDatas, value);
}
},
{
field: 'busiType',
title: '业务类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(busiTypeDatas, value);
}
},
{
field: 'trxAmount',
title: '转入金额TRX'
},
{
field: 'delegateAmountTrx',
title: '兑换支出TRX'
},
{
field: 'delegateTxId',
title: '能量交易订单'
},
{
field: 'lockPeriod',
title: '锁定周期(*3s)'
},
{
field: 'delegateStatus',
title: '资源委托状态',
formatter: function(value, item, index) {
return $.table.selectDictLabel(datas, item.delegateStatus);
}
},
{
field: 'unDelegateTxId',
title: '回收资源交易'
},
{
field: 'fcd',
title: '创建时间'
},
/* {
field: 'fcu',
title: '创建用户'
},*/
{
field: 'lcd',
title: '更新时间'
},
/*{
field: 'lcu',
title: '更新用户'
},*/
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.idTrxExchangeInfo + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.idTrxExchangeInfo + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<title>若依系统首页</title> <title>feeen系统首页</title>
<!-- 避免IE使用兼容模式 --> <!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/> <link th:href="@{favicon.ico}" rel="shortcut icon"/>
@ -27,7 +27,7 @@
</div> </div>
<a th:href="@{/index}"> <a th:href="@{/index}">
<li class="logo hidden-xs"> <li class="logo hidden-xs">
<span class="logo-lg">RuoYi</span> <span class="logo-lg"></span>
</li> </li>
</a> </a>
<div class="sidebar-collapse tab-content" id="side-menu"> <div class="sidebar-collapse tab-content" id="side-menu">
@ -237,16 +237,15 @@
</a> </a>
</li> </li>
<li role="presentation" id="tab_demo" th:if="${demoEnabled}"> <!-- <li role="presentation" id="tab_demo" th:if="${demoEnabled}">
<a data-toggle="tab" href="#demo"> <a data-toggle="tab" href="#demo">
<i class="fa fa-desktop"></i> <span>实例演示</span> <i class="fa fa-desktop"></i> <span>实例演示</span>
</a> </a>
</li> </li>-->
</ul> </ul>
</div> </div>
<!-- 右侧栏 --> <!-- 右侧栏 -->
<ul class="nav navbar-top-links navbar-right welcome-message"> <ul class="nav navbar-top-links navbar-right welcome-message">
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="开发文档" href="http://doc.ruoyi.vip/ruoyi" target="_blank"><i class="fa fa-question-circle"></i> 文档</a></li>
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="锁定屏幕" href="javascript:;" id="lockScreen"><i class="fa fa-lock"></i> 锁屏</a></li> <li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="锁定屏幕" href="javascript:;" id="lockScreen"><i class="fa fa-lock"></i> 锁屏</a></li>
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="全屏显示" href="javascript:;" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏</a></li> <li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="全屏显示" href="javascript:;" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏</a></li>
@ -305,7 +304,7 @@
</div> </div>
<div th:if="${footer}" class="footer"> <div th:if="${footer}" class="footer">
<div class="pull-right">© [[${copyrightYear}]] RuoYi Copyright </div> <div class="pull-right">© [[${copyrightYear}]] Copyright </div>
</div> </div>
</div> </div>
<!--右侧部分结束--> <!--右侧部分结束-->

View File

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<title>若依系统首页</title> <title>feeen系统首页</title>
<!-- 避免IE使用兼容模式 --> <!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/> <link th:href="@{favicon.ico}" rel="shortcut icon"/>
@ -26,7 +26,7 @@
</div> </div>
<a th:href="@{/index}"> <a th:href="@{/index}">
<li class="logo hidden-xs"> <li class="logo hidden-xs">
<span class="logo-lg">RuoYi</span> <span class="logo-lg">后台管理</span>
</li> </li>
</a> </a>
<div class="sidebar-collapse"> <div class="sidebar-collapse">
@ -71,113 +71,6 @@
</li> </li>
</ul> </ul>
</li> </li>
<li th:if="${demoEnabled}">
<a href="javascript:;"><i class="fa fa-desktop"></i><span class="nav-label">实例演示</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li> <a>表单<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a class="menuItem" th:href="@{/demo/form/button}">按钮</a></li>
<li><a class="menuItem" th:href="@{/demo/form/grid}">栅格</a></li>
<li><a class="menuItem" th:href="@{/demo/form/select}">下拉框</a></li>
<li><a class="menuItem" th:href="@{/demo/form/timeline}">时间轴</a></li>
<li><a class="menuItem" th:href="@{/demo/form/progress_bars}">进度条</a></li>
<li><a class="menuItem" th:href="@{/demo/form/basic}">基本表单</a></li>
<li><a class="menuItem" th:href="@{/demo/form/cards}">卡片列表</a></li>
<li><a class="menuItem" th:href="@{/demo/form/jasny}">功能扩展</a></li>
<li><a class="menuItem" th:href="@{/demo/form/sortable}">拖动排序</a></li>
<li><a class="menuItem" th:href="@{/demo/form/invoice}">单据打印</a></li>
<li><a class="menuItem" th:href="@{/demo/form/labels_tips}">标签 & 提示</a></li>
<li><a class="menuItem" th:href="@{/demo/form/tabs_panels}">选项卡 & 面板</a></li>
<li><a class="menuItem" th:href="@{/demo/form/validate}">表单校验</a></li>
<li><a class="menuItem" th:href="@{/demo/form/wizard}">表单向导</a></li>
<li><a class="menuItem" th:href="@{/demo/form/upload}">文件上传</a></li>
<li><a class="menuItem" th:href="@{/demo/form/datetime}">日期和时间</a></li>
<li><a class="menuItem" th:href="@{/demo/form/summernote}">富文本编辑器</a></li>
<li><a class="menuItem" th:href="@{/demo/form/duallistbox}">左右互选组件</a></li>
<li><a class="menuItem" th:href="@{/demo/form/autocomplete}">搜索自动补全</a></li>
<li><a class="menuItem" th:href="@{/demo/form/cxselect}">多级联动下拉</a></li>
<li><a class="menuItem" th:href="@{/demo/form/localrefresh}">Ajax局部刷新</a></li>
</ul>
</li>
<li> <a>表格<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a class="menuItem" th:href="@{/demo/table/search}">查询条件</a></li>
<li><a class="menuItem" th:href="@{/demo/table/footer}">数据汇总</a></li>
<li><a class="menuItem" th:href="@{/demo/table/groupHeader}">组合表头</a></li>
<li><a class="menuItem" th:href="@{/demo/table/export}">表格导出</a></li>
<li><a class="menuItem" th:href="@{/demo/table/exportSelected}">导出选择列</a></li>
<li><a class="menuItem" th:href="@{/demo/table/remember}">翻页记住选择</a></li>
<li><a class="menuItem" th:href="@{/demo/table/pageGo}">跳转至指定页</a></li>
<li><a class="menuItem" th:href="@{/demo/table/params}">自定义查询参数</a></li>
<li><a class="menuItem" th:href="@{/demo/table/multi}">初始多表格</a></li>
<li><a class="menuItem" th:href="@{/demo/table/button}">点击按钮加载表格</a></li>
<li><a class="menuItem" th:href="@{/demo/table/data}">直接加载表格数据</a></li>
<li><a class="menuItem" th:href="@{/demo/table/fixedColumns}">表格冻结列</a></li>
<li><a class="menuItem" th:href="@{/demo/table/event}">自定义触发事件</a></li>
<li><a class="menuItem" th:href="@{/demo/table/headerStyle}">表格标题格式化</a></li>
<li><a class="menuItem" th:href="@{/demo/table/detail}">表格细节视图</a></li>
<li><a class="menuItem" th:href="@{/demo/table/child}">表格父子视图</a></li>
<li><a class="menuItem" th:href="@{/demo/table/image}">表格图片预览</a></li>
<li><a class="menuItem" th:href="@{/demo/table/curd}">动态增删改查</a></li>
<li><a class="menuItem" th:href="@{/demo/table/reorderRows}">表格行拖拽操作</a></li>
<li><a class="menuItem" th:href="@{/demo/table/reorderColumns}">表格列拖拽操作</a></li>
<li><a class="menuItem" th:href="@{/demo/table/resizable}">表格列宽拖动</a></li>
<li><a class="menuItem" th:href="@{/demo/table/editable}">表格行内编辑</a></li>
<li><a class="menuItem" th:href="@{/demo/table/subdata}">主子表提交</a></li>
<li><a class="menuItem" th:href="@{/demo/table/refresh}">表格自动刷新</a></li>
<li><a class="menuItem" th:href="@{/demo/table/print}">表格打印配置</a></li>
<li><a class="menuItem" th:href="@{/demo/table/dynamicColumns}">表格动态列</a></li>
<li><a class="menuItem" th:href="@{/demo/table/customView}">自定义视图分页</a></li>
<li><a class="menuItem" th:href="@{/demo/table/asynTree}">异步加载表格树</a></li>
<li><a class="menuItem" th:href="@{/demo/table/other}">表格其他操作</a></li>
</ul>
</li>
<li> <a>弹框<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a class="menuItem" th:href="@{/demo/modal/dialog}">模态窗口</a></li>
<li><a class="menuItem" th:href="@{/demo/modal/layer}">弹层组件</a></li>
<li><a class="menuItem" th:href="@{/demo/modal/table}">弹层表格</a></li>
</ul>
</li>
<li> <a>操作<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a class="menuItem" th:href="@{/demo/operate/table}">表格</a></li>
<li><a class="menuItem" th:href="@{/demo/operate/other}">其他</a></li>
</ul>
</li>
<li> <a>报表<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a class="menuItem" th:href="@{/demo/report/echarts}">百度ECharts</a></li>
<li><a class="menuItem" th:href="@{/demo/report/peity}">peity</a></li>
<li><a class="menuItem" th:href="@{/demo/report/sparkline}">sparkline</a></li>
<li><a class="menuItem" th:href="@{/demo/report/metrics}">图表组合</a></li>
</ul>
</li>
<li> <a>图标<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a class="menuItem" th:href="@{/demo/icon/fontawesome}">Font Awesome</a></li>
<li><a class="menuItem" th:href="@{/demo/icon/glyphicons}">Glyphicons</a></li>
</ul>
</li>
<li>
<a href="javascript:;"><i class="fa fa-sitemap"></i>四层菜单<span class="fa arrow"></span></a>
<ul class="nav nav-third-level collapse">
<li>
<a href="javascript:;" id="damian">三级菜单1<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li>
<a href="javascript:;">四级菜单1</a>
</li>
<li>
<a href="javascript:;">四级菜单2</a>
</li>
</ul>
</li>
<li><a href="javascript:;">三级菜单2</a></li>
</ul>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</nav> </nav>
@ -193,7 +86,6 @@
</a> </a>
</div> </div>
<ul class="nav navbar-top-links navbar-right welcome-message"> <ul class="nav navbar-top-links navbar-right welcome-message">
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="开发文档" href="http://doc.ruoyi.vip/ruoyi" target="_blank"><i class="fa fa-question-circle"></i> 文档</a></li>
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="锁定屏幕" href="javascript:;" id="lockScreen"><i class="fa fa-lock"></i> 锁屏</a></li> <li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="锁定屏幕" href="javascript:;" id="lockScreen"><i class="fa fa-lock"></i> 锁屏</a></li>
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="全屏显示" href="javascript:;" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏</a></li> <li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="全屏显示" href="javascript:;" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏</a></li>
<li class="dropdown user-menu"> <li class="dropdown user-menu">
@ -251,7 +143,7 @@
</div> </div>
<div th:if="${footer}" class="footer"> <div th:if="${footer}" class="footer">
<div class="pull-right">© [[${copyrightYear}]] RuoYi Copyright </div> <div class="pull-right">© [[${copyrightYear}]] Copyright </div>
</div> </div>
</div> </div>
<!--右侧部分结束--> <!--右侧部分结束-->

View File

@ -3,8 +3,8 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>登录若依系统</title> <title>登录feeen系统</title>
<meta name="description" content="若依后台管理框架"> <meta name="description" content="feeen后台管理框架">
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/> <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/> <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/> <link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>
@ -25,11 +25,11 @@
<div class="row"> <div class="row">
<div class="col-sm-7"> <div class="col-sm-7">
<div class="signin-info"> <div class="signin-info">
<div class="logopanel m-b"> <!-- <div class="logopanel m-b">
<h1><img alt="[ 若依 ]" src="../static/ruoyi.png" th:src="@{/ruoyi.png}"></h1> <h1><img alt="[ feeen ]" src="../static/ruoyi.png" th:src="@{/ruoyi.png}"></h1>
</div> </div>
<div class="m-b"></div> <div class="m-b"></div>-->
<h4>欢迎使用 <strong>若依 后台管理系统</strong></h4> <!-- <h4>欢迎使用 <strong>feeen 后台管理系统</strong></h4>
<ul class="m-b"> <ul class="m-b">
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> SpringBoot</li> <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> SpringBoot</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Mybatis</li> <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Mybatis</li>
@ -37,15 +37,15 @@
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Thymeleaf</li> <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Thymeleaf</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Bootstrap</li> <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Bootstrap</li>
</ul> </ul>
<strong th:if="${isAllowRegister}">还没有账号? <a th:href="@{/register}">立即注册&raquo;</a></strong> <strong th:if="${isAllowRegister}">还没有账号? <a th:href="@{/register}">立即注册&raquo;</a></strong>-->
</div> </div>
</div> </div>
<div class="col-sm-5"> <div class="col-sm-5">
<form id="signupForm" autocomplete="off"> <form id="signupForm" autocomplete="off">
<h4 class="no-margins">登录:</h4> <h4 class="no-margins">登录:</h4>
<p class="m-t-md">你若不离不弃,我必生死相依</p> <!-- <p class="m-t-md">你若不离不弃,我必生死相依</p>-->
<input type="text" name="username" class="form-control uname" placeholder="用户名" value="admin" /> <input type="text" name="username" class="form-control uname" placeholder="用户名" value="" />
<input type="password" name="password" class="form-control pword" placeholder="密码" value="admin123" /> <input type="password" name="password" class="form-control pword" placeholder="密码" value="" />
<div class="row m-t" th:if="${captchaEnabled==true}"> <div class="row m-t" th:if="${captchaEnabled==true}">
<div class="col-xs-6"> <div class="col-xs-6">
<input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5" /> <input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5" />
@ -63,11 +63,11 @@
</form> </form>
</div> </div>
</div> </div>
<div class="signup-footer"> <!-- <div class="signup-footer">
<div class="pull-left"> <div class="pull-left">
Copyright © 2018-2024 ruoyi.vip All Rights Reserved. <br> Copyright © 2018-2024 ruoyi.vip All Rights Reserved. <br>
</div> </div>
</div> </div>-->
</div> </div>
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; var captchaEnabled = [[${captchaEnabled}]];</script> <script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; var captchaEnabled = [[${captchaEnabled}]];</script>
<!--[if lte IE 8]><script>window.location.href=ctx+'html/ie.html';</script><![endif]--> <!--[if lte IE 8]><script>window.location.href=ctx+'html/ie.html';</script><![endif]-->

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('错误日志列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>地址:</label>
<input type="text" name="address"/>
</li>
<li>
<label>交易id</label>
<input type="text" name="trxId"/>
</li>
<li>
<label>其他id</label>
<input type="text" name="otherId"/>
</li>
<li>
<label>发生场景:</label>
<input type="text" name="errorCode"/>
</li>
<li>
<label>创建时间:</label>
<input type="text" class="time-input" placeholder="请选择创建时间" name="fcd"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="monitor:err:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="monitor:err:edit">
<i class="fa fa-edit"></i> 修改
</a>-->
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:err:remove">
<i class="fa fa-remove"></i> 删除
</a>
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:err:export">
<i class="fa fa-download"></i> 导出
</a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('monitor:err:edit')}]];
var removeFlag = [[${@permission.hasPermi('monitor:err:remove')}]];
var prefix = ctx + "monitor/err";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "错误日志",
columns: [{
checkbox: true
},
{
field: 'idErrorLog',
title: '主键',
visible: false
},
{
field: 'address',
title: '地址'
},
{
field: 'trxId',
title: '交易订单'
},
{
field: 'otherId',
title: '其他id'
},
{
field: 'errorCode',
title: '发生场景'
},
{
field: 'errorMsg',
title: '错误信息'
},
{
field: 'fcd',
title: '创建时间'
}/*,
{
field: 'fcu',
title: '创建用户'
},
{
field: 'lcd',
title: '更新时间'
},
{
field: 'lcu',
title: '更新用户'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.idErrorLog + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.idErrorLog + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}*/
]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -3,8 +3,8 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>注册若依系统</title> <title>注册feeen系统</title>
<meta name="description" content="若依后台管理框架"> <meta name="description" content="feeen后台管理框架">
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/> <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/> <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/> <link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>
@ -22,18 +22,18 @@
<div class="row"> <div class="row">
<div class="col-sm-7"> <div class="col-sm-7">
<div class="signin-info"> <div class="signin-info">
<div class="logopanel m-b"> <!-- <div class="logopanel m-b">-->
<h1><img alt="[ 若依 ]" src="../static/ruoyi.png" th:src="@{/ruoyi.png}"></h1> <!-- <h1><img alt="[ feeen ]" src="../static/ruoyi.png" th:src="@{/ruoyi.png}"></h1>-->
</div> <!-- </div>-->
<div class="m-b"></div> <!-- <div class="m-b"></div>-->
<h4>欢迎使用 <strong>若依 后台管理系统</strong></h4> <!-- <h4>欢迎使用 <strong>feeen 后台管理系统</strong></h4>-->
<ul class="m-b"> <!-- <ul class="m-b">-->
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> SpringBoot</li> <!-- <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> SpringBoot</li>-->
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Mybatis</li> <!-- <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Mybatis</li>-->
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Shiro</li> <!-- <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Shiro</li>-->
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Thymeleaf</li> <!-- <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Thymeleaf</li>-->
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Bootstrap</li> <!-- <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Bootstrap</li>-->
</ul> <!-- </ul>-->
<strong>已经注册过? <a th:href="@{/login}">直接登录&raquo;</a></strong> <strong>已经注册过? <a th:href="@{/login}">直接登录&raquo;</a></strong>
</div> </div>
</div> </div>
@ -62,11 +62,11 @@
</form> </form>
</div> </div>
</div> </div>
<div class="signup-footer"> <!-- <div class="signup-footer">
<div class="pull-left"> <div class="pull-left">
&copy; 2018-2024 All Rights Reserved. RuoYi <br> &copy; 2018-2024 All Rights Reserved. RuoYi <br>
</div> </div>
</div> </div>-->
</div> </div>
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; var captchaEnabled = [[${captchaEnabled}]];</script> <script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; var captchaEnabled = [[${captchaEnabled}]];</script>
<!-- 全局js --> <!-- 全局js -->

View File

@ -95,6 +95,12 @@
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -35,6 +35,7 @@ public class UserConstants
/** 是否为系统默认(是) */ /** 是否为系统默认(是) */
public static final String YES = "Y"; public static final String YES = "Y";
public static final String NO = "N";
/** 是否唯一的返回标识 */ /** 是否唯一的返回标识 */
public final static boolean UNIQUE = true; public final static boolean UNIQUE = true;

View File

@ -0,0 +1,81 @@
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 lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* account_address_info
*
* @author dorion
* @date 2024-04-13
*/
@Data
public class AccountAddressInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long idAccoutAddressInfo;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 加密之后的账户秘钥 */
@Excel(name = "加密之后的账户秘钥")
private String encryptPrivateKey;
/** 用于解密加密之后的账户秘钥的秘钥 */
@Excel(name = "用于解密加密之后的账户秘钥的秘钥")
private String encryptKey;
/** 是否有效,用于逻辑删除 */
@Excel(name = "是否有效,用于逻辑删除")
private String isValid;
/**
*
*/
private String netResource;
/**
*
*/
private String energyResource;
/**
*
*/
private BigDecimal totalFrozen;
/**
* trx
*/
private BigDecimal trxBalance;
//** 创建时间 *//*
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date fcd;
//** 创建用户 *//*
@Excel(name = "创建用户")
private String fcu;
//** 更新时间 *//*
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lcd;
//** 更新用户 *//*
@Excel(name = "更新用户")
private String lcu;
}

View File

@ -0,0 +1,170 @@
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 lombok.Builder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* error_log
*
* @author dorion
* @date 2024-04-13
*/
@Builder
public class ErrorLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long idErrorLog;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 交易id */
@Excel(name = "交易id")
private String trxId;
/** 其他可能关联的eid */
@Excel(name = "其他可能关联的eid")
private String otherId;
/** 错误类型发生场景 */
@Excel(name = "错误类型发生场景")
private String errorCode;
/** 错误信息 */
@Excel(name = "错误信息")
private String errorMsg;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date fcd;
/** 创建用户 */
@Excel(name = "创建用户")
private String fcu;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lcd;
/** 更新用户 */
@Excel(name = "更新用户")
private String lcu;
public void setIdErrorLog(Long idErrorLog)
{
this.idErrorLog = idErrorLog;
}
public Long getIdErrorLog()
{
return idErrorLog;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setTrxId(String trxId)
{
this.trxId = trxId;
}
public String getTrxId()
{
return trxId;
}
public void setOtherId(String otherId)
{
this.otherId = otherId;
}
public String getOtherId()
{
return otherId;
}
public void setErrorCode(String errorCode)
{
this.errorCode = errorCode;
}
public String getErrorCode()
{
return errorCode;
}
public void setErrorMsg(String errorMsg)
{
this.errorMsg = errorMsg;
}
public String getErrorMsg()
{
return errorMsg;
}
public void setFcd(Date fcd)
{
this.fcd = fcd;
}
public Date getFcd()
{
return fcd;
}
public void setFcu(String fcu)
{
this.fcu = fcu;
}
public String getFcu()
{
return fcu;
}
public void setLcd(Date lcd)
{
this.lcd = lcd;
}
public Date getLcd()
{
return lcd;
}
public void setLcu(String lcu)
{
this.lcu = lcu;
}
public String getLcu()
{
return lcu;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("idErrorLog", getIdErrorLog())
.append("address", getAddress())
.append("trxId", getTrxId())
.append("otherId", getOtherId())
.append("errorCode", getErrorCode())
.append("errorMsg", getErrorMsg())
.append("fcd", getFcd())
.append("fcu", getFcu())
.append("lcd", getLcd())
.append("lcu", getLcu())
.toString();
}
}

View File

@ -0,0 +1,58 @@
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 lombok.Data;
import java.util.Date;
/**
* freeze_balance_info
*
* @author dorion
* @date 2024-04-13
*/
@Data
public class FreezeBalanceInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long idFreezeBalanceInfo;
/** 账户地址 */
@Excel(name = "账户地址")
private String address;
/** 抵押金额trx */
@Excel(name = "抵押金额trx")
private Long freezeTrxAmount;
/** 交换资源类型id */
@Excel(name = "交换资源")
private String exchangeResourceType;
/** 交易id */
@Excel(name = "交易id")
private String txId;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date fcd;
/** 创建用户 */
@Excel(name = "创建用户")
private String fcu;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lcd;
/** 更新用户 */
@Excel(name = "更新用户")
private String lcu;
}

View File

@ -0,0 +1,182 @@
package com.ruoyi.common.core.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* monitor_address_info
*
* @author dorion
* @date 2024-04-14
*/
public class MonitorAddressInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long idMonitorAddress;
/** 监听地址 */
@Excel(name = "监听地址")
private String monitorAddress;
/** 出账地址 */
@Excel(name = "出账地址")
private String accountAddress;
/** 单价 */
@Excel(name = "单价")
private Long price;
/** trx或者usdt */
@Excel(name = "trx或者usdt")
private String monitorType;
/** API_KEY */
@Excel(name = "API_KEY")
private String apiKey;
/** 是否有效 */
@Excel(name = "是否有效")
private String isValid;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date fcd;
/** 创建用户 */
@Excel(name = "创建用户")
private String fcu;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lcd;
/** 更新用户 */
@Excel(name = "更新用户")
private String lcu;
public void setIdMonitorAddress(Long idMonitorAddress)
{
this.idMonitorAddress = idMonitorAddress;
}
public Long getIdMonitorAddress()
{
return idMonitorAddress;
}
public void setMonitorAddress(String monitorAddress)
{
this.monitorAddress = monitorAddress;
}
public String getMonitorAddress()
{
return monitorAddress;
}
public void setAccountAddress(String accountAddress)
{
this.accountAddress = accountAddress;
}
public String getAccountAddress()
{
return accountAddress;
}
public void setPrice(Long price)
{
this.price = price;
}
public Long getPrice()
{
return price;
}
public void setMonitorType(String monitorType)
{
this.monitorType = monitorType;
}
public String getMonitorType()
{
return monitorType;
}
public void setApiKey(String apiKey)
{
this.apiKey = apiKey;
}
public String getApiKey()
{
return apiKey;
}
public void setIsValid(String isValid)
{
this.isValid = isValid;
}
public String getIsValid()
{
return isValid;
}
public void setFcd(Date fcd)
{
this.fcd = fcd;
}
public Date getFcd()
{
return fcd;
}
public void setFcu(String fcu)
{
this.fcu = fcu;
}
public String getFcu()
{
return fcu;
}
public void setLcd(Date lcd)
{
this.lcd = lcd;
}
public Date getLcd()
{
return lcd;
}
public void setLcu(String lcu)
{
this.lcu = lcu;
}
public String getLcu()
{
return lcu;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("idMonitorAddress", getIdMonitorAddress())
.append("monitorAddress", getMonitorAddress())
.append("accountAddress", getAccountAddress())
.append("price", getPrice())
.append("monitorType", getMonitorType())
.append("apiKey", getApiKey())
.append("isValid", getIsValid())
.append("fcd", getFcd())
.append("fcu", getFcu())
.append("lcd", getLcd())
.append("lcu", getLcu())
.toString();
}
}

View File

@ -0,0 +1,239 @@
package com.ruoyi.common.core.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* tenant_info
*
* @author dorion
* @date 2024-04-14
*/
public class TenantInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long idTenantInfo;
/** 接收能量地址 */
@Excel(name = "接收能量地址")
private String receiverAddress;
/** 监控入账地址 */
@Excel(name = "监控入账地址")
private String monitorAddress;
/** 单价 */
@Excel(name = "单价")
private Long price;
/** 笔数 */
@Excel(name = "笔数")
private Long transferCount;
/** 交易单位 */
@Excel(name = "交易单位")
private String exchangeUnit;
/** 订单号 */
@Excel(name = "订单号")
private String txId;
/** 交易总额 */
@Excel(name = "交易总额")
private Long exchangeAmount;
/** 是否到账 */
@Excel(name = "是否到账")
private String isPaid;
/** 租期 */
@Excel(name = "租期")
private Long period;
/** 最终到期日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最终到期日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date finishTransferTime;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date fcd;
/** 创建用户 */
@Excel(name = "创建用户")
private String fcu;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lcd;
/** 更新用户 */
@Excel(name = "更新用户")
private String lcu;
public void setIdTenantInfo(Long idTenantInfo)
{
this.idTenantInfo = idTenantInfo;
}
public Long getIdTenantInfo()
{
return idTenantInfo;
}
public void setReceiverAddress(String receiverAddress)
{
this.receiverAddress = receiverAddress;
}
public String getReceiverAddress()
{
return receiverAddress;
}
public void setMonitorAddress(String monitorAddress)
{
this.monitorAddress = monitorAddress;
}
public String getMonitorAddress()
{
return monitorAddress;
}
public void setPrice(Long price)
{
this.price = price;
}
public Long getPrice()
{
return price;
}
public void setTransferCount(Long transferCount)
{
this.transferCount = transferCount;
}
public Long getTransferCount()
{
return transferCount;
}
public void setExchangeUnit(String exchangeUnit)
{
this.exchangeUnit = exchangeUnit;
}
public String getExchangeUnit()
{
return exchangeUnit;
}
public void setTxId(String txId)
{
this.txId = txId;
}
public String getTxId()
{
return txId;
}
public void setExchangeAmount(Long exchangeAmount)
{
this.exchangeAmount = exchangeAmount;
}
public Long getExchangeAmount()
{
return exchangeAmount;
}
public void setIsPaid(String isPaid)
{
this.isPaid = isPaid;
}
public String getIsPaid()
{
return isPaid;
}
public void setPeriod(Long period)
{
this.period = period;
}
public Long getPeriod()
{
return period;
}
public void setFinishTransferTime(Date finishTransferTime)
{
this.finishTransferTime = finishTransferTime;
}
public Date getFinishTransferTime()
{
return finishTransferTime;
}
public void setFcd(Date fcd)
{
this.fcd = fcd;
}
public Date getFcd()
{
return fcd;
}
public void setFcu(String fcu)
{
this.fcu = fcu;
}
public String getFcu()
{
return fcu;
}
public void setLcd(Date lcd)
{
this.lcd = lcd;
}
public Date getLcd()
{
return lcd;
}
public void setLcu(String lcu)
{
this.lcu = lcu;
}
public String getLcu()
{
return lcu;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("idTenantInfo", getIdTenantInfo())
.append("receiverAddress", getReceiverAddress())
.append("monitorAddress", getMonitorAddress())
.append("price", getPrice())
.append("transferCount", getTransferCount())
.append("exchangeUnit", getExchangeUnit())
.append("txId", getTxId())
.append("exchangeAmount", getExchangeAmount())
.append("isPaid", getIsPaid())
.append("period", getPeriod())
.append("finishTransferTime", getFinishTransferTime())
.append("fcd", getFcd())
.append("fcu", getFcu())
.append("lcd", getLcd())
.append("lcu", getLcu())
.toString();
}
}

View File

@ -0,0 +1,261 @@
package com.ruoyi.common.core.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Sensitive;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.enums.DesensitizedType;
import lombok.Builder;
import lombok.Data;
import java.util.Date;
/**
* trx trx_exchange_info
*
* @author dorion
* @date 2024-04-13
*/
@Builder
@Data
public class TrxExchangeInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** trx进账表 */
private Long idTrxExchangeInfo;
/** 转出账户 */
@Excel(name = "交易账户")
private String fromAddress;
/** 转入账户 */
@Excel(name = "转入账户")
@Sensitive(desensitizedType = DesensitizedType.WALLET_ADDRESS)
private String toAddress;
/** 实际出账账户 */
@Excel(name = "实际出账账户")
@Sensitive(desensitizedType = DesensitizedType.WALLET_ADDRESS)
private String accountAddress;
/** 单位 */
@Excel(name = "单价")
private Long price;
/** 订单hash */
@Excel(name = "订单")
private String trxTxId;
/** 笔数 */
@Excel(name = "笔数")
private Long tranferCount;
/** 业务类型 */
@Excel(name = "业务类型")
private String busiType;
/** 转入金额 */
@Excel(name = "转入金额")
private Long trxAmount;
/** 兑换支出能量 */
@Excel(name = "兑换支出能量")
private Long delegateAmountTrx;
/** 能量交易订单hash */
@Excel(name = "能量交易订单")
private String delegateTxId;
/** 锁定周期 */
@Excel(name = "锁定周期")
private Long lockPeriod;
/** 资源委托状态 */
@Excel(name = "资源委托状态")
private String delegateStatus;
/** 回收资源交易id */
@Excel(name = "回收资源交易")
private String unDelegateTxId;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date fcd;
/** 创建用户 */
@Excel(name = "创建用户")
private String fcu;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat ="yyyy-MM-dd HH:mm:ss")
private Date lcd;
/** 更新用户 */
@Excel(name = "更新用户")
private String lcu;
public void setIdTrxExchangeInfo(Long idTrxExchangeInfo)
{
this.idTrxExchangeInfo = idTrxExchangeInfo;
}
public Long getIdTrxExchangeInfo()
{
return idTrxExchangeInfo;
}
public void setFromAddress(String fromAddress)
{
this.fromAddress = fromAddress;
}
public String getFromAddress()
{
return fromAddress;
}
public void setToAddress(String toAddress)
{
this.toAddress = toAddress;
}
public String getToAddress()
{
return toAddress;
}
public void setAccountAddress(String accountAddress)
{
this.accountAddress = accountAddress;
}
public String getAccountAddress()
{
return accountAddress;
}
public void setPrice(Long price)
{
this.price = price;
}
public Long getPrice()
{
return price;
}
public void setTrxTxId(String trxTxId)
{
this.trxTxId = trxTxId;
}
public String getTrxTxId()
{
return trxTxId;
}
public void setTrxAmount(Long trxAmount)
{
this.trxAmount = trxAmount;
}
public Long getTrxAmount()
{
return trxAmount;
}
public void setDelegateAmountTrx(Long delegateAmountTrx)
{
this.delegateAmountTrx = delegateAmountTrx;
}
public Long getDelegateAmountTrx()
{
return delegateAmountTrx;
}
public void setDelegateTxId(String delegateTxId)
{
this.delegateTxId = delegateTxId;
}
public String getDelegateTxId()
{
return delegateTxId;
}
public void setLockPeriod(Long lockPeriod)
{
this.lockPeriod = lockPeriod;
}
public Long getLockPeriod()
{
return lockPeriod;
}
public void setDelegateStatus(String delegateStatus)
{
this.delegateStatus = delegateStatus;
}
public String getDelegateStatus()
{
return delegateStatus;
}
public void setUnDelegateTxId(String unDelegateTxId)
{
this.unDelegateTxId = unDelegateTxId;
}
public String getUnDelegateTxId()
{
return unDelegateTxId;
}
public void setFcd(Date fcd)
{
this.fcd = fcd;
}
public Date getFcd()
{
return fcd;
}
public void setFcu(String fcu)
{
this.fcu = fcu;
}
public String getFcu()
{
return fcu;
}
public void setLcd(Date lcd)
{
this.lcd = lcd;
}
public Date getLcd()
{
return lcd;
}
public void setLcu(String lcu)
{
this.lcu = lcu;
}
public String getLcu()
{
return lcu;
}
public Long getTranferCount() {
return tranferCount;
}
public void setTranferCount(Long tranferCount) {
this.tranferCount = tranferCount;
}
public String getBusiType() {
return busiType;
}
public void setBusiType(String busiType) {
this.busiType = busiType;
}
}

View File

@ -27,6 +27,8 @@ public enum BusinessType
*/ */
DELETE, DELETE,
ACTIVE_DATA,
/** /**
* *
*/ */

View File

@ -1,8 +1,9 @@
package com.ruoyi.common.enums; package com.ruoyi.common.enums;
import java.util.function.Function;
import com.ruoyi.common.utils.DesensitizedUtil; import com.ruoyi.common.utils.DesensitizedUtil;
import java.util.function.Function;
/** /**
* *
* *
@ -43,7 +44,9 @@ public enum DesensitizedType
/** /**
* *
*/ */
CAR_LICENSE(DesensitizedUtil::carLicense); CAR_LICENSE(DesensitizedUtil::carLicense),
WALLET_ADDRESS(s -> s.replaceAll("(.{6})(.*)(.{8})", "$1********$3"));
private final Function<String, String> desensitizer; private final Function<String, String> desensitizer;
@ -56,4 +59,5 @@ public enum DesensitizedType
{ {
return desensitizer; return desensitizer;
} }
} }

View File

@ -0,0 +1,748 @@
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ruoyi.common.utils.encrpt;
import org.apache.commons.codec.binary.Base64OutputStream;
import java.io.UnsupportedEncodingException;
/**
* Utilities for encoding and decoding the Base64 representation of
* binary data. See RFCs <a
* href="http://www.ietf.org/rfc/rfc2045.txt">2045</a> and <a
* href="http://www.ietf.org/rfc/rfc3548.txt">3548</a>.
*/
public class Base64 {
/**
* Default values for encoder/decoder flags.
*/
public static final int DEFAULT = 0;
/**
* Encoder flag bit to omit the padding '=' characters at the end
* of the output (if any).
*/
public static final int NO_PADDING = 1;
/**
* Encoder flag bit to omit all line terminators (i.e., the output
* will be on one long line).
*/
public static final int NO_WRAP = 2;
/**
* Encoder flag bit to indicate lines should be terminated with a
* CRLF pair instead of just an LF. Has no effect if {@code
* NO_WRAP} is specified as well.
*/
public static final int CRLF = 4;
/**
* Encoder/decoder flag bit to indicate using the "URL and
* filename safe" variant of Base64 (see RFC 3548 section 4) where
* {@code -} and {@code _} are used in place of {@code +} and
* {@code /}.
*/
public static final int URL_SAFE = 8;
/**
* Flag to pass to {@link Base64OutputStream} to indicate that it
* should not close the output stream it is wrapping when it
* itself is closed.
*/
public static final int NO_CLOSE = 16;
// --------------------------------------------------------
// shared code
// --------------------------------------------------------
/* package */ static abstract class Coder {
public byte[] output;
public int op;
/**
* Encode/decode another block of input data. this.output is
* provided by the caller, and must be big enough to hold all
* the coded data. On exit, this.opwill be set to the length
* of the coded data.
*
* @param finish true if this is the final call to process for
* this object. Will finalize the coder state and
* include any final bytes in the output.
* @return true if the input so far is good; false if some
* error has been detected in the input stream..
*/
public abstract boolean process(byte[] input, int offset, int len, boolean finish);
/**
* @return the maximum number of bytes a call to process()
* could produce for the given number of input bytes. This may
* be an overestimate.
*/
public abstract int maxOutputSize(int len);
}
// --------------------------------------------------------
// decoding
// --------------------------------------------------------
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param str the input String to decode, which is converted to
* bytes using the default charset
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(String str, int flags) {
return decode(str.getBytes(), flags);
}
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param input the input array to decode
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(byte[] input, int flags) {
return decode(input, 0, input.length, flags);
}
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param input the data to decode
* @param offset the position within the input array at which to start
* @param len the number of bytes of input to decode
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(byte[] input, int offset, int len, int flags) {
// Allocate space for the most data the input could represent.
// (It could contain less if it contains whitespace, etc.)
Decoder decoder = new Decoder(flags, new byte[len * 3 / 4]);
if (!decoder.process(input, offset, len, true)) {
throw new IllegalArgumentException("bad base-64");
}
// Maybe we got lucky and allocated exactly enough output space.
if (decoder.op == decoder.output.length) {
return decoder.output;
}
// Need to shorten the array, so allocate a new one of the
// right size and copy.
byte[] temp = new byte[decoder.op];
System.arraycopy(decoder.output, 0, temp, 0, decoder.op);
return temp;
}
/* package */ static class Decoder extends Coder {
/**
* Lookup table for turning bytes into their position in the
* Base64 alphabet.
*/
private static final int DECODE[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
/**
* Decode lookup table for the "web safe" variant (RFC 3548
* sec. 4) where - and _ replace + and /.
*/
private static final int DECODE_WEBSAFE[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
/**
* Non-data values in the DECODE arrays.
*/
private static final int SKIP = -1;
private static final int EQUALS = -2;
/**
* States 0-3 are reading through the next input tuple.
* State 4 is having read one '=' and expecting exactly
* one more.
* State 5 is expecting no more data or padding characters
* in the input.
* State 6 is the error state; an error has been detected
* in the input and no future input can "fix" it.
*/
private int state; // state number (0 to 6)
private int value;
final private int[] alphabet;
public Decoder(int flags, byte[] output) {
this.output = output;
alphabet = ((flags & URL_SAFE) == 0) ? DECODE : DECODE_WEBSAFE;
state = 0;
value = 0;
}
/**
* @return an overestimate for the number of bytes {@code
* len} bytes could decode to.
*/
public int maxOutputSize(int len) {
return len * 3 / 4 + 10;
}
/**
* Decode another block of input data.
*
* @return true if the state machine is still healthy. false if
* bad base-64 data has been detected in the input stream.
*/
public boolean process(byte[] input, int offset, int len, boolean finish) {
if (this.state == 6) return false;
int p = offset;
len += offset;
// Using local variables makes the decoder about 12%
// faster than if we manipulate the member variables in
// the loop. (Even alphabet makes a measurable
// difference, which is somewhat surprising to me since
// the member variable is final.)
int state = this.state;
int value = this.value;
int op = 0;
final byte[] output = this.output;
final int[] alphabet = this.alphabet;
while (p < len) {
// Try the fast path: we're starting a new tuple and the
// next four bytes of the input stream are all data
// bytes. This corresponds to going through states
// 0-1-2-3-0. We expect to use this method for most of
// the data.
//
// If any of the next four bytes of input are non-data
// (whitespace, etc.), value will end up negative. (All
// the non-data values in decode are small negative
// numbers, so shifting any of them up and or'ing them
// together will result in a value with its top bit set.)
//
// You can remove this whole block and the output should
// be the same, just slower.
if (state == 0) {
while (p + 4 <= len &&
(value = ((alphabet[input[p] & 0xff] << 18) |
(alphabet[input[p + 1] & 0xff] << 12) |
(alphabet[input[p + 2] & 0xff] << 6) |
(alphabet[input[p + 3] & 0xff]))) >= 0) {
output[op + 2] = (byte) value;
output[op + 1] = (byte) (value >> 8);
output[op] = (byte) (value >> 16);
op += 3;
p += 4;
}
if (p >= len) break;
}
// The fast path isn't available -- either we've read a
// partial tuple, or the next four input bytes aren't all
// data, or whatever. Fall back to the slower state
// machine implementation.
int d = alphabet[input[p++] & 0xff];
switch (state) {
case 0:
if (d >= 0) {
value = d;
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 1:
if (d >= 0) {
value = (value << 6) | d;
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 2:
if (d >= 0) {
value = (value << 6) | d;
++state;
} else if (d == EQUALS) {
// Emit the last (partial) output tuple;
// expect exactly one more padding character.
output[op++] = (byte) (value >> 4);
state = 4;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 3:
if (d >= 0) {
// Emit the output triple and return to state 0.
value = (value << 6) | d;
output[op + 2] = (byte) value;
output[op + 1] = (byte) (value >> 8);
output[op] = (byte) (value >> 16);
op += 3;
state = 0;
} else if (d == EQUALS) {
// Emit the last (partial) output tuple;
// expect no further data or padding characters.
output[op + 1] = (byte) (value >> 2);
output[op] = (byte) (value >> 10);
op += 2;
state = 5;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 4:
if (d == EQUALS) {
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 5:
if (d != SKIP) {
this.state = 6;
return false;
}
break;
}
}
if (!finish) {
// We're out of input, but a future call could provide
// more.
this.state = state;
this.value = value;
this.op = op;
return true;
}
// Done reading input. Now figure out where we are left in
// the state machine and finish up.
switch (state) {
case 0:
// Output length is a multiple of three. Fine.
break;
case 1:
// Read one extra input byte, which isn't enough to
// make another output byte. Illegal.
this.state = 6;
return false;
case 2:
// Read two extra input bytes, enough to emit 1 more
// output byte. Fine.
output[op++] = (byte) (value >> 4);
break;
case 3:
// Read three extra input bytes, enough to emit 2 more
// output bytes. Fine.
output[op++] = (byte) (value >> 10);
output[op++] = (byte) (value >> 2);
break;
case 4:
// Read one padding '=' when we expected 2. Illegal.
this.state = 6;
return false;
case 5:
// Read all the padding '='s we expected and no more.
// Fine.
break;
}
this.state = state;
this.op = op;
return true;
}
}
// --------------------------------------------------------
// encoding
// --------------------------------------------------------
/**
* Base64-encode the given data and return a newly allocated
* String with the result.
*
* @param input the data to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static String encodeToString(byte[] input, int flags) {
try {
return new String(encode(input, flags), "US-ASCII");
} catch (UnsupportedEncodingException e) {
// US-ASCII is guaranteed to be available.
throw new AssertionError(e);
}
}
/**
* Base64-encode the given data and return a newly allocated
* String with the result.
*
* @param input the data to encode
* @param offset the position within the input array at which to
* start
* @param len the number of bytes of input to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static String encodeToString(byte[] input, int offset, int len, int flags) {
try {
return new String(encode(input, offset, len, flags), "US-ASCII");
} catch (UnsupportedEncodingException e) {
// US-ASCII is guaranteed to be available.
throw new AssertionError(e);
}
}
/**
* Base64-encode the given data and return a newly allocated
* byte[] with the result.
*
* @param input the data to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static byte[] encode(byte[] input, int flags) {
return encode(input, 0, input.length, flags);
}
/**
* Base64-encode the given data and return a newly allocated
* byte[] with the result.
*
* @param input the data to encode
* @param offset the position within the input array at which to
* start
* @param len the number of bytes of input to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static byte[] encode(byte[] input, int offset, int len, int flags) {
Encoder encoder = new Encoder(flags, null);
// Compute the exact length of the array we will produce.
int output_len = len / 3 * 4;
// Account for the tail of the data and the padding bytes, if any.
if (encoder.do_padding) {
if (len % 3 > 0) {
output_len += 4;
}
} else {
switch (len % 3) {
case 0:
break;
case 1:
output_len += 2;
break;
case 2:
output_len += 3;
break;
}
}
// Account for the newlines, if any.
if (encoder.do_newline && len > 0) {
output_len += (((len - 1) / (3 * Encoder.LINE_GROUPS)) + 1) *
(encoder.do_cr ? 2 : 1);
}
encoder.output = new byte[output_len];
encoder.process(input, offset, len, true);
assert encoder.op == output_len;
return encoder.output;
}
/* package */ static class Encoder extends Coder {
/**
* Emit a new line every this many output tuples. Corresponds to
* a 76-character line length (the maximum allowable according to
* <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>).
*/
public static final int LINE_GROUPS = 19;
/**
* Lookup table for turning Base64 alphabet positions (6 bits)
* into output bytes.
*/
private static final byte ENCODE[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/',
};
/**
* Lookup table for turning Base64 alphabet positions (6 bits)
* into output bytes.
*/
private static final byte ENCODE_WEBSAFE[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_',
};
final private byte[] tail;
/* package */ int tailLen;
private int count;
final public boolean do_padding;
final public boolean do_newline;
final public boolean do_cr;
final private byte[] alphabet;
public Encoder(int flags, byte[] output) {
this.output = output;
do_padding = (flags & NO_PADDING) == 0;
do_newline = (flags & NO_WRAP) == 0;
do_cr = (flags & CRLF) != 0;
alphabet = ((flags & URL_SAFE) == 0) ? ENCODE : ENCODE_WEBSAFE;
tail = new byte[2];
tailLen = 0;
count = do_newline ? LINE_GROUPS : -1;
}
/**
* @return an overestimate for the number of bytes {@code
* len} bytes could encode to.
*/
public int maxOutputSize(int len) {
return len * 8 / 5 + 10;
}
public boolean process(byte[] input, int offset, int len, boolean finish) {
// Using local variables makes the encoder about 9% faster.
final byte[] alphabet = this.alphabet;
final byte[] output = this.output;
int op = 0;
int count = this.count;
int p = offset;
len += offset;
int v = -1;
// First we need to concatenate the tail of the previous call
// with any input bytes available now and see if we can empty
// the tail.
switch (tailLen) {
case 0:
// There was no tail.
break;
case 1:
if (p + 2 <= len) {
// A 1-byte tail with at least 2 bytes of
// input available now.
v = ((tail[0] & 0xff) << 16) |
((input[p++] & 0xff) << 8) |
(input[p++] & 0xff);
tailLen = 0;
}
;
break;
case 2:
if (p + 1 <= len) {
// A 2-byte tail with at least 1 byte of input.
v = ((tail[0] & 0xff) << 16) |
((tail[1] & 0xff) << 8) |
(input[p++] & 0xff);
tailLen = 0;
}
break;
}
if (v != -1) {
output[op++] = alphabet[(v >> 18) & 0x3f];
output[op++] = alphabet[(v >> 12) & 0x3f];
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (--count == 0) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
count = LINE_GROUPS;
}
}
// At this point either there is no tail, or there are fewer
// than 3 bytes of input available.
// The main loop, turning 3 input bytes into 4 output bytes on
// each iteration.
while (p + 3 <= len) {
v = ((input[p] & 0xff) << 16) |
((input[p + 1] & 0xff) << 8) |
(input[p + 2] & 0xff);
output[op] = alphabet[(v >> 18) & 0x3f];
output[op + 1] = alphabet[(v >> 12) & 0x3f];
output[op + 2] = alphabet[(v >> 6) & 0x3f];
output[op + 3] = alphabet[v & 0x3f];
p += 3;
op += 4;
if (--count == 0) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
count = LINE_GROUPS;
}
}
if (finish) {
// Finish up the tail of the input. Note that we need to
// consume any bytes in tail before any bytes
// remaining in input; there should be at most two bytes
// total.
if (p - tailLen == len - 1) {
int t = 0;
v = ((tailLen > 0 ? tail[t++] : input[p++]) & 0xff) << 4;
tailLen -= t;
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (do_padding) {
output[op++] = '=';
output[op++] = '=';
}
if (do_newline) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
} else if (p - tailLen == len - 2) {
int t = 0;
v = (((tailLen > 1 ? tail[t++] : input[p++]) & 0xff) << 10) |
(((tailLen > 0 ? tail[t++] : input[p++]) & 0xff) << 2);
tailLen -= t;
output[op++] = alphabet[(v >> 12) & 0x3f];
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (do_padding) {
output[op++] = '=';
}
if (do_newline) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
} else if (do_newline && op > 0 && count != LINE_GROUPS) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
assert tailLen == 0;
assert p == len;
} else {
// Save the leftovers in tail to be consumed on the next
// call to encodeInternal.
if (p == len - 1) {
tail[tailLen++] = input[p];
} else if (p == len - 2) {
tail[tailLen++] = input[p];
tail[tailLen++] = input[p + 1];
}
}
this.op = op;
this.count = count;
return true;
}
}
private Base64() {
} // don't instantiate
}

View File

@ -0,0 +1,154 @@
package com.ruoyi.common.utils.encrpt;
import org.springframework.util.StringUtils;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
public class Dt {
public static final String KEY = "com.awm.six";
private static final String DES = "DES";
/**
* Description
*
* @param data
* @param key byte
* @return
* @throws Exception
*/
public static String encrypt(String data, String key) throws Exception {
byte[] bt = encrypt(data.getBytes("UTF-8"), key.getBytes());
String strs = Base64.encodeToString(bt, Base64.DEFAULT);
return strs;
}
/**
* Description
*
* @param data
* @param key byte
* @return
* @throws IOException
* @throws Exception
*/
public static String decrypt(String data, String key) throws Exception {
if (data == null) {
return null;
}
byte[] buf = Base64.decode(data.getBytes(), Base64.DEFAULT);
byte[] bt = decrypt(buf, key.getBytes());
return new String(bt, "UTF-8");
}
/**
* Description
*
* @param data
* @param key byte
* @return
* @throws Exception
*/
private static byte[] encrypt(byte[] data, byte[] key) throws Exception {
// 生成一个可信任的随机数源
SecureRandom sr = new SecureRandom();
// 从原始密钥数据创建DESKeySpec对象
DESKeySpec dks = new DESKeySpec(key);
// 创建一个密钥工厂然后用它把DESKeySpec转换成SecretKey对象
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
SecretKey securekey = keyFactory.generateSecret(dks);
// Cipher对象实际完成加密操作
Cipher cipher = Cipher.getInstance(DES);
// 用密钥初始化Cipher对象
cipher.init(Cipher.ENCRYPT_MODE, securekey, sr);
return cipher.doFinal(data);
}
/**
* Description
*
* @param data
* @param key byte
* @return
* @throws Exception
*/
private static byte[] decrypt(byte[] data, byte[] key) throws Exception {
// 生成一个可信任的随机数源
SecureRandom sr = new SecureRandom();
// 从原始密钥数据创建DESKeySpec对象
DESKeySpec dks = new DESKeySpec(key);
// 创建一个密钥工厂然后用它把DESKeySpec转换成SecretKey对象
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
SecretKey securekey = keyFactory.generateSecret(dks);
// Cipher对象实际完成解密操作
Cipher cipher = Cipher.getInstance(DES);
// 用密钥初始化Cipher对象
cipher.init(Cipher.DECRYPT_MODE, securekey, sr);
return cipher.doFinal(data);
}
public static String md5(String string) {
if (StringUtils.isEmpty(string)) {
return "";
}
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
byte[] bytes = md5.digest(string.getBytes());
String result = toHexString(bytes, "");
return result;
} catch (NoSuchAlgorithmException e) {
}
return "";
}
public static String toHexString(byte[] bytes, String separator) {
StringBuilder hexString = new StringBuilder();
byte[] arrayOfByte = bytes;
int j = bytes.length;
for (int i = 0; i < j; i++) {
byte b = arrayOfByte[i];
int byteValue = 0xFF & b;
if (byteValue < 16) {
hexString.append("0");
}
hexString.append(Integer.toHexString(0xFF & b)).append(separator);
}
return hexString.toString();
}
public static void main(String[] args) throws Exception {
String data = "abc";
String encryptData = encrypt(data, KEY);
System.out.println(encryptData);
String decrypt1 = decrypt(encryptData, KEY);
System.out.println(decrypt1);
}
}

View File

@ -0,0 +1,628 @@
package com.ruoyi.common.utils.http;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import java.util.Arrays;
import java.util.Map;
public class RestTemplateUtils {
private static final RestTemplate restTemplate = new RestTemplate();
private static HttpHeaders headers = new HttpHeaders();
static {
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON_UTF8));
headers.add("user-agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36");
}
// ----------------------------------GET-------------------------------------------------------
/**
* GET
*
* @param url URL
* @param responseType
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> get(String url, Class<T> responseType) {
return restTemplate.getForEntity(url, responseType);
}
/**
* GET
*
* @param url URL
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> get(String url, Class<T> responseType, Object... uriVariables) {
return restTemplate.getForEntity(url, responseType, uriVariables);
}
/**
* GET
*
* @param url URL
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> get(String url, Class<T> responseType, Map<String, ?> uriVariables) {
return restTemplate.getForEntity(url, responseType, uriVariables);
}
/**
* GET
*
* @param url URL
* @param headers
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> get(String url, Map<String, String> headers, Class<T> responseType, Object... uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return get(url, httpHeaders, responseType, uriVariables);
}
/**
* GET
*
* @param url URL
* @param headers
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> get(String url, HttpHeaders headers, Class<T> responseType, Object... uriVariables) {
HttpEntity<?> requestEntity = new HttpEntity<>(headers);
return exchange(url, HttpMethod.GET, requestEntity, responseType, uriVariables);
}
/**
* GET
*
* @param url URL
* @param headers
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> get(String url, Map<String, String> headers, Class<T> responseType, Map<String, ?> uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return get(url, httpHeaders, responseType, uriVariables);
}
/**
* GET
*
* @param url URL
* @param headers
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> get(String url, HttpHeaders headers, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<?> requestEntity = new HttpEntity<>(headers);
return exchange(url, HttpMethod.GET, requestEntity, responseType, uriVariables);
}
private static Logger logger = LoggerFactory.getLogger(RestTemplateUtils.class);
// ----------------------------------POST-------------------------------------------------------
/**
* POST
*
* @param url URL
* @param responseType
* @return
*/
public static <T> ResponseEntity<T> post(String url, Class<T> responseType) {
return restTemplate.postForEntity(url, HttpEntity.EMPTY, responseType);
}
/**
* POST
*
* @param url URL
* @param requestBody
* @param responseType
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType) {
return restTemplate.postForEntity(url, requestBody, responseType);
}
/**
* POST
*
* @param url URL
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType, Object... uriVariables) {
return restTemplate.postForEntity(url, requestBody, responseType, uriVariables);
}
/**
* POST
*
* @param url URL
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
return restTemplate.postForEntity(url, requestBody, responseType, uriVariables);
}
/**
* POST
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return post(url, httpHeaders, requestBody, responseType, uriVariables);
}
/**
* POST
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return post(url, requestEntity, responseType, uriVariables);
}
/**
* POST
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return post(url, httpHeaders, requestBody, responseType, uriVariables);
}
/**
* POST
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return post(url, requestEntity, responseType, uriVariables);
}
/**
* POST
*
* @param url URL
* @param requestEntity
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) {
return restTemplate.exchange(url, HttpMethod.POST, requestEntity, responseType, uriVariables);
}
/**
* POST
*
* @param url URL
* @param requestEntity
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> post(String url, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) {
return restTemplate.exchange(url, HttpMethod.POST, requestEntity, responseType, uriVariables);
}
// ----------------------------------PUT-------------------------------------------------------
/**
* PUT
*
* @param url URL
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, Class<T> responseType, Object... uriVariables) {
return put(url, HttpEntity.EMPTY, responseType, uriVariables);
}
/**
* PUT
*
* @param url URL
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, Object requestBody, Class<T> responseType, Object... uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody);
return put(url, requestEntity, responseType, uriVariables);
}
/**
* PUT
*
* @param url URL
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody);
return put(url, requestEntity, responseType, uriVariables);
}
/**
* PUT
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return put(url, httpHeaders, requestBody, responseType, uriVariables);
}
/**
* PUT
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return put(url, requestEntity, responseType, uriVariables);
}
/**
* PUT
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return put(url, httpHeaders, requestBody, responseType, uriVariables);
}
/**
* PUT
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return put(url, requestEntity, responseType, uriVariables);
}
/**
* PUT
*
* @param url URL
* @param requestEntity
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) {
return restTemplate.exchange(url, HttpMethod.PUT, requestEntity, responseType, uriVariables);
}
/**
* PUT
*
* @param url URL
* @param requestEntity
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> put(String url, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) {
return restTemplate.exchange(url, HttpMethod.PUT, requestEntity, responseType, uriVariables);
}
// ----------------------------------DELETE-------------------------------------------------------
/**
* DELETE
*
* @param url URL
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, Class<T> responseType, Object... uriVariables) {
return delete(url, HttpEntity.EMPTY, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, Class<T> responseType, Map<String, ?> uriVariables) {
return delete(url, HttpEntity.EMPTY, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, Object requestBody, Class<T> responseType, Object... uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody);
return delete(url, requestEntity, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody);
return delete(url, requestEntity, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param headers
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, Map<String, String> headers, Class<T> responseType, Object... uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return delete(url, httpHeaders, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param headers
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, HttpHeaders headers, Class<T> responseType, Object... uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(headers);
return delete(url, requestEntity, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param headers
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, Map<String, String> headers, Class<T> responseType, Map<String, ?> uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return delete(url, httpHeaders, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param headers
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, HttpHeaders headers, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(headers);
return delete(url, requestEntity, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return delete(url, httpHeaders, requestBody, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return delete(url, requestEntity, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setAll(headers);
return delete(url, httpHeaders, requestBody, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return delete(url, requestEntity, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param requestEntity
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) {
return restTemplate.exchange(url, HttpMethod.DELETE, requestEntity, responseType, uriVariables);
}
/**
* DELETE
*
* @param url URL
* @param requestEntity
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> delete(String url, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) {
return restTemplate.exchange(url, HttpMethod.DELETE, requestEntity, responseType, uriVariables);
}
// ----------------------------------通用方法-------------------------------------------------------
/**
*
*
* @param url URL
* @param method
* @param requestEntity
* @param responseType
* @param uriVariables URL
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) {
return restTemplate.exchange(url, method, requestEntity, responseType, uriVariables);
}
/**
*
*
* @param url URL
* @param method
* @param requestEntity
* @param responseType
* @param uriVariables URLMapkey
* @return ResponseEntity
*/
public static <T> ResponseEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) {
return restTemplate.exchange(url, method, requestEntity, responseType, uriVariables);
}
/**
* RestTemplate
*
* @return RestTemplate
*/
public static RestTemplate getRestTemplate() {
return restTemplate;
}
}

View File

@ -1,13 +1,14 @@
package com.ruoyi.framework.shiro.web.filter.captcha; package com.ruoyi.framework.shiro.web.filter.captcha;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import org.apache.shiro.web.filter.AccessControlFilter;
import com.google.code.kaptcha.Constants; import com.google.code.kaptcha.Constants;
import com.ruoyi.common.constant.ShiroConstants; import com.ruoyi.common.constant.ShiroConstants;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import org.apache.shiro.web.filter.AccessControlFilter;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
/** /**
* *
@ -19,7 +20,8 @@ public class CaptchaValidateFilter extends AccessControlFilter
/** /**
* *
*/ */
private boolean captchaEnabled = true; private boolean captchaEnabled = true
;
/** /**
* *

View File

@ -2,7 +2,7 @@
# 代码生成 # 代码生成
gen: gen:
# 作者 # 作者
author: ruoyi author: dorion
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system packageName: com.ruoyi.system
# 自动去除表前缀默认是false # 自动去除表前缀默认是false

View File

@ -35,6 +35,19 @@
<artifactId>ruoyi-common</artifactId> <artifactId>ruoyi-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -0,0 +1,65 @@
package com.ruoyi.quartz.task;
import com.ruoyi.common.core.domain.entity.AccountAddressInfo;
import com.ruoyi.common.core.domain.entity.MonitorAddressInfo;
import com.ruoyi.system.domain.MonitorAddressAccount;
import com.ruoyi.system.service.IAccountAddressInfoService;
import com.ruoyi.system.service.IMonitorAddressInfoService;
import com.ruoyi.system.service.ITrxExchangeInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component("monitorTrxTransferTask")
@Slf4j
public class MonitorTrxTransferTask {
@Autowired
private IMonitorAddressInfoService iMonitorAddressInfoService;
@Autowired
private ITrxExchangeInfoService trxExchangeInfoService;
@Autowired
private IAccountAddressInfoService accountAddressInfoService;
public void doMonitorTrxTransfer() {
//获取需要监听的地址列表
/* MonitorAddressAccount monitorAddressAccountExample = MonitorAddressAccount.builder()
.isValid("Y")
.monitorType("TRX")
.build();
List<MonitorAddressAccount> monitorAddressAccountList = iMonitorAddressInfoService.selectAllMonitorAddressAccount(monitorAddressAccountExample);*/
List<MonitorAddressInfo> monitorAddressInfoList = iMonitorAddressInfoService.selectAllValidMonitorAddressAccount();
List<MonitorAddressAccount> monitorAddressAccountList = new ArrayList<>();
for (MonitorAddressInfo monitorAddressInfo : monitorAddressInfoList) {
AccountAddressInfo accountAddressInfoExample = new AccountAddressInfo();
String accountAddress = monitorAddressInfo.getAccountAddress();
accountAddressInfoExample.setAddress(accountAddress);
List<AccountAddressInfo> accountAddressInfoList = accountAddressInfoService.selectAccountAddressInfoList(accountAddressInfoExample);
AccountAddressInfo accountAddressInfo = accountAddressInfoList.get(0);
MonitorAddressAccount monitorAddressAccount = MonitorAddressAccount.builder()
.monitorAddress(monitorAddressInfo.getMonitorAddress())
.accountAddress(accountAddress)
.price(monitorAddressInfo.getPrice().intValue())
.monitorType(monitorAddressInfo.getMonitorType())
.apiKey(monitorAddressInfo.getApiKey())
.encryptPrivateKey(accountAddressInfo.getEncryptPrivateKey())
.encryptKey(accountAddressInfo.getEncryptKey())
.build();
monitorAddressAccountList.add(monitorAddressAccount);
}
for (MonitorAddressAccount monitorAddressAccount : monitorAddressAccountList) {
trxExchangeInfoService.doMonitorTrxTransferByMonitorAddressInfo(monitorAddressAccount);
}
}
}

View File

@ -0,0 +1,4 @@
package com.ruoyi.quartz.task;
public class MonitorUsdtTransferTask {
}

View File

@ -0,0 +1,35 @@
package com.ruoyi.quartz.task;
import com.ruoyi.common.core.domain.entity.TrxExchangeInfo;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.system.service.ITrxExchangeInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component("undelegateEnergyTask")
@Slf4j
public class UndelegateEnergyTask {
@Autowired
private ITrxExchangeInfoService trxExchangeInfoService;
public void doUndelegateEnergy() {
String dictValue = DictUtils.getDictValue("sys_delegate_status", "已委托");
TrxExchangeInfo trxExchangeInfoExample = TrxExchangeInfo.builder().delegateStatus(dictValue).build();
List<TrxExchangeInfo> trxExchangeInfoList = trxExchangeInfoService.selectTrxExchangeInfoList(trxExchangeInfoExample);
for (TrxExchangeInfo trxExchangeInfo : trxExchangeInfoList) {
trxExchangeInfoService.doUndelegateEnergyByTrxExchangeInfo(trxExchangeInfo);
}
}
}

View File

@ -23,6 +23,47 @@
<artifactId>ruoyi-common</artifactId> <artifactId>ruoyi-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>abi</artifactId>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>utils</artifactId>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>org.tron.trident</groupId>
<artifactId>core</artifactId>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.12</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.5.15</version>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>3.10.6</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -0,0 +1,49 @@
package com.ruoyi.system.domain;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
@Builder
@Data
public class MonitorAddressAccount implements Serializable {
/**
*
*/
private String monitorAddress;
/**
*
*/
private String accountAddress;
/**
*
*/
private Integer price;
/**
* trxusdt
*/
private String monitorType;
/**
*
*/
private String isValid;
/**
*
*/
private String encryptPrivateKey;
/**
*
*/
private String encryptKey;
private String apiKey;
}

View File

@ -0,0 +1,58 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* trx trx_exchange_info
*
* @author dorion
* @date 2024-04-13
*/
public class TrxExchange extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 转出账户 */
private String fromAddress;
/** 实际出账账户 */
private String accountAddress;
private Long transferNumber;
private Long lockNum;
public String getFromAddress() {
return fromAddress;
}
public void setFromAddress(String fromAddress) {
this.fromAddress = fromAddress;
}
public String getAccountAddress() {
return accountAddress;
}
public void setAccountAddress(String accountAddress) {
this.accountAddress = accountAddress;
}
public Long getTransferNumber() {
return transferNumber;
}
public void setTransferNumber(Long transferNumber) {
this.transferNumber = transferNumber;
}
public Long getLockNum() {
return lockNum;
}
public void setLockNum(Long lockNum) {
this.lockNum = lockNum;
}
}

View File

@ -0,0 +1,9 @@
package com.ruoyi.system.dto;
import lombok.Data;
@Data
public class Contract {
private Parameter parameter;
private String type;
}

View File

@ -0,0 +1,19 @@
package com.ruoyi.system.dto;
import java.util.List;
@lombok.Data
public class Data {
private List<Ret> ret;
private List<String> signature;
private String txID;
private int net_usage;
private String raw_data_hex;
private int net_fee;
private int energy_usage;
private long blockNumber;
private long block_timestamp;
private int energy_fee;
private int energy_usage_total;
private Raw_data raw_data;
private List<String> internal_transactions;
}

View File

@ -0,0 +1,9 @@
package com.ruoyi.system.dto;
import lombok.Data;
@Data
public class Meta {
private long at;
private int page_size;
}

View File

@ -0,0 +1,9 @@
package com.ruoyi.system.dto;
import lombok.Data;
@Data
public class Parameter {
private Value value;
private String type_url;
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.system.dto;
import lombok.Data;
import java.util.List;
@Data
public class Raw_data {
private List<Contract> contract;
private String ref_block_bytes;
private String ref_block_hash;
private long expiration;
private long timestamp;
}

View File

@ -0,0 +1,19 @@
package com.ruoyi.system.dto;
import lombok.Data;
/**
* Auto-generated: 2024-04-08 17:25:14
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class Ret {
private String contractRet;
private int fee;
}

View File

@ -0,0 +1,40 @@
package com.ruoyi.system.dto;
import java.io.Serializable;
import java.util.List;
public class TronGridResponse implements Serializable {
private static final long serialVersionUID = 7446744944022223302L;
private List<Data> data;
private boolean success;
private Meta meta;
public List<Data> getData() {
return data;
}
public void setData(List<Data> data) {
this.data = data;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public Meta getMeta() {
return meta;
}
public void setMeta(Meta meta) {
this.meta = meta;
}
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.system.dto;
import lombok.Data;
@Data
public class Value {
private String resource;
private long frozen_balance;
private String owner_address;
private long amount;
private String to_address;
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.AccountAddressInfo;
import java.util.List;
/**
* Mapper
*
* @author dorion
* @date 2024-04-13
*/
public interface AccountAddressInfoMapper
{
/**
*
*
* @param idAccoutAddressInfo
* @return
*/
public AccountAddressInfo selectAccountAddressInfoByIdAccoutAddressInfo(Long idAccoutAddressInfo);
/**
*
*
* @param accountAddressInfo
* @return
*/
public List<AccountAddressInfo> selectAccountAddressInfoList(AccountAddressInfo accountAddressInfo);
/**
*
*
* @param accountAddressInfo
* @return
*/
public int insertAccountAddressInfo(AccountAddressInfo accountAddressInfo);
/**
*
*
* @param accountAddressInfo
* @return
*/
public int updateAccountAddressInfo(AccountAddressInfo accountAddressInfo);
/**
*
*
* @param idAccoutAddressInfo
* @return
*/
public int deleteAccountAddressInfoByIdAccoutAddressInfo(Long idAccoutAddressInfo);
/**
*
*
* @param idAccoutAddressInfos
* @return
*/
public int deleteAccountAddressInfoByIdAccoutAddressInfos(String[] idAccoutAddressInfos);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.ErrorLog;
import java.util.List;
/**
* Mapper
*
* @author dorion
* @date 2024-04-13
*/
public interface ErrorLogMapper
{
/**
*
*
* @param idErrorLog
* @return
*/
public ErrorLog selectErrorLogByIdErrorLog(Long idErrorLog);
/**
*
*
* @param errorLog
* @return
*/
public List<ErrorLog> selectErrorLogList(ErrorLog errorLog);
/**
*
*
* @param errorLog
* @return
*/
public int insertErrorLog(ErrorLog errorLog);
/**
*
*
* @param errorLog
* @return
*/
public int updateErrorLog(ErrorLog errorLog);
/**
*
*
* @param idErrorLog
* @return
*/
public int deleteErrorLogByIdErrorLog(Long idErrorLog);
/**
*
*
* @param idErrorLogs
* @return
*/
public int deleteErrorLogByIdErrorLogs(String[] idErrorLogs);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.FreezeBalanceInfo;
import java.util.List;
/**
* Mapper
*
* @author dorion
* @date 2024-04-13
*/
public interface FreezeBalanceInfoMapper
{
/**
*
*
* @param idFreezeBalanceInfo
* @return
*/
public FreezeBalanceInfo selectFreezeBalanceInfoByIdFreezeBalanceInfo(Long idFreezeBalanceInfo);
/**
*
*
* @param freezeBalanceInfo
* @return
*/
public List<FreezeBalanceInfo> selectFreezeBalanceInfoList(FreezeBalanceInfo freezeBalanceInfo);
/**
*
*
* @param freezeBalanceInfo
* @return
*/
public int insertFreezeBalanceInfo(FreezeBalanceInfo freezeBalanceInfo);
/**
*
*
* @param freezeBalanceInfo
* @return
*/
public int updateFreezeBalanceInfo(FreezeBalanceInfo freezeBalanceInfo);
/**
*
*
* @param idFreezeBalanceInfo
* @return
*/
public int deleteFreezeBalanceInfoByIdFreezeBalanceInfo(Long idFreezeBalanceInfo);
/**
*
*
* @param idFreezeBalanceInfos
* @return
*/
public int deleteFreezeBalanceInfoByIdFreezeBalanceInfos(String[] idFreezeBalanceInfos);
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.MonitorAddressInfo;
import java.util.List;
/**
* Mapper
*
* @author dorion
* @date 2024-04-13
*/
public interface MonitorAddressInfoMapper
{
/**
*
*
* @param idMonitorAddress
* @return
*/
public MonitorAddressInfo selectMonitorAddressInfoByIdMonitorAddress(Long idMonitorAddress);
/**
*
*
* @param monitorAddressInfo
* @return
*/
public List<MonitorAddressInfo> selectMonitorAddressInfoList(MonitorAddressInfo monitorAddressInfo);
/**
*
*
* @param monitorAddressInfo
* @return
*/
public int insertMonitorAddressInfo(MonitorAddressInfo monitorAddressInfo);
/**
*
*
* @param monitorAddressInfo
* @return
*/
public int updateMonitorAddressInfo(MonitorAddressInfo monitorAddressInfo);
/**
*
*
* @param idMonitorAddress
* @return
*/
public int deleteMonitorAddressInfoByIdMonitorAddress(Long idMonitorAddress);
/**
*
*
* @param idMonitorAddresss
* @return
*/
public int deleteMonitorAddressInfoByIdMonitorAddresss(String[] idMonitorAddresss);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.TenantInfo;
import java.util.List;
/**
* Mapper
*
* @author dorion
* @date 2024-04-14
*/
public interface TenantInfoMapper
{
/**
*
*
* @param idTenantInfo
* @return
*/
public TenantInfo selectTenantInfoByIdTenantInfo(Long idTenantInfo);
/**
*
*
* @param tenantInfo
* @return
*/
public List<TenantInfo> selectTenantInfoList(TenantInfo tenantInfo);
/**
*
*
* @param tenantInfo
* @return
*/
public int insertTenantInfo(TenantInfo tenantInfo);
/**
*
*
* @param tenantInfo
* @return
*/
public int updateTenantInfo(TenantInfo tenantInfo);
/**
*
*
* @param idTenantInfo
* @return
*/
public int deleteTenantInfoByIdTenantInfo(Long idTenantInfo);
/**
*
*
* @param idTenantInfos
* @return
*/
public int deleteTenantInfoByIdTenantInfos(String[] idTenantInfos);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.TrxExchangeInfo;
import java.util.List;
/**
* trxMapper
*
* @author dorion
* @date 2024-04-13
*/
public interface TrxExchangeInfoMapper
{
/**
* trx
*
* @param idTrxExchangeInfo trx
* @return trx
*/
public TrxExchangeInfo selectTrxExchangeInfoByIdTrxExchangeInfo(Long idTrxExchangeInfo);
/**
* trx
*
* @param trxExchangeInfo trx
* @return trx
*/
public List<TrxExchangeInfo> selectTrxExchangeInfoList(TrxExchangeInfo trxExchangeInfo);
/**
* trx
*
* @param trxExchangeInfo trx
* @return
*/
public int insertTrxExchangeInfo(TrxExchangeInfo trxExchangeInfo);
/**
* trx
*
* @param trxExchangeInfo trx
* @return
*/
public int updateTrxExchangeInfo(TrxExchangeInfo trxExchangeInfo);
/**
* trx
*
* @param idTrxExchangeInfo trx
* @return
*/
public int deleteTrxExchangeInfoByIdTrxExchangeInfo(Long idTrxExchangeInfo);
/**
* trx
*
* @param idTrxExchangeInfos
* @return
*/
public int deleteTrxExchangeInfoByIdTrxExchangeInfos(String[] idTrxExchangeInfos);
}

View File

@ -0,0 +1,69 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.AccountAddressInfo;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-13
*/
public interface IAccountAddressInfoService
{
/**
*
*
* @param idAccoutAddressInfo
* @return
*/
public AccountAddressInfo selectAccountAddressInfoByIdAccoutAddressInfo(Long idAccoutAddressInfo);
/**
*
*
* @param accountAddressInfo
* @return
*/
public List<AccountAddressInfo> selectAccountAddressInfoList(AccountAddressInfo accountAddressInfo) ;
/**
*
*
* @param accountAddressInfo
* @return
*/
public int insertAccountAddressInfo(AccountAddressInfo accountAddressInfo) throws Exception;
/**
*
*
* @param accountAddressInfo
* @return
*/
public int updateAccountAddressInfo(AccountAddressInfo accountAddressInfo) throws Exception;
/**
*
*
* @param idAccoutAddressInfos
* @return
*/
public int deleteAccountAddressInfoByIdAccoutAddressInfos(String idAccoutAddressInfos);
/**
*
*
* @param idAccoutAddressInfo
* @return
*/
public int deleteAccountAddressInfoByIdAccoutAddressInfo(Long idAccoutAddressInfo);
Object selectAccountAddressInfoAll();
String getDecryptPrivateKey(String address) throws Exception;
List<AccountAddressInfo> selectAccountAddressInfoListByResouce(AccountAddressInfo accountAddressInfo) throws Exception;
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.ErrorLog;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-13
*/
public interface IErrorLogService
{
/**
*
*
* @param idErrorLog
* @return
*/
public ErrorLog selectErrorLogByIdErrorLog(Long idErrorLog);
/**
*
*
* @param errorLog
* @return
*/
public List<ErrorLog> selectErrorLogList(ErrorLog errorLog);
/**
*
*
* @param errorLog
* @return
*/
public int insertErrorLog(ErrorLog errorLog);
/**
*
*
* @param errorLog
* @return
*/
public int updateErrorLog(ErrorLog errorLog);
/**
*
*
* @param idErrorLogs
* @return
*/
public int deleteErrorLogByIdErrorLogs(String idErrorLogs);
/**
*
*
* @param idErrorLog
* @return
*/
public int deleteErrorLogByIdErrorLog(Long idErrorLog);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.FreezeBalanceInfo;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-13
*/
public interface IFreezeBalanceInfoService
{
/**
*
*
* @param idFreezeBalanceInfo
* @return
*/
public FreezeBalanceInfo selectFreezeBalanceInfoByIdFreezeBalanceInfo(Long idFreezeBalanceInfo);
/**
*
*
* @param freezeBalanceInfo
* @return
*/
public List<FreezeBalanceInfo> selectFreezeBalanceInfoList(FreezeBalanceInfo freezeBalanceInfo);
/**
*
*
* @param freezeBalanceInfo
* @return
*/
public int insertFreezeBalanceInfo(FreezeBalanceInfo freezeBalanceInfo) throws Exception;
/**
*
*
* @param freezeBalanceInfo
* @return
*/
public int updateFreezeBalanceInfo(FreezeBalanceInfo freezeBalanceInfo);
/**
*
*
* @param idFreezeBalanceInfos
* @return
*/
public int deleteFreezeBalanceInfoByIdFreezeBalanceInfos(String idFreezeBalanceInfos);
/**
*
*
* @param idFreezeBalanceInfo
* @return
*/
public int deleteFreezeBalanceInfoByIdFreezeBalanceInfo(Long idFreezeBalanceInfo);
}

View File

@ -0,0 +1,71 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.MonitorAddressInfo;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-13
*/
public interface IMonitorAddressInfoService
{
/**
*
*
* @param idMonitorAddress
* @return
*/
public MonitorAddressInfo selectMonitorAddressInfoByIdMonitorAddress(Long idMonitorAddress);
/**
*
*
* @param monitorAddressInfo
* @return
*/
public List<MonitorAddressInfo> selectMonitorAddressInfoList(MonitorAddressInfo monitorAddressInfo);
/**
*
*
* @param monitorAddressInfo
* @return
*/
public int insertMonitorAddressInfo(MonitorAddressInfo monitorAddressInfo);
/**
*
*
* @param monitorAddressInfo
* @return
*/
public int updateMonitorAddressInfo(MonitorAddressInfo monitorAddressInfo);
/**
*
*
* @param idMonitorAddresss
* @return
*/
public int deleteMonitorAddressInfoByIdMonitorAddresss(String idMonitorAddresss);
/**
*
*
* @param idMonitorAddress
* @return
*/
public int deleteMonitorAddressInfoByIdMonitorAddress(Long idMonitorAddress);
/*
List<MonitorAddressAccount> selectAllMonitorAddressAccount(MonitorAddressAccount monitorAddressAccountExample);
*/
List<MonitorAddressInfo> selectAllValidMonitorAddressAccount();
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.TenantInfo;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-14
*/
public interface ITenantInfoService
{
/**
*
*
* @param idTenantInfo
* @return
*/
public TenantInfo selectTenantInfoByIdTenantInfo(Long idTenantInfo);
/**
*
*
* @param tenantInfo
* @return
*/
public List<TenantInfo> selectTenantInfoList(TenantInfo tenantInfo);
/**
*
*
* @param tenantInfo
* @return
*/
public int insertTenantInfo(TenantInfo tenantInfo);
/**
*
*
* @param tenantInfo
* @return
*/
public int updateTenantInfo(TenantInfo tenantInfo);
/**
*
*
* @param idTenantInfos
* @return
*/
public int deleteTenantInfoByIdTenantInfos(String idTenantInfos);
/**
*
*
* @param idTenantInfo
* @return
*/
public int deleteTenantInfoByIdTenantInfo(Long idTenantInfo);
int activeDataTenantInfoByIdTenantInfos(String ids) throws Exception;
}

View File

@ -0,0 +1,71 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.TrxExchangeInfo;
import com.ruoyi.system.domain.MonitorAddressAccount;
import com.ruoyi.system.domain.TrxExchange;
import java.util.List;
/**
* trxService
*
* @author dorion
* @date 2024-04-13
*/
public interface ITrxExchangeInfoService
{
/**
* trx
*
* @param idTrxExchangeInfo trx
* @return trx
*/
public TrxExchangeInfo selectTrxExchangeInfoByIdTrxExchangeInfo(Long idTrxExchangeInfo);
/**
* trx
*
* @param trxExchangeInfo trx
* @return trx
*/
public List<TrxExchangeInfo> selectTrxExchangeInfoList(TrxExchangeInfo trxExchangeInfo);
/**
* trx
*
* @param trxExchangeInfo trx
* @return
*/
public int insertTrxExchangeInfo(TrxExchangeInfo trxExchangeInfo);
/**
* trx
*
* @param trxExchangeInfo trx
* @return
*/
public int updateTrxExchangeInfo(TrxExchangeInfo trxExchangeInfo);
/**
* trx
*
* @param idTrxExchangeInfos trx
* @return
*/
public int deleteTrxExchangeInfoByIdTrxExchangeInfos(String idTrxExchangeInfos);
/**
* trx
*
* @param idTrxExchangeInfo trx
* @return
*/
public int deleteTrxExchangeInfoByIdTrxExchangeInfo(Long idTrxExchangeInfo);
int delegate(TrxExchange trxExchange,Boolean isTenant) throws Exception;
void doMonitorTrxTransferByMonitorAddressInfo(MonitorAddressAccount monitorAddressAccount);
void doUndelegateEnergyByTrxExchangeInfo(TrxExchangeInfo trxExchangeInfo);
}

View File

@ -0,0 +1,205 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.AccountAddressInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.encrpt.Dt;
import com.ruoyi.system.mapper.AccountAddressInfoMapper;
import com.ruoyi.system.service.IAccountAddressInfoService;
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
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.proto.Response;
import java.math.BigDecimal;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-13
*/
@Service
public class AccountAddressInfoServiceImpl implements IAccountAddressInfoService {
private static final Logger log = LoggerFactory.getLogger(AccountAddressInfoServiceImpl.class);
@Autowired
private AccountAddressInfoMapper accountAddressInfoMapper;
/**
*
*
* @param idAccoutAddressInfo
* @return
*/
@Override
public AccountAddressInfo selectAccountAddressInfoByIdAccoutAddressInfo(Long idAccoutAddressInfo) {
return accountAddressInfoMapper.selectAccountAddressInfoByIdAccoutAddressInfo(idAccoutAddressInfo);
}
/**
*
*
* @param accountAddressInfo
* @return
*/
@Override
public List<AccountAddressInfo> selectAccountAddressInfoList(AccountAddressInfo accountAddressInfo) {
return accountAddressInfoMapper.selectAccountAddressInfoList(accountAddressInfo);
}
/**
*
*
* @param accountAddressInfo
* @return
*/
@Override
public int insertAccountAddressInfo(AccountAddressInfo accountAddressInfo) throws Exception {
String encryptPrivateKey = accountAddressInfo.getEncryptPrivateKey();
SecureRandomNumberGenerator secureRandom = new SecureRandomNumberGenerator();
String encrptKey = secureRandom.nextBytes(24).toHex();
String encrypt = Dt.encrypt(encryptPrivateKey, encrptKey);
accountAddressInfo.setEncryptPrivateKey(encrypt);
accountAddressInfo.setEncryptKey(encrptKey);
String userName = ShiroUtils.getLoginName();
accountAddressInfo.setFcu(userName);
accountAddressInfo.setLcu(userName);
return accountAddressInfoMapper.insertAccountAddressInfo(accountAddressInfo);
}
/**
*
*
* @param accountAddressInfo
* @return
*/
@Override
public int updateAccountAddressInfo(AccountAddressInfo accountAddressInfo) throws Exception {
String encryptPrivateKey = accountAddressInfo.getEncryptPrivateKey();
SecureRandomNumberGenerator secureRandom = new SecureRandomNumberGenerator();
String encrptKey = secureRandom.nextBytes(24).toHex();
String encrypt = Dt.encrypt(encryptPrivateKey, encrptKey);
accountAddressInfo.setEncryptPrivateKey(encrypt);
accountAddressInfo.setEncryptKey(encrptKey);
String userName = ShiroUtils.getLoginName();
accountAddressInfo.setLcu(userName);
return accountAddressInfoMapper.updateAccountAddressInfo(accountAddressInfo);
}
/**
*
*
* @param idAccoutAddressInfos
* @return
*/
@Override
public int deleteAccountAddressInfoByIdAccoutAddressInfos(String idAccoutAddressInfos) {
return accountAddressInfoMapper.deleteAccountAddressInfoByIdAccoutAddressInfos(Convert.toStrArray(idAccoutAddressInfos));
}
/**
*
*
* @param idAccoutAddressInfo
* @return
*/
@Override
public int deleteAccountAddressInfoByIdAccoutAddressInfo(Long idAccoutAddressInfo) {
return accountAddressInfoMapper.deleteAccountAddressInfoByIdAccoutAddressInfo(idAccoutAddressInfo);
}
@Override
public List<AccountAddressInfo> selectAccountAddressInfoAll() {
AccountAddressInfo accountAddressInfo = new AccountAddressInfo();
accountAddressInfo.setIsValid(UserConstants.YES);
return accountAddressInfoMapper.selectAccountAddressInfoList(accountAddressInfo);
}
/**
*
* @param address
* @return
* @throws Exception
*/
@Override
public String getDecryptPrivateKey(String address) throws Exception {
AccountAddressInfo accountAddressInfoExample = new AccountAddressInfo();
accountAddressInfoExample.setAddress(address);
List<AccountAddressInfo> accountAddressInfoList = accountAddressInfoMapper.selectAccountAddressInfoList(accountAddressInfoExample);
AccountAddressInfo accountAddressInfo = accountAddressInfoList.get(0);
String encryptPrivateKey = accountAddressInfo.getEncryptPrivateKey();
String encryptKey = accountAddressInfo.getEncryptKey();
//解密获得秘钥
String decryptPrivateKey = Dt.decrypt(encryptPrivateKey, encryptKey);
return decryptPrivateKey;
}
@Override
public List<AccountAddressInfo> selectAccountAddressInfoListByResouce(AccountAddressInfo accountAddressInfo) throws Exception {
List<AccountAddressInfo> accountAddressInfoList = accountAddressInfoMapper.selectAccountAddressInfoList(accountAddressInfo);
for (AccountAddressInfo addressInfo : accountAddressInfoList) {
String encryptPrivateKey = addressInfo.getEncryptPrivateKey();
String encryptKey = addressInfo.getEncryptKey();
//解密获得秘钥
String decryptPrivateKey = Dt.decrypt(encryptPrivateKey, encryptKey);
String tronApiKey = DictUtils.getDictValue("sys_tron_api_key", "synp@outlook");
ApiWrapper apiWrapper = ApiWrapper.ofMainnet(decryptPrivateKey,tronApiKey);
String address = addressInfo.getAddress();
Response.AccountResourceMessage accountResource = apiWrapper.getAccountResource(address);
//免费带宽使用量
long freeNetUsed = accountResource.getFreeNetUsed();
//免费带宽上限
long freeNetLimit = accountResource.getFreeNetLimit();
//网络带宽消耗
long netUsed = accountResource.getNetUsed();
//网络上限
long netLimit = accountResource.getNetLimit();
//能量消耗
long energyUsed = accountResource.getEnergyUsed();
//能量上限
long energyLimit = accountResource.getEnergyLimit();
long totalNetUsed = freeNetUsed + netUsed;
long taotalNetLimit = freeNetLimit + netLimit;
long totalNetBalance = taotalNetLimit - totalNetUsed;
long totalEnergyBalance = energyLimit - energyUsed;
addressInfo.setNetResource(totalNetBalance + "/" + taotalNetLimit);
addressInfo.setEnergyResource(totalEnergyBalance + "/" + energyLimit);
Response.Account account = apiWrapper.getAccount(address);
long balance = account.getBalance();
List<Response.Account.FreezeV2> frozenV2List = account.getFrozenV2List();
Long totalFrozen = 0L;
for (Response.Account.FreezeV2 freezeV2 : frozenV2List) {
totalFrozen += freezeV2.getAmount();
}
addressInfo.setTrxBalance(BigDecimal.valueOf(balance).movePointLeft(6));
addressInfo.setTotalFrozen(BigDecimal.valueOf(totalFrozen).movePointLeft(6));
}
return accountAddressInfoList;
}
}

View File

@ -0,0 +1,101 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.domain.entity.ErrorLog;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.mapper.ErrorLogMapper;
import com.ruoyi.system.service.IErrorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-13
*/
@Service
public class ErrorLogServiceImpl implements IErrorLogService
{
@Autowired
private ErrorLogMapper errorLogMapper;
/**
*
*
* @param idErrorLog
* @return
*/
@Override
public ErrorLog selectErrorLogByIdErrorLog(Long idErrorLog)
{
return errorLogMapper.selectErrorLogByIdErrorLog(idErrorLog);
}
/**
*
*
* @param errorLog
* @return
*/
@Override
public List<ErrorLog> selectErrorLogList(ErrorLog errorLog)
{
return errorLogMapper.selectErrorLogList(errorLog);
}
/**
*
*
* @param errorLog
* @return
*/
@Override
public int insertErrorLog(ErrorLog errorLog)
{
String userName = ShiroUtils.getLoginName();
errorLog.setFcu(userName);
errorLog.setLcu(userName);
return errorLogMapper.insertErrorLog(errorLog);
}
/**
*
*
* @param errorLog
* @return
*/
@Override
public int updateErrorLog(ErrorLog errorLog)
{
String userName = ShiroUtils.getLoginName();
errorLog.setLcu(userName);
return errorLogMapper.updateErrorLog(errorLog);
}
/**
*
*
* @param idErrorLogs
* @return
*/
@Override
public int deleteErrorLogByIdErrorLogs(String idErrorLogs)
{
return errorLogMapper.deleteErrorLogByIdErrorLogs(Convert.toStrArray(idErrorLogs));
}
/**
*
*
* @param idErrorLog
* @return
*/
@Override
public int deleteErrorLogByIdErrorLog(Long idErrorLog)
{
return errorLogMapper.deleteErrorLogByIdErrorLog(idErrorLog);
}
}

View File

@ -0,0 +1,136 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.FreezeBalanceInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.mapper.FreezeBalanceInfoMapper;
import com.ruoyi.system.service.IAccountAddressInfoService;
import com.ruoyi.system.service.IFreezeBalanceInfoService;
import com.ruoyi.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.tron.trident.core.ApiWrapper;
import org.tron.trident.proto.Chain;
import org.tron.trident.proto.Common;
import org.tron.trident.proto.Response;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-13
*/
@Service
public class FreezeBalanceInfoServiceImpl implements IFreezeBalanceInfoService
{
@Autowired
private FreezeBalanceInfoMapper freezeBalanceInfoMapper;
@Autowired
private IAccountAddressInfoService accountAddressInfoService;
@Autowired
private ISysConfigService configService;
/**
*
*
* @param idFreezeBalanceInfo
* @return
*/
@Override
public FreezeBalanceInfo selectFreezeBalanceInfoByIdFreezeBalanceInfo(Long idFreezeBalanceInfo)
{
return freezeBalanceInfoMapper.selectFreezeBalanceInfoByIdFreezeBalanceInfo(idFreezeBalanceInfo);
}
/**
*
*
* @param freezeBalanceInfo
* @return
*/
@Override
public List<FreezeBalanceInfo> selectFreezeBalanceInfoList(FreezeBalanceInfo freezeBalanceInfo)
{
return freezeBalanceInfoMapper.selectFreezeBalanceInfoList(freezeBalanceInfo);
}
/**
*
*
* @param freezeBalanceInfo
* @return
*/
@Override
public int insertFreezeBalanceInfo(FreezeBalanceInfo freezeBalanceInfo) throws Exception {
String systronApiSwitch = configService.selectConfigByKey("sys.tron.api");
if(UserConstants.YES.equals(systronApiSwitch)){
Long freezeTrxAmount = freezeBalanceInfo.getFreezeTrxAmount();
String address = freezeBalanceInfo.getAddress();
String decryptPrivateKey = accountAddressInfoService.getDecryptPrivateKey(address);
String tronApiKey = DictUtils.getDictValue("sys_tron_api_key", "synp@outlook");
//发起抵押
ApiWrapper apiWrapper = ApiWrapper.ofMainnet(decryptPrivateKey,tronApiKey);
Long frozenBalance = freezeTrxAmount * 1000000L;
Response.TransactionExtention transactionExtention = apiWrapper.freezeBalanceV2(address, frozenBalance, Common.ResourceCode.valueOf(freezeBalanceInfo.getExchangeResourceType()).getNumber());
//签名
Chain.Transaction signTransaction = apiWrapper.signTransaction(transactionExtention);
//广播 交易hash
String hexTxid = apiWrapper.broadcastTransaction(signTransaction);
freezeBalanceInfo.setTxId(hexTxid);
}
String userName = ShiroUtils.getLoginName();
freezeBalanceInfo.setFcu(userName);
freezeBalanceInfo.setLcu(userName);
return freezeBalanceInfoMapper.insertFreezeBalanceInfo(freezeBalanceInfo);
}
/**
*
*
* @param freezeBalanceInfo
* @return
*/
@Override
public int updateFreezeBalanceInfo(FreezeBalanceInfo freezeBalanceInfo)
{
return freezeBalanceInfoMapper.updateFreezeBalanceInfo(freezeBalanceInfo);
}
/**
*
*
* @param idFreezeBalanceInfos
* @return
*/
@Override
public int deleteFreezeBalanceInfoByIdFreezeBalanceInfos(String idFreezeBalanceInfos)
{
return freezeBalanceInfoMapper.deleteFreezeBalanceInfoByIdFreezeBalanceInfos(Convert.toStrArray(idFreezeBalanceInfos));
}
/**
*
*
* @param idFreezeBalanceInfo
* @return
*/
@Override
public int deleteFreezeBalanceInfoByIdFreezeBalanceInfo(Long idFreezeBalanceInfo)
{
return freezeBalanceInfoMapper.deleteFreezeBalanceInfoByIdFreezeBalanceInfo(idFreezeBalanceInfo);
}
}

View File

@ -0,0 +1,113 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.domain.entity.MonitorAddressInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.mapper.MonitorAddressInfoMapper;
import com.ruoyi.system.service.IMonitorAddressInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-13
*/
@Service
@Slf4j
public class MonitorAddressInfoServiceImpl implements IMonitorAddressInfoService {
@Autowired
private MonitorAddressInfoMapper monitorAddressInfoMapper;
/**
*
*
* @param idMonitorAddress
* @return
*/
@Override
public MonitorAddressInfo selectMonitorAddressInfoByIdMonitorAddress(Long idMonitorAddress) {
return monitorAddressInfoMapper.selectMonitorAddressInfoByIdMonitorAddress(idMonitorAddress);
}
/**
*
*
* @param monitorAddressInfo
* @return
*/
@Override
public List<MonitorAddressInfo> selectMonitorAddressInfoList(MonitorAddressInfo monitorAddressInfo) {
return monitorAddressInfoMapper.selectMonitorAddressInfoList(monitorAddressInfo);
}
/**
*
*
* @param monitorAddressInfo
* @return
*/
@Override
public int insertMonitorAddressInfo(MonitorAddressInfo monitorAddressInfo) {
String userName = ShiroUtils.getLoginName();
monitorAddressInfo.setFcu(userName);
monitorAddressInfo.setLcu(userName);
return monitorAddressInfoMapper.insertMonitorAddressInfo(monitorAddressInfo);
}
/**
*
*
* @param monitorAddressInfo
* @return
*/
@Override
public int updateMonitorAddressInfo(MonitorAddressInfo monitorAddressInfo) {
String userName = ShiroUtils.getLoginName();
monitorAddressInfo.setLcu(userName);
return monitorAddressInfoMapper.updateMonitorAddressInfo(monitorAddressInfo);
}
/**
*
*
* @param idMonitorAddresss
* @return
*/
@Override
public int deleteMonitorAddressInfoByIdMonitorAddresss(String idMonitorAddresss) {
return monitorAddressInfoMapper.deleteMonitorAddressInfoByIdMonitorAddresss(Convert.toStrArray(idMonitorAddresss));
}
/**
*
*
* @param idMonitorAddress
* @return
*/
@Override
public int deleteMonitorAddressInfoByIdMonitorAddress(Long idMonitorAddress) {
return monitorAddressInfoMapper.deleteMonitorAddressInfoByIdMonitorAddress(idMonitorAddress);
}
/* @Override
public List<MonitorAddressAccount> selectAllMonitorAddressAccount(MonitorAddressAccount monitorAddressAccountExample) {
return monitorAddressInfoMapper.selectAllMonitorAddressAccount(monitorAddressAccountExample);
}*/
@Override
public List<MonitorAddressInfo> selectAllValidMonitorAddressAccount() {
MonitorAddressInfo monitorAddressInfo = new MonitorAddressInfo();
monitorAddressInfo.setIsValid("Y");
return monitorAddressInfoMapper.selectMonitorAddressInfoList(monitorAddressInfo);
}
}

View File

@ -0,0 +1,178 @@
package com.ruoyi.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.google.common.base.Preconditions;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.MonitorAddressInfo;
import com.ruoyi.common.core.domain.entity.TenantInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.TrxExchange;
import com.ruoyi.system.mapper.MonitorAddressInfoMapper;
import com.ruoyi.system.mapper.TenantInfoMapper;
import com.ruoyi.system.service.ITenantInfoService;
import com.ruoyi.system.service.ITrxExchangeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* Service
*
* @author dorion
* @date 2024-04-14
*/
@Service
public class TenantInfoServiceImpl implements ITenantInfoService
{
@Autowired
private TenantInfoMapper tenantInfoMapper;
@Autowired
private ITrxExchangeInfoService trxExchangeInfoService;
@Autowired
private MonitorAddressInfoMapper monitorAddressInfoMapper;
/**
*
*
* @param idTenantInfo
* @return
*/
@Override
public TenantInfo selectTenantInfoByIdTenantInfo(Long idTenantInfo)
{
return tenantInfoMapper.selectTenantInfoByIdTenantInfo(idTenantInfo);
}
/**
*
*
* @param tenantInfo
* @return
*/
@Override
public List<TenantInfo> selectTenantInfoList(TenantInfo tenantInfo)
{
return tenantInfoMapper.selectTenantInfoList(tenantInfo);
}
/**
*
*
* @param tenantInfo
* @return
*/
@Override
public int insertTenantInfo(TenantInfo tenantInfo)
{
Long price = tenantInfo.getPrice();
Long transferCount = tenantInfo.getTransferCount();
long exchangeAmount = price * transferCount;
tenantInfo.setExchangeAmount(exchangeAmount);
tenantInfo.setIsPaid(UserConstants.NO);
Long period = tenantInfo.getPeriod();
DateTime dateTime = DateUtil.offsetDay(DateUtil.date(), period.intValue());
tenantInfo.setFinishTransferTime( DateUtil.endOfDay(dateTime));
String loginName = ShiroUtils.getLoginName();
tenantInfo.setFcd(new Date());
tenantInfo.setFcu(loginName);
tenantInfo.setLcd(new Date());
tenantInfo.setLcu(loginName);
return tenantInfoMapper.insertTenantInfo(tenantInfo);
}
/**
*
*
* @param tenantInfo
* @return
*/
@Override
public int updateTenantInfo(TenantInfo tenantInfo)
{
Long price = tenantInfo.getPrice();
Long transferCount = tenantInfo.getTransferCount();
long exchangeAmount = price * transferCount;
tenantInfo.setExchangeAmount(exchangeAmount);
Long period = tenantInfo.getPeriod();
DateTime dateTime = DateUtil.offsetDay(tenantInfo.getFcd(), period.intValue());
tenantInfo.setFinishTransferTime( DateUtil.endOfDay(dateTime));
String loginName = ShiroUtils.getLoginName();
tenantInfo.setLcd(new Date());
tenantInfo.setLcu(loginName);
return tenantInfoMapper.updateTenantInfo(tenantInfo);
}
/**
*
*
* @param idTenantInfos
* @return
*/
@Override
public int deleteTenantInfoByIdTenantInfos(String idTenantInfos)
{
return tenantInfoMapper.deleteTenantInfoByIdTenantInfos(Convert.toStrArray(idTenantInfos));
}
/**
*
*
* @param idTenantInfo
* @return
*/
@Override
public int deleteTenantInfoByIdTenantInfo(Long idTenantInfo)
{
return tenantInfoMapper.deleteTenantInfoByIdTenantInfo(idTenantInfo);
}
@Override
public int activeDataTenantInfoByIdTenantInfos(String idTenantInfos) throws Exception {
String[] idArray = Convert.toStrArray(idTenantInfos);
for (String id : idArray) {
TenantInfo tenantInfo = tenantInfoMapper.selectTenantInfoByIdTenantInfo(Long.valueOf(id));
Date finishTransferTime = tenantInfo.getFinishTransferTime();
int compare = DateUtil.compare(new Date(), finishTransferTime);
Preconditions.checkState(compare <= 0, "租户已过期,无法再次委托能量");
MonitorAddressInfo monitorAddressInfoExample = new MonitorAddressInfo();
monitorAddressInfoExample.setMonitorAddress(tenantInfo.getMonitorAddress());
monitorAddressInfoExample.setIsValid(UserConstants.YES);
List<MonitorAddressInfo> monitorAddressInfoList = monitorAddressInfoMapper.selectMonitorAddressInfoList(monitorAddressInfoExample);
Preconditions.checkState(CollectionUtil.isNotEmpty(monitorAddressInfoList), "监听地址不存在或者已失效,无法再次委托能量");
MonitorAddressInfo monitorAddressInfo = monitorAddressInfoList.get(0);
TrxExchange trxExchange = new TrxExchange();
trxExchange.setFromAddress(tenantInfo.getReceiverAddress());
trxExchange.setAccountAddress(monitorAddressInfo.getAccountAddress());
trxExchange.setTransferNumber(tenantInfo.getTransferCount());
trxExchange.setLockNum(24L);
trxExchangeInfoService.delegate(trxExchange, true);
}
return 1;
}
}

View File

@ -0,0 +1,637 @@
package com.ruoyi.system.service.impl;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.ErrorLog;
import com.ruoyi.common.core.domain.entity.TenantInfo;
import com.ruoyi.common.core.domain.entity.TrxExchangeInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.encrpt.Dt;
import com.ruoyi.common.utils.http.RestTemplateUtils;
import com.ruoyi.system.domain.MonitorAddressAccount;
import com.ruoyi.system.domain.TrxExchange;
import com.ruoyi.system.dto.Contract;
import com.ruoyi.system.dto.Data;
import com.ruoyi.system.dto.TronGridResponse;
import com.ruoyi.system.dto.Value;
import com.ruoyi.system.mapper.ErrorLogMapper;
import com.ruoyi.system.mapper.TenantInfoMapper;
import com.ruoyi.system.mapper.TrxExchangeInfoMapper;
import com.ruoyi.system.service.IAccountAddressInfoService;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ITrxExchangeInfoService;
import com.ruoyi.system.util.AddressUtil;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.util.UriComponentsBuilder;
import org.tron.trident.core.ApiWrapper;
import org.tron.trident.core.exceptions.IllegalException;
import org.tron.trident.proto.Chain;
import org.tron.trident.proto.Common;
import org.tron.trident.proto.Response;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* trxService
*
* @author dorion
* @date 2024-04-13
*/
@Service
@Slf4j
public class TrxExchangeInfoServiceImpl implements ITrxExchangeInfoService {
@Autowired
private TrxExchangeInfoMapper trxExchangeInfoMapper;
@Autowired
private ISysConfigService configService;
@Autowired
private IAccountAddressInfoService accountAddressInfoService;
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private RedissonClient redissonClient;
@Autowired
private ErrorLogMapper errorLogMapper;
@Autowired
private TenantInfoMapper tenantInfoMapper;
/**
* trx
*
* @param idTrxExchangeInfo trx
* @return trx
*/
@Override
public TrxExchangeInfo selectTrxExchangeInfoByIdTrxExchangeInfo(Long idTrxExchangeInfo) {
return trxExchangeInfoMapper.selectTrxExchangeInfoByIdTrxExchangeInfo(idTrxExchangeInfo);
}
/**
* trx
*
* @param trxExchangeInfo trx
* @return trx
*/
@Override
public List<TrxExchangeInfo> selectTrxExchangeInfoList(TrxExchangeInfo trxExchangeInfo) {
return trxExchangeInfoMapper.selectTrxExchangeInfoList(trxExchangeInfo);
}
/**
* trx
*
* @param trxExchangeInfo trx
* @return
*/
@Override
public int insertTrxExchangeInfo(TrxExchangeInfo trxExchangeInfo) {
String userName = ShiroUtils.getSysUser().getUserName();
trxExchangeInfo.setFcu(userName);
trxExchangeInfo.setLcu(userName);
return trxExchangeInfoMapper.insertTrxExchangeInfo(trxExchangeInfo);
}
/**
* trx
*
* @param trxExchangeInfo trx
* @return
*/
@Override
public int updateTrxExchangeInfo(TrxExchangeInfo trxExchangeInfo) {
String userName = ShiroUtils.getSysUser().getUserName();
trxExchangeInfo.setLcu(userName);
return trxExchangeInfoMapper.updateTrxExchangeInfo(trxExchangeInfo);
}
/**
* trx
*
* @param idTrxExchangeInfos trx
* @return
*/
@Override
public int deleteTrxExchangeInfoByIdTrxExchangeInfos(String idTrxExchangeInfos) {
return trxExchangeInfoMapper.deleteTrxExchangeInfoByIdTrxExchangeInfos(Convert.toStrArray(idTrxExchangeInfos));
}
/**
* trx
*
* @param idTrxExchangeInfo trx
* @return
*/
@Override
public int deleteTrxExchangeInfoByIdTrxExchangeInfo(Long idTrxExchangeInfo) {
return trxExchangeInfoMapper.deleteTrxExchangeInfoByIdTrxExchangeInfo(idTrxExchangeInfo);
}
@Override
public int delegate(TrxExchange trxExchange,Boolean isTenant) throws Exception {
//转账笔数
Long transferNumber = trxExchange.getTransferNumber();
//实际锁定周期
long lockPeriod = trxExchange.getLockNum() * 1200;
String systronApiSwitch = configService.selectConfigByKey("sys.tron.api");
String fromAddress = trxExchange.getFromAddress();
String dictValue = DictUtils.getDictValue("sys_delegate_status", "已委托");
TrxExchangeInfo trxExchangeInfo = null;
String userName = ShiroUtils.getLoginName();
if (UserConstants.YES.equals(systronApiSwitch)) {
String accountAddress = trxExchange.getAccountAddress();
String decryptPrivateKey = accountAddressInfoService.getDecryptPrivateKey(accountAddress);
String tronApiKey = DictUtils.getDictValue("sys_tron_api_key", "synp@outlook");
ApiWrapper apiWrapper = ApiWrapper.ofMainnet(decryptPrivateKey, tronApiKey);
Response.AccountResourceMessage accountResource = apiWrapper.getAccountResource(accountAddress);
//总用于质押换取能量的trx上限
long balance = getBalance(accountResource, transferNumber);
String delegateResourceTxid = getDelegateResourceTxid(apiWrapper, accountAddress, balance, fromAddress, lockPeriod);
String busiType = DictUtils.getDictValue("sys_busi_type", "闪兑套餐");
if (isTenant){
busiType = DictUtils.getDictValue("sys_busi_type", "天数套餐");
}else if (lockPeriod > 1200 && lockPeriod <= 24*1200){
busiType = DictUtils.getDictValue("sys_busi_type", "笔数套餐");
}
trxExchangeInfo = TrxExchangeInfo.builder()
.delegateAmountTrx(balance)
.tranferCount(transferNumber)
.busiType(busiType)
.lockPeriod(lockPeriod)
.accountAddress(trxExchange.getAccountAddress())
.fromAddress(fromAddress)
.delegateTxId(delegateResourceTxid)
.delegateStatus(dictValue)
.fcu(userName)
.lcu(userName)
.build();
}else{
String busiType = DictUtils.getDictValue("sys_busi_type", "闪兑套餐");
if (isTenant){
busiType = DictUtils.getDictValue("sys_busi_type", "天数套餐");
}else if (lockPeriod > 1200 && lockPeriod <= 24*1200){
busiType = DictUtils.getDictValue("sys_busi_type", "笔数套餐");
}
trxExchangeInfo = TrxExchangeInfo.builder()
.delegateAmountTrx(0L)
.tranferCount(transferNumber)
.lockPeriod(lockPeriod)
.busiType(busiType)
.lockPeriod(lockPeriod)
.accountAddress(trxExchange.getAccountAddress())
.fromAddress(fromAddress)
.delegateStatus(dictValue)
.fcu(userName)
.lcu(userName)
.build();
}
return trxExchangeInfoMapper.insertTrxExchangeInfo(trxExchangeInfo);
}
/**
*
*
* @param monitorAddressAccount
*/
@Override
public void doMonitorTrxTransferByMonitorAddressInfo(MonitorAddressAccount monitorAddressAccount) {
String monitorAddress = monitorAddressAccount.getMonitorAddress();
String apiKey = monitorAddressAccount.getApiKey();
ResponseEntity responseEntity = null;
try {
responseEntity = getTransActionList(monitorAddress, apiKey);
} catch (Exception e) {
log.error("获取交易列表异常", e);
ErrorLog errorLog = ErrorLog.builder()
.address(monitorAddressAccount.getMonitorAddress())
.errorCode("getTransAction")
.errorMsg(e.getMessage())
.fcu("system")
.lcu("system").build();
errorLogMapper.insertErrorLog(errorLog);
throw new RuntimeException("获取交易列表异常", e);
}
Object responseEntityBody = getResponseEntityBody(responseEntity, monitorAddress);
if (responseEntityBody == null) return;
TronGridResponse tronGridResponse = JSONUtil.toBean((String) responseEntityBody, TronGridResponse.class);
if (log.isInfoEnabled()) {
log.info("{}responseEntityBody:{}", monitorAddress, JSONUtil.toJsonStr(tronGridResponse));
}
List<Data> dataList = tronGridResponse.getData();
for (Data data : dataList) {
//交易hash判断有没有处理过
String txID = data.getTxID();
Boolean hasKey = redisTemplate.hasKey("transfer_trx_" + txID);
if (hasKey) {
continue;
}
RLock lock = redissonClient.getLock("lock_" + txID);
try {
boolean res = lock.tryLock(3, 50, TimeUnit.SECONDS);
if (!res) {
//有其他程序正在处理则不需要再处理
continue;
}
Contract contract = data.getRaw_data().getContract().get(0);
String type = contract.getType();
//判断是否转账业务
if (Chain.Transaction.Contract.ContractType.TransferContract.name().equals(type)) {
//判断是否是租户
doDelegateResource(contract, txID, monitorAddressAccount);
} else {
log.info("txID:{}其他业务类型不处理:{}", txID, JSONUtil.toJsonStr(data));
}
} catch (Exception e) {
log.error("业务处理异常{},txid:{}", monitorAddress, txID, e);
ErrorLog errorLog = ErrorLog.builder()
.address(monitorAddressAccount.getMonitorAddress())
.trxId(txID)
.errorCode("doDelegateResource")
.errorMsg(e.getMessage())
.fcu("system")
.lcu("system").build();
errorLogMapper.insertErrorLog(errorLog);
} finally {
if (lock.isLocked()) {
if (lock.isHeldByCurrentThread()) {
lock.unlock();
}
}
}
}
}
/**
*
*
* @param responseEntity
* @param address
* @return
*/
private static Object getResponseEntityBody(ResponseEntity responseEntity, String address) {
if (responseEntity == null) {
log.warn("{}:responseEntity is null", address);
return null;
}
HttpStatus statusCode = responseEntity.getStatusCode();
if (statusCode != HttpStatus.OK) {
log.error("获取trx交易信息失败:{}", address);
return null;
}
Object responseEntityBody = responseEntity.getBody();
if (responseEntityBody == null) {
log.warn("{}:responseEntityBody is null", address);
return null;
}
return responseEntityBody;
}
/**
*
*
* @param address
* @param apiKey
* @return
*/
private ResponseEntity getTransActionList(String address, String apiKey) {
ResponseEntity responseEntity;
HttpHeaders headers = new HttpHeaders();
headers.add("TRON-PRO-API-KEY", apiKey);
//监听
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString("https://api.trongrid.io/v1/accounts/" + address + "/transactions");
// builder.queryParam("only_confirmed", true);
builder.queryParam("only_to", true);
builder.queryParam("limit", 200);
String sysTransferBetween = configService.selectConfigByKey("sys.transfer.between");
DateTime min_timestamp = DateUtil.offset(new Date(), DateField.MINUTE, Integer.valueOf(sysTransferBetween));
builder.queryParam("min_timestamp", min_timestamp.getTime());
String uriString = builder.toUriString();
responseEntity = RestTemplateUtils.get(uriString, headers, String.class);
return responseEntity;
}
/**
*
*
* @param contract
* @param txID
* @param monitorAddressAccount
* @throws IllegalException
*/
private void doDelegateResource(Contract contract, String txID, MonitorAddressAccount monitorAddressAccount) throws Exception {
Value value = contract.getParameter().getValue();
//转账金额需除以10的6次方精度
long amountSun = value.getAmount();
long amount = amountSun / 1000000L;
if (amount < 1) {
log.info("txID:{}金额{}小于1TRX不做处理", txID, amountSun);
return;
}
String ownerAddress = value.getOwner_address();
String toAddress = value.getTo_address();
//查询是否是按天支付的租户
TenantInfo tenantInfoExample = new TenantInfo();
tenantInfoExample.setReceiverAddress(ownerAddress);
tenantInfoExample.setMonitorAddress(monitorAddressAccount.getMonitorAddress());
tenantInfoExample.setFinishTransferTime(new Date());
tenantInfoExample.setIsPaid(UserConstants.NO);
List<TenantInfo> tenantInfoList = tenantInfoMapper.selectTenantInfoList(tenantInfoExample);
long lockPeriod = 1200L;
long transferCount = 0L;
Integer price = null;
String busiType = DictUtils.getDictValue("sys_busi_type", "闪兑套餐");
if (tenantInfoList.size() > 0) {
TenantInfo tenantInfo = tenantInfoList.get(0);
Long exchangeAmount = tenantInfo.getExchangeAmount();
//判断入账金额是否与转入金额相等,如果相等则设置为已支付
if (amount != exchangeAmount) {
log.info("txID:{}金额{}不是入账金额{}不做处理", txID, amountSun, exchangeAmount);
ErrorLog errorLog = ErrorLog.builder()
.address(ownerAddress)
.errorCode("tenantTansferAmount")
.errorMsg("金额" + amountSun + "不是入账金额" + exchangeAmount + "不做处理")
.trxId(txID)
.fcu("system")
.lcu("system").build();
errorLogMapper.insertErrorLog(errorLog);
return;
}
tenantInfo.setIsPaid("Y");
tenantInfo.setLcu("system");
tenantInfo.setTxId(txID);
tenantInfoMapper.updateTenantInfo(tenantInfo);
//取包天的套餐锁定时间和交易笔数
lockPeriod = 1200L * 24;
busiType = DictUtils.getDictValue("sys_busi_type", "天数套餐");
transferCount = tenantInfo.getTransferCount();
price = tenantInfo.getPrice().intValue();
} else {
price = monitorAddressAccount.getPrice();
transferCount = amount / price;
if (transferCount < 1) {
log.info("txID:{}金额{}不是单价的倍数不做处理", txID, amountSun);
return;
}
}
String accountAddress = monitorAddressAccount.getAccountAddress();
String encryptPrivateKey = monitorAddressAccount.getEncryptPrivateKey();
String encryptKey = monitorAddressAccount.getEncryptKey();
String decryptPrivateKey = Dt.decrypt(encryptPrivateKey, encryptKey);
// apiWrapper = ApiWrapper.ofShasta(encryptPrivateKey);
String tronApiKey = DictUtils.getDictValue("sys_tron_api_key", "synp@outlook");
ApiWrapper apiWrapper = ApiWrapper.ofMainnet(decryptPrivateKey, tronApiKey);
Response.AccountResourceMessage accountResource = apiWrapper.getAccountResource(accountAddress);
//总用于质押换取能量的trx上限
long balance = getBalance(accountResource, transferCount);
/* lock_period: 锁定周期以区块时间3s为单位表示锁定多少个区块的时间当lock为true时该字段有效。如果代理锁定期为1天则lock_period为28800*/
String delegateResourceTxid = getDelegateResourceTxid(apiWrapper, accountAddress, balance, ownerAddress, lockPeriod);
TrxExchangeInfo trxExchangeInfo = TrxExchangeInfo.builder()
.fromAddress(AddressUtil.hexToBase58(ownerAddress))
.toAddress(AddressUtil.hexToBase58(toAddress))
.accountAddress(accountAddress)
.price(Long.valueOf(price))
.trxTxId(txID)
.tranferCount(transferCount)
.busiType(busiType)
.trxAmount(amount)
.delegateAmountTrx(balance)
.delegateTxId(delegateResourceTxid)
.lockPeriod(lockPeriod)
.delegateStatus("0")
.fcd(new Date())
.fcu("system")
.lcd(new Date())
.fcu("system")
.build();
trxExchangeInfoMapper.insertTrxExchangeInfo(trxExchangeInfo);
//持久化之后放redis
redisTemplate.opsForValue().set("transfer_trx_" + txID, txID, 1, TimeUnit.DAYS);
}
private static long getBalance(Response.AccountResourceMessage accountResource, long energyNum) {
long totalEnergyLimit = accountResource.getTotalEnergyLimit();
//已经用于质押换取能量的trx
long totalEnergyWeight = accountResource.getTotalEnergyWeight();
//系数 保留一位或者保留2位,算出trx往上进一位
BigDecimal trxToFreezeEnergyTimes = BigDecimal.valueOf(totalEnergyLimit).divide(BigDecimal.valueOf(totalEnergyWeight), 2, BigDecimal.ROUND_DOWN);
//计算代理的数量
// long balance = energyNum * 32000 / 12;
long balance = BigDecimal.valueOf(energyNum * 32000).divide(trxToFreezeEnergyTimes, 0, BigDecimal.ROUND_UP).longValue();
return balance;
}
private static String getDelegateResourceTxid(ApiWrapper apiWrapper, String accountAddress, long balance, String ownerAddress, long lockPeriod) throws IllegalException {
Response.TransactionExtention transactionExtention = apiWrapper.delegateResourceV2(accountAddress, balance * 1000000, Common.ResourceCode.ENERGY_VALUE, ownerAddress, true, lockPeriod);
Chain.Transaction transaction = apiWrapper.signTransaction(transactionExtention);
String delegateResourceTxid = apiWrapper.broadcastTransaction(transaction);
return delegateResourceTxid;
}
@Override
public void doUndelegateEnergyByTrxExchangeInfo(TrxExchangeInfo trxExchangeInfo) {
Long lockPeriod = trxExchangeInfo.getLockPeriod();
Date fcd = trxExchangeInfo.getFcd();
Date now = new Date();
long betweenSeconds = DateUtil.between(fcd, now, DateUnit.SECOND);
if (betweenSeconds <= lockPeriod * 3) {
//不解锁时间不处理
return;
}
String accountAddress = trxExchangeInfo.getAccountAddress();
RLock lock = redissonClient.getLock("lock_undelegate_" + trxExchangeInfo.getDelegateTxId());
try {
String decryptPrivateKey = accountAddressInfoService.getDecryptPrivateKey(accountAddress);
boolean res = lock.tryLock(3, 50, TimeUnit.SECONDS);
if (!res) {
//有其他程序正在处理则不需要再处理
return;
}
String tronApiKey = DictUtils.getDictValue("sys_tron_api_key", "synp@outlook");
ApiWrapper apiWrapper = ApiWrapper.ofMainnet(decryptPrivateKey, tronApiKey);
//回收能量
doUndelegateEnergy(trxExchangeInfo, apiWrapper);
//查询是否是按天支付的租户,是的话需要回收完再次赠送
TenantInfo tenantInfoExample = new TenantInfo();
tenantInfoExample.setReceiverAddress(trxExchangeInfo.getFromAddress());
tenantInfoExample.setMonitorAddress(trxExchangeInfo.getToAddress());
tenantInfoExample.setFinishTransferTime(new Date());
List<TenantInfo> tenantInfoList = tenantInfoMapper.selectTenantInfoList(tenantInfoExample);
if (tenantInfoList.size() > 0) {
Response.AccountResourceMessage accountResource = apiWrapper.getAccountResource(accountAddress);
TenantInfo tenantInfo = tenantInfoList.get(0);
if (UserConstants.NO.equals(tenantInfo.getIsPaid())){
return;
}
Long period = tenantInfo.getPeriod();
Date tenantInfoFcd = tenantInfo.getFcd();
long between = DateUtil.between(tenantInfoFcd, new Date(), DateUnit.DAY);
if (between > period) {
//已到期不处理
return;
}
Long transferCount = tenantInfo.getTransferCount();
long balance = getBalance(accountResource, transferCount);
String receiverAddress = tenantInfo.getReceiverAddress();
/* lock_period: 锁定周期以区块时间3s为单位表示锁定多少个区块的时间当lock为true时该字段有效。如果代理锁定期为1天则lock_period为28800*/
long newLockPeriod = 24 * 1200L;
String delegateResourceTxid = getDelegateResourceTxid(apiWrapper, accountAddress, balance, receiverAddress, newLockPeriod);
TrxExchangeInfo trxExchangeInfoNew = TrxExchangeInfo.builder()
.fromAddress(receiverAddress)
.toAddress(accountAddress)
.accountAddress(accountAddress)
.price(tenantInfo.getPrice())
.trxTxId(tenantInfo.getTxId())
.tranferCount(transferCount)
.busiType(DictUtils.getDictValue("sys_busi_type", "天数套餐"))
.trxAmount(null)
.delegateAmountTrx(balance)
.delegateTxId(delegateResourceTxid)
.lockPeriod(newLockPeriod)
.delegateStatus("0")
.fcd(new Date())
.fcu("system")
.lcd(new Date())
.fcu("system")
.build();
trxExchangeInfoMapper.insertTrxExchangeInfo(trxExchangeInfoNew);
}
} catch (Exception e) {
log.error("回收能量业务处理异常{}", trxExchangeInfo.getIdTrxExchangeInfo(), e);
ErrorLog errorLog = ErrorLog.builder()
.address(accountAddress)
.errorCode("UndelegateEnergy")
.errorMsg(e.getMessage())
.trxId(trxExchangeInfo.getDelegateTxId())
.otherId(trxExchangeInfo.getIdTrxExchangeInfo().toString())
.fcu("system")
.lcu("system").build();
errorLogMapper.insertErrorLog(errorLog);
throw new RuntimeException("回收能量业务处理异常", e);
} finally {
if (lock.isLocked()) {
if (lock.isHeldByCurrentThread()) {
lock.unlock();
}
}
}
}
/**
*
*
* @param trxExchangeInfo
* @param apiWrapper
* @throws IllegalException
*/
private void doUndelegateEnergy(TrxExchangeInfo trxExchangeInfo, ApiWrapper apiWrapper) throws IllegalException {
String accountAddress = trxExchangeInfo.getAccountAddress();
String fromAddress = trxExchangeInfo.getFromAddress();
long balance = trxExchangeInfo.getDelegateAmountTrx() * 1000000;
Response.TransactionExtention transactionExtention = apiWrapper.undelegateResource(accountAddress,
balance, Common.ResourceCode.ENERGY_VALUE, fromAddress);
Chain.Transaction transaction = apiWrapper.signTransaction(transactionExtention);
String unDelegateTxId = apiWrapper.broadcastTransaction(transaction);
String dictValue = DictUtils.getDictValue("sys_delegate_status", "已回收");
trxExchangeInfo.setDelegateStatus(dictValue);
trxExchangeInfo.setUnDelegateTxId(unDelegateTxId);
trxExchangeInfo.setLcd(new Date());
trxExchangeInfo.setLcu("system");
trxExchangeInfoMapper.updateTrxExchangeInfo(trxExchangeInfo);
}
}

View File

@ -0,0 +1,12 @@
package com.ruoyi.system.util;
import com.google.protobuf.ByteString;
import org.tron.trident.core.ApiWrapper;
import org.tron.trident.utils.Base58Check;
public class AddressUtil {
public static String hexToBase58(String address) {
ByteString bytes = ApiWrapper.parseAddress(address);
return Base58Check.bytesToBase58(bytes.toByteArray());
}
}

View File

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.AccountAddressInfoMapper">
<resultMap type="AccountAddressInfo" id="AccountAddressInfoResult">
<result property="idAccoutAddressInfo" column="id_accout_address_info" />
<result property="address" column="address" />
<result property="encryptPrivateKey" column="encrypt_private_key" />
<result property="encryptKey" column="encrypt_key" />
<result property="isValid" column="is_valid" />
<result property="fcd" column="fcd" />
<result property="fcu" column="fcu" />
<result property="lcd" column="lcd" />
<result property="lcu" column="lcu" />
</resultMap>
<sql id="selectAccountAddressInfoVo">
select id_accout_address_info, address, encrypt_private_key, encrypt_key, is_valid, fcd, fcu, lcd, lcu from account_address_info
</sql>
<select id="selectAccountAddressInfoList" parameterType="AccountAddressInfo" resultMap="AccountAddressInfoResult">
<include refid="selectAccountAddressInfoVo"/>
<where>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="encryptPrivateKey != null and encryptPrivateKey != ''"> and encrypt_private_key = #{encryptPrivateKey}</if>
<if test="encryptKey != null and encryptKey != ''"> and encrypt_key = #{encryptKey}</if>
<if test="isValid != null and isValid != ''"> and is_valid = #{isValid}</if>
<if test="fcd != null "> and fcd = #{fcd}</if>
<if test="fcu != null and fcu != ''"> and fcu = #{fcu}</if>
<if test="lcd != null "> and lcd = #{lcd}</if>
<if test="lcu != null and lcu != ''"> and lcu = #{lcu}</if>
</where>
</select>
<select id="selectAccountAddressInfoByIdAccoutAddressInfo" parameterType="Long" resultMap="AccountAddressInfoResult">
<include refid="selectAccountAddressInfoVo"/>
where id_accout_address_info = #{idAccoutAddressInfo}
</select>
<insert id="insertAccountAddressInfo" parameterType="AccountAddressInfo" useGeneratedKeys="true" keyProperty="idAccoutAddressInfo">
insert into account_address_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="address != null">address,</if>
<if test="encryptPrivateKey != null">encrypt_private_key,</if>
<if test="encryptKey != null">encrypt_key,</if>
<if test="isValid != null">is_valid,</if>
<if test="fcd != null">fcd,</if>
<if test="fcu != null">fcu,</if>
<if test="lcd != null">lcd,</if>
<if test="lcu != null">lcu,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="address != null">#{address},</if>
<if test="encryptPrivateKey != null">#{encryptPrivateKey},</if>
<if test="encryptKey != null">#{encryptKey},</if>
<if test="isValid != null">#{isValid},</if>
<if test="fcd != null">#{fcd},</if>
<if test="fcu != null">#{fcu},</if>
<if test="lcd != null">#{lcd},</if>
<if test="lcu != null">#{lcu},</if>
</trim>
</insert>
<update id="updateAccountAddressInfo" parameterType="AccountAddressInfo">
update account_address_info
<trim prefix="SET" suffixOverrides=",">
<if test="address != null">address = #{address},</if>
<if test="encryptPrivateKey != null">encrypt_private_key = #{encryptPrivateKey},</if>
<if test="encryptKey != null">encrypt_key = #{encryptKey},</if>
<if test="isValid != null">is_valid = #{isValid},</if>
<if test="fcd != null">fcd = #{fcd},</if>
<if test="fcu != null">fcu = #{fcu},</if>
<if test="lcd != null">lcd = #{lcd},</if>
<if test="lcu != null">lcu = #{lcu},</if>
</trim>
where id_accout_address_info = #{idAccoutAddressInfo}
</update>
<delete id="deleteAccountAddressInfoByIdAccoutAddressInfo" parameterType="Long">
delete from account_address_info where id_accout_address_info = #{idAccoutAddressInfo}
</delete>
<delete id="deleteAccountAddressInfoByIdAccoutAddressInfos" parameterType="String">
delete from account_address_info where id_accout_address_info in
<foreach item="idAccoutAddressInfo" collection="array" open="(" separator="," close=")">
#{idAccoutAddressInfo}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.FreezeBalanceInfoMapper">
<resultMap type="FreezeBalanceInfo" id="FreezeBalanceInfoResult">
<result property="idFreezeBalanceInfo" column="id_freeze_balance_info" />
<result property="address" column="address" />
<result property="freezeTrxAmount" column="freeze_trx_amount" />
<result property="exchangeResourceType" column="exchange_resource_type" />
<result property="txId" column="tx_id" />
<result property="fcd" column="fcd" />
<result property="fcu" column="fcu" />
<result property="lcd" column="lcd" />
<result property="lcu" column="lcu" />
</resultMap>
<sql id="selectFreezeBalanceInfoVo">
select id_freeze_balance_info, address, freeze_trx_amount, exchange_resource_type, tx_id, fcd, fcu, lcd, lcu from freeze_balance_info
</sql>
<select id="selectFreezeBalanceInfoList" parameterType="FreezeBalanceInfo" resultMap="FreezeBalanceInfoResult">
<include refid="selectFreezeBalanceInfoVo"/>
<where>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="freezeTrxAmount != null "> and freeze_trx_amount = #{freezeTrxAmount}</if>
<if test="exchangeResourceType != null and exchangeResourceType != ''"> and exchange_resource_type = #{exchangeResourceType}</if>
<if test="txId != null and txId != ''"> and tx_id = #{txId}</if>
<if test="fcd != null "> and fcd = #{fcd}</if>
<if test="fcu != null and fcu != ''"> and fcu = #{fcu}</if>
<if test="lcd != null "> and lcd = #{lcd}</if>
<if test="lcu != null and lcu != ''"> and lcu = #{lcu}</if>
</where>
</select>
<select id="selectFreezeBalanceInfoByIdFreezeBalanceInfo" parameterType="Long" resultMap="FreezeBalanceInfoResult">
<include refid="selectFreezeBalanceInfoVo"/>
where id_freeze_balance_info = #{idFreezeBalanceInfo}
</select>
<insert id="insertFreezeBalanceInfo" parameterType="FreezeBalanceInfo" useGeneratedKeys="true" keyProperty="idFreezeBalanceInfo">
insert into freeze_balance_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="address != null">address,</if>
<if test="freezeTrxAmount != null">freeze_trx_amount,</if>
<if test="exchangeResourceType != null">exchange_resource_type,</if>
<if test="txId != null">tx_id,</if>
<if test="fcd != null">fcd,</if>
<if test="fcu != null">fcu,</if>
<if test="lcd != null">lcd,</if>
<if test="lcu != null">lcu,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="address != null">#{address},</if>
<if test="freezeTrxAmount != null">#{freezeTrxAmount},</if>
<if test="exchangeResourceType != null">#{exchangeResourceType},</if>
<if test="txId != null">#{txId},</if>
<if test="fcd != null">#{fcd},</if>
<if test="fcu != null">#{fcu},</if>
<if test="lcd != null">#{lcd},</if>
<if test="lcu != null">#{lcu},</if>
</trim>
</insert>
<update id="updateFreezeBalanceInfo" parameterType="FreezeBalanceInfo">
update freeze_balance_info
<trim prefix="SET" suffixOverrides=",">
<if test="address != null">address = #{address},</if>
<if test="freezeTrxAmount != null">freeze_trx_amount = #{freezeTrxAmount},</if>
<if test="exchangeResourceType != null">exchange_resource_type = #{exchangeResourceType},</if>
<if test="txId != null">tx_id = #{txId},</if>
<if test="fcd != null">fcd = #{fcd},</if>
<if test="fcu != null">fcu = #{fcu},</if>
<if test="lcd != null">lcd = #{lcd},</if>
<if test="lcu != null">lcu = #{lcu},</if>
</trim>
where id_freeze_balance_info = #{idFreezeBalanceInfo}
</update>
<delete id="deleteFreezeBalanceInfoByIdFreezeBalanceInfo" parameterType="Long">
delete from freeze_balance_info where id_freeze_balance_info = #{idFreezeBalanceInfo}
</delete>
<delete id="deleteFreezeBalanceInfoByIdFreezeBalanceInfos" parameterType="String">
delete from freeze_balance_info where id_freeze_balance_info in
<foreach item="idFreezeBalanceInfo" collection="array" open="(" separator="," close=")">
#{idFreezeBalanceInfo}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.MonitorAddressInfoMapper">
<resultMap type="MonitorAddressInfo" id="MonitorAddressInfoResult">
<result property="idMonitorAddress" column="id_monitor_address" />
<result property="monitorAddress" column="monitor_address" />
<result property="accountAddress" column="account_address" />
<result property="price" column="price" />
<result property="monitorType" column="monitor_type" />
<result property="apiKey" column="api_key" />
<result property="isValid" column="is_valid" />
<result property="fcd" column="fcd" />
<result property="fcu" column="fcu" />
<result property="lcd" column="lcd" />
<result property="lcu" column="lcu" />
</resultMap>
<sql id="selectMonitorAddressInfoVo">
select id_monitor_address, monitor_address, account_address, price, monitor_type, api_key, is_valid, fcd, fcu, lcd, lcu from monitor_address_info
</sql>
<select id="selectMonitorAddressInfoList" parameterType="MonitorAddressInfo" resultMap="MonitorAddressInfoResult">
<include refid="selectMonitorAddressInfoVo"/>
<where>
<if test="monitorAddress != null and monitorAddress != ''"> and monitor_address = #{monitorAddress}</if>
<if test="accountAddress != null and accountAddress != ''"> and account_address = #{accountAddress}</if>
<if test="price != null "> and price = #{price}</if>
<if test="monitorType != null and monitorType != ''"> and monitor_type = #{monitorType}</if>
<if test="apiKey != null and apiKey != ''"> and api_key = #{apiKey}</if>
<if test="isValid != null and isValid != ''"> and is_valid = #{isValid}</if>
<if test="fcd != null "> and fcd = #{fcd}</if>
<if test="fcu != null and fcu != ''"> and fcu = #{fcu}</if>
<if test="lcd != null "> and lcd = #{lcd}</if>
<if test="lcu != null and lcu != ''"> and lcu = #{lcu}</if>
</where>
</select>
<select id="selectMonitorAddressInfoByIdMonitorAddress" parameterType="Long" resultMap="MonitorAddressInfoResult">
<include refid="selectMonitorAddressInfoVo"/>
where id_monitor_address = #{idMonitorAddress}
</select>
<insert id="insertMonitorAddressInfo" parameterType="MonitorAddressInfo" useGeneratedKeys="true" keyProperty="idMonitorAddress">
insert into monitor_address_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monitorAddress != null">monitor_address,</if>
<if test="accountAddress != null">account_address,</if>
<if test="price != null">price,</if>
<if test="monitorType != null">monitor_type,</if>
<if test="apiKey != null">api_key,</if>
<if test="isValid != null">is_valid,</if>
<if test="fcd != null">fcd,</if>
<if test="fcu != null">fcu,</if>
<if test="lcd != null">lcd,</if>
<if test="lcu != null">lcu,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monitorAddress != null">#{monitorAddress},</if>
<if test="accountAddress != null">#{accountAddress},</if>
<if test="price != null">#{price},</if>
<if test="monitorType != null">#{monitorType},</if>
<if test="apiKey != null">#{apiKey},</if>
<if test="isValid != null">#{isValid},</if>
<if test="fcd != null">#{fcd},</if>
<if test="fcu != null">#{fcu},</if>
<if test="lcd != null">#{lcd},</if>
<if test="lcu != null">#{lcu},</if>
</trim>
</insert>
<update id="updateMonitorAddressInfo" parameterType="MonitorAddressInfo">
update monitor_address_info
<trim prefix="SET" suffixOverrides=",">
<if test="monitorAddress != null">monitor_address = #{monitorAddress},</if>
<if test="accountAddress != null">account_address = #{accountAddress},</if>
<if test="price != null">price = #{price},</if>
<if test="monitorType != null">monitor_type = #{monitorType},</if>
<if test="apiKey != null">api_key = #{apiKey},</if>
<if test="isValid != null">is_valid = #{isValid},</if>
<if test="fcd != null">fcd = #{fcd},</if>
<if test="fcu != null">fcu = #{fcu},</if>
<if test="lcd != null">lcd = #{lcd},</if>
<if test="lcu != null">lcu = #{lcu},</if>
</trim>
where id_monitor_address = #{idMonitorAddress}
</update>
<delete id="deleteMonitorAddressInfoByIdMonitorAddress" parameterType="Long">
delete from monitor_address_info where id_monitor_address = #{idMonitorAddress}
</delete>
<delete id="deleteMonitorAddressInfoByIdMonitorAddresss" parameterType="String">
delete from monitor_address_info where id_monitor_address in
<foreach item="idMonitorAddress" collection="array" open="(" separator="," close=")">
#{idMonitorAddress}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TenantInfoMapper">
<resultMap type="TenantInfo" id="TenantInfoResult">
<result property="idTenantInfo" column="id_tenant_info" />
<result property="receiverAddress" column="receiver_address" />
<result property="monitorAddress" column="monitor_address" />
<result property="price" column="price" />
<result property="transferCount" column="transfer_count" />
<result property="exchangeUnit" column="exchange_unit" />
<result property="txId" column="tx_id" />
<result property="exchangeAmount" column="exchange_amount" />
<result property="isPaid" column="is_paid" />
<result property="period" column="period" />
<result property="finishTransferTime" column="finish_transfer_time" />
<result property="fcd" column="fcd" />
<result property="fcu" column="fcu" />
<result property="lcd" column="lcd" />
<result property="lcu" column="lcu" />
</resultMap>
<sql id="selectTenantInfoVo">
select id_tenant_info, receiver_address, monitor_address, price, transfer_count, exchange_unit, tx_id, exchange_amount, is_paid, period, finish_transfer_time, fcd, fcu, lcd, lcu from tenant_info
</sql>
<select id="selectTenantInfoList" parameterType="TenantInfo" resultMap="TenantInfoResult">
<include refid="selectTenantInfoVo"/>
<where>
<if test="receiverAddress != null and receiverAddress != ''"> and receiver_address = #{receiverAddress}</if>
<if test="monitorAddress != null and monitorAddress != ''"> and monitor_address = #{monitorAddress}</if>
<if test="price != null "> and price = #{price}</if>
<if test="transferCount != null "> and transfer_count = #{transferCount}</if>
<if test="exchangeUnit != null and exchangeUnit != ''"> and exchange_unit = #{exchangeUnit}</if>
<if test="txId != null and txId != ''"> and tx_id = #{txId}</if>
<if test="exchangeAmount != null "> and exchange_amount = #{exchangeAmount}</if>
<if test="isPaid != null and isPaid != ''"> and is_paid = #{isPaid}</if>
<if test="period != null "> and period = #{period}</if>
<if test="finishTransferTime != null "> and finish_transfer_time &gt;= #{finishTransferTime}</if>
<if test="fcd != null "> and fcd &gt;= #{fcd}</if>
<if test="fcu != null and fcu != ''"> and fcu = #{fcu}</if>
<if test="lcd != null "> and lcd &lt;= #{lcd}</if>
<if test="lcu != null and lcu != ''"> and lcu = #{lcu}</if>
</where>
</select>
<select id="selectTenantInfoByIdTenantInfo" parameterType="Long" resultMap="TenantInfoResult">
<include refid="selectTenantInfoVo"/>
where id_tenant_info = #{idTenantInfo}
</select>
<insert id="insertTenantInfo" parameterType="TenantInfo" useGeneratedKeys="true" keyProperty="idTenantInfo">
insert into tenant_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="receiverAddress != null and receiverAddress != ''">receiver_address,</if>
<if test="monitorAddress != null">monitor_address,</if>
<if test="price != null">price,</if>
<if test="transferCount != null">transfer_count,</if>
<if test="exchangeUnit != null">exchange_unit,</if>
<if test="txId != null">tx_id,</if>
<if test="exchangeAmount != null">exchange_amount,</if>
<if test="isPaid != null">is_paid,</if>
<if test="period != null">period,</if>
<if test="finishTransferTime != null">finish_transfer_time,</if>
<if test="fcd != null">fcd,</if>
<if test="fcu != null">fcu,</if>
<if test="lcd != null">lcd,</if>
<if test="lcu != null">lcu,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="receiverAddress != null and receiverAddress != ''">#{receiverAddress},</if>
<if test="monitorAddress != null">#{monitorAddress},</if>
<if test="price != null">#{price},</if>
<if test="transferCount != null">#{transferCount},</if>
<if test="exchangeUnit != null">#{exchangeUnit},</if>
<if test="txId != null">#{txId},</if>
<if test="exchangeAmount != null">#{exchangeAmount},</if>
<if test="isPaid != null">#{isPaid},</if>
<if test="period != null">#{period},</if>
<if test="finishTransferTime != null">#{finishTransferTime},</if>
<if test="fcd != null">#{fcd},</if>
<if test="fcu != null">#{fcu},</if>
<if test="lcd != null">#{lcd},</if>
<if test="lcu != null">#{lcu},</if>
</trim>
</insert>
<update id="updateTenantInfo" parameterType="TenantInfo">
update tenant_info
<trim prefix="SET" suffixOverrides=",">
<if test="receiverAddress != null and receiverAddress != ''">receiver_address = #{receiverAddress},</if>
<if test="monitorAddress != null">monitor_address = #{monitorAddress},</if>
<if test="price != null">price = #{price},</if>
<if test="transferCount != null">transfer_count = #{transferCount},</if>
<if test="exchangeUnit != null">exchange_unit = #{exchangeUnit},</if>
<if test="txId != null">tx_id = #{txId},</if>
<if test="exchangeAmount != null">exchange_amount = #{exchangeAmount},</if>
<if test="isPaid != null">is_paid = #{isPaid},</if>
<if test="period != null">period = #{period},</if>
<if test="finishTransferTime != null">finish_transfer_time = #{finishTransferTime},</if>
<if test="fcd != null">fcd = #{fcd},</if>
<if test="fcu != null">fcu = #{fcu},</if>
<if test="lcd != null">lcd = #{lcd},</if>
<if test="lcu != null">lcu = #{lcu},</if>
</trim>
where id_tenant_info = #{idTenantInfo}
</update>
<delete id="deleteTenantInfoByIdTenantInfo" parameterType="Long">
delete from tenant_info where id_tenant_info = #{idTenantInfo}
</delete>
<delete id="deleteTenantInfoByIdTenantInfos" parameterType="String">
delete from tenant_info where id_tenant_info in
<foreach item="idTenantInfo" collection="array" open="(" separator="," close=")">
#{idTenantInfo}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TrxExchangeInfoMapper">
<resultMap type="TrxExchangeInfo" id="TrxExchangeInfoResult">
<result property="idTrxExchangeInfo" column="id_trx_exchange_info" />
<result property="fromAddress" column="from_address" />
<result property="toAddress" column="to_address" />
<result property="accountAddress" column="account_address" />
<result property="price" column="price" />
<result property="trxTxId" column="trx_tx_id" />
<result property="tranferCount" column="tranfer_count" />
<result property="busiType" column="busi_type" />
<result property="trxAmount" column="trx_amount" />
<result property="delegateAmountTrx" column="delegate_amount_trx" />
<result property="delegateTxId" column="delegate_tx_id" />
<result property="lockPeriod" column="lock_period" />
<result property="delegateStatus" column="delegate_status" />
<result property="unDelegateTxId" column="un_delegate_tx_id" />
<result property="fcd" column="fcd" />
<result property="fcu" column="fcu" />
<result property="lcd" column="lcd" />
<result property="lcu" column="lcu" />
</resultMap>
<sql id="selectTrxExchangeInfoVo">
select id_trx_exchange_info, from_address, to_address, account_address, price, trx_tx_id, tranfer_count, busi_type, trx_amount, delegate_amount_trx, delegate_tx_id, lock_period, delegate_status, un_delegate_tx_id, fcd, fcu, lcd, lcu from trx_exchange_info
</sql>
<select id="selectTrxExchangeInfoList" parameterType="TrxExchangeInfo" resultMap="TrxExchangeInfoResult">
<include refid="selectTrxExchangeInfoVo"/>
<where> 1=1
<if test="fromAddress != null and fromAddress != ''"> and from_address = #{fromAddress}</if>
<if test="toAddress != null and toAddress != ''"> and to_address = #{toAddress}</if>
<if test="accountAddress != null and accountAddress != ''"> and account_address = #{accountAddress}</if>
<if test="price != null "> and price = #{price}</if>
<if test="trxTxId != null and trxTxId != ''"> and trx_tx_id = #{trxTxId}</if>
<if test="tranferCount != null "> and tranfer_count = #{tranferCount}</if>
<if test="busiType != null and busiType != ''"> and busi_type = #{busiType}</if>
<if test="trxAmount != null "> and trx_amount = #{trxAmount}</if>
<if test="delegateAmountTrx != null "> and delegate_amount_trx = #{delegateAmountTrx}</if>
<if test="delegateTxId != null and delegateTxId != ''"> and delegate_tx_id = #{delegateTxId}</if>
<if test="lockPeriod != null "> and lock_period = #{lockPeriod}</if>
<if test="delegateStatus != null and delegateStatus != ''"> and delegate_status = #{delegateStatus}</if>
<if test="unDelegateTxId != null and unDelegateTxId != ''"> and un_delegate_tx_id = #{unDelegateTxId}</if>
<if test="fcd != null "> and fcd &gt;= #{fcd}</if>
<if test="fcu != null and fcu != ''"> and fcu = #{fcu}</if>
<if test="lcd != null "> and lcd &lt;= #{lcd}</if>
<if test="lcu != null and lcu != ''"> and lcu = #{lcu}</if>
order by fcd desc
</where>
</select>
<select id="selectTrxExchangeInfoByIdTrxExchangeInfo" parameterType="Long" resultMap="TrxExchangeInfoResult">
<include refid="selectTrxExchangeInfoVo"/>
where id_trx_exchange_info = #{idTrxExchangeInfo}
</select>
<insert id="insertTrxExchangeInfo" parameterType="TrxExchangeInfo" useGeneratedKeys="true" keyProperty="idTrxExchangeInfo">
insert into trx_exchange_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fromAddress != null">from_address,</if>
<if test="toAddress != null">to_address,</if>
<if test="accountAddress != null">account_address,</if>
<if test="price != null">price,</if>
<if test="trxTxId != null">trx_tx_id,</if>
<if test="tranferCount != null">tranfer_count,</if>
<if test="busiType != null">busi_type,</if>
<if test="trxAmount != null">trx_amount,</if>
<if test="delegateAmountTrx != null">delegate_amount_trx,</if>
<if test="delegateTxId != null">delegate_tx_id,</if>
<if test="lockPeriod != null">lock_period,</if>
<if test="delegateStatus != null">delegate_status,</if>
<if test="unDelegateTxId != null">un_delegate_tx_id,</if>
<if test="fcd != null">fcd,</if>
<if test="fcu != null">fcu,</if>
<if test="lcd != null">lcd,</if>
<if test="lcu != null">lcu,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fromAddress != null">#{fromAddress},</if>
<if test="toAddress != null">#{toAddress},</if>
<if test="accountAddress != null">#{accountAddress},</if>
<if test="price != null">#{price},</if>
<if test="trxTxId != null">#{trxTxId},</if>
<if test="tranferCount != null">#{tranferCount},</if>
<if test="busiType != null">#{busiType},</if>
<if test="trxAmount != null">#{trxAmount},</if>
<if test="delegateAmountTrx != null">#{delegateAmountTrx},</if>
<if test="delegateTxId != null">#{delegateTxId},</if>
<if test="lockPeriod != null">#{lockPeriod},</if>
<if test="delegateStatus != null">#{delegateStatus},</if>
<if test="unDelegateTxId != null">#{unDelegateTxId},</if>
<if test="fcd != null">#{fcd},</if>
<if test="fcu != null">#{fcu},</if>
<if test="lcd != null">#{lcd},</if>
<if test="lcu != null">#{lcu},</if>
</trim>
</insert>
<update id="updateTrxExchangeInfo" parameterType="TrxExchangeInfo">
update trx_exchange_info
<trim prefix="SET" suffixOverrides=",">
<if test="fromAddress != null">from_address = #{fromAddress},</if>
<if test="toAddress != null">to_address = #{toAddress},</if>
<if test="accountAddress != null">account_address = #{accountAddress},</if>
<if test="price != null">price = #{price},</if>
<if test="trxTxId != null">trx_tx_id = #{trxTxId},</if>
<if test="tranferCount != null">tranfer_count = #{tranferCount},</if>
<if test="busiType != null">busi_type = #{busiType},</if>
<if test="trxAmount != null">trx_amount = #{trxAmount},</if>
<if test="delegateAmountTrx != null">delegate_amount_trx = #{delegateAmountTrx},</if>
<if test="delegateTxId != null">delegate_tx_id = #{delegateTxId},</if>
<if test="lockPeriod != null">lock_period = #{lockPeriod},</if>
<if test="delegateStatus != null">delegate_status = #{delegateStatus},</if>
<if test="unDelegateTxId != null">un_delegate_tx_id = #{unDelegateTxId},</if>
<if test="fcd != null">fcd = #{fcd},</if>
<if test="fcu != null">fcu = #{fcu},</if>
<if test="lcd != null">lcd = #{lcd},</if>
<if test="lcu != null">lcu = #{lcu},</if>
</trim>
where id_trx_exchange_info = #{idTrxExchangeInfo}
</update>
<delete id="deleteTrxExchangeInfoByIdTrxExchangeInfo" parameterType="Long">
delete from trx_exchange_info where id_trx_exchange_info = #{idTrxExchangeInfo}
</delete>
<delete id="deleteTrxExchangeInfoByIdTrxExchangeInfos" parameterType="String">
delete from trx_exchange_info where id_trx_exchange_info in
<foreach item="idTrxExchangeInfo" collection="array" open="(" separator="," close=")">
#{idTrxExchangeInfo}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.ErrorLogMapper">
<resultMap type="ErrorLog" id="ErrorLogResult">
<result property="idErrorLog" column="id_error_log" />
<result property="address" column="address" />
<result property="trxId" column="trx_id" />
<result property="otherId" column="other_id" />
<result property="errorCode" column="error_code" />
<result property="errorMsg" column="error_msg" />
<result property="fcd" column="fcd" />
<result property="fcu" column="fcu" />
<result property="lcd" column="lcd" />
<result property="lcu" column="lcu" />
</resultMap>
<sql id="selectErrorLogVo">
select id_error_log, address, trx_id, other_id, error_code, error_msg, fcd, fcu, lcd, lcu from error_log
</sql>
<select id="selectErrorLogList" parameterType="ErrorLog" resultMap="ErrorLogResult">
<include refid="selectErrorLogVo"/>
<where>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="trxId != null and trxId != ''"> and trx_id = #{trxId}</if>
<if test="otherId != null and otherId != ''"> and other_id = #{otherId}</if>
<if test="errorCode != null and errorCode != ''"> and error_code = #{errorCode}</if>
<if test="errorMsg != null and errorMsg != ''"> and error_msg = #{errorMsg}</if>
<if test="fcd != null "> and fcd = #{fcd}</if>
<if test="fcu != null and fcu != ''"> and fcu = #{fcu}</if>
<if test="lcd != null "> and lcd = #{lcd}</if>
<if test="lcu != null and lcu != ''"> and lcu = #{lcu}</if>
</where>
</select>
<select id="selectErrorLogByIdErrorLog" parameterType="Long" resultMap="ErrorLogResult">
<include refid="selectErrorLogVo"/>
where id_error_log = #{idErrorLog}
</select>
<insert id="insertErrorLog" parameterType="ErrorLog" useGeneratedKeys="true" keyProperty="idErrorLog">
insert into error_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="address != null">address,</if>
<if test="trxId != null">trx_id,</if>
<if test="otherId != null">other_id,</if>
<if test="errorCode != null">error_code,</if>
<if test="errorMsg != null">error_msg,</if>
<if test="fcd != null">fcd,</if>
<if test="fcu != null">fcu,</if>
<if test="lcd != null">lcd,</if>
<if test="lcu != null">lcu,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="address != null">#{address},</if>
<if test="trxId != null">#{trxId},</if>
<if test="otherId != null">#{otherId},</if>
<if test="errorCode != null">#{errorCode},</if>
<if test="errorMsg != null">#{errorMsg},</if>
<if test="fcd != null">#{fcd},</if>
<if test="fcu != null">#{fcu},</if>
<if test="lcd != null">#{lcd},</if>
<if test="lcu != null">#{lcu},</if>
</trim>
</insert>
<update id="updateErrorLog" parameterType="ErrorLog">
update error_log
<trim prefix="SET" suffixOverrides=",">
<if test="address != null">address = #{address},</if>
<if test="trxId != null">trx_id = #{trxId},</if>
<if test="otherId != null">other_id = #{otherId},</if>
<if test="errorCode != null">error_code = #{errorCode},</if>
<if test="errorMsg != null">error_msg = #{errorMsg},</if>
<if test="fcd != null">fcd = #{fcd},</if>
<if test="fcu != null">fcu = #{fcu},</if>
<if test="lcd != null">lcd = #{lcd},</if>
<if test="lcu != null">lcu = #{lcu},</if>
</trim>
where id_error_log = #{idErrorLog}
</update>
<delete id="deleteErrorLogByIdErrorLog" parameterType="Long">
delete from error_log where id_error_log = #{idErrorLog}
</delete>
<delete id="deleteErrorLogByIdErrorLogs" parameterType="String">
delete from error_log where id_error_log in
<foreach item="idErrorLog" collection="array" open="(" separator="," close=")">
#{idErrorLog}
</foreach>
</delete>
</mapper>

View File

@ -2,7 +2,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang='en' xmlns='http://www.w3.org/1999/xhtml' > <html lang='en' xmlns='http://www.w3.org/1999/xhtml' >
<head> <head>
<title>RuoYi</title> <title>后台管理</title>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
@ -238,7 +238,7 @@ body {
<!-- == Legend == --> <!-- == Legend == -->
<g transform='translate(10,10)'> <g transform='translate(10,10)'>
<rect x='10' y='10' width='330' height='56' rx='6' ry='6' style='fill:url(#legendGradient);filter:url(#shadow);'/> <rect x='10' y='10' width='330' height='56' rx='6' ry='6' style='fill:url(#legendGradient);filter:url(#shadow);'/>
<text x='20' y='43'>RuoYi</text> <text x='20' y='43'>后台管理</text>
<text x='20' y='57' style='fill:#aaaaaa; font-size:11px;'><tspan>Move the mouse over tables &amp; columns to read the comments.</tspan></text> <text x='20' y='57' style='fill:#aaaaaa; font-size:11px;'><tspan>Move the mouse over tables &amp; columns to read the comments.</tspan></text>
<a xlink:href='https://www.dbschema.com'> <path class='logo' d='m 32.309685,20.963194 c 0.411708,4.732616 -4.298055,7.925636 -8.723583,6.970196 -6.616967,1.8448 -2.656457,-6.434594 -3.911969,-10.01566 -2.15469,-5.89407 6.06247,-3.508505 9.167655,-2.863689 2.199228,1.054873 3.389343,3.582089 3.467897,5.909153 z m -3.720955,0.01451 c 0.434195,-4.414565 -7.644142,-5.37533 -5.137307,0.107342 -1.812268,5.992146 5.532698,4.379388 5.137307,-0.107342 z' /> <path class='logo' d='m 44.329732,23.050637 c 0.850982,5.097305 -5.250434,4.558924 -7.144836,4.752415 -6.418993,1.64391 -1.872992,-7.49274 -3.541914,-10.942842 -2.499646,-3.817859 5.939283,-4.402698 3.538545,-0.13612 -1.287874,4.989123 4.215411,-1.154796 5.956717,2.809584 0.840273,0.970849 1.168829,2.272413 1.191488,3.516963 z m -3.519477,-0.09299 c -1.398216,-5.518069 -6.361061,2.717467 -0.984368,1.810718 0.686994,-0.30388 1.029454,-1.087638 0.984368,-1.810718 z' /> <path class='logo' d='m 52.234961,23.301163 c 0.954818,5.035675 -8.606408,6.284861 -6.262292,1.674914 6.000358,-1.604717 -5.188764,-7.870044 1.75972,-10.384908 2.288682,-3.253567 6.399287,3.075831 2.304111,2.48058 -2.124941,2.016587 2.688777,3.89858 2.198472,6.229403 z' /> <path class='logo' d='m 60.204336,21.349224 c -4.894917,-1.916474 -3.458707,5.391212 0.347494,3.37231 2.120589,6.821713 -10.599623,1.664746 -6.906229,-3.691132 0.354172,-3.663246 9.875349,-4.711252 6.558735,0.318822 z' /> <path class='logo' d='m 71.730617,20.654299 c 0.0013,2.316285 0.190131,4.655698 0.07825,6.958009 -6.532419,3.303565 -0.660423,-8.722256 -6.009639,-5.821653 -0.818815,2.024533 1.726403,6.746337 -1.95327,6.005484 -3.458346,-1.137537 -0.696275,-7.713407 -1.833252,-10.994208 -2.308916,-3.710131 5.93704,-4.164951 3.518609,0.0063 -1.462376,6.166445 5.169629,-2.857523 6.19931,3.846079 z' /> <path class='logo' d='m 82.245738,22.378957 c -0.24581,2.448954 -9.386766,0.8867 -3.885979,2.877055 3.312576,-2.99157 5.250902,3.334514 0.482647,2.665545 -7.415384,1.492275 -7.823196,-11.597641 -0.275476,-10.032117 2.068161,0.391458 3.682204,2.408824 3.678808,4.489517 z m -3.414436,-0.578473 c -1.124703,-4.072004 -5.087405,2.125488 -0.316922,0.156453 z' /> <path class='logo' d='m 98.936899,27.222794 c -4.73541,2.718339 -3.1239,-3.406557 -3.92611,-6.050494 -4.66985,-1.438471 0.21621,6.932413 -3.41219,6.438039 -4.46096,1.160054 -0.22824,-5.774711 -3.31526,-6.700429 -3.410722,1.082173 1.04451,9.536575 -4.745091,6.372895 0.746632,-3.355214 -2.776394,-10.269232 3.034971,-9.038963 -0.058,2.544602 5.00686,-2.785359 6.00342,1.37844 3.42021,-4.316316 7.851251,0.524966 6.24018,4.690538 0.0379,0.969988 0.0954,1.940046 0.12008,2.909974 z' /> <path class='logo' d='m 110.47859,22.686058 c 0.91826,2.682088 0.13016,6.890551 -3.0725,4.397004 -1.63641,1.077877 -7.664291,0.541832 -7.09365,-4.114836 -0.907891,-4.692933 5.14729,-5.625578 7.24058,-4.40354 3.85932,-1.686263 3.13176,1.271515 2.92557,4.121372 z m -3.12695,0.0704 c -1.46278,-5.460062 -6.61615,2.5826 -1.08221,1.782003 0.70431,-0.272594 1.13111,-1.037444 1.08221,-1.782003 z' /> </a> <a xlink:href='https://www.dbschema.com'> <path class='logo' d='m 32.309685,20.963194 c 0.411708,4.732616 -4.298055,7.925636 -8.723583,6.970196 -6.616967,1.8448 -2.656457,-6.434594 -3.911969,-10.01566 -2.15469,-5.89407 6.06247,-3.508505 9.167655,-2.863689 2.199228,1.054873 3.389343,3.582089 3.467897,5.909153 z m -3.720955,0.01451 c 0.434195,-4.414565 -7.644142,-5.37533 -5.137307,0.107342 -1.812268,5.992146 5.532698,4.379388 5.137307,-0.107342 z' /> <path class='logo' d='m 44.329732,23.050637 c 0.850982,5.097305 -5.250434,4.558924 -7.144836,4.752415 -6.418993,1.64391 -1.872992,-7.49274 -3.541914,-10.942842 -2.499646,-3.817859 5.939283,-4.402698 3.538545,-0.13612 -1.287874,4.989123 4.215411,-1.154796 5.956717,2.809584 0.840273,0.970849 1.168829,2.272413 1.191488,3.516963 z m -3.519477,-0.09299 c -1.398216,-5.518069 -6.361061,2.717467 -0.984368,1.810718 0.686994,-0.30388 1.029454,-1.087638 0.984368,-1.810718 z' /> <path class='logo' d='m 52.234961,23.301163 c 0.954818,5.035675 -8.606408,6.284861 -6.262292,1.674914 6.000358,-1.604717 -5.188764,-7.870044 1.75972,-10.384908 2.288682,-3.253567 6.399287,3.075831 2.304111,2.48058 -2.124941,2.016587 2.688777,3.89858 2.198472,6.229403 z' /> <path class='logo' d='m 60.204336,21.349224 c -4.894917,-1.916474 -3.458707,5.391212 0.347494,3.37231 2.120589,6.821713 -10.599623,1.664746 -6.906229,-3.691132 0.354172,-3.663246 9.875349,-4.711252 6.558735,0.318822 z' /> <path class='logo' d='m 71.730617,20.654299 c 0.0013,2.316285 0.190131,4.655698 0.07825,6.958009 -6.532419,3.303565 -0.660423,-8.722256 -6.009639,-5.821653 -0.818815,2.024533 1.726403,6.746337 -1.95327,6.005484 -3.458346,-1.137537 -0.696275,-7.713407 -1.833252,-10.994208 -2.308916,-3.710131 5.93704,-4.164951 3.518609,0.0063 -1.462376,6.166445 5.169629,-2.857523 6.19931,3.846079 z' /> <path class='logo' d='m 82.245738,22.378957 c -0.24581,2.448954 -9.386766,0.8867 -3.885979,2.877055 3.312576,-2.99157 5.250902,3.334514 0.482647,2.665545 -7.415384,1.492275 -7.823196,-11.597641 -0.275476,-10.032117 2.068161,0.391458 3.682204,2.408824 3.678808,4.489517 z m -3.414436,-0.578473 c -1.124703,-4.072004 -5.087405,2.125488 -0.316922,0.156453 z' /> <path class='logo' d='m 98.936899,27.222794 c -4.73541,2.718339 -3.1239,-3.406557 -3.92611,-6.050494 -4.66985,-1.438471 0.21621,6.932413 -3.41219,6.438039 -4.46096,1.160054 -0.22824,-5.774711 -3.31526,-6.700429 -3.410722,1.082173 1.04451,9.536575 -4.745091,6.372895 0.746632,-3.355214 -2.776394,-10.269232 3.034971,-9.038963 -0.058,2.544602 5.00686,-2.785359 6.00342,1.37844 3.42021,-4.316316 7.851251,0.524966 6.24018,4.690538 0.0379,0.969988 0.0954,1.940046 0.12008,2.909974 z' /> <path class='logo' d='m 110.47859,22.686058 c 0.91826,2.682088 0.13016,6.890551 -3.0725,4.397004 -1.63641,1.077877 -7.664291,0.541832 -7.09365,-4.114836 -0.907891,-4.692933 5.14729,-5.625578 7.24058,-4.40354 3.85932,-1.686263 3.13176,1.271515 2.92557,4.121372 z m -3.12695,0.0704 c -1.46278,-5.460062 -6.61615,2.5826 -1.08221,1.782003 0.70431,-0.272594 1.13111,-1.037444 1.08221,-1.782003 z' /> </a>
</g> </g>