基础代码生成
This commit is contained in:
1 parent
352d7d023f
commit
1c0544afe0
122 files changed
+21475
No files matched your search
@@ -0,0 +1,107 @@
|
||||
// Generate reviewable apply_patch input; this script never writes project files.
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const root = path.resolve(__dirname, '../..');
|
||||
const base = path.join(root, 'ruoyi-system/src/main/java/com/ruoyi/system');
|
||||
const labels = {
|
||||
RentAccount: 'UserId', RentApp: 'Name', RentNode: 'Name',
|
||||
RentCredential: 'ApiKey', RentEvent: 'EventNo', RentLedger: 'BusinessKey',
|
||||
RentNonce: 'Nonce', RentOrder: 'OrderNo', RentPackage: 'Name',
|
||||
RentRefund: 'RefundNo', RentSettlement: 'SettlementNo',
|
||||
RentSettlementItem: 'OrderId', RentTask: 'TaskNo',
|
||||
RentTransaction: 'TxId', RentWallet: 'Address', RentWebhook: 'EventNo'
|
||||
};
|
||||
const read = p => fs.readFileSync(p, 'utf8').replace(/\r\n/g, '\n');
|
||||
function blockEnd(text, open) {
|
||||
let depth = 0;
|
||||
let quote = null;
|
||||
for (let i = open; i < text.length; i++) {
|
||||
const c = text[i];
|
||||
if (quote) {
|
||||
if (c === '\\') i++;
|
||||
else if (c === quote) quote = null;
|
||||
} else if (c === '"' || c === "'") quote = c;
|
||||
else if (c === '{') depth++;
|
||||
else if (c === '}' && --depth === 0) return i + 1;
|
||||
}
|
||||
throw new Error('Unclosed generated block');
|
||||
}
|
||||
function removeBlocks(text, pattern, includeDoc = false) {
|
||||
let match;
|
||||
while ((match = pattern.exec(text))) {
|
||||
let start = match.index;
|
||||
// The regex ends at the method/if brace. Mapping paths can contain {id}.
|
||||
const open = start + match[0].lastIndexOf('{');
|
||||
const end = blockEnd(text, open);
|
||||
if (includeDoc) {
|
||||
const docStart = text.lastIndexOf('/**', start);
|
||||
const docEnd = text.lastIndexOf('*/', start);
|
||||
if (docStart >= 0 && docEnd > docStart && !text.slice(docEnd + 2, start).trim()) {
|
||||
start = text.lastIndexOf('\n', docStart) + 1;
|
||||
}
|
||||
}
|
||||
text = text.slice(0, start) + text.slice(end).replace(/^\n/, '');
|
||||
pattern.lastIndex = 0;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
const model = process.argv[2];
|
||||
if (!(model in labels)) throw new Error('Explicit rental model required');
|
||||
const plus = model + 'Plus';
|
||||
const domain = read(path.join(base, 'domain', plus + '.java'));
|
||||
const hasUser = /private Long userId;/.test(domain);
|
||||
const label = labels[model];
|
||||
if (!new RegExp('\\bget' + label + '\\(').test(domain)) throw new Error('Invalid display field');
|
||||
let patch = '*** Begin Patch\n';
|
||||
const changed = [];
|
||||
for (const [folder, name] of [
|
||||
['controller', model + 'Controller.java'],
|
||||
['service', 'I' + model + 'Service.java'],
|
||||
['service/impl', model + 'ServiceImpl.java']
|
||||
]) {
|
||||
const file = path.join(base, folder, name);
|
||||
const before = read(file);
|
||||
let after = before;
|
||||
if (!hasUser) {
|
||||
if (folder === 'controller') {
|
||||
after = removeBlocks(after,
|
||||
/^"\)\n[ \t]*public AjaxResult user\w+\([^\n]*\)\s*\{/m);
|
||||
after = removeBlocks(after,
|
||||
/^[ \t]*@PreAuthorize\("@ss\.hasPermi\('[^'\n]*:user-[^'\n]*'\)"\)[\s\S]*?public [^{]+\{/m,
|
||||
true);
|
||||
}
|
||||
if (folder === 'service/impl') {
|
||||
after = removeBlocks(after, /^[ \t]*if\s*\(\s*isUser\s*\)\s*\{/m);
|
||||
after = removeBlocks(after, /^[ \t]*private void checkUser(?:Plus)?\([^)]*\)\s*\{/m);
|
||||
after = after.replace('import com.ruoyi.common.utils.SecurityUtils;\n', '');
|
||||
after = after.replaceAll(plus + '::getUserId,', '');
|
||||
}
|
||||
after = after.replace(/\s*,\s*boolean isUser/g, '');
|
||||
after = after.replace(/,\s*(?:false|true)(?=[,)])/g, '');
|
||||
if (/\b(?:isUser|checkUser|checkUserPlus|getUserId|setUserId|userGetInfo|userRemove)\b/.test(after)) {
|
||||
throw new Error('Unexpected user-scope reference in ' + file);
|
||||
}
|
||||
}
|
||||
if (label !== 'Name') {
|
||||
after = after.replaceAll(plus + '::getName', plus + '::get' + label);
|
||||
after = after.replace('selectItem.setName(item.getName());',
|
||||
'selectItem.setName(String.valueOf(item.get' + label + '()));');
|
||||
}
|
||||
if (after === before) continue;
|
||||
const oldLines = before.trimEnd().split('\n');
|
||||
const newLines = after.trimEnd().split('\n');
|
||||
let start = 0;
|
||||
while (start < Math.min(oldLines.length, newLines.length) && oldLines[start] === newLines[start]) start++;
|
||||
let oldEnd = oldLines.length, newEnd = newLines.length;
|
||||
while (oldEnd > start && newEnd > start && oldLines[oldEnd - 1] === newLines[newEnd - 1]) { oldEnd--; newEnd--; }
|
||||
const contextStart = Math.max(0, start - 3);
|
||||
const contextEnd = Math.min(oldLines.length, oldEnd + 3);
|
||||
patch += '*** Update File: ' + file.replaceAll('\\', '/') + '\n@@\n';
|
||||
patch += oldLines.slice(contextStart, start).map(l => ' ' + l + '\n').join('');
|
||||
patch += oldLines.slice(start, oldEnd).map(l => '-' + l + '\n').join('');
|
||||
patch += newLines.slice(start, newEnd).map(l => '+' + l + '\n').join('');
|
||||
patch += oldLines.slice(oldEnd, contextEnd).map(l => ' ' + l + '\n').join('');
|
||||
changed.push(path.relative(root, file));
|
||||
}
|
||||
patch += '*** End Patch';
|
||||
process.stdout.write(JSON.stringify({ model, hasUser, label, changed, patch: changed.length ? patch : null }));
|
||||
@@ -0,0 +1,39 @@
|
||||
# 审查发现
|
||||
|
||||
## 已确认范围
|
||||
|
||||
- 当前租赁文件为未跟踪的新设计:sql/rent_init.sql、docs/rental/schema-design.md、docs/rental/table-functional-flows.md。
|
||||
- 未检索到租赁 Java 服务,当前修改应保持为设计文件,不宣称修复运行时行为。
|
||||
- 15 表 V2.1 使用逻辑外键,MySQL 5.7 不执行 CHECK。
|
||||
|
||||
## 待修正缺口
|
||||
|
||||
1. 部分退款被 webhook(order_id,event_type) 唯一键阻止;退款缺少独立持久业务编号及审批/幂等对象。
|
||||
2. 结算没有付款中状态,人工付款与数据库确认间可能被拒绝并释放来源。
|
||||
3. 原文允许手续费返还供应商,但净应收/结算来源公式没有增加返还额,造成账单无法结算该金额。
|
||||
4. 钱包预留释放和异步快照刷新缺少区块及版本屏障,可能用旧快照重新出租已委托本金。
|
||||
5. 同地址对同资源多单仅描述应用串行,缺少可持久的互斥来源,原始关系增量和回收归属难以证明。
|
||||
6. 服务起点使用核验完成时间,核验延迟会推迟租期并使经济事实不一致。
|
||||
7. 无持久下单等待截止,回收任务未显式关联原委托交易;任务无 network 字段,跨表核验靠 JSON。
|
||||
8. ITronService已有getCanDelegatedMaxSize只读查询;NILE/MAINNET通用delegateResourceV2写死lock=true、86400,与任意租期不兼容,租赁不可直接复用。
|
||||
|
||||
## V2.2决策
|
||||
|
||||
- 增加rent_refund至16表,部分退款使用独立幂等编号,回调按业务事件键和订单序号去重。
|
||||
- 订单地址对占位持续至本金回收且资源恢复;任务按钱包及资源类型串行,未知不释放。
|
||||
- 钱包确认区块下界、快照CAS及失效屏障共同防旧查询覆盖。
|
||||
- 首版仅非锁定委托,避免不同业务租期被链上锁定合并;多单同地址对排队或另选钱包。
|
||||
- 结算PAYING在人工付款前持久化,付款未知保留原授权编号与来源。
|
||||
|
||||
## 资源
|
||||
|
||||
## 后续生成代码审查
|
||||
|
||||
- 用户已新增16模块Controller/Domain/Mapper/Service/XML;之前未实现状态仅属于设计复核时点。
|
||||
- 只有RentApp、RentNode、RentAccount实体直接有userId,其余13模块模板错误生成相同用户过滤/赋值/检查方法。
|
||||
- 无userId模块的/user路由不能简单移除过滤后保留,应删除错误路由及无效isUser参数,保留后台PreAuthorize权限。
|
||||
- 多个Controller和Service还引用不存在的getName;下拉显示使用真实业务编号或钱包地址。
|
||||
|
||||
- sql/rent_init.sql
|
||||
- docs/rental/schema-design.md
|
||||
- docs/rental/table-functional-flows.md
|
||||
@@ -0,0 +1,33 @@
|
||||
# 工作记录
|
||||
|
||||
## 设计审查
|
||||
|
||||
- 已读取项目规则、15 表 SQL 及业务说明;仅以当前工作区为依据,无 Git 历史查询。
|
||||
- 已确认凭证、防重放、冻结、任务、链上独立核验的主框架可保留。
|
||||
- 正在将退款、付款副作用、资源快照及地址对互斥缺口收敛为 V2.2 修改。
|
||||
|
||||
## SQL与文档修正
|
||||
|
||||
- SQL已升级16表V2.2;新增退款单、两个占位及唯一键、快照区块屏障、PAYING授权、显式回收来源。
|
||||
- 主设计及逐表说明已同步,新建business-review-v2.2.md记录发现、事务协议、迁移要求及验收场景。
|
||||
- MySQL方言解析:SQLGlot 26.33.0解析16条CREATE,无回退命令。
|
||||
- 首轮12项离线检查有2项失败:验证记录链接尚未创建,以及用例对89字符示例错误要求超过96;已创建记录并删除无依据长度断言,保留160上限及跨账户去重检查。
|
||||
- pip工具下载一次超时后自动重试成功;不加入项目依赖。
|
||||
|
||||
## 验证完成
|
||||
|
||||
- 最终SQLGlot严格MySQL方言解析16条CREATE TABLE,无不支持回退。
|
||||
- 最终python docs/rental/check_schema.py运行12项全部通过。
|
||||
- 明确补充原生委托费用预算非协议fee_limit硬上限、新任务RENT_TASK_V2、旧HMAC原文兼容。
|
||||
- 已完成schema-design.md、table-functional-flows.md同步及business-review-v2.2.md、validation-v2.2.md、check_schema.py交付文件。
|
||||
- 没有修改已有数据库、支付服务、Java/前端实现,没有执行链上操作。真实MySQL并发及NILE验收仍需实现阶段完成,验证记录明确此边界。
|
||||
|
||||
## 后续:用户新增16表基础代码后的清理
|
||||
|
||||
- 仅RentApp/RentNode/RentAccount直接有userId。其余13模块删除错误用户过滤、赋值、检查辅助方法及isUser参数,同步Service接口/实现/Controller调用。
|
||||
- 无userId模块删除7个/user端点/模块(共91个),保留后台接口及PreAuthorize;未将无过滤接口继续暴露为用户接口。
|
||||
- 12个无name模型的Controller改用真实字段;无name且无userId的11个Service下拉显示和检索改用编号、地址等字段。
|
||||
- 共修改40个Java文件;Domain、Mapper、SQL、前端不作改动。
|
||||
- 首轮机械删除误判注解中的{id}边界,已修正脚本并清理两类残片;静态检查确认每个无userId模块仅8个后台端点,有userId模块保留7个用户端点,所有端点均有权限注解。
|
||||
- 16模块158处方法引用存在性检查通过;13个无userId模块不再有isUser、getUserId/setUserId、checkUser等模板引用。
|
||||
- 默认JDK17触发现有Lombok模块访问错误,切换JAVA_HOME=C:\Java\jdk1.8.0_481后,mvn -o -pl ruoyi-system -am -DskipTests compile -q退出0。
|
||||
@@ -0,0 +1,53 @@
|
||||
# 能量与带宽租赁设计复核
|
||||
|
||||
## Goal
|
||||
|
||||
修正租赁 SQL 与业务文档中的资金、调度、交易恢复、回收及退款协同缺口,不操作现有数据库。
|
||||
|
||||
## Next Step
|
||||
|
||||
已完成生成代码清理及JDK8编译验证,交付40个相关Java文件的修改。
|
||||
|
||||
## Current Phase
|
||||
|
||||
全部完成(含生成代码清理)
|
||||
|
||||
### Phase 1: 设计审查
|
||||
|
||||
- **Status:** complete
|
||||
- 核对初始化 SQL、两份文档、现有调用与工具可用性。
|
||||
|
||||
### Phase 2: 修正 SQL 与文档
|
||||
|
||||
- **Status:** complete
|
||||
- 采用明确可实现的约束,同步字段、状态、关系及异常流程。
|
||||
|
||||
### Phase 3: 验证与交付
|
||||
|
||||
- **Status:** complete
|
||||
- 验证 DDL、唯一约束、典型并发/资金场景及文档一致性,说明验证边界。
|
||||
|
||||
## Decisions Made
|
||||
|
||||
### Phase 4: 生成代码清理
|
||||
|
||||
- **Status:** complete
|
||||
- 无 userId 的13个模块删除直接用户过滤和/user路由,保留后台权限注解;有字段的3个模块保留。
|
||||
- 按实际业务字段修正不存在的name引用;不扩展为关联归属授权实现。
|
||||
|
||||
|
||||
| 决策 | 原因 |
|
||||
| --- | --- |
|
||||
| 只修改当前租赁设计及相关说明 | 用户请求为 SQL 和文档修正,当前无租赁 Java 服务 |
|
||||
| 不执行现有数据库迁移 | 未掌握部署表及数据,初始化脚本不能直接升级旧表 |
|
||||
|
||||
## Errors Encountered
|
||||
|
||||
| 错误 | 处理 |
|
||||
| --- | --- |
|
||||
| 首次技能输出局部截断 | 补读被截断部分,完成技能阅读 |
|
||||
| PowerShell下rg目录通配符不是实际目录 | 改为项目根搜索并按扩展名过滤 |
|
||||
| Docker Linux引擎未启动,无本地MySQL命令 | 尝试独立临时工具进行DDL解析,不能宣称真实MySQL验收 |
|
||||
| PowerShell foreach输出直接管道语法错误 | 将foreach包在数组表达式后输出 |
|
||||
| 清理脚本误把路径{id}当作方法块开始 | 改为正则匹配末尾的真实方法大括号,删除残片并重新检查端点权限及编译 |
|
||||
| 默认JDK17编译与现有Lombok处理器不兼容 | 使用项目要求的JDK1.8.0_481,离线Maven编译成功 |
|
||||
@@ -0,0 +1,235 @@
|
||||
# 能量与带宽出租业务复核与修正 V2.2
|
||||
|
||||
## 1. 结论与适用范围
|
||||
|
||||
原 V2.1 的独立余额、供应商本地签名、链上独立核验、未知隔离、履约和回收分离方向可保留,但退款、人工付款、资源快照和多单回收存在实质缺口。V2.2 已在 [初始化 SQL](../../sql/rent_init.sql)、[主设计](schema-design.md) 和[逐表说明](table-functional-flows.md)中同步修正,表数由 15 增至 16。
|
||||
|
||||
这是设计及初始化脚本修正,不是运行时修复报告。当前未实现租赁服务、未对现有数据库执行迁移、未进行 NILE 真实委托。下述应用约束必须由后续服务及 Agent 实现,MySQL 5.7 不会替应用执行 CHECK 或逻辑外键。
|
||||
|
||||
| 问题与触发场景 | 原设计后果 | 本次修正 |
|
||||
| --- | --- | --- |
|
||||
| 同订单第二次部分退款 | 回调 `(order_id,event_type)` 唯一键冲突;没有退款请求幂等主体 | 新增 rent_refund;回调改为 event_key 及订单事件序号唯一 |
|
||||
| 审批后已人工付款,但尚未登记结果 | 仍处于 APPROVED,可能被拒绝并释放订单,或再次付款 | 新增 PAYING、唯一 payout_no、payment_started_at,先持久化授权再付款 |
|
||||
| 平台手续费退给供应商 | 账户待结算增加,但订单结算来源公式不包含这部分 | 增加 supplier_fee_returned_amount,并纳入净可结算公式 |
|
||||
| 委托已确认、资源预留已扣减,但异步旧查询回写 | 旧可委托本金再次可见,可能超卖 | 钱包最低快照区块、快照高度、version CAS、旧快照失效和任务执行占位配合 |
|
||||
| 同钱包同接收者同类型存在多笔委托 | 链上聚合关系难归单,锁定及撤销可能互相影响 | 订单 relation_slot 持久互斥,直到本金回收且资源恢复;同地址下一单排队或改选钱包 |
|
||||
| 可重试失败时先解冻,再生成新任务 | 可能无冻结资金继续履约 | 明确重试与终结:重试保留 HELD;最终失败才 RELEASE |
|
||||
| 只扫描交易表恢复 UNKNOWN | Agent 已接单但未回 txId 的任务永远遗漏 | 同时扫描任务和交易,未知占位不释放 |
|
||||
| 核验晚于实际交付很久 | 用核验时间作为租期起点,额外延长占用或对已过期业务扣款 | 保存 block_time,以确认交易区块时间算租期;已到期转人工 |
|
||||
| 任意业务租期直接调用现有通用委托方法 | 当前实现写死 lock=true、86400 且直接广播,无法遵守本地持久化恢复协议 | 套餐 delegate_lock=0,首版只非锁定委托,Agent 独立执行;只复用查询 |
|
||||
| 回收任务未显式绑定原交易 | 可能按当前资源换算或引用错误本金 | task.source_transaction_id 固定原确认委托,撤销原 SUN、同网络同类型 |
|
||||
| 已上链但资源量不足 | 若按普通失败释放,将低估实际已委托本金 | 链上 CONFIRMED 与订单 SUCCESS 分离;先记事实及屏障,再人工处置和回收 |
|
||||
|
||||
## 2. 修正后的业务主流程
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["应用认证、订单幂等、套餐校验"] --> B["下单事务:冻结USDT、锁定价格规则和执行截止"]
|
||||
B --> C{"钱包、关系占位、快照和资源满足?"}
|
||||
C -->|无| D["WAITING等待;截止前重试"]
|
||||
D --> C
|
||||
D -->|从未派单且超时| Z["取消、解冻、回调"]
|
||||
C -->|有| E["预留SUN、关系占位、创建唯一在途任务"]
|
||||
E --> F["Agent持久化、复核、原交易签名广播"]
|
||||
F --> G{"云端独立核验"}
|
||||
G -->|未知| H["保留占用、查询原任务和交易"]
|
||||
H --> G
|
||||
G -->|明确失败可重试| I["释放旧资源占位,保留冻结资金"]
|
||||
I --> C
|
||||
G -->|最终失败| J["解冻资金、释放安全占位、失败回调"]
|
||||
G -->|上链但交付不足或核验已过期| M["确认链上事实、快照屏障、人工核对及回收"]
|
||||
G -->|达标且未过期| K["扣款、供应商净应收、快照屏障、成功回调"]
|
||||
K --> R["租期届满,按原交易SUN创建回收任务"]
|
||||
M --> R
|
||||
R --> S["撤销核验、快照屏障、资源恢复检查"]
|
||||
S -->|未恢复| S
|
||||
S -->|恢复| T["回收DONE,释放关系占位"]
|
||||
K --> P["结算占用、独立审批、PAYING授权、人工付款核验"]
|
||||
K --> Q["独立退款单审批、余额与流水原子调整"]
|
||||
```
|
||||
|
||||
首版保持固定套餐、一单一种资源、一个钱包、整笔交付、整笔回收、每订单来源全额结算一次。能量与带宽分别下单、换算和预留。非锁定不表示自动回收,供应商必须承诺租期内不擅自撤销;平台监测委托关系,提前撤销转人工并按规则退款。平台不掌握私钥,不能用数据库约束阻止供应商自行链上操作。
|
||||
|
||||
## 3. 钱包快照、预留和互斥协议
|
||||
|
||||
### 3.1 两种占位分别负责什么
|
||||
|
||||
- `rent_order.relation_slot=1`:限制同钱包、同接收者、同类型只保留一笔在租或待回收订单。成功履约后仍保留;只有明确未执行释放,或原本金回收且本单资源恢复后才置 NULL。
|
||||
- `rent_task.wallet_execution_slot=1`:同钱包同类型只允许一个在途链上操作,包括委托、回收和 UNKNOWN。核验终结并写入屏障后可置 NULL,让其他接收者的任务继续执行。
|
||||
- `rent_task.active_slot=1`:同订单同任务类型的有效或已成功尝试占位。成功后继续保留用于追溯,只有明确失败且安全时才能置 NULL 后产生新 attempt。
|
||||
|
||||
三个占位业务上只允许 1 或 NULL。唯一键不阻止写入 2,所以服务端必须校验,不能接受客户端提交。节点不能把 UNKNOWN 当失败;租约、会话失效不释放占位。
|
||||
|
||||
### 3.2 取得和应用快照
|
||||
|
||||
1. 先读取钱包 version、snapshot_min_block_height 及地址、网络、策略,不持有长事务进行 RPC。
|
||||
2. 通过受信任节点获取两类资源状态、对应全网参数、`getCanDelegatedMaxSize`、确认区块高度及必要证据。高度必须代表这些数据的实际观测状态,不得给旧数据贴上新高度。
|
||||
3. 若 RPC 不支持按区块一致查询,应通过前后区块检查和节点一致性验证形成可验证观测;不能证明数据覆盖下界就拒绝调度,不伪造“确认区块参数”。历史交付核验需要可信历史快照或支持历史状态的节点,不能拿当前 L/W 冒充确认区块值。
|
||||
4. 短事务 CAS 更新:version 仍等于查询前值,快照区块不回退且不低于 snapshot_min_block_height;成功后递增 version。任一条件失败丢弃并重查。
|
||||
5. 快照刷新只改链上投影、参数、时间及高度,不覆盖 reserved_sun、占位和供应商策略。两类查询有一类失败时不推进共同快照,不用零覆盖旧值。
|
||||
6. 调度还要检查对应 enabled、节点在线和审核状态、快照未过期、执行占位为空及可调度本金。普通 TRX 余额、免费带宽、收到代理量不参与本金池。
|
||||
|
||||
### 3.3 委托确认与快照屏障
|
||||
|
||||
假设旧快照可委托 1000 SUN,本次在途预留 600 SUN,链上已执行但旧查询仍返回 1000。若只减预留至 0,旧值会错误允许再委托 1000。
|
||||
|
||||
修正顺序:确认交易 → 同事务将该笔预留从 HELD 转 COMMITTED,reserved_sun 减 600 → snapshot_min_block_height 提升到确认区块 → snapshot_expires_at=NULL → version 递增 → 释放钱包执行占位。此时任何调度都因快照失效失败;旧查询因版本或区块不符失败。新查询覆盖已确认委托,取得真实剩余额度后才恢复出租。
|
||||
|
||||
撤销确认同样先写屏障、失效快照,再释放执行占位。回收任务固定 `reservation_status=NONE`,不能把回收本金当一笔新的待委托预留,也不能一确认撤销就机械增加可出租本金。接收者使用资源后撤销可能将资源使用债务转回供应者,实际可委托上限需重新查询。
|
||||
|
||||
未知时不释放预留或执行占位,即便快照已经包含交易变化,多扣一份也只会暂时保守,不得以“看起来余额够了”为由解除未知隔离。
|
||||
|
||||
### 3.4 地址对、链上锁定与外部修改
|
||||
|
||||
首版任务必须非锁定,接收者不是 owner,地址有效、已激活且满足目标网络当下委托条件。签名前检查同 owner/receiver 同类型已委托基线为零;存在外部委托或锁定关系则不使用该地址对。回收前确认关系与本单原本金对应,发现外部追加、提前撤销或部分变化则暂停相关调度并转人工。
|
||||
|
||||
参与租赁的钱包不得同时由其他平台或无协调脚本修改相同资源池。Agent 本地也要按钱包及类型串行,不只依赖云端。数据库无法防止拥有私钥者绕开 Agent;必须持续核对链上变化,不把事先审核当永久授权事实。
|
||||
|
||||
共享快照可能因另一资源类型的确认暂时整体失效,这是保守的首版取舍;不能跨类型转移本金。将来若拆独立快照,应为两类分别设置版本和区块屏障。
|
||||
|
||||
### 3.5 费用与任务授权
|
||||
|
||||
Stake 2.0 委托和撤销是原生操作,不应把智能合约调用的 fee_limit 字段当作它们的协议费用硬上限。此设计的 fee_limit_sun 是本地允许预算,Agent 根据当下带宽、网络费用、权限/签名附加费用和费用留存进行检查;预算为零或无法估算则拒绝。它不承诺协议费率变化时绝对不超额,供应商毛收入须覆盖双方约定的委托及回收成本。
|
||||
|
||||
新任务 intent 使用业务结构版本 `RENT_TASK_V2`,外层 HMAC 协议仍为 RENT_HMAC_SHA256_V1;签名覆盖新增 network、source_transaction_id、原委托 txId、精确 SUN、类型、两端地址、预算及期限等完整意图。Agent 对标量字段和签名原文一致性逐项校验,不能只验 JSON 一份却使用另一份未校验字段执行。回收来源必须可对应真实原交易;旧任务仍保留旧结构原文和验证路径,不原地重签。
|
||||
|
||||
## 4. 失败、重试、交付与回收
|
||||
|
||||
### 4.1 截止与重试
|
||||
|
||||
订单创建时固化 `dispatch_deadline`,DELEGATE 任务 deadline 不晚于它;RECLAIM 使用独立有效期,不受原下单截止限制。Agent 不能在任务过期后新签名/新广播,原交易查询和结果回报仍允许。
|
||||
|
||||
只有从未创建过执行任务的 WAITING 单可以用户取消或等待超时直接取消;已有投递线索时先恢复原任务。明确未执行拒绝可在截止前释放资源、保持 HELD 并重派;原订单 wallet_id、供应商及账号只在已证明无副作用且旧占位释放的安全重试中可重选,旧尝试归属保留在 task。最终 FAILED/CANCELLED 与资金 RELEASED 是终态,不能再自动恢复执行。
|
||||
|
||||
已构建原交易的重试,必须确认链上失败且无委托副作用,或原交易有效期已过并通过可信链上查询证明未执行。查询返回一次“未找到”、节点离线、worker 租约过期、Agent 本地丢记录都不足以证明。无 txId 的 UNKNOWN 同样由任务扫描处理,保留占用直至有足够证据。
|
||||
|
||||
### 4.2 链上成功与交付成功
|
||||
|
||||
`rent_transaction.CONFIRMED` 表示链上操作已执行,不表示套餐交付合格。将实际资源额度写入 verified_resource_quantity,即便小于目标也保存真实值。task VERIFIED 记录操作已核验,订单 MANUAL_REVIEW 保留资金,原本金进入回收计划。
|
||||
|
||||
服务起点为委托交易的可信 block_time;到期时间为起点加 duration_seconds。核验很晚、服务已经到期或无法取得可信历史参数时,不自动扣款或重设起点,转人工按实际交付和合同处理。已确认委托无论订单是否成功都要持久化回收计划。
|
||||
|
||||
异常 HELD 订单回收完毕后,按审核处置释放资金并终结 FAILED;没有确认供应商收入时不凭空创建应收。若要对异常实际服务收费,须新增明确补偿审批和流水业务,不能绕过本版成功条件直接修改余额。
|
||||
|
||||
### 4.3 回收不等于瞬间可再次出租
|
||||
|
||||
RECLAIM.source_transaction_id 只能引用本订单已确认的 DELEGATE 交易,网络、owner、receiver、资源类型和 SUN 全部一致。回收不能重新按资源量换算,不撤销其他来源,不自动部分回收。
|
||||
|
||||
撤销确认后状态可进入 RECOVERING;按可信可委托上限及资源恢复证据判定本单恢复,不要求数值回到旧快照(会受其他订单和全网参数影响)。无法归属或恢复债务持续异常时保留关系占位并人工核对。资源恢复判定标准须在 NILE 实测后固定,不能仅靠数据库状态宣称恢复。
|
||||
|
||||
## 5. 资金、退款和结算
|
||||
|
||||
### 5.1 统一锁顺序与原子性
|
||||
|
||||
所有流程统一锁序:账户按 ID 升序 → 已有结算单按 ID 升序 → 订单按 ID 升序 → 退款单按 ID 升序 → 钱包按 ID 升序 → 任务按 ID 升序 → 交易记录。只锁本操作涉及的层级,可跳过但不能逆序回锁。先读取候选 ID,再开启事务按顺序重查状态和归属;发现归属已变则回滚重试,禁止持有订单锁后补锁账户。
|
||||
|
||||
套餐版本商业字段不可变;下单在账户之后锁套餐再插入新订单。节点审核/连接改变用状态条件、版本和 Agent 再验证保护,不在钱包锁后反向锁账户。所有外部调用在短事务外执行。
|
||||
|
||||
结算创建和退款审批共同锁定供应商账户及来源订单,因此不能在检查完“无结算占用”后又被并发结算抢走。结算不扣审批阶段余额,但有效明细占住来源。退款提交时 PENDING 不预留金额,审批时必须再次校验累计,多个审批由订单行锁裁决。
|
||||
|
||||
余额、流水、订单累计、退款 APPLIED、回调队列和审计同事务;唯一键冲突必须回滚整个余额变更,不得捕获后继续提交。重试用固定业务键查既有结果。
|
||||
|
||||
### 5.2 退款计算和逐次回调
|
||||
|
||||
设本次商户退款 M、供应商原净额冲正 S、平台手续费退回 F:
|
||||
|
||||
- M > 0;M 加累计 refunded_amount 不超过售价。
|
||||
- S >= 0;S 加 supplier_reversed_amount 不超过原 supplier_net_amount。
|
||||
- F >= 0;F 加 supplier_fee_reversed_amount 不超过原 supplier_fee_amount。
|
||||
- F=0 时 fee_return_to 必须 NONE;F>0 时只能 MERCHANT 或 SUPPLIER。
|
||||
- MERCHANT 时 F<=M,F 已包含在 M 中,不能再增加 F 可用余额。
|
||||
- SUPPLIER 时增加待结算 F,并增加订单 supplier_fee_returned_amount;它是 supplier_fee_reversed_amount 的子集,不能再冲正第二次。
|
||||
- 涉及 S 或 F 的审批,若来源已结算或存在有效结算明细,拒绝应用;回到人工协调,不能修改已付记录。S=F=0 的平台承担退款可独立审批。
|
||||
- 最终各账户余额不能为负。商户和供应商是同一账户时仍分别追加业务流水,按单次变化顺序计算 after 值。
|
||||
|
||||
退款流水建议使用 `REFUND:<refund_no>:MERCHANT`、`:SUPPLIER_REVERSE`、`:FEE_RETURN` 等独立 business_key,全部关联 refund_id。MERCHANT 退费可拆为基础退款 M-F 与手续费退款 F,后者 delta_platform_fee=-F;F=M 时不必写零额基础流水。SUPPLIER 方向的商户退款为 +M,供应商手续费返还为待结算 +F、平台手续费 -F,供应商原净额冲正另为 -S。
|
||||
|
||||
每次 APPLIED 产生 event_key=`REFUND:<refund_no>`,payload 保存本次金额及该时点累计。锁订单行后,以当前读查询该订单最高序号(例如按序号倒序 LIMIT 1 FOR UPDATE),分配 `order_event_sequence=max(已有序号)+1`;不能使用事务旧快照中的 MAX。普通成功等事件仍使用稳定 ORDER:id:type 键。没有回调地址时不创建发送任务。重试不修改内容和序号;消费者按 event_no 去重,不用到达顺序覆盖较新累计。
|
||||
|
||||
### 5.3 手续费返还与结算来源一致
|
||||
|
||||
```text
|
||||
本单净可结算 = supplier_net_amount
|
||||
- supplier_reversed_amount
|
||||
+ supplier_fee_returned_amount
|
||||
```
|
||||
|
||||
例:原供应商净应收 9.5 USDT、平台手续费 0.5 USDT;审核给商户退 1 USDT,同时将 0.2 USDT 手续费返供应商。商户 +1,供应商待结算 +0.2,平台手续费 -0.2;本单可结算变 9.7,而不是仍为 9.5。若另冲正原净应收 0.3,则变 9.4。此来源金额在结算创建时快照,结算占用期间禁止再改变供应商/手续费来源。
|
||||
|
||||
### 5.4 人工付款恢复
|
||||
|
||||
```text
|
||||
PENDING → APPROVED → PAYING → PAID
|
||||
↘ UNKNOWN → PAID
|
||||
PENDING / APPROVED → REJECTED(尚未授权付款)
|
||||
PAYING / UNKNOWN → REJECTED(独立证明未付款且授权已作废,特殊审核)
|
||||
```
|
||||
|
||||
出款前必须持久化 payout_no 并提交 PAYING。付款页面和操作规程以 payout_no 为核对依据,结果未确认不得提供“重新付款”入口。进程崩溃后查询原付款证据;数据库授权只能防应用重复发起,人工操作和外部付款平台也必须遵守单一授权,不声称数据库能保证外部资金绝对只支付一次。
|
||||
|
||||
付款凭据按 network:txid:eventIndex 等规范化并独立核验金额、币种、网络、实际收款人与授权一致;payment_reference 唯一不能代替真实性核验。付款确认时原子减少待结算、追加 SETTLE、标记 PAID。PAID 明细占位保留。
|
||||
|
||||
### 5.5 充值与对账
|
||||
|
||||
TOPUP 的 business_key 以已核验的全局充值事件构造,不含账户 ID;其他流水键可以包含账户。键长度扩为 160 ASCII,为不同事件编号及账户组合留足空间,所有写入仍检查长度并拒绝截断。evidence_ref 仍是依据描述,不是唯一约束。
|
||||
|
||||
每日按网络核对:冻结余额 = HELD 订单售价合计;供应商待结算 = 已确认且未支付来源净额合计(包括退回供应商手续费);账户各余额 = 对应流水增量合计;平台手续费收入 = delta_platform_fee 合计;钱包预留 = HELD 委托任务本金合计。退款拒绝、结算拒绝和未知都保留历史,不手改差额。
|
||||
|
||||
## 6. SQL 与文档修正清单
|
||||
|
||||
| 表 | V2.2 变化 |
|
||||
| --- | --- |
|
||||
| rent_wallet | 快照高度、最低区块屏障 |
|
||||
| rent_package | delegate_lock,首版只允许非锁定 |
|
||||
| rent_order | 供应商账户、关系占位、执行截止、手续费返还累计、关系唯一键及扫描索引;修正服务起点 |
|
||||
| rent_task | network、原委托交易引用、钱包执行占位及唯一键;回收预留 NONE |
|
||||
| rent_transaction | block_time;实际资源不足不篡改链上事实 |
|
||||
| rent_ledger | business_key 扩容及 ASCII、refund_id,修正手续费方向说明 |
|
||||
| rent_settlement | PAYING、唯一 payout_no、付款授权时间 |
|
||||
| rent_settlement_item | 净结算来源加入返还供应商手续费 |
|
||||
| rent_refund | 新表,审批、幂等、退款与各方费用承担 |
|
||||
| rent_webhook | event_key、订单事件序号及唯一键,删除按事件类型唯一限制 |
|
||||
| rent_event | 编号长度与 ASCII、REFUND 审计类型 |
|
||||
|
||||
其余表保留原身份、凭证、防重放和资金账户职责。金额和状态检查仍须服务端执行,不能把 COMMENT 当数据库约束。
|
||||
|
||||
## 7. 已有数据库的迁移要求
|
||||
|
||||
本次只修订初始化 DDL,不提供盲目执行的 ALTER,因为目前没有实际已部署表结构和历史数据证据。重跑 IF NOT EXISTS 不会增加字段、修改索引或回填数据。
|
||||
|
||||
1. 暂停新单和新出款,备份结构及数据,核对实际版本;历史链上交易继续独立核对。
|
||||
2. 先增可空字段并建退款表,再从可信来源回填;不要直接给历史在途单填一个“当前时间”或虚构的 block_time。
|
||||
3. 同钱包同接收者同类型的历史重复在租订单,以及同钱包同类型多在途任务,先隔离核对,不能直接全部赋占位 1 后强建唯一键,也不能把 UNKNOWN 随意置 NULL。
|
||||
4. 回填 supplier_account_id,检查用户/网络归属;历史手续费返还从不可变流水及审核依据重建,没有事实证明时不能猜测。
|
||||
5. 回填 dispatch_deadline;历史已投递任务保持恢复路径,不因回填截止被自动取消或重派。
|
||||
6. 原委托 block_time 从链上核验;RECLAIM.source_transaction_id 按真实原交易回填。旧任务 intent 和 HMAC 不原地修改,新字段仅用于新任务协议,旧在途沿旧版验证至完结。
|
||||
7. 历史已锁定委托不改写为非锁定;保留原授权和真实锁期,专门回收。新套餐使用新版本和 delegate_lock=0。
|
||||
8. 历史结算 APPROVED 需逐笔核对是否已付款或已开始人工付款,未知先隔离为 UNKNOWN;不能默认未付。历史付款凭据规范化去重后再建唯一索引。
|
||||
9. 已有回调在保留原 payload、event_no 前提下按可信业务来源分配 event_key 和订单序号;历史缺失的部分退款需核对后补独立记录,不能重发造成再次退款。
|
||||
10. 快照全部失效,初始化最低区块为已确认相关交易高度,可信重查后才恢复出租;验证新唯一键及逻辑约束,再上线服务。
|
||||
|
||||
## 8. 验收场景与边界
|
||||
|
||||
| 场景 | 必须满足的结果 |
|
||||
| --- | --- |
|
||||
| 同订单并发两次同退款请求 | 只一条退款单、一次余额变化和一次业务回调 |
|
||||
| 同订单两次不同部分退款 | 两条退款来源和回调均可保存,累计不超过售价 |
|
||||
| 两个退款审批累计超限 | 订单行锁裁决,第二个重新检查后拒绝,不改余额 |
|
||||
| 同地址对同类型两单并发调度 | 关系唯一键只允许一个占位;失败事务不能遗留预留 |
|
||||
| 同钱包同类型两个链上任务 | 执行唯一键拒绝第二个;不同类型独立占位 |
|
||||
| 原任务 UNKNOWN | 预留及占位保留,不新签、不改派;无 txId 仍被恢复扫描 |
|
||||
| 老快照请求在新确认事务之后返回 | 版本或高度不匹配,丢弃,不恢复出租额度 |
|
||||
| 委托确认后扣掉预留但尚无新快照 | 快照失效,调度拒绝 |
|
||||
| 已上链却未覆盖冗余目标 | 交易 CONFIRMED,订单人工核对,仍追踪本金回收,不重复委托 |
|
||||
| 可重试失败 | 保留商户冻结资金,无终态失败回调 |
|
||||
| 最终失败 | 一次解冻,不再自动新执行 |
|
||||
| 核验晚于原租期 | 不延长起点或自动扣款,人工处理真实交付 |
|
||||
| 回收任务 | 绑定原委托、原 SUN、同类型,reservation_status=NONE |
|
||||
| 回收后资源尚未恢复 | RECOVERING,不按旧快照重租,不释放关系占位 |
|
||||
| 手续费返供应商后结算 | 返还额同时存在账户、流水和来源订单,可结算金额一致 |
|
||||
| 退款与结算并发 | 同账户/订单锁序决定唯一有效来源,不能既付款又冲掉来源 |
|
||||
| PAYING 后崩溃或失联 | 查原 payout_no,不能普通拒绝或重新出款 |
|
||||
| 重复充值凭据给不同账户 | TOPUP 全局业务键冲突,整个事务回滚 |
|
||||
| 重复回调与乱序 | 余额不受影响,商户按 event_no 去重及事件序号识别旧事件 |
|
||||
|
||||
静态 DDL 与模型验证结果记录在 [validation-v2.2.md](validation-v2.2.md)。静态检查不能替代真实 MySQL 5.7/8.0 并发事务、Agent 故障恢复、HMAC 跨语言向量和 NILE 资源恢复实测。
|
||||
@@ -0,0 +1,169 @@
|
||||
"""离线验证租赁 DDL 的索引语义、文档覆盖及资金算例。
|
||||
|
||||
运行:python docs/rental/check_schema.py
|
||||
仅使用标准库。SQLite 内存库只映射实际 DDL 的列名和唯一键,
|
||||
用于验证冲突/NULL 占位语义,不替代 MySQL 方言、类型或并发事务测试。
|
||||
"""
|
||||
|
||||
from decimal import Decimal
|
||||
from pathlib import Path
|
||||
import re
|
||||
import sqlite3
|
||||
import unittest
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
DDL = (ROOT / "sql/rent_init.sql").read_text(encoding="utf-8")
|
||||
TABLES = {}
|
||||
for match in re.finditer(
|
||||
r"CREATE TABLE IF NOT EXISTS `([^`]+)` \((.*?)\n\) ENGINE=.*?;",
|
||||
DDL,
|
||||
re.S,
|
||||
):
|
||||
name, body = match.groups()
|
||||
columns = re.findall(r"^ `([^`]+)` (.+?)(?:,)?$", body, re.M)
|
||||
unique = [
|
||||
(key, re.findall(r"`([^`]+)`", fields))
|
||||
for key, fields in re.findall(
|
||||
r"UNIQUE KEY `([^`]+)` \(([^)]+)\)", body
|
||||
)
|
||||
]
|
||||
TABLES[name] = (columns, unique)
|
||||
|
||||
|
||||
class RentalDesignChecks(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.db = sqlite3.connect(":memory:")
|
||||
self.serial = 0
|
||||
for table, (columns, unique) in TABLES.items():
|
||||
definitions = [
|
||||
'"id" INTEGER PRIMARY KEY' if field == "id" else f'"{field}" TEXT'
|
||||
for field, _ in columns
|
||||
]
|
||||
definitions.extend(
|
||||
"UNIQUE (" + ",".join(f'"{field}"' for field in fields) + ")"
|
||||
for _, fields in unique
|
||||
)
|
||||
self.db.execute(f'CREATE TABLE "{table}" ({",".join(definitions)})')
|
||||
self.addCleanup(self.db.close)
|
||||
|
||||
def insert(self, table, **values):
|
||||
self.serial += 1
|
||||
# 为与本用例无关的唯一列使用独立值,避免错误命中其他唯一键。
|
||||
row = {
|
||||
field: f"row-{self.serial}-{field}"
|
||||
for field, _ in TABLES[table][0]
|
||||
if field != "id"
|
||||
}
|
||||
row.update(values)
|
||||
self.db.execute(
|
||||
f'INSERT INTO "{table}" ({",".join(row)}) '
|
||||
f'VALUES ({",".join("?" for _ in row)})',
|
||||
tuple(row.values()),
|
||||
)
|
||||
|
||||
def conflict(self, table, **values):
|
||||
with self.assertRaises(sqlite3.IntegrityError):
|
||||
self.insert(table, **values)
|
||||
|
||||
def test_table_and_document_coverage(self):
|
||||
self.assertEqual(len(TABLES), 16)
|
||||
self.assertEqual(len(re.findall(r"CREATE TABLE", DDL)), 16)
|
||||
doc = (ROOT / "docs/rental/table-functional-flows.md").read_text("utf-8")
|
||||
sections = set(re.findall(r"### 2\.\d+ (rent_\w+):", doc))
|
||||
self.assertEqual(sections, set(TABLES))
|
||||
for table, (columns, unique) in TABLES.items():
|
||||
fields = {name for name, _ in columns}
|
||||
self.assertEqual(len(fields), len(columns), table)
|
||||
self.assertTrue({"id", "version", "created_at", "updated_at"} <= fields)
|
||||
for name, definition in columns:
|
||||
self.assertIn("COMMENT '", definition, f"{table}.{name}")
|
||||
for key, parts in unique:
|
||||
self.assertTrue(set(parts) <= fields, f"{table}.{key}")
|
||||
executable = re.sub(r"--[^\n]*", "", DDL)
|
||||
self.assertNotRegex(executable, r"(?i)\b(DROP|ALTER|DELETE|TRUNCATE)\b")
|
||||
|
||||
def test_document_local_links(self):
|
||||
for path in (ROOT / "docs/rental").glob("*.md"):
|
||||
for target in re.findall(r"\]\(([^)]+)\)", path.read_text("utf-8")):
|
||||
if "://" not in target and not target.startswith("#"):
|
||||
self.assertTrue((path.parent / target.split("#")[0]).exists(), target)
|
||||
|
||||
def test_order_relation_exclusion_and_null_release(self):
|
||||
key = dict(wallet_id=7, receiver_address="receiver-A", resource_type="ENERGY")
|
||||
self.insert("rent_order", **key, relation_slot=1)
|
||||
self.conflict("rent_order", **key, relation_slot=1)
|
||||
self.insert("rent_order", **key, relation_slot=None)
|
||||
self.insert("rent_order", **key, relation_slot=None)
|
||||
self.insert("rent_order", **{**key, "resource_type": "BANDWIDTH"}, relation_slot=1)
|
||||
self.insert("rent_order", **{**key, "receiver_address": "receiver-B"}, relation_slot=1)
|
||||
|
||||
def test_wallet_execution_shared_by_delegate_and_reclaim(self):
|
||||
key = dict(wallet_id=7, resource_type="ENERGY", wallet_execution_slot=1)
|
||||
self.insert("rent_task", **key, task_type="DELEGATE")
|
||||
self.conflict("rent_task", **key, task_type="RECLAIM")
|
||||
self.insert("rent_task", **{**key, "resource_type": "BANDWIDTH"})
|
||||
self.insert("rent_task", **{**key, "wallet_execution_slot": None})
|
||||
self.insert("rent_task", **{**key, "wallet_execution_slot": None})
|
||||
|
||||
def test_task_attempt_active_slot(self):
|
||||
key = dict(order_id=11, task_type="DELEGATE", active_slot=1)
|
||||
self.insert("rent_task", **key, attempt_no=1)
|
||||
self.conflict("rent_task", **key, attempt_no=2)
|
||||
self.insert("rent_task", **{**key, "active_slot": None}, attempt_no=2)
|
||||
self.conflict("rent_task", **{**key, "active_slot": None}, attempt_no=2)
|
||||
|
||||
def test_refund_request_deduplication(self):
|
||||
self.insert("rent_refund", order_id=11, request_no="request-A")
|
||||
self.conflict("rent_refund", order_id=11, request_no="request-A")
|
||||
self.insert("rent_refund", order_id=11, request_no="request-B")
|
||||
|
||||
def test_multiple_partial_refund_webhooks(self):
|
||||
self.insert("rent_webhook", order_id=11, event_type="REFUNDED",
|
||||
event_key="REFUND:R1", order_event_sequence=2)
|
||||
self.insert("rent_webhook", order_id=11, event_type="REFUNDED",
|
||||
event_key="REFUND:R2", order_event_sequence=3)
|
||||
self.conflict("rent_webhook", order_id=11, event_type="REFUNDED",
|
||||
event_key="REFUND:R1", order_event_sequence=4)
|
||||
self.conflict("rent_webhook", order_id=11, event_type="REFUNDED",
|
||||
event_key="REFUND:R3", order_event_sequence=3)
|
||||
|
||||
def test_payout_and_payment_reference_uniqueness(self):
|
||||
self.insert("rent_settlement", payout_no="P1", payment_reference="MAINNET:tx:0")
|
||||
self.conflict("rent_settlement", payout_no="P1", payment_reference=None)
|
||||
self.conflict("rent_settlement", payout_no="P2", payment_reference="MAINNET:tx:0")
|
||||
self.insert("rent_settlement", payout_no=None, payment_reference=None)
|
||||
self.insert("rent_settlement", payout_no=None, payment_reference=None)
|
||||
|
||||
def test_settlement_order_source_not_reusable_after_paid(self):
|
||||
self.insert("rent_settlement_item", order_id=11, active_slot=1)
|
||||
self.conflict("rent_settlement_item", order_id=11, active_slot=1)
|
||||
self.insert("rent_settlement_item", order_id=11, active_slot=None)
|
||||
|
||||
def test_topup_global_business_key(self):
|
||||
key = "TOPUP:MAINNET:" + "a" * 64 + ":2147483647"
|
||||
self.assertLessEqual(len(key), 160)
|
||||
self.insert("rent_ledger", account_id=1, business_key=key)
|
||||
self.conflict("rent_ledger", account_id=2, business_key=key)
|
||||
|
||||
def test_one_transaction_per_task_and_hash(self):
|
||||
self.insert("rent_transaction", task_id=11, network="NILE", tx_id="tx1")
|
||||
self.conflict("rent_transaction", task_id=11, network="NILE", tx_id="tx2")
|
||||
self.conflict("rent_transaction", task_id=12, network="NILE", tx_id="tx1")
|
||||
|
||||
def test_supplier_fee_return_example(self):
|
||||
# 精确金额算例:账户待结算增量必须与来源订单可结算额一致。
|
||||
gross, fee = Decimal("10"), Decimal("0.5")
|
||||
returned, reversed_net = Decimal("0.2"), Decimal("0.3")
|
||||
ledger_pending = gross - fee + returned - reversed_net
|
||||
order_source = Decimal("9.5") - reversed_net + returned
|
||||
self.assertEqual(ledger_pending, order_source)
|
||||
self.assertEqual(order_source, Decimal("9.4"))
|
||||
# 退商户的手续费已包含于M:基础退款+手续费退款=M,不能M+F。
|
||||
merchant_refund, merchant_fee_part = Decimal("1"), Decimal("0.2")
|
||||
self.assertEqual((merchant_refund - merchant_fee_part) + merchant_fee_part,
|
||||
merchant_refund)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(verbosity=2)
|
||||
@@ -0,0 +1,305 @@
|
||||
# 能量/带宽出租表结构与业务流程 V2.2
|
||||
|
||||
状态:设计稿,未执行现有数据库变更、未实现租赁业务服务。当前权威 DDL 为 [rent_init.sql](../../sql/rent_init.sql),共 16 张 rent_ 表。V2.2 复核结果、事务协议、迁移要求和验收场景见 [业务复核与修正说明](business-review-v2.2.md),逐表说明见 [table-functional-flows.md](table-functional-flows.md)。本版不表示生产数据库已经迁移。
|
||||
|
||||
## 1. 简化范围和保留边界
|
||||
|
||||
本版采用以下明确设计假设:同时出租Energy和Bandwidth,固定套餐,一单一种资源、一个供应钱包,全额交付、单币种USDT内部记账;供应商自行质押并提供可委托本金,平台不替其质押。一个钱包首版只绑定一个Agent,Agent通过主动出站WSS长连接收取任务并上报,具有双向心跳和断线恢复,不再长轮询领取。套餐价格和供应商成本由运营预先配置,无独立报价流程。
|
||||
|
||||
登录、Google、用户、角色、菜单和按钮权限沿用若依sys_*体系,不增加成员/角色表。租赁应用、凭证、订单、资金和任务独立,不复用支付apps、orders、wallet_address或余额。通过现有TRON查询service获取链上事实,业务调度、交易执行和核验编排独立。
|
||||
|
||||
首版暂缓动态报价、多级代理佣金、自动续租、复杂供应商竞价、自动链上充值识别和自动出金。人工充值审核和供应商结算仍必须有依据、去重、余额流水及审计;未来需要这些功能时再增量扩展,不能把暂缓功能隐含进JSON自动执行。
|
||||
|
||||
保留供应商本地密钥、默认禁止广播、链上独立核验、订单幂等、原交易恢复、未知状态隔离、资金冻结、资源预留、到期回收、回调持久队列和不可变流水。
|
||||
|
||||
## 2. 16张表及职责
|
||||
|
||||
| 表 | 作用 |
|
||||
| --- | --- |
|
||||
| rent_app | 独立商户应用,user_id关联sys_user |
|
||||
| rent_credential | APP/NODE统一api_key与加密api_secret,轮换保留历史 |
|
||||
| rent_nonce | HMAC认证域内防重放 |
|
||||
| rent_node | 供应商节点、审核、心跳,直接关联供应商sys_user |
|
||||
| rent_wallet | 公开钱包授权、能量/质押带宽可信快照、按资源类型隔离的可委托SUN与预留 |
|
||||
| rent_package | 固定套餐版本、数量、时长、USDT售价、供应商应付及费用约束 |
|
||||
| rent_account | 用户在某网络的可用USDT、冻结USDT及供应商待结算USDT |
|
||||
| rent_order | 下单、价格快照、履约、退款累计、租期和回收调度 |
|
||||
| rent_task | 委托/回收执行任务、重试历史、原子资源占用和持久队列 |
|
||||
| rent_transaction | 任务唯一链上交易与回执、关系增量和独立核验 |
|
||||
| rent_ledger | 不可变余额变更流水与业务幂等键 |
|
||||
| rent_settlement | 人工供应商结算审核及付款证据 |
|
||||
| rent_settlement_item | 每个订单的供应商应收只能结算一次 |
|
||||
| rent_refund | 内部余额退款审批、业务幂等、费用承担及逐次退款来源 |
|
||||
| rent_webhook | 订单事件回调持久队列 |
|
||||
| rent_event | 关键操作、状态转换及节点消息去重的追加审计 |
|
||||
|
||||
简化方式:供应商不再单独建档(使用节点user_id);产品、规则和报价合并为不可变版本套餐;快照/资源池合并到钱包,预留明细合并到任务;委托关系与回收调度放订单和任务,链上证据独立;资金采用余额+不可变流水,不建设整套复式会计总账;业务任务表和回调表直接作可靠队列,不额外建设消息中间件与通用Outbox。
|
||||
|
||||
### 资源类型与字段约定
|
||||
|
||||
- rent_package、rent_order、rent_task、rent_transaction均有resource_type,允许ENERGY或BANDWIDTH,不设默认值;套餐、订单、任务及实际链上类型必须一致。
|
||||
- 套餐、订单、任务使用resource_quantity正整数:ENERGY单位Energy,BANDWIDTH单位bytes;不再使用energy_quantity。单位由类型唯一确定,不另存可冲突的单位字段。
|
||||
- 每个套餐及订单只租一种资源;同一用户需要两种资源时分别下单,价格和供应商应付独立配置。套餐同一package_code各版本不允许变换资源类型,新类型使用新代码。
|
||||
- 钱包保留energy_available并增加bandwidth_available(仅可出租质押带宽,不含免费带宽)。energy_enabled/bandwidth_enabled独立开关,默认关闭。
|
||||
- 能量本金字段为energy_delegatable_sun、energy_reserved_sun、energy_retain_sun;带宽对应bandwidth_delegatable_sun、bandwidth_reserved_sun、bandwidth_retain_sun。同一钱包行锁串行修改,只更新本任务的资源类型字段;未知能量任务不占用带宽本金,反之亦然。
|
||||
- total_energy_limit/weight及total_bandwidth_limit/weight分别表示各自全网额度/权重,使用同一时点可信快照;两类快照未完整成功时不推进共同snapshot_at/expires_at,失败不能用零值覆盖另一类型占用。
|
||||
- 链上BANDWIDTH的resource_code=0,ENERGY=1;免费带宽不可委托,账户普通TRX余额、收到代理量均不能直接视为可出租本金。RECLAIM必须使用原委托的resource_type和对应SUN,不能撤销另一类本金。
|
||||
- HMAC意图、下单摘要、商户查询、回调、管理列表及审计都须明确资源类型和数量;内部统计按类型分组,不把Energy数量和bytes相加。
|
||||
- 任务唯一键仍按order_id/task_type/active_slot,因为一个订单只含一种资源;钱包地址唯一键保持(network,address),不为两类资源重复创建钱包。
|
||||
- V2.2 订单以 `(wallet_id,receiver_address,resource_type,relation_slot)` 限制同地址对同类型只有一笔在租或待回收订单,任务以 `(wallet_id,resource_type,wallet_execution_slot)` 限制同钱包同类型只有一个在途操作。两个占位均只能为 1 或 NULL;未知不可释放。不同接收者可分别在租,但同钱包同类型的链上操作串行。
|
||||
- 钱包 `snapshot_block_height / snapshot_min_block_height` 配合 version CAS 防止旧快照覆盖。确认交易、释放预留与快照失效屏障同事务;获取新快照前不能再调度。详细顺序见复核说明第 3 节。
|
||||
- 首版仅 `delegate_lock=0` 非锁定 Stake 2.0 委托,套餐 rules 和任务 intent 必须一致。不得直接复用现有 NILE/MAINNET 通用 `delegateResourceV2`(写死 `lock=true,86400` 且直接签名广播)。租赁只复用只读查询,本地 Agent 自行构建、持久化再广播。
|
||||
|
||||
### 请求资源量、冗余和委托TRX换算
|
||||
|
||||
链上Stake 2.0委托提交的是该资源类型对应的质押等值TRX本金,接口单位SUN,不直接提交Energy或bytes,也不是将TRX转账给接收人。Energy和Bandwidth必须使用各自当前网络总额度及权重,禁止固定TRX/资源汇率。
|
||||
|
||||
设Q为用户请求resource_quantity,R为锁定的redundancy_percent(20表示20%),L为该类型当前全网资源总额度,W为该类型当前全网总权重(协议的TRX权重单位,不是SUN):
|
||||
|
||||
```text
|
||||
目标资源量 T = max(Q + 1, ceil(Q × (1 + R / 100)))
|
||||
委托TRX本金 P = ceil(T × W / L)
|
||||
委托SUN本金 S = P × 1,000,000
|
||||
预计可交付资源 E = floor(S × L / (W × 1,000,000))
|
||||
必须满足:Q > 0,R > 0,L > 0,W > 0,E >= T > Q
|
||||
```
|
||||
|
||||
本版选择按整TRX向上取整,是避免不足的业务保守策略,不声称链上只能接受整TRX;若未来支持更细SUN步长,必须另定精度策略并验证节点最小委托限制及实际资源映射。公式使用BigDecimal/BigInteger和显式CEILING/FLOOR,中间乘积不能用long直接相乘或double;转换为BIGINT入库前执行精确范围检查。Q+1也必须检查溢出。
|
||||
|
||||
示例仅用于说明计算,不是当前网络价格:Q=65000 Energy,R=20%,T=78000;若当时L/W=60 Energy/TRX,则P=1300 TRX,S=1300000000 SUN,E=78000。带宽Q=1000 bytes、R=20%,若当时L/W=1.5 bytes/TRX,则T=1200、P=800 TRX。两种比例均从实时网络取得,不能把示例常量写入代码。
|
||||
|
||||
冗余仅放大用户购买的资源额度,不凭空增加同额TRX费用预算,也不自动扩大商户计价数量。固定套餐仍按resource_quantity收取快照售价,供应商成本和费用限制须已覆盖冗余;不能因实时换算需要更多本金而绕过本地额度/费用上限。Q表示本次应委托增加的资源量,不默认减去接收地址已有可用资源。
|
||||
|
||||
字段分工:套餐保存resource_quantity和默认20%的redundancy_percent;订单锁定二者及target_resource_quantity;任务保存原请求、冗余目标、换算参数/区块/时间、estimated_resource_quantity和delegate_sun;链上交易保存实际amount_sun、verified_total_limit/weight和verified_resource_quantity。TRX展示从SUN用BigDecimal除1000000得到,不额外存一份可冲突的本金TRX字段。
|
||||
|
||||
任务生成前可信查询L/W及可委托本金,按S而非未加冗余的估算量预留对应类型SUN。Agent签名前再次查询L/W、可委托额度、链上限制和费用:若原任务S已不足覆盖T,明确未构建/广播时拒绝旧任务并释放旧占位,由云端重新计算、预留、签发新attempt;Agent不可悄悄改大已签HMAC的S。原任务已构建/广播或结果未知时只按原交易恢复,不重签或新建一笔补额交易。
|
||||
|
||||
云端在确认区块用实际amount_sun与该区块L/W核验资源额度及链上委托增量,必须满足verified_resource_quantity >= T > Q才可结算成功。这里核验的是本单委托所对应的资源额度,不是接收方瞬时可用余额差;后者会受已有委托和并发消费影响,不能直接当作本单交付。
|
||||
|
||||
交易已成功但参数变化导致不足T时,不回滚链上事实、不将其标为未执行失败,不释放已委托本金、不重复委托;订单进入MANUAL_REVIEW并保留资金,按原确认SUN追踪回收,经审核选择撤销/退款等处置。首版不自动补委托以维持一单一笔成功委托的模型。冗余只是确认时的交付缓冲,不保证租期内全网参数永不变化,不能承诺资源额度恒定。
|
||||
|
||||
撤销以原已确认amount_sun为准,保持同资源类型,绝不能按到期时L/W重新换算原resource_quantity,否则可能多撤或少撤。RECLAIM任务的换算字段仅复制原委托审计快照,不用于决定撤销SUN。发生本金已委托但订单未成功的异常也必须进入回收扫描,不能仅扫描SUCCESS订单。
|
||||
|
||||
## 3. 业务流程示意图
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["商户选择能量或带宽固定套餐并下单"] --> B{"HMAC、幂等、余额校验"}
|
||||
B -->|不通过| X["拒绝请求"]
|
||||
B -->|通过| C["事务:创建订单、冻结USDT"]
|
||||
C --> R["请求数量加正冗余,得到更大的目标量"]
|
||||
R --> D["按当前资源参数换算TRX并向上取整,预留SUN"]
|
||||
D --> E["本地Agent复核额度并签名广播"]
|
||||
E --> F{"云端独立核验链上结果"}
|
||||
F -->|明确最终失败| G["释放冻结资金与预留资源"]
|
||||
F -->|明确未执行且允许重试| V["释放旧资源占位,保留冻结资金"]
|
||||
V --> D
|
||||
F -->|结果未知| H["保持占用,查询原txId或人工核对"]
|
||||
H --> F
|
||||
F -->|确认且资源额度覆盖冗余目标| I["事务:扣款、供应商应收、回调入队"]
|
||||
F -->|已委托但额度不足或核验已到期| U["人工核对、保留资金及本金记录,不重复委托"]
|
||||
U --> K
|
||||
I --> J["商户使用能量或带宽"]
|
||||
J --> K["租期结束,生成撤销任务"]
|
||||
K --> L["Agent撤销,云端核验"]
|
||||
L --> M{"本金回收且资源恢复?"}
|
||||
M -->|未恢复或被锁定| N["等待链上条件并告警"]
|
||||
N --> L
|
||||
M -->|是| O["回收完成,资源可再次出租"]
|
||||
I --> P["运营人工审核供应商结算"]
|
||||
```
|
||||
|
||||
### 3.1 开通与充值
|
||||
|
||||
1. 用户通过共用系统登录,运营在系统角色/菜单中授予rent:*权限。商户创建rent_app,获取独立API凭证;供应商创建rent_node并申请钱包接入。
|
||||
2. 供应商在平台通过TronLink完成一次性消息签名验证,后端恢复的地址必须与待绑定地址一致;不要求发送链上证明交易或支付验证费用。运营审核与链上委托权限检查另行执行,未通过验证和审核的钱包不可接单。
|
||||
3. 供应商Agent配置自己的钱包、留存本金/费用上限,默认广播关闭。人工确认后在本地允许广播;平台无法替节点打开。
|
||||
4. 商户提交充值依据,运营通过受保护接口审核,原子增加rent_account.available_amount并追加TOPUP流水及rent_event。TOPUP的business_key使用规范化唯一充值凭据,例如TOPUP:network:txid:logIndex,唯一约束阻止同一凭据给不同用户重复入账。币种仅USDT且网络必须一致,凭据必须独立核验;不以截图作为到账真相。此版无待审充值单表,未审核请求不先增加余额。
|
||||
|
||||
### 3.2 下单与调度
|
||||
|
||||
TronLink钱包验证的完整规则见下方“TronLink钱包控制权验证”;下单仍使用原有HMAC或系统登录认证。
|
||||
|
||||
1. 请求提交package_id、merchant_order_no、receiver_address(resource_type由套餐决定,如请求携带则必须一致),可指定回调URL。应用/用户由认证结果派生。查同一(app_id,merchant_order_no),相同规范化摘要返回原单,不同摘要拒绝。
|
||||
2. 事务内锁套餐及账户,校验上架、网络、价格、地址和余额,保存订单/规则快照:可用减售价、冻结加售价,写HOLD流水和订单WAITING。同事务写状态审计。套餐改价新增revision,旧行不直接改金额。
|
||||
3. 后台扫描WAITING并条件抢占。按锁定正冗余比例计算target_resource_quantity,再选在线、审核通过且快照有效的供应钱包,以当前该资源L/W换算整TRX向上取整后的delegate_sun。预计资源必须覆盖冗余目标,并保存完整换算快照;Energy和Bandwidth参数不能混用。
|
||||
4. 事务内锁订单与钱包,按订单 resource_type 检查对应 delegatable_sun-retain_sun-reserved_sun 足够,取得地址对占位和钱包执行占位,固定 supplier_account_id,仅增加该类型 reserved_sun、创建 DELEGATE 任务并置订单 EXECUTING。任务显式保存 network,意图固定网络、类型、数量、地址、本金、非锁定参数、期限、费用和目标节点。签名前还须核验接收账户可委托条件及同类型地址对基线为零。
|
||||
5. 创建订单时将等待上限固化为 dispatch_deadline,任务 deadline 不得晚于它。WAITING 超时且从未生成任务时取消并解冻。已投递的任务不因截止或断线被推定未执行;查原交易并隔离。明确未执行的可重试任务在截止前保留商户 HELD 资金,释放旧任务及地址对占位后重新调度;终结失败才解冻。用户仅可取消从未生成执行任务的 WAITING 单,取消与调度锁同一订单行裁决。
|
||||
|
||||
### 3.3 委托与确认
|
||||
|
||||
1. Agent持久化接单,验HMAC及本地授权/资源/费用,实时检查可委托额度;拒绝可返回明确未执行结果。
|
||||
2. 本地仅构建签名一次,先持久化原签名交易及txId再广播;任何重试先查原txId,不重签另一笔交易。云端租约过期不能证明未执行。
|
||||
3. 云端独立检查网络、owner、receiver、资源类型(ENERGY或BANDWIDTH)、SUN、回执、确认深度、委托前后差异;节点自报成功及HTTP200均不代表成功。
|
||||
4. 确认成功后同事务:订单 SUCCESS、fund_status=CHARGED,冻结余额减售价;供应商先记 SUPPLIER_EARN 毛收入,再记 SUPPLIER_FEE 扣费,待结算净增加 supplier_net_amount;流水、审计和 SUCCESS 回调原子提交。service_started_at 使用独立核验交易的 block_time,service_expires_at=起点+租期;核验延迟不得延长租期。核验时已到期或无法取得足够历史证据则转人工核对,不静默扣款。多账户按 account_id 升序加锁,同账户只锁一次。
|
||||
5. 链上事实确认即将对应委托预留转 COMMITTED 并扣除 reserved_sun,提升钱包 snapshot_min_block_height 至确认区块,令 snapshot_expires_at=NULL,再释放任务 wallet_execution_slot;与订单是否达到交付目标分开处理。后台按版本和区块屏障应用新的可信快照,之后才可接新任务;不能沿用旧值或先释放后异步补屏障。
|
||||
6. 明确未执行的可重试失败只释放资源并重新调度,不写终态 FAILED 回调或解冻;决定最终失败时才同事务释放冻结、写 RELEASE 和 FAILED 回调。UNKNOWN 保留占位及预留,扫描任务及交易的 next_check_at;即使没有 txId 也必须扫描任务恢复,不能只扫描交易表。未知不能改钱包。已构建交易只有证实链上失败或超过原交易有效期且独立确认未上链才可重试;未找到一次、租约超时或 Agent 丢记录都不算证明。
|
||||
|
||||
### 3.4 到期回收
|
||||
|
||||
1. 业务服务到期只生成RECLAIM任务,不改已成功的履约状态,不自动退租金。
|
||||
2. Agent查询实际锁定及可撤销量,按链上规则撤销;云端确认撤销交易后仍需核对资源实际恢复。
|
||||
3. 首版同钱包、同 receiver、同类型仅允许一笔占位订单,拒绝存在该类型外部委托基线的钱包地址对;同地址对的下一笔单排队或选择其他钱包。RECLAIM 的 source_transaction_id 必须指向本单原确认 DELEGATE;仅撤销原 amount_sun。回收任务 reservation_status=NONE,不新增可委托本金预留,但要取得钱包执行占位。部分可回收或关系变化转人工,不撤销他人份额。
|
||||
4. 链上仍锁定则 next_reclaim_at 等待;未知保留执行占位。撤销确认后更新快照区块屏障并失效旧快照,再释放执行占位;本金已回收但资源未恢复为 RECOVERING,按新的 getCanDelegatedMaxSize 及资源使用证据核对,不机械等待数值回到旧快照。确认本单恢复后才置 DONE 并释放订单 relation_slot。回收未发起前也要持久化 next_reclaim_at,不能遗漏异常委托。
|
||||
5. active_slot保留成功DELEGATE任务用于定位原始SUN和链上证据;RECLAIM任务独立占位,不能把履约与回收混成一个status。
|
||||
|
||||
### 3.5 人工结算与退款
|
||||
|
||||
### 供应商手续费
|
||||
|
||||
平台在订单链上履约核验成功、订单转SUCCESS时向供应商扣取手续费;不在下单冻结、节点自报、未知状态、到期回收或结算付款时重复收取。商户售价不因此额外增加。套餐显式配置supplier_fee_percent(百分数,5代表5%),不擅自指定实际费率;下单锁定费率及金额,后续调费新增套餐版本,不改历史订单。
|
||||
|
||||
```text
|
||||
供应商毛收入 G = supplier_amount
|
||||
平台供应商手续费 F = round(G × supplier_fee_percent / 100, 6, HALF_UP)
|
||||
供应商净应收 N = G - F
|
||||
必须满足:0 < 费率 < 100,0 < F < G,N > 0,G <= 商户售价
|
||||
```
|
||||
|
||||
例如毛收入10 USDT、配置费率5%,则平台手续费0.5 USDT、供应商净应收9.5 USDT。5%仅为示例,不是初始化默认费率。若极小金额舍入后手续费为0,拒绝启用套餐/创建订单,不能无提示按0收费或额外收最低费。
|
||||
|
||||
同一成功事务写两条供应商rent_ledger:SUPPLIER_EARN的delta_supplier_pending=+G、delta_platform_fee=0;SUPPLIER_FEE的delta_supplier_pending=-F、delta_platform_fee=+F。分别使用包含订单与事件类型的唯一business_key;只有首次成功状态转换可记账,重复扫描/回报不能再次扣费。三种余额的after值按两条流水顺序连续保存,事务提交后净增加N。平台手续费事实以不可变流水delta_platform_fee累计,不将其放入用户可用余额;这是简化收入统计,不是另一个可提款账户。
|
||||
|
||||
平台经营统计分别展示商户售价、供应商毛收入、供应商手续费、净应付和售采差价。平台总服务收入为商户售价减G再加F(仍需另计实际其他成本),不能将F重复加进已经按售价减N计算的收入。
|
||||
|
||||
结算来源金额为 supplier_net_amount-supplier_reversed_amount+supplier_fee_returned_amount,不能使用原 supplier_amount 或再次扣手续费。失败及未执行取消不计应收不抽手续费;已委托但资源不足的人工核对单也不能提前收取。
|
||||
|
||||
每次退款先创建 rent_refund,以 (order_id,request_no) 和 request_hash 幂等。只处理已 CHARGED 且已确认收入的订单。PENDING 不改余额;独立审批时重新校验累计金额,APPLIED 与订单累计、余额、各事件流水及退款回调同事务。分别保存商户退款额、供应商原净额冲正、平台手续费退回额及 fee_return_to。手续费退商户时已经包含在 refund_amount,不得再次加余额;退供应商时增加待结算及 supplier_fee_returned_amount。手续费退回累计不超过原手续费,原净额冲正累计不超过 supplier_net_amount,商户退款累计不超过售价。fee_return_to=NONE 当且仅当手续费退回为零;退商户手续费不得大于本次退款额。若来源已结算或已被结算占用,涉及供应商或手续费变化的退款不得应用;商户单方由平台承担的退款可单独审核。无外部退款出金。
|
||||
|
||||
结算发起时锁供应商账户及订单来源,检查订单SUCCESS、已核验、净应付未被占用;rent_settlement_item的(order_id,active_slot)唯一。结算金额按订单净应付汇总,不能超过账户待结算余额。结算审核不提前减少待结算,所有已占用来源都禁止再入其他结算单。
|
||||
|
||||
人工付款前先将 APPROVED 条件更新为 PAYING,持久化唯一 payout_no、payment_started_at 及审计,提交后才允许出款。付款后独立核验凭据,再同事务扣待结算、写 SETTLE、标记 PAID 并审计。PAYING/UNKNOWN 禁止普通拒绝、释放明细或重新出款;恢复时查询原 payout_no 和凭据。只有独立核验明确未付款且原授权已作废后,才可审核拒绝并释放来源。payment_reference 全局唯一。创建、审批职责分离,首版每来源整笔结算。
|
||||
|
||||
普通执行失败是解冻,不叫退款。退款按锁定规则和上述退款单审批执行,禁止制造负应付或修改已付历史。每次部分退款产生独立 event_key=REFUND:refund_no;回调不再按 (order_id,event_type) 唯一,而按业务事件键及订单事件序号唯一,避免第二次退款无法通知。
|
||||
|
||||
结算拒绝、退款及调度恢复都必须写审计,不能仅手工UPDATE数据库余额。
|
||||
|
||||
## 4. 状态和必须执行的约束
|
||||
|
||||
- 履约order.status:WAITING → EXECUTING → VERIFYING → SUCCESS;失败/取消明确终态FAILED/CANCELLED,结果不确定MANUAL_REVIEW。任务UNKNOWN不直接映射FAILED。
|
||||
- 资金fund_status:HELD → CHARGED或RELEASED;退款累计refunded_amount另记,不覆盖原扣款事实。
|
||||
- 回收reclaim_status:NOT_STARTED → WAITING → RUNNING → RECOVERING → DONE;异常MANUAL_REVIEW。
|
||||
- 任务status:PENDING → ACCEPTED → BROADCASTED → VERIFIED,另有REJECTED/FAILED/UNKNOWN;任务类型DELEGATE/RECLAIM。
|
||||
- 关联记录的network必须一致,用户id逻辑关联sys_user。API权限不等于数据归属,所有操作校验app.user_id或node.user_id,管理操作另查rent:*权限。
|
||||
- available/frozen/supplier_pending均不得负数。余额变更、流水、状态、回调和审计同事务提交;相同business_key不重复变动余额。
|
||||
- 不可变流水记录三种余额的正负增量及变更后值,可根据历史重建;不冒充双重记账总账。每日校验冻结合计与HELD订单、供应商待结算与未结应付、余额投影与流水。差异记录在rent_event并人工核对,不静默补差。
|
||||
- 云端扫描数据库持久任务后经节点WSS连接推送,回调仍由数据库队列重试;数据库扫描是云端内部恢复机制,不是Agent长轮询。按状态/version及worker租约条件更新,先验证租约再落结果;Socket只负责传输,任务状态与节点本地持久化才负责副作用幂等。
|
||||
- 一个任务唯一交易,(network,tx_id)全局去重;task(node_id、credential_id)和钱包节点归属必须一致。节点事件用rent_event.event_no唯一键原子去重,相同事件编号不同内容必须拒绝。
|
||||
- HMAC通过后原子预留nonce;业务幂等与nonce是两种约束,重试新nonce、原merchant_order_no。云端定时任务都需限流、分页、超时及显式关闭。
|
||||
- 所有表和字段有COMMENT;日期UTC DATETIME(3),金额DECIMAL(30,6),使用BigDecimal;MYSQL5.7跨表约束必须应用落实。禁止记录Secret、私钥及口令。
|
||||
|
||||
## 5. HMAC规则与共享权限
|
||||
|
||||
### TronLink钱包控制权验证
|
||||
|
||||
此流程是用户明确指定的钱包验证例外:使用TRON原生消息签名证明地址控制权,不引入RSA、公钥认证表,也不改变API/节点/任务/回调的HMAC体系。签署消息不是链上交易,不广播、不转账、不收链上手续费,平台不索取私钥、助记词或钱包密码。
|
||||
|
||||
1. 已登录供应商进入钱包绑定页,连接TronLink并获取当前地址,选择NILE或MAINNET。平台检查rent:*权限、node.user_id归属及(network,address)唯一性;Base58格式不能区分网络,网络必须作为独立声明和后续RPC校验条件。
|
||||
2. 后端生成至少32随机字节的nonce和建议5分钟有效期,保存到rent_wallet的ownership_challenge、ownership_message及签发/到期字段。文本应可读,明确写明“仅验证钱包控制权,不授权转账或委托”,并包含固定协议版本、受信任站点域名、登录user_id、wallet_id、network、address、nonce、签发及过期UTC时间。站点域名来自受信任配置,不盲信请求Host。nonce不得由客户端指定;重新签发前将旧记录写rent_event,再覆盖当前挑战并清空本次签名和消费状态。
|
||||
3. 前端将后端返回的原文原样传入TronLink提供的tronWeb.trx.signMessageV2(message),不预先SHA256、不二次hex编码,不使用sign交易接口或旧signMessage接口替代。签名前后核对当前连接地址与目标地址一致;用户拒签、钱包锁定、账户切换或不支持该版本时显示明确错误,不自动降级到其他签名协议。
|
||||
4. 前端只提交wallet_id、challenge及signature,后端读取已保存原文,校验登录归属、当前地址/网络、有效期及未消费。Java后端使用与TronWeb verifyMessageV2相同的TRON消息前缀、UTF-8字节长度和签名恢复规则,恢复Base58Check地址并严格比较address;不能仅接受前端验签布尔值。JDK8实现应选兼容库并用TronLink真实样本及跨语言向量验证,不能假设Ethereum personal_sign直接兼容。
|
||||
5. 验签通过后以当前challenge、version及未消费状态做条件更新,原子保存signature、恢复地址、ownership_verified_at和challenge_consumed_at,并写rent_event。同一挑战只接受一次;并发仅一方成功,重复完成请求可返回既有验证状态,但不再次产生授权或审核副作用。旧nonce、过期、改原文、跨用户/钱包/域/网络的签名均拒绝。
|
||||
6. 服务端验证当前账户的链上委托权限、本金和网络状态,运营确认后才将钱包设为ACTIVE。地址签名通过仅说明该地址密钥控制能力,不保证质押资源充足、Agent拥有足够的Active Permission,也不证明TronLink实际连接网络;多签/权限密钥不能恢复为目标owner时首版明确拒绝,后续需专门设计多签证明,不能绕过校验。
|
||||
7. 已验证钱包更换地址或网络必须新建/重新验证并先处理在途任务;禁止直接修改已承载订单的钱包地址。认证签名原文与结果作为公开证明数据仍应仅向所属用户/运营展示,日志只记录必要标识和摘要。
|
||||
|
||||
建议接口(共用系统登录与权限,不要求为网页再签一次API HMAC):POST /system/rental/wallet/{id}/challenge、POST /system/rental/wallet/{id}/verify。前者返回message/challenge/expires_at/签名版本,后者返回验证状态和恢复地址;不提供私钥输入框。前端增加连接、签名中、验证成功、拒签/过期/账户切换状态。
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant U as 供应商
|
||||
participant P as 平台网页
|
||||
participant T as TronLink
|
||||
participant S as 后端
|
||||
U->>P: 登录并绑定钱包地址
|
||||
P->>S: 申请一次性挑战
|
||||
S-->>P: 完整原文、nonce、有效期
|
||||
P->>T: signMessageV2(原文)
|
||||
T->>U: 展示原文并请求确认
|
||||
U->>T: 确认签名
|
||||
T-->>P: 消息签名
|
||||
P->>S: 提交挑战与签名
|
||||
S->>S: 验签恢复地址、检查归属与有效期
|
||||
S->>S: 原子消费挑战并保存验证结果
|
||||
S-->>P: 钱包验证成功,等待审核/权限核验
|
||||
```
|
||||
|
||||
旧版若已建ownership_tx_id,仅为旧链上证明字段,不直接当成TronLink验证结果;按实际数据做增量迁移,新验证字段先置空并要求新挑战。旧供应商在途任务保持可核对,不自动将旧签名或历史交易转换为本次签名证明。当前仅修改初始化DDL设计,未执行数据库迁移。
|
||||
|
||||
统一rent_credential:APP主体owner_id为rent_app.id,NODE为rent_node.id;新版本生成新api_key/api_secret,保留旧行。Secret仅在受认证TLS通道创建时展示一次,云端保存AES-GCM封装,主密钥在外部配置。ACTIVE用于新消息,VERIFY_ONLY仅接受明确绑定旧在途任务的有效验证,REVOKED一律拒绝。
|
||||
|
||||
HMAC-SHA256小写64位十六进制;签名覆盖协议版本RENT_HMAC_SHA256_V1、scope、api_key、Unix毫秒timestamp、nonce、HTTP方法、规范化path/query、SHA256实际body。字段以换行分隔,限制字段中换行,查询编码/排序及空body规则需固定跨语言测试向量;签名自身置于外层信封不参与body哈希。常量时间比较,Secret不上传请求,TLS提供传输加密。
|
||||
|
||||
API、NODE、TASK、WEBHOOK四域区分方向和用途。TASK使用节点凭证,完整intent及task_no、node_id、deadline纳入认证,按deadline验时效;回调只选择该订单APP的ACTIVE凭证,每次重试新timestamp/nonce,同一event_no保持不变。商户返回HTTP200且正文ok才确认,失败退避直至最大次数后DEAD并告警。回调逐次执行SSRF、DNS及重定向校验。共享Secret不具不可否认性,独立链上核验不可省略。
|
||||
|
||||
系统登录沿用GoogleOauthService及若依权限;后端@PreAuthorize和前端v-hasPermi使用rent:order:list、rent:node:audit、rent:account:topup、rent:settlement:approve等。不创建新角色表,凭证只供外部API/Agent使用,不能替代用户菜单权限。
|
||||
|
||||
## 6. 实施步骤与验证
|
||||
|
||||
### 云端与节点Socket通信和心跳
|
||||
|
||||
本版明确采用WebSocket(生产WSS)作为双向Socket协议,建议入口wss://平台域名/node/v1/socket。由Agent主动连接,适配NAT且无需开放本地公网端口;服务端复用当前JDK8/Spring Boot可兼容的WebSocket能力,Agent选兼容JDK8的客户端。API及商户回调仍用HTTPS,浏览器TronLink流程不走节点通道。
|
||||
|
||||
**认证与会话:**TLS升级后连接仍未认证,云端先发短期随机挑战,Agent在5秒内提交AUTH(node_no、api_key、timestamp、nonce、挑战及HMAC);Secret不放URL、查询参数或消息正文。AUTH按NODE域覆盖协议版本、用途、挑战、请求路径和全部业务字段,查rent_credential的NODE归属/状态、节点审核状态及防重放记录。只有成功后才能处理心跳和业务消息。服务端响应AUTH_OK也用该节点Secret认证并回显挑战,生成session_id及原子递增session_epoch。不能把HTTP升级成功当认证成功。
|
||||
|
||||
每节点仅允许一个当前认证会话。新连接认证成功后以node行CAS替换旧会话、递增epoch并关闭旧连接;每帧携带且签名覆盖当前session_id/epoch、方向、type、message_id、timestamp、递增sequence及payload摘要。节点上行和云端下行各自独立sequence,从1递增;字段/nonce不可跨NODE/TASK签名域复用。服务端下行序号由持连接进程串行维护,重启必须重新认证新会话,不能从旧序号继续。数据库last_client_sequence用于上行去重和连接恢复审计,不支持一个节点被多个实例并发接单。
|
||||
|
||||
节点业务status和连接connection_status分离:PENDING审核、ACTIVE允许接单、PAUSED暂停、REVOKED吊销不因连接变化而更改;OFFLINE离线、SYNCING恢复、ONLINE可通信独立变化。PAUSED可保持连接用于上报和核对在途任务,不能分配新单;REVOKED立即关闭通道并拒绝认证,云端继续独立链上核对历史交易。
|
||||
|
||||
**双向心跳:**默认每15秒发带HMAC的应用层PING,对端立即回PONG并回显ping message_id;云端和Agent都维护最近有效PONG及超时,默认45秒未收到则断开并重连。只接受属于当前会话、有效签名及未过期的心跳,重复旧PONG或任意TCP字节不能续租;云端用接收时间更新heartbeat_at/heartbeat_expires_at,不能信任节点自报时钟。WebSocket原生Ping/Pong可辅助探活,但不替代带身份的应用心跳。任务执行在线程池中进行,不能阻塞Socket事件线程而丢心跳。
|
||||
|
||||
所有节点状态、心跳、业务帧及断线回调更新都带node_id/session_epoch条件;旧会话close事件不得把新会话置OFFLINE。云端定时扫描过期心跳并条件标离线,调度只选status=ACTIVE、connection_status=ONLINE且租约未过期的节点,同时资源快照必须有效。数据库心跳可按15秒粒度合并写入,不将每次PING/PONG写rent_event以免无限增长。
|
||||
|
||||
**消息类型和可靠交付:**AUTH/AUTH_OK、PING/PONG、TASK_PUSH/TASK_ACK、TASK_ACCEPT/TASK_REJECT、TASK_EVENT/TASK_RESULT、RESULT_ACK、SYNC_REQUEST/SYNC_STATE/SYNC_ACK、PAUSE/ERROR。TASK_ACK只表示节点已持久化接收到的任务;TASK_ACCEPT才表示本地策略与资源允许执行,二者均不是广播成功。Socket发送成功不能将任务设ACCEPTED,更不能设SUCCESS。
|
||||
|
||||
云端先提交rent_task再推送,保留delivery_message_id;丢ACK时只重发同一任务及同一message_id,外层会话签名可以重新生成,原任务intent/HMAC和txId不可重构。Agent先持久化task_no及消息摘要再ACK,已存在任务相同内容返回本地状态,不同内容拒绝。过期任务即使重投也不能新执行。delivery_count仅投递计数,不是交易重试次数。
|
||||
|
||||
节点事件先存本地可靠发送队列,云端以rent_event.event_no=nodeId:eventId同事务去重、更新任务及交易后才发RESULT_ACK;ACK丢失可重发同事件,不能重复扣费/结算。云端当前帧sequence防会话重放,跨会话message_id/eventId/task_no负责持久幂等。逐帧HMAC与TASK内层HMAC分开:外层认证当前连接,内层认证冻结授权意图。
|
||||
|
||||
**重连恢复:**断线采用带随机抖动的指数退避,建议1、2、4、8秒逐步到最大30秒;连接并完成稳定认证后复位。新会话先SYNCING:Agent发送未完成task_no、已持久化txId、最后本地状态及待确认事件;云端与数据库及链上证据核对,ACK历史结果,返回需重发的原任务及禁止执行/过期状态。完成SYNC_ACK才ONLINE并允许新单。不能仅根据“本地没有该任务”就认定未执行;云端已有广播线索或未知副作用时仍先核对链上。
|
||||
|
||||
断线/心跳超时不等于链上失败,已接受/已广播/UNKNOWN任务继续保留资金和对应资源占用。Agent断线后不得接受新任务;尚未签名广播的任务暂停直到恢复认证并核对授权,已广播的交易仅本地查询原txId和持久化结果,重连回传;不因断线重签另一笔交易。网络恢复不能延长原deadline。
|
||||
|
||||
**多实例及限流:**session_id/epoch及server_instance_id落node表,Socket对象仅存在持连接实例内存。首版可单Socket入口;多实例时任务只能由连接所属实例投递,其他实例通过受控路由/发布通知唤醒持连接实例,持久事实始终在MySQL。进程重启连接失效并重新认证;Redis只作路由缓存。配置认证超时、帧大小上限(建议64KiB)、JSON深度、每节点消息速率、发送队列和线程池上限,慢消费者背压/断开而非无限堆积;日志禁止Secret和完整认证材料。
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant A as 本地Agent
|
||||
participant C as 云端WSS
|
||||
participant D as 数据库
|
||||
A->>C: 主动建立WSS连接
|
||||
C-->>A: 一次性认证挑战
|
||||
A->>C: AUTH(api_key及HMAC)
|
||||
C->>D: 校验身份、分配session及epoch
|
||||
C-->>A: AUTH_OK(HMAC)
|
||||
A->>C: SYNC_STATE(历史任务及txId)
|
||||
C-->>A: SYNC_ACK,允许接单
|
||||
loop 每15秒双向心跳
|
||||
C->>A: PING
|
||||
A-->>C: PONG
|
||||
A->>C: PING
|
||||
C-->>A: PONG
|
||||
end
|
||||
C->>A: TASK_PUSH(持久化原任务)
|
||||
A-->>C: TASK_ACK(已本地持久化)
|
||||
A-->>C: TASK_ACCEPT / TASK_RESULT
|
||||
C->>D: 原子更新并去重事件
|
||||
C-->>A: RESULT_ACK
|
||||
Note over A,C: 45秒无有效心跳则离线;重连先核对原任务,不盲目重派
|
||||
```
|
||||
|
||||
测试增加:认证超时/伪造HMAC、旧PONG重放、心跳与长链上调用并发、网络半开、丢TASK_ACK、丢RESULT_ACK、重复推送、连接代次抢占、旧close不能影响新会话、重连未同步禁止接单、节点吊销、多实例路由、帧超限/背压、离线已广播成功后的恢复。现有表需新增会话与投递字段的版本化迁移,不能靠IF NOT EXISTS升级。本次仅设计,不声称已实现Socket服务或真实断线测试。
|
||||
|
||||
1. 建 16 表及 Mapper、共享菜单权限、HMAC 测试向量,隔离 MySQL 检查 DDL 及逻辑归属;验证本文及复核说明中的跨表约束。
|
||||
2. 套餐、应用、节点/钱包审核、人工充值和不可变流水。
|
||||
3. 下单冻结、单节点调度及Fake Agent闭环,覆盖并发/崩溃/幂等/未知。
|
||||
4. NILE真实委托、云端独立核验、回调、到期撤销及资源恢复证据。
|
||||
5. 人工结算/退款、每日账实核对、权限及限额、暂停接单与持续核对在途任务。
|
||||
6. 主网上线单独批准,小额限额逐步开放;未完成资金及链上规则验收不得自动广播。
|
||||
|
||||
本文件与 DDL 是 V2.2 新设计,不是 V2.1 或旧 53 表的就地升级。初始化脚本不含 DROP 或 ALTER;已有表必须按实际历史数据另写增量迁移,不能依赖 IF NOT EXISTS 覆盖。字段回填、冲突隔离和旧 HMAC 兼容要求见复核说明。本次只改设计文件,无现有数据库操作。
|
||||
|
||||
测试至少覆盖:重复下单不同参数、余额不足、两个节点/任务抢同钱包、套餐改价、广播超时但实际成功、重启后按原交易恢复、未知单取消/重派拒绝、回收锁定/未恢复、同地址对同类型多订单及异类型并发、重复回调和SSRF、充值凭据重复、结算占位和未知付款、退款冲正、越权及UTC映射。Fake通过不等于NILE真实验证,编译通过不等于资金并发测试通过。
|
||||
|
||||
### V2单能量稿升级说明
|
||||
|
||||
若V2单能量表已执行,不能重跑IF NOT EXISTS完成升级。须备份后编写版本化ALTER:历史套餐/订单/task/transaction明确回填resource_type=ENERGY;energy_quantity改为resource_quantity;钱包原delegatable_sun/reserved_sun/retain_sun分别迁为energy_*,保留原金额与预留;新增带宽字段初始为0、bandwidth_enabled=0,重新可信查询并审核后才能启用。任务新增resource_quantity从原订单快照回填。旧HMAC任务的intent和签名不能原地篡改,应保留旧协议验证直到在途完成,新任务才使用包含资源类型的版本。最终去掉resource_type临时迁移默认值并验证非空。此处为迁移要求,本次未执行ALTER或修改数据库数据。
|
||||
@@ -0,0 +1,520 @@
|
||||
# 能量与带宽租赁:逐表功能流程及协同关系
|
||||
|
||||
## 1. 文档依据与业务范围
|
||||
|
||||
本文依据 [rent_init.sql](../../sql/rent_init.sql) 及 [schema-design.md](schema-design.md) 的 V2.2 设计整理,覆盖全部 16 张 `rent_` 表。复核发现、并发协议和迁移要求见 [business-review-v2.2.md](business-review-v2.2.md)。本文描述设计约定,不代表数据库迁移、业务服务或链上执行已经完成。
|
||||
|
||||
业务范围:商户通过内部 USDT 余额购买固定能量或带宽套餐,平台选择供应商钱包,由供应商本地 Agent 签名广播,云端独立核验后扣款、确认供应商应收;租期结束再回收资源。充值和供应商付款由人工审核处理。
|
||||
|
||||
共享若依 `sys_user`、登录及 RBAC 权限;租赁应用、订单和资金独立,不复用支付业务的 `apps`、`orders`、`wallet_address`。平台不保存供应商私钥或助记词。
|
||||
|
||||
### 1.1 通用字段与一致性约定
|
||||
|
||||
- `id` 为表内主键;业务编号和唯一键另行承担幂等职责。
|
||||
- `version` 用于 CAS 乐观锁,更新时带原版本条件并递增;追加记录保持 0。
|
||||
- `created_at / updated_at` 为应用显式写入的 UTC `DATETIME(3)`。
|
||||
- USDT 金额使用 `DECIMAL(30,6)`,业务计算使用精确十进制。
|
||||
- 表间采用逻辑外键;归属、网络、状态机、金额非负及跨表一致性由应用落实。
|
||||
- `ENERGY` 数量单位为 Energy,`BANDWIDTH` 为 bytes;本金单位为 SUN,1 TRX = 1,000,000 SUN。
|
||||
|
||||
## 2. 逐表功能与流程
|
||||
|
||||
### 2.1 rent_app:商户应用
|
||||
|
||||
**设计功能:** 区分不同商户应用,确定订单归属、API 主体及默认回调地址。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `user_id` | 应用所属 `sys_user.user_id` |
|
||||
| `name` | 应用名称 |
|
||||
| `status` | `ACTIVE` 启用、`DISABLED` 禁用 |
|
||||
| `notify_url` | 默认 HTTPS 回调地址,需要 SSRF 校验 |
|
||||
|
||||
**功能流程:** 用户登录并获得权限 → 创建应用 → 签发应用凭证 → 商户认证下单 → 订单保存应用 ID 和回调地址快照。查询、取消等操作检查应用归属,不能仅凭传入 ID 操作。
|
||||
|
||||
**协同关系:** 一个用户可以创建多个应用,一个应用有多版 `rent_credential` 和多笔 `rent_order`。应用不保存余额,通过所属用户和订单网络定位 `rent_account`。
|
||||
|
||||
### 2.2 rent_credential:商户与节点统一凭证
|
||||
|
||||
**设计功能:** 管理 HMAC 身份、加密 Secret、密钥轮换及历史在途消息验证。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `owner_type / owner_id` | `APP` 指向应用,`NODE` 指向节点 |
|
||||
| `api_key` | 全局唯一公开标识 |
|
||||
| `api_secret / master_key_version` | AES-GCM 密文及外部主密钥版本 |
|
||||
| `status` | `ACTIVE` 可签发新消息;`VERIFY_ONLY` 仅验历史在途;`REVOKED` 吊销 |
|
||||
| `expires_at / revoked_at` | 到期和吊销时间 |
|
||||
|
||||
**功能流程:** 创建主体 → 生成凭证 → 受认证通道一次性展示 Secret → 请求签名与服务端验证 → 轮换时新增凭证行并保留历史 → 必要时吊销。Secret 不随请求传输,也不写日志。
|
||||
|
||||
**协同关系:** 与 `rent_nonce` 协作防重放;`rent_task.credential_id` 固定节点授权版本;`rent_webhook.credential_id` 记录最近发送使用的应用凭证。主体归属是多态关联,需根据 `owner_type` 校验。
|
||||
|
||||
### 2.3 rent_nonce:认证消息防重放
|
||||
|
||||
**设计功能:** 阻止合法签名消息被重复使用。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `api_key` | 对应凭证 |
|
||||
| `scope` | API、NODE、TASK、WEBHOOK 认证域 |
|
||||
| `nonce` | 高熵随机数 |
|
||||
| `expires_at` | 安全清理时间,必须晚于消息有效期 |
|
||||
|
||||
**功能流程:** 验签并检查时效 → 原子插入 `(api_key, scope, nonce)` → 唯一键冲突则拒绝重放 → 超出有效窗口后清理。各方向的接收方落实防重放;Agent 和商户接收端同样需要相应机制,不能仅依赖云端此表。
|
||||
|
||||
**协同关系:** 关联 `rent_credential.api_key`。消息防重放与业务幂等分开:重试请求使用新 nonce,但保留原商户订单号。
|
||||
|
||||
### 2.4 rent_node:供应商本地执行节点
|
||||
|
||||
**设计功能:** 管理供应商 Agent 的审核、接单资格、在线状态、会话和心跳。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `user_id / node_no` | 供应商及全局节点编号 |
|
||||
| `status` | PENDING、ACTIVE、PAUSED、REVOKED |
|
||||
| `connection_status` | OFFLINE、SYNCING、ONLINE |
|
||||
| `session_id / session_epoch` | 当前会话及连接代次,隔离旧连接 |
|
||||
| `server_instance_id` | 当前连接所在云端实例 |
|
||||
| `heartbeat_at / heartbeat_expires_at` | 最近有效心跳及在线租约 |
|
||||
| `last_client_sequence` | 当前会话上行认证帧去重序号 |
|
||||
|
||||
**功能流程:** 供应商注册 → 运营审核 → Agent 主动建立 WSS → 节点凭证认证 → 原子更新会话代次 → SYNCING 同步历史任务 → ONLINE → 持续心跳。默认心跳周期 15 秒、超时 45 秒,按云端接收时间判定。
|
||||
|
||||
**协同关系:** 一个节点绑定多个 `rent_wallet`,执行多个 `rent_task`,并持有节点凭证。仅审核允许接单、连接在线且租约有效的节点可获新单。PAUSED 可核对在途任务;离线不能作为交易失败依据。旧会话断开事件必须带 epoch 条件,避免覆盖新会话。
|
||||
|
||||
### 2.5 rent_wallet:供应钱包与两类资源池
|
||||
|
||||
**设计功能:** 保存公开钱包、控制权证明、可信资源快照、本金保留及在途预留。首版一个钱包只绑定一个执行节点。
|
||||
|
||||
| 字段组 | 功能 |
|
||||
| --- | --- |
|
||||
| `node_id / network / address` | 执行节点、网络、资源所有者地址 |
|
||||
| `ownership_challenge / ownership_message` | 平台保存的一次性挑战和完整待签原文 |
|
||||
| `ownership_signature / ownership_verified_address` | TronLink 消息签名及后端恢复地址 |
|
||||
| `challenge_* / ownership_verified_at` | 挑战期限、消费及验证时间 |
|
||||
| `energy_enabled / bandwidth_enabled` | 两类资源独立出租开关,默认关闭 |
|
||||
| `*_delegatable_sun / *_reserved_sun / *_retain_sun` | 各类可委托本金、在途预留、供应商保留本金 |
|
||||
| `energy_available / bandwidth_available` | 查询投影;带宽只含可出租质押带宽 |
|
||||
| `total_*_limit / total_*_weight` | 两类全网换算参数 |
|
||||
| `snapshot_at / snapshot_expires_at` | 可信快照有效期 |
|
||||
| `snapshot_block_height / snapshot_min_block_height` | 当前快照高度及允许应用快照的最低确认区块 |
|
||||
|
||||
**功能流程:** 绑定钱包 → 平台签发挑战 → 用户通过 TronLink `signMessageV2` 签署原文 → 后端恢复地址、验证归属和有效期并原子消费挑战 → 检查链上执行权限及运营审核 → 启用出租 → 刷新可信快照 → 调度时锁钱包行并预留对应类型本金 → 委托成功后转换预留并刷新链上状态 → 回收且资源恢复后重新出租。
|
||||
|
||||
```text
|
||||
对应类型可调度本金 = delegatable_sun - retain_sun - reserved_sun
|
||||
```
|
||||
|
||||
**协同关系:** 节点决定供应商归属;订单记录选定钱包,任务记录预留明细,交易表提供实际委托和回收证据。能量与带宽本金不互借,免费带宽、普通 TRX 余额和收到的代理资源不能直接视为可出租本金。验证地址控制权不等于审核通过或 Agent 已具备委托权限。
|
||||
|
||||
异步刷新必须先读取 version,再查询可信节点,最后 CAS 更新;确认交易时原子提升最低区块、失效旧快照并处理预留,再释放钱包执行占位。新快照必须覆盖屏障区块,才能再调度;可委托本金取对应类型 `getCanDelegatedMaxSize`,不能简单用总质押减已委托。
|
||||
|
||||
### 2.6 rent_package:固定套餐与价格版本
|
||||
|
||||
**设计功能:** 定义资源数量、租期、售价、供应商毛收入、手续费及执行规则。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `package_code / revision` | 套餐代码与递增版本 |
|
||||
| `network / resource_type / resource_quantity` | 网络、资源类型、购买数量 |
|
||||
| `redundancy_percent` | 正冗余比例,默认 20%,订单创建时锁定 |
|
||||
| `duration_seconds / sale_amount` | 租期与商户售价 |
|
||||
| `supplier_amount / supplier_fee_percent` | 供应商毛收入与平台手续费率 |
|
||||
| `fee_limit_sun / rules` | 单笔链上费用上限及锁定、偏差、退款规则 |
|
||||
| `delegate_lock` | 首版固定 0 非锁定,1 拒绝上架 |
|
||||
| `status` | ACTIVE 上架、DISABLED 下架 |
|
||||
|
||||
**功能流程:** 运营配置 → 校验数量、价格、毛收入、正手续费及完整规则 → 上架 → 商户下单保存快照 → 改价或调整商业规则时新增 revision,历史订单不变。
|
||||
|
||||
**协同关系:** 一个套餐版本关联多笔订单;同一代码各版本不能改变资源类型。供应商金额已包含约定链上操作成本;费用上限为零时不能广播。
|
||||
|
||||
### 2.7 rent_account:租赁内部资金账户
|
||||
|
||||
**设计功能:** 按用户和网络隔离 USDT 可用、冻结和供应商待结算余额。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `user_id / network` | 唯一账户归属 |
|
||||
| `available_amount` | 商户可消费余额 |
|
||||
| `frozen_amount` | 订单资金冻结余额 |
|
||||
| `supplier_pending_amount` | 供应商扣手续费后的待结算余额 |
|
||||
| `status` | ACTIVE 可操作、FROZEN 冻结业务 |
|
||||
|
||||
**功能流程:** 人工充值核验后增加可用余额 → 下单由可用转冻结 → 成功扣冻结;明确失败或取消则冻结转回可用 → 供应商成功履约增加净待结算 → 人工付款核验后减少待结算。成功订单退款按审核规则返还内部余额。
|
||||
|
||||
**协同关系:** 所有余额变化必须与 `rent_ledger` 同事务;订单引用付款账户,结算单引用供应商账户。同一用户可同时是商户和供应商,同网络仍只有一个账户。三类余额均不得为负。
|
||||
|
||||
### 2.8 rent_order:租赁业务主订单
|
||||
|
||||
**设计功能:** 汇总下单、资源交付、价格快照、资金、退款、租期及回收计划。
|
||||
|
||||
| 字段组 | 功能 |
|
||||
| --- | --- |
|
||||
| `order_no / app_id / merchant_order_no / request_hash` | 平台编号、商户归属和业务幂等 |
|
||||
| `package_id / package_snapshot` | 套餐版本及规则快照 |
|
||||
| `resource_* / redundancy_percent / target_resource_quantity` | 购买量及含冗余目标 |
|
||||
| `sale_amount / supplier_*` | 售价、毛收入、手续费、净应收及累计冲正 |
|
||||
| `wallet_id / supplier_user_id` | 选定供应钱包与供应商快照 |
|
||||
| `supplier_account_id / relation_slot` | 固定供应商账户及同钱包、接收者、资源类型的持久占位 |
|
||||
| `dispatch_deadline` | 下单时锁定最晚新任务执行时间,不能用于推定已投递任务失败 |
|
||||
| `supplier_fee_returned_amount` | 退回供应商的手续费累计,增加结算来源金额 |
|
||||
| `payer_account_id / fund_status / refunded_amount` | 付款账户、资金状态和退款累计 |
|
||||
| `status` | 履约状态 |
|
||||
| `service_* / reclaim_status / next_reclaim_at` | 租期及独立回收调度 |
|
||||
| `notify_url` | 本单回调地址快照 |
|
||||
|
||||
**功能流程:** 请求校验与幂等 → 同事务创建 WAITING 订单和冻结资金 → 选择钱包并创建委托任务,进入 EXECUTING → VERIFYING 独立核验 → 成功则 SUCCESS 并扣款、确认应收、回调入队 → 到期推进回收。明确未执行失败可解冻,结果不确定进入核对流程。
|
||||
|
||||
| 状态维度 | 主路径 |
|
||||
| --- | --- |
|
||||
| 履约 `status` | WAITING → EXECUTING → VERIFYING → SUCCESS;另有 FAILED、CANCELLED、MANUAL_REVIEW |
|
||||
| 资金 `fund_status` | HELD → CHARGED 或 RELEASED |
|
||||
| 回收 `reclaim_status` | NOT_STARTED → WAITING → RUNNING → RECOVERING → DONE;异常 MANUAL_REVIEW |
|
||||
|
||||
**协同关系:** 连接应用、套餐、账户、钱包、任务、交易、流水、结算明细、回调和审计。一单一种资源、一个供应钱包。未知执行结果不能改派;用户只能取消尚未生成任务的 WAITING 订单。无供应方时有明确等待上限,避免无限冻结。
|
||||
|
||||
同钱包同接收地址同资源类型只允许一个 relation_slot=1,直到明确未执行释放或本金回收且资源恢复;下一单排队或改选其他钱包。服务起点采用核验交易的区块时间,不能使用核验完成时间;延迟核验时已到期转人工。退款不覆盖 CHARGED 事实。
|
||||
|
||||
### 2.9 rent_task:委托与回收任务
|
||||
|
||||
**设计功能:** 兼任持久执行队列、授权意图、尝试历史和资源预留明细。
|
||||
|
||||
| 字段组 | 功能 |
|
||||
| --- | --- |
|
||||
| `order_id / wallet_id / node_id` | 订单及执行归属 |
|
||||
| `network / source_transaction_id` | 显式网络;回收任务绑定原确认委托交易 |
|
||||
| `wallet_execution_slot` | 同钱包同资源类型最多一个在途操作,未知保留 |
|
||||
| `task_type` | DELEGATE 委托、RECLAIM 回收,不支持转账 |
|
||||
| `conversion_* / estimated_resource_quantity / delegate_sun` | 换算证据、预计交付量和授权本金 |
|
||||
| `attempt_no / active_slot` | 尝试序号及有效占位 |
|
||||
| `credential_id / intent / signature / deadline` | 固定凭证、HMAC 意图和执行期限 |
|
||||
| `status / reservation_status` | 执行状态及 HELD、COMMITTED、RELEASED 资源状态 |
|
||||
| `lease_owner / lease_until` | worker 处理租约 |
|
||||
| `delivery_* / last_sent_at` | 稳定消息编号、投递代次、次数及持久接收 ACK |
|
||||
|
||||
**功能流程:** 查询可信全网参数 → 锁订单与钱包 → 预留本金并创建任务 → 提交后 WSS 推送 → Agent 持久化后 TASK_ACK → 策略与资源检查后 ACCEPTED → 原交易广播 BROADCASTED → 云端核验 VERIFIED。明确拒绝或失败才可释放相应占用;UNKNOWN 保留隔离并查原交易。
|
||||
|
||||
**协同关系:** 一个订单可以保留多个历史尝试,但同类型有效或成功任务由 `(order_id, task_type, active_slot)` 限制。MySQL 唯一键允许多个 NULL,因此明确未执行失败后可置空占位并创建新尝试。任务最多对应一笔 `rent_transaction`。成功委托占位保留以追溯原本金,回收任务另行占位。
|
||||
|
||||
委托的 reservation_status 使用 HELD、COMMITTED、RELEASED;回收固定 NONE,不再次预留委托本金。钱包执行占位在终结并写入快照屏障后置 NULL,订单关系占位继续保留。可重试失败保留订单资金 HELD;最终失败才解冻,不能既解冻又重试。
|
||||
|
||||
投递 ACK 不表示接受或成功;发送次数不是链上执行次数。丢 ACK 重发同任务及 message_id,不能重构授权意图或重签另一笔交易。
|
||||
|
||||
### 2.10 rent_transaction:链上事实与核验证据
|
||||
|
||||
**设计功能:** 保存任务唯一交易及云端独立核验结果。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `task_id / network / tx_id` | 任务与链上交易身份 |
|
||||
| `owner_address / receiver_address / transaction_type / resource_type` | 实际交易参数 |
|
||||
| `amount_sun` | 实际委托或回收本金 |
|
||||
| `verified_total_* / verified_resource_quantity` | 确认区块参数及本单资源额度 |
|
||||
| `baseline_sun / after_sun` | 同地址对同资源类型的前后关系证据 |
|
||||
| `block_height / evidence / confirmed_at` | 确认高度、证据和时间 |
|
||||
| `block_time` | 独立查询交易所在区块的 UTC 时间,作为服务起点 |
|
||||
| `status / next_check_at` | REPORTED、CONFIRMED、FAILED、UNKNOWN 及核对计划 |
|
||||
|
||||
**功能流程:** Agent 上报原 txId → 云端查询交易、回执和委托关系 → 校验网络、地址、类型、金额及确认规则 → 委托额覆盖冗余目标才可认定交付成功 → 更新任务和订单。未知则继续查询原 txId。
|
||||
|
||||
**协同关系:** `task_id` 唯一,每任务最多一笔交易;`(network, tx_id)` 唯一,防止同笔交易重复归属。节点自报、HTTP 成功或接收方瞬时可用余额变化不能直接作为本单交付依据。
|
||||
|
||||
链上 CONFIRMED 与订单 SUCCESS 分开:实际已委托但资源不足也应确认链上事实、转换本金预留并安排回收,订单转 MANUAL_REVIEW,不能谎报链上失败或提前扣款。
|
||||
|
||||
### 2.11 rent_ledger:不可变资金流水
|
||||
|
||||
**设计功能:** 记录余额变化及平台供应商手续费,提供幂等、追溯和对账依据。
|
||||
|
||||
| 字段组 | 功能 |
|
||||
| --- | --- |
|
||||
| `account_id / business_key / event_type` | 账户、全局唯一记账键和业务事件 |
|
||||
| `delta_available / delta_frozen / delta_supplier_pending` | 三类余额增量 |
|
||||
| `after_available / after_frozen / after_supplier_pending` | 变更后余额 |
|
||||
| `delta_platform_fee` | 平台供应商手续费收入变化,不是用户可提款余额 |
|
||||
| `order_id / settlement_id / reversal_of_id` | 来源订单、结算单及冲正对象 |
|
||||
| `refund_id` | 本次退款和相关冲正来源,关联 rent_refund |
|
||||
| `operator_user_id / evidence_ref / reason` | 操作者及核验依据 |
|
||||
|
||||
**功能流程:** 锁账户 → 校验业务状态和记账键 → 修改余额并追加流水 → 同事务更新业务状态和审计。纠错通过追加 REVERSAL 等流水,不覆盖旧记录。
|
||||
|
||||
| 事件 | 典型余额变化 |
|
||||
| --- | --- |
|
||||
| TOPUP | 可用 +金额 |
|
||||
| HOLD | 可用 -售价,冻结 +售价 |
|
||||
| CHARGE | 冻结 -售价 |
|
||||
| RELEASE | 冻结 -售价,可用 +售价 |
|
||||
| SUPPLIER_EARN | 待结算 +毛收入 |
|
||||
| SUPPLIER_FEE | 待结算 -手续费,平台手续费 +手续费 |
|
||||
| SETTLE | 待结算 -结算额 |
|
||||
| REFUND / REVERSAL | 按审核规则追加退款或冲正增量 |
|
||||
|
||||
**协同关系:** 关联账户、订单、结算及原流水。账户是余额投影,流水是变更历史。充值必须通过规范化全局唯一凭据构造 business_key;`evidence_ref` 自身没有唯一索引,不能单靠该字段防重复入账。
|
||||
|
||||
### 2.12 rent_settlement:人工结算单
|
||||
|
||||
**设计功能:** 管理供应商净应收的审核、人工付款和付款核验。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `settlement_no / account_id / amount` | 结算编号、供应商账户及总额 |
|
||||
| `status` | PENDING、APPROVED、PAYING、PAID、REJECTED、UNKNOWN |
|
||||
| `payout_no / payment_started_at` | 出款前持久化的唯一付款授权及时间 |
|
||||
| `payment_reference / payment_evidence` | 全局唯一标准化付款凭据和核验结果 |
|
||||
| `created_by / approved_by / paid_at` | 发起、审批及核验时间 |
|
||||
|
||||
**功能流程:** 锁账户和来源订单 → 检查可结算净应收 → 创建结算单及明细 → 独立人员审批 → 先提交 PAYING 和唯一 payout_no → 人工付款 → 核验唯一付款凭据 → 同事务扣待结算余额、写 SETTLE 流水、标记 PAID 并审计。
|
||||
|
||||
**协同关系:** 账户确定付款对象,明细确定来源订单,流水记录实际扣减。审批不提前扣余额。UNKNOWN 保留来源占用,不得重付;仅明确未付并拒绝时释放。
|
||||
|
||||
PAYING 同样禁止普通拒绝和重复出款;必须先核验原授权明确未付且作废,才能拒绝释放。超时不能自动认定未付款。
|
||||
|
||||
### 2.13 rent_settlement_item:结算来源明细
|
||||
|
||||
**设计功能:** 关联结算单和订单,防止同一来源重复结算。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `settlement_id / order_id` | 结算单及来源订单 |
|
||||
| `amount` | 本单净可结算额 |
|
||||
| `active_slot` | 占用或已付款取 1,明确拒绝且未付款才置 NULL |
|
||||
|
||||
**功能流程:** 锁定成功且核验通过的订单 → 计算 `supplier_net_amount - supplier_reversed_amount + supplier_fee_returned_amount` → 插入明细占位 → 汇总结算总额 → 付款后永久保留有效占位。唯一键 `(order_id, active_slot)` 防止重复占用和重复付款。
|
||||
|
||||
**协同关系:** 一张结算单包含多笔订单;首版每笔订单只全额结算一次,不能拆到多个批次。结算按净应收计算,不再次扣手续费。
|
||||
|
||||
### 2.14 rent_webhook:商户回调持久队列
|
||||
|
||||
**设计功能:** 可靠通知商户订单 SUCCESS、FAILED、CANCELLED、REFUNDED、RECLAIMED 事件。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `event_no / order_id / event_type` | 稳定事件编号及订单事件类型 |
|
||||
| `event_key / order_event_sequence` | 业务事件去重键及订单内递增序号,支持逐次部分退款 |
|
||||
| `payload` | 固定业务内容,不暴露内部成本或 Secret |
|
||||
| `status` | PENDING、SENDING、ACKED、DEAD |
|
||||
| `attempt_count / next_attempt_at` | 重试次数与退避计划 |
|
||||
| `credential_id` | 最近使用的商户凭证 |
|
||||
| `lock_owner / lock_until / last_error` | worker 租约及脱敏失败信息 |
|
||||
|
||||
**功能流程:** 订单状态变更同事务入队 → worker 抢占 → 校验地址、DNS、重定向等 SSRF 风险 → 使用所属 APP 的有效凭证签名发送 → HTTP 200 且正文 ok 才 ACKED → 失败退避重试 → 超限 DEAD 并告警。
|
||||
|
||||
**协同关系:** 订单提供应用归属和回调地址快照,凭证表提供认证。重试保持同一 event_no、event_key、序号和业务内容,重新生成时间戳和 nonce。普通事件键为 ORDER:id:type,退款为 REFUND:refund_no;移除旧的 `(order_id,event_type)` 唯一限制,改用 event_key 和 `(order_id,order_event_sequence)` 唯一。锁订单后分配序号,商户按 event_no 去重并按序号识别乱序。
|
||||
|
||||
### 2.15 rent_event:追加业务审计
|
||||
|
||||
**设计功能:** 记录关键操作、状态变化及节点结果事件去重。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `event_no` | 全局唯一事件编号,节点来源使用 nodeId:eventId |
|
||||
| `object_type / object_id` | APP、NODE、WALLET、PACKAGE、ORDER、TASK、ACCOUNT、SETTLEMENT 等对象 |
|
||||
| `action / actor_user_id / node_id` | 动作、用户和节点来源 |
|
||||
| `detail / reason` | 脱敏前后状态、证据和操作依据 |
|
||||
|
||||
**功能流程:** 关键操作产生事件 → 与业务状态同事务写入 → 节点重复回报按唯一事件去重,相同编号不同内容拒绝 → 提交成功才返回 RESULT_ACK → 按对象查询完整操作历史。
|
||||
|
||||
**协同关系:** 横向关联各业务表,记录操作依据;资金以 `rent_ledger` 为准,链上事实以 `rent_transaction` 为准。普通心跳不逐条写审计,避免无效膨胀。
|
||||
|
||||
### 2.16 rent_refund:内部余额退款与费用调整
|
||||
|
||||
**设计功能:** 让每次部分退款具有独立审批、稳定幂等编号及对应流水和回调,避免重复点击重复退款。
|
||||
|
||||
| 关键字段 | 功能 |
|
||||
| --- | --- |
|
||||
| `refund_no / order_id / request_no / request_hash` | 平台编号、原订单和同订单请求幂等 |
|
||||
| `refund_amount` | 商户内部余额返还额,大于 0,含退商户手续费部分 |
|
||||
| `supplier_reverse_amount` | 供应商原净应收冲正额 |
|
||||
| `platform_fee_reverse_amount / fee_return_to` | 平台退费金额及 NONE、MERCHANT、SUPPLIER 方向 |
|
||||
| `status / created_by / approved_by / applied_at` | PENDING、APPLIED、REJECTED;独立审批及生效时间 |
|
||||
|
||||
**功能流程:** 创建请求 → 同编号同摘要返回原单,不同摘要拒绝 → 独立审批 → 重新锁定校验订单、账户、结算来源和累计上限 → 同事务返还余额、调整应收及平台手续费、写流水、更新订单累计和退款 APPLIED、创建独立 REFUNDED 回调并审计。
|
||||
|
||||
**协同关系:** 仅处理已 CHARGED 且已记收入订单;HELD 走解冻。PENDING 不改余额也不占用退款额度,审批时竞争同一订单行重新核验。退供应商手续费增加订单 supplier_fee_returned_amount 和待结算,纳入结算来源;退商户的手续费已包含在 refund_amount,不能另加一次。涉及供应商或手续费变化且来源已结算/被占用时拒绝应用,转人工处置。
|
||||
|
||||
## 3. 主要表间协同关系
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
U["共享 sys_user"] --> A["rent_app 商户应用"]
|
||||
U --> N["rent_node 供应节点"]
|
||||
U --> AC["rent_account 资金账户"]
|
||||
A --> C["rent_credential 凭证"]
|
||||
N --> C
|
||||
C --> NO["rent_nonce 防重放"]
|
||||
N --> W["rent_wallet 供应钱包"]
|
||||
A --> O["rent_order 订单"]
|
||||
P["rent_package 套餐版本"] --> O
|
||||
AC --> O
|
||||
W --> O
|
||||
O --> T["rent_task 委托与回收任务"]
|
||||
W --> T
|
||||
N --> T
|
||||
T --> TX["rent_transaction 链上证据"]
|
||||
AC --> L["rent_ledger 资金流水"]
|
||||
O --> L
|
||||
AC --> S["rent_settlement 结算单"]
|
||||
S --> SI["rent_settlement_item 结算明细"]
|
||||
O --> SI
|
||||
S --> L
|
||||
O --> WH["rent_webhook 回调队列"]
|
||||
O --> R["rent_refund 退款单"]
|
||||
R --> L
|
||||
R --> WH
|
||||
E["rent_event 关键审计"] -.-> O
|
||||
E -.-> T
|
||||
E -.-> AC
|
||||
E -.-> S
|
||||
```
|
||||
|
||||
图中为主要业务关联,不表示数据库已声明物理外键;审计还覆盖应用、节点、钱包和套餐。
|
||||
|
||||
| 关联 | 基数及用途 |
|
||||
| --- | --- |
|
||||
| sys_user → rent_app / rent_node | 一对多,分别为商户应用及供应节点归属 |
|
||||
| sys_user → rent_account | 一对多,按网络唯一 |
|
||||
| rent_app / rent_node → rent_credential | 一对多,通过 owner_type、owner_id 区分 |
|
||||
| rent_credential → rent_nonce | 一对多,通过 api_key 关联认证记录 |
|
||||
| rent_node → rent_wallet | 一对多;钱包首版只绑定一个节点 |
|
||||
| rent_app / rent_package → rent_order | 一对多,保存订单归属和套餐来源 |
|
||||
| rent_account → rent_order | 一对多,payer_account_id 指定商户付款账户 |
|
||||
| rent_wallet → rent_order | 一对多,调度前订单钱包可为空 |
|
||||
| rent_order → rent_task | 一对多,委托、回收及历史尝试 |
|
||||
| rent_task → rent_transaction | 一对零或一,每任务最多一笔链上交易 |
|
||||
| rent_account / rent_order → rent_ledger | 一对多,余额与订单资金变动 |
|
||||
| rent_account → rent_settlement | 一对多,供应商结算批次 |
|
||||
| rent_settlement → rent_settlement_item | 一对多,批次订单来源 |
|
||||
| rent_order → rent_settlement_item | 可有历史拒绝明细,最多一个有效或已付占位 |
|
||||
| rent_order → rent_webhook | 一对多,按业务事件去重,退款逐次独立 |
|
||||
| rent_order → rent_refund | 一对多,每次部分退款保留独立记录 |
|
||||
| rent_refund → rent_ledger | 一对多,商户退款、应收冲正和手续费调整分别记账 |
|
||||
| 各业务对象 → rent_event | 一对多,通过 object_type、object_id 审计 |
|
||||
|
||||
## 4. 完整业务协同流程
|
||||
|
||||
### 4.1 开通和人工充值
|
||||
|
||||
1. 共用系统登录和权限授予;商户创建应用、供应商注册节点及钱包。
|
||||
2. 为 APP 和 NODE 分别签发凭证;钱包完成消息签名验证、链上权限核验及审核。
|
||||
3. Agent 配置本地钱包、保留本金和费用限制;广播默认关闭,只能供应商本地明确允许。
|
||||
4. 运营独立核验 USDT 充值凭据,锁账户后增加可用余额,同事务写 TOPUP 流水及审计。
|
||||
5. 充值凭据规范化并构造全局唯一 business_key,阻止同凭据给不同账户重复入账。本版无待审核充值单表。
|
||||
|
||||
### 4.2 下单与资金冻结
|
||||
|
||||
1. 校验应用凭证、签名、消息时效及 nonce,或使用系统登录身份和权限。
|
||||
2. 按 `(app_id, merchant_order_no)` 查重;相同摘要返回原订单,不同内容拒绝。
|
||||
3. 锁套餐和账户,检查上架、网络、地址、资源、规则、费用及余额。
|
||||
4. 同事务创建订单并锁定快照,扣可用、加冻结,追加 HOLD 流水和审计。
|
||||
5. 订单进入 WAITING,资金 HELD,回收 NOT_STARTED,保存 dispatch_deadline。
|
||||
|
||||
### 4.3 冗余换算与资源预留
|
||||
|
||||
设请求数量为 Q,正冗余百分数为 R,该资源全网总额度为 L、TRX 权重为 W:
|
||||
|
||||
```text
|
||||
目标资源量 T = max(Q + 1, ceil(Q × (1 + R / 100)))
|
||||
委托本金 TRX = ceil(T × W / L)
|
||||
委托本金 SUN = 委托本金 TRX × 1,000,000
|
||||
预计资源量 E = floor(SUN × L / (W × 1,000,000))
|
||||
要求:Q > 0,R > 0,L > 0,W > 0,E >= T > Q
|
||||
```
|
||||
|
||||
1. 选择已审核、在线、快照有效且对应资源开启的钱包。
|
||||
2. 使用对应资源的当前参数精确换算,不能用固定 TRX 汇率。
|
||||
3. 锁订单和钱包,检查截止、地址对占位、钱包执行占位、可信快照屏障及可调度本金,增加该类型 reserved_sun,固定供应商账户。
|
||||
4. 创建包含完整授权意图及换算证据的 DELEGATE 任务,订单进入 EXECUTING。
|
||||
5. 事务提交后推送任务。链上调用不作为数据库原子事务的一部分,通过持久状态恢复衔接。
|
||||
|
||||
### 4.4 Agent 执行与云端核验
|
||||
|
||||
1. Agent 持久化原任务后回 ACK,再验证 HMAC、期限、本地授权、费用及实时资源。
|
||||
2. 如原授权本金已不足且明确未构建或广播,可拒绝任务,由云端释放旧占位并重新换算新尝试;Agent 不能擅自放大本金。
|
||||
3. 一次构建签名交易,先持久化原交易及 txId 再广播;重试查原交易,不重签另一笔。
|
||||
4. 云端独立核验网络、地址、资源类型、SUN、回执、确认区块及关系变化。
|
||||
5. 实际确认资源量覆盖冗余目标,才能成功记账。
|
||||
6. 链上已委托但交付不足时进入人工核对,保留资金及本金记录并安排回收,不自动补委托。
|
||||
|
||||
### 4.5 成功扣款与供应商应收
|
||||
|
||||
云端核验交付达标且尚未到期后,同事务完成:交易 CONFIRMED、任务 VERIFIED、订单 SUCCESS、资金 CHARGED、扣冻结、供应商收入和手续费流水、预留转换、钱包快照屏障及执行占位释放、服务起止、回收计划、SUCCESS 回调及审计。服务起点取交易 block_time,核验时间不延长租期。已委托但交付不达标也必须确认链上事实和处理预留、回收,订单保持人工核对。
|
||||
|
||||
```text
|
||||
供应商毛收入 G = supplier_amount
|
||||
手续费 F = round(G × supplier_fee_percent / 100, 6, HALF_UP)
|
||||
净应收 N = G - F
|
||||
要求:0 < 费率 < 100,0 < F < G,N > 0,G <= 商户售价
|
||||
```
|
||||
|
||||
先追加 SUPPLIER_EARN:待结算 +G;再追加 SUPPLIER_FEE:待结算 -F、平台手续费 +F。最终供应商待结算净增 N。各流水按顺序保存变更后余额,多账户按 account_id 顺序加锁,同一账户只锁一次。
|
||||
|
||||
例如售价 12 USDT、毛收入 10 USDT、示例费率 5%,供应商净应收 9.5 USDT。平台收入统计为售价减毛收入加手续费,即 2.5 USDT(未扣其他成本);不能在售价减净应收后再次加手续费。5% 仅为示例。
|
||||
|
||||
### 4.6 明确失败、取消及未知结果
|
||||
|
||||
| 情况 | 协同处理 |
|
||||
| --- | --- |
|
||||
| WAITING 且未生成执行任务的取消 | 锁订单裁决,解冻资金,写 RELEASE、CANCELLED 回调及审计 |
|
||||
| 明确未执行的可重试失败 | 只释放资源及旧任务占位,保留订单 HELD 资金,截止前重试;不发终态 FAILED |
|
||||
| 明确终结失败 | 释放资金及资源,写 RELEASE 和 FAILED 回调,不再重试该订单 |
|
||||
| 无供应方等待超时 | 按公开等待上限取消并释放资金 |
|
||||
| 已广播但结果未知、节点离线 | 保留资金和资源占用,核对原 txId,不盲目重派 |
|
||||
| 链上已委托但交付不足 | MANUAL_REVIEW,保留事实并追踪回收,经审核处置 |
|
||||
|
||||
普通失败释放冻结是解冻;成功扣款后返还内部余额才是退款。
|
||||
|
||||
### 4.7 到期回收
|
||||
|
||||
1. 扫描订单回收计划,包括已委托但未正常成功的异常订单。
|
||||
2. 使用原确认交易的资源类型和 SUN 本金创建 RECLAIM 任务并保存 source_transaction_id,不按当前参数重算撤销金额;回收 reservation_status=NONE。
|
||||
3. 同钱包同类型链上操作串行,同地址对同类型只允许一笔占位订单,避免混入其他订单份额。
|
||||
4. 未解锁则安排下次检查;结果未知继续隔离;部分可回收或份额异常转人工。
|
||||
5. 撤销确认后若资源尚未恢复,回收状态 RECOVERING。
|
||||
6. 撤销确认时先写快照屏障、失效旧快照再释放执行占位;本金回收且资源恢复后应用可信新快照,回收 DONE,释放订单 relation_slot,写 RECLAIMED 回调及审计。
|
||||
|
||||
回收不改变原履约成功事实,也不自动退款。
|
||||
|
||||
### 4.8 人工结算与退款
|
||||
|
||||
**结算:** 锁供应商账户及来源订单 → 选择已核验且未被占用的净应收 → 创建结算单及明细 → 独立审批 → 提交 PAYING、唯一 payout_no → 人工付款 → 独立核验唯一付款凭据 → 同事务扣待结算、写 SETTLE、标记 PAID 并审计。PAYING 或付款未知不得重付或释放来源。
|
||||
|
||||
**退款:** 创建 rent_refund 幂等请求 → 独立审批费用承担 → 按统一顺序锁账户、订单、退款单并检查结算来源及累计上限 → 追加 REFUND / REVERSAL → 更新订单累计和退款 APPLIED → 同事务写本次退款独立回调及审计。供应商或手续费变化遇到已结算、结算占用或应付不足时转人工;单纯平台承担的商户退款可独立审核。不得制造负余额或重复返还手续费。
|
||||
|
||||
## 5. 关键事务与幂等边界
|
||||
|
||||
| 操作 | 必须原子协同的主要记录 |
|
||||
| --- | --- |
|
||||
| 充值 | account + ledger + event |
|
||||
| 下单冻结 | order + account + ledger + event |
|
||||
| 分配执行任务 | order + wallet 预留 + task + event |
|
||||
| 委托核验成功 | transaction + task + order + wallet + account + ledger + webhook + event |
|
||||
| 明确失败释放 | task / transaction 状态 + order + wallet + account + ledger + webhook + event,按实际发生阶段处理 |
|
||||
| 创建结算 | settlement + settlement_item + 来源资格及账户余额锁定校验 + event |
|
||||
| 确认付款 | settlement + account + ledger + event,明细有效占位继续保留 |
|
||||
| 退款冲正 | refund + order + account + ledger + webhook + event,并锁定校验结算来源状态 |
|
||||
|
||||
| 保护层 | 主要唯一约束或机制 |
|
||||
| --- | --- |
|
||||
| 消息重放 | nonce(api_key, scope, nonce) |
|
||||
| 重复下单 | order(app_id, merchant_order_no) + request_hash |
|
||||
| 重复有效任务 | task(order_id, task_type, active_slot) |
|
||||
| 重复任务投递 | 稳定 delivery_message_id + Agent 本地持久幂等 |
|
||||
| 重复交易归属 | transaction(task_id)、transaction(network, tx_id) |
|
||||
| 重复记账 | ledger(business_key) |
|
||||
| 重复结算来源 | settlement_item(order_id, active_slot) |
|
||||
| 重复付款凭据 | settlement(payment_reference) |
|
||||
| 重复退款请求 | refund(order_id, request_no) + request_hash |
|
||||
| 重复回调事件 | webhook(event_no)、webhook(event_key)、webhook(order_id, order_event_sequence) |
|
||||
| 地址对在租互斥 | order(wallet_id, receiver_address, resource_type, relation_slot) |
|
||||
| 钱包链上操作互斥 | task(wallet_id, resource_type, wallet_execution_slot) |
|
||||
| 节点重复上报 | event(event_no),相同编号不同内容拒绝 |
|
||||
| 旧连接覆盖新连接 | node.session_epoch 条件更新 |
|
||||
|
||||
## 6. 对账与实现注意事项
|
||||
|
||||
1. 每日核对账户冻结余额与 HELD 订单、待结算余额与未结净应收、余额投影与不可变流水;差异记录审计并人工处理。
|
||||
2. 钱包在途预留与 HELD 任务逐笔对应;确认成功时避免链上已扣减和本地预留重复扣减,保留其他未知任务占用。
|
||||
3. 资源快照必须可信且未过期;Agent 签名前再次查询。冗余是确认时缓冲,不保证整个租期资源额度恒定。
|
||||
4. Socket 仅负责传输;任务数据库和 Agent 本地持久化负责恢复。断线重连先同步,再允许新单。
|
||||
5. 本版不是完整复式会计总账,也不包含自动充值识别、自动出金、动态报价或供应商竞价。
|
||||
6. 初始化脚本的 `IF NOT EXISTS` 不能升级已有旧表;本文仅说明设计,没有执行建表、迁移或资金操作。
|
||||
@@ -0,0 +1,36 @@
|
||||
# V2.2 设计验证记录
|
||||
|
||||
## 验证范围
|
||||
|
||||
本次验证针对初始化 SQL、逐表文档、唯一索引语义及精确金额算例。没有连接或修改项目现有数据库,没有进行真实链上交易。
|
||||
|
||||
## 检查方式
|
||||
|
||||
1. 使用 SQLGlot 26.33.0 的 MySQL 方言解析完整 rent_init.sql:16 条 CREATE TABLE,0 条不支持的回退命令。该依赖仅安装于临时工具目录,不加入项目依赖。
|
||||
2. 运行标准库脚本 `python docs/rental/check_schema.py`:从实际 DDL 提取列名和唯一键,在 SQLite 内存库检查重复插入及 NULL 占位语义;同时核对 16 张表文档覆盖、列注释、索引字段引用、本地文档链接及无破坏性语句。
|
||||
3. 使用 Decimal 核对供应商手续费返还、净额冲正与结算来源一致,以及商户退款中手续费不重复入账。
|
||||
|
||||
## 结果
|
||||
|
||||
SQLGlot 严格 MySQL 方言解析通过:16 条 CREATE TABLE,无回退命令。离线脚本 12 项检查全部通过:
|
||||
|
||||
- 16 表及逐表文档一一覆盖、字段注释、唯一索引字段、无破坏性语句。
|
||||
- 本地 Markdown 链接存在。
|
||||
- 同地址对同资源类型互斥及 NULL 释放,多接收者/不同类型可并存。
|
||||
- 同钱包同类型的委托与回收共享执行互斥。
|
||||
- 同订单任务尝试与有效占位去重。
|
||||
- 退款请求去重,同订单多次部分退款回调可写入且业务键、序号防重复。
|
||||
- 出款授权与付款凭据唯一,未付款 NULL 可并存。
|
||||
- 结算来源唯一,已付来源不能再占用。
|
||||
- 跨账户重复充值业务键冲突。
|
||||
- 一任务一交易及同网络交易哈希去重。
|
||||
- Decimal 金额例中供应商返还手续费与结算来源一致,商户退款不重复加手续费。
|
||||
|
||||
脚本实际总数为 12。首轮发现验证记录尚未创建,以及一个记账键长度示例断言不成立;均已修正并完整重跑通过。
|
||||
|
||||
## 未覆盖内容
|
||||
|
||||
- 当前机器 Docker Linux 引擎未启动,也未发现可直接使用的 MySQL/MariaDB 命令。因此没有声称 MySQL 5.7/8.0 真实建表、索引字节限制、事务隔离或死锁测试通过。
|
||||
- SQLite 映射仅验证实际唯一键的等值冲突及 NULL 语义,未模拟 MySQL 字段类型、字符集、外键或业务状态机。
|
||||
- 租赁应用服务和 Agent 尚未实现,无法验证真实并发记账、CAS、出款恢复、断线恢复、HMAC 或状态转换;验收要求见 business-review-v2.2.md 第 8 节。
|
||||
- 未执行 NILE/MAINNET 委托或回收,非锁定委托条件、历史参数取证、资源使用债务及恢复判定仍需真实网络验证。
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentAccount;
|
||||
import com.ruoyi.system.domain.RentAccountPlus;
|
||||
import com.ruoyi.system.service.IRentAccountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 独立租赁资金账户;仅USDT,按用户和网络隔离Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentAccount")
|
||||
public class RentAccountController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentAccountService rentAccountService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentAccountPlus> list = rentAccountService.getByIds(ids.getLongIds(),false,RentAccountPlus::getUserId,RentAccountPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:user-getByIds')")
|
||||
@PostMapping("/user/getByIds")
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentAccountPlus> list = rentAccountService.getByIds(ids.getLongIds(),true,RentAccountPlus::getUserId,RentAccountPlus::getUserId,RentAccountPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentAccountService.select(keyword,false);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:user-select')")
|
||||
@GetMapping("/user/select")
|
||||
public AjaxResult userSelect(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentAccountService.select(keyword,true);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询独立租赁资金账户;仅USDT,按用户和网络隔离列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentAccount rentAccount)
|
||||
{
|
||||
startPage();
|
||||
List<RentAccount> list = rentAccountService.selectRentAccountList(rentAccount,false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询独立租赁资金账户;仅USDT,按用户和网络隔离列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:user-list')")
|
||||
@GetMapping("/user/list")
|
||||
public TableDataInfo userList(RentAccount rentAccount)
|
||||
{
|
||||
startPage();
|
||||
List<RentAccount> list = rentAccountService.selectRentAccountList(rentAccount,true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出独立租赁资金账户;仅USDT,按用户和网络隔离列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:export')")
|
||||
@Log(title = "独立租赁资金账户;仅USDT,按用户和网络隔离", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentAccount rentAccount)
|
||||
{
|
||||
List<RentAccount> list = rentAccountService.selectRentAccountList(rentAccount,false);
|
||||
ExcelUtil<RentAccount> util = new ExcelUtil<RentAccount>(RentAccount.class);
|
||||
return util.exportExcel(list, "rentAccount");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取独立租赁资金账户;仅USDT,按用户和网络隔离详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentAccountService.selectRentAccountById(id,false));
|
||||
}
|
||||
/**
|
||||
* 获取独立租赁资金账户;仅USDT,按用户和网络隔离详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:user-query')")
|
||||
@GetMapping(value = "/user/{id}")
|
||||
public AjaxResult userGetInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentAccountService.selectRentAccountById(id,true));
|
||||
}
|
||||
/**
|
||||
* 新增独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:add')")
|
||||
@Log(title = "独立租赁资金账户;仅USDT,按用户和网络隔离", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentAccount rentAccount)
|
||||
{
|
||||
return toAjax(rentAccountService.insertRentAccount(rentAccount,false));
|
||||
}
|
||||
/**
|
||||
* 新增独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:user-add')")
|
||||
@Log(title = "独立租赁资金账户;仅USDT,按用户和网络隔离", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user")
|
||||
public AjaxResult userAdd(@RequestBody RentAccount rentAccount)
|
||||
{
|
||||
return toAjax(rentAccountService.insertRentAccount(rentAccount,true));
|
||||
}
|
||||
/**
|
||||
* 修改独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:edit')")
|
||||
@Log(title = "独立租赁资金账户;仅USDT,按用户和网络隔离", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentAccount rentAccount)
|
||||
{
|
||||
return toAjax(rentAccountService.updateRentAccount(rentAccount,false));
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:user-edit')")
|
||||
@Log(title = "独立租赁资金账户;仅USDT,按用户和网络隔离", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user")
|
||||
public AjaxResult userEdit(@RequestBody RentAccount rentAccount)
|
||||
{
|
||||
return toAjax(rentAccountService.updateRentAccount(rentAccount,true));
|
||||
}
|
||||
/**
|
||||
* 删除独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:remove')")
|
||||
@Log(title = "独立租赁资金账户;仅USDT,按用户和网络隔离", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentAccountService.deleteRentAccountByIds(ids,false));
|
||||
}
|
||||
/**
|
||||
* 删除独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentAccount:user-remove')")
|
||||
@Log(title = "独立租赁资金账户;仅USDT,按用户和网络隔离", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}")
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentAccountService.deleteRentAccountByIds(ids,true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentApp;
|
||||
import com.ruoyi.system.domain.RentAppPlus;
|
||||
import com.ruoyi.system.service.IRentAppService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租赁独立商户应用;登录及权限共用若依Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentApp")
|
||||
public class RentAppController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentAppService rentAppService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentAppPlus> list = rentAppService.getByIds(ids.getLongIds(),false,RentAppPlus::getName,RentAppPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:user-getByIds')")
|
||||
@PostMapping("/user/getByIds")
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentAppPlus> list = rentAppService.getByIds(ids.getLongIds(),true,RentAppPlus::getUserId,RentAppPlus::getName,RentAppPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentAppService.select(keyword,false);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:user-select')")
|
||||
@GetMapping("/user/select")
|
||||
public AjaxResult userSelect(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentAppService.select(keyword,true);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询租赁独立商户应用;登录及权限共用若依列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentApp rentApp)
|
||||
{
|
||||
startPage();
|
||||
List<RentApp> list = rentAppService.selectRentAppList(rentApp,false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询租赁独立商户应用;登录及权限共用若依列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:user-list')")
|
||||
@GetMapping("/user/list")
|
||||
public TableDataInfo userList(RentApp rentApp)
|
||||
{
|
||||
startPage();
|
||||
List<RentApp> list = rentAppService.selectRentAppList(rentApp,true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出租赁独立商户应用;登录及权限共用若依列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:export')")
|
||||
@Log(title = "租赁独立商户应用;登录及权限共用若依", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentApp rentApp)
|
||||
{
|
||||
List<RentApp> list = rentAppService.selectRentAppList(rentApp,false);
|
||||
ExcelUtil<RentApp> util = new ExcelUtil<RentApp>(RentApp.class);
|
||||
return util.exportExcel(list, "rentApp");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租赁独立商户应用;登录及权限共用若依详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentAppService.selectRentAppById(id,false));
|
||||
}
|
||||
/**
|
||||
* 获取租赁独立商户应用;登录及权限共用若依详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:user-query')")
|
||||
@GetMapping(value = "/user/{id}")
|
||||
public AjaxResult userGetInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentAppService.selectRentAppById(id,true));
|
||||
}
|
||||
/**
|
||||
* 新增租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:add')")
|
||||
@Log(title = "租赁独立商户应用;登录及权限共用若依", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentApp rentApp)
|
||||
{
|
||||
return toAjax(rentAppService.insertRentApp(rentApp,false));
|
||||
}
|
||||
/**
|
||||
* 新增租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:user-add')")
|
||||
@Log(title = "租赁独立商户应用;登录及权限共用若依", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user")
|
||||
public AjaxResult userAdd(@RequestBody RentApp rentApp)
|
||||
{
|
||||
return toAjax(rentAppService.insertRentApp(rentApp,true));
|
||||
}
|
||||
/**
|
||||
* 修改租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:edit')")
|
||||
@Log(title = "租赁独立商户应用;登录及权限共用若依", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentApp rentApp)
|
||||
{
|
||||
return toAjax(rentAppService.updateRentApp(rentApp,false));
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:user-edit')")
|
||||
@Log(title = "租赁独立商户应用;登录及权限共用若依", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user")
|
||||
public AjaxResult userEdit(@RequestBody RentApp rentApp)
|
||||
{
|
||||
return toAjax(rentAppService.updateRentApp(rentApp,true));
|
||||
}
|
||||
/**
|
||||
* 删除租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:remove')")
|
||||
@Log(title = "租赁独立商户应用;登录及权限共用若依", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentAppService.deleteRentAppByIds(ids,false));
|
||||
}
|
||||
/**
|
||||
* 删除租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentApp:user-remove')")
|
||||
@Log(title = "租赁独立商户应用;登录及权限共用若依", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}")
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentAppService.deleteRentAppByIds(ids,true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentCredential;
|
||||
import com.ruoyi.system.domain.RentCredentialPlus;
|
||||
import com.ruoyi.system.service.IRentCredentialService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户及节点统一HMAC凭证版本;不含RSAController
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentCredential")
|
||||
public class RentCredentialController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentCredentialService rentCredentialService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentCredential:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentCredentialPlus> list = rentCredentialService.getByIds(ids.getLongIds(),RentCredentialPlus::getApiKey,RentCredentialPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentCredential:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentCredentialService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询商户及节点统一HMAC凭证版本;不含RSA列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentCredential:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentCredential rentCredential)
|
||||
{
|
||||
startPage();
|
||||
List<RentCredential> list = rentCredentialService.selectRentCredentialList(rentCredential);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出商户及节点统一HMAC凭证版本;不含RSA列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentCredential:export')")
|
||||
@Log(title = "商户及节点统一HMAC凭证版本;不含RSA", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentCredential rentCredential)
|
||||
{
|
||||
List<RentCredential> list = rentCredentialService.selectRentCredentialList(rentCredential);
|
||||
ExcelUtil<RentCredential> util = new ExcelUtil<RentCredential>(RentCredential.class);
|
||||
return util.exportExcel(list, "rentCredential");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商户及节点统一HMAC凭证版本;不含RSA详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentCredential:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentCredentialService.selectRentCredentialById(id));
|
||||
}
|
||||
/**
|
||||
* 新增商户及节点统一HMAC凭证版本;不含RSA
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentCredential:add')")
|
||||
@Log(title = "商户及节点统一HMAC凭证版本;不含RSA", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentCredential rentCredential)
|
||||
{
|
||||
return toAjax(rentCredentialService.insertRentCredential(rentCredential));
|
||||
}
|
||||
/**
|
||||
* 修改商户及节点统一HMAC凭证版本;不含RSA
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentCredential:edit')")
|
||||
@Log(title = "商户及节点统一HMAC凭证版本;不含RSA", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentCredential rentCredential)
|
||||
{
|
||||
return toAjax(rentCredentialService.updateRentCredential(rentCredential));
|
||||
}
|
||||
/**
|
||||
* 删除商户及节点统一HMAC凭证版本;不含RSA
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentCredential:remove')")
|
||||
@Log(title = "商户及节点统一HMAC凭证版本;不含RSA", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentCredentialService.deleteRentCredentialByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentEvent;
|
||||
import com.ruoyi.system.domain.RentEventPlus;
|
||||
import com.ruoyi.system.service.IRentEventService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务操作和状态变更追加审计;关键事务同写Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentEvent")
|
||||
public class RentEventController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentEventService rentEventService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentEvent:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentEventPlus> list = rentEventService.getByIds(ids.getLongIds(),RentEventPlus::getEventNo,RentEventPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentEvent:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentEventService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询业务操作和状态变更追加审计;关键事务同写列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentEvent:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentEvent rentEvent)
|
||||
{
|
||||
startPage();
|
||||
List<RentEvent> list = rentEventService.selectRentEventList(rentEvent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出业务操作和状态变更追加审计;关键事务同写列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentEvent:export')")
|
||||
@Log(title = "业务操作和状态变更追加审计;关键事务同写", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentEvent rentEvent)
|
||||
{
|
||||
List<RentEvent> list = rentEventService.selectRentEventList(rentEvent);
|
||||
ExcelUtil<RentEvent> util = new ExcelUtil<RentEvent>(RentEvent.class);
|
||||
return util.exportExcel(list, "rentEvent");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取业务操作和状态变更追加审计;关键事务同写详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentEvent:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentEventService.selectRentEventById(id));
|
||||
}
|
||||
/**
|
||||
* 新增业务操作和状态变更追加审计;关键事务同写
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentEvent:add')")
|
||||
@Log(title = "业务操作和状态变更追加审计;关键事务同写", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentEvent rentEvent)
|
||||
{
|
||||
return toAjax(rentEventService.insertRentEvent(rentEvent));
|
||||
}
|
||||
/**
|
||||
* 修改业务操作和状态变更追加审计;关键事务同写
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentEvent:edit')")
|
||||
@Log(title = "业务操作和状态变更追加审计;关键事务同写", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentEvent rentEvent)
|
||||
{
|
||||
return toAjax(rentEventService.updateRentEvent(rentEvent));
|
||||
}
|
||||
/**
|
||||
* 删除业务操作和状态变更追加审计;关键事务同写
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentEvent:remove')")
|
||||
@Log(title = "业务操作和状态变更追加审计;关键事务同写", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentEventService.deleteRentEventByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentLedger;
|
||||
import com.ruoyi.system.domain.RentLedgerPlus;
|
||||
import com.ruoyi.system.service.IRentLedgerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentLedger")
|
||||
public class RentLedgerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentLedgerService rentLedgerService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentLedger:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentLedgerPlus> list = rentLedgerService.getByIds(ids.getLongIds(),RentLedgerPlus::getBusinessKey,RentLedgerPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentLedger:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentLedgerService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentLedger:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentLedger rentLedger)
|
||||
{
|
||||
startPage();
|
||||
List<RentLedger> list = rentLedgerService.selectRentLedgerList(rentLedger);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentLedger:export')")
|
||||
@Log(title = "不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentLedger rentLedger)
|
||||
{
|
||||
List<RentLedger> list = rentLedgerService.selectRentLedgerList(rentLedger);
|
||||
ExcelUtil<RentLedger> util = new ExcelUtil<RentLedger>(RentLedger.class);
|
||||
return util.exportExcel(list, "rentLedger");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentLedger:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentLedgerService.selectRentLedgerById(id));
|
||||
}
|
||||
/**
|
||||
* 新增不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentLedger:add')")
|
||||
@Log(title = "不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentLedger rentLedger)
|
||||
{
|
||||
return toAjax(rentLedgerService.insertRentLedger(rentLedger));
|
||||
}
|
||||
/**
|
||||
* 修改不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentLedger:edit')")
|
||||
@Log(title = "不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentLedger rentLedger)
|
||||
{
|
||||
return toAjax(rentLedgerService.updateRentLedger(rentLedger));
|
||||
}
|
||||
/**
|
||||
* 删除不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentLedger:remove')")
|
||||
@Log(title = "不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentLedgerService.deleteRentLedgerByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentNode;
|
||||
import com.ruoyi.system.domain.RentNodePlus;
|
||||
import com.ruoyi.system.service.IRentNodeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商本地Agent节点;供应商直接关联共享用户,不另建成员Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentNode")
|
||||
public class RentNodeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentNodeService rentNodeService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentNodePlus> list = rentNodeService.getByIds(ids.getLongIds(),false,RentNodePlus::getName,RentNodePlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:user-getByIds')")
|
||||
@PostMapping("/user/getByIds")
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentNodePlus> list = rentNodeService.getByIds(ids.getLongIds(),true,RentNodePlus::getUserId,RentNodePlus::getName,RentNodePlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentNodeService.select(keyword,false);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:user-select')")
|
||||
@GetMapping("/user/select")
|
||||
public AjaxResult userSelect(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentNodeService.select(keyword,true);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询供应商本地Agent节点;供应商直接关联共享用户,不另建成员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentNode rentNode)
|
||||
{
|
||||
startPage();
|
||||
List<RentNode> list = rentNodeService.selectRentNodeList(rentNode,false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询供应商本地Agent节点;供应商直接关联共享用户,不另建成员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:user-list')")
|
||||
@GetMapping("/user/list")
|
||||
public TableDataInfo userList(RentNode rentNode)
|
||||
{
|
||||
startPage();
|
||||
List<RentNode> list = rentNodeService.selectRentNodeList(rentNode,true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出供应商本地Agent节点;供应商直接关联共享用户,不另建成员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:export')")
|
||||
@Log(title = "供应商本地Agent节点;供应商直接关联共享用户,不另建成员", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentNode rentNode)
|
||||
{
|
||||
List<RentNode> list = rentNodeService.selectRentNodeList(rentNode,false);
|
||||
ExcelUtil<RentNode> util = new ExcelUtil<RentNode>(RentNode.class);
|
||||
return util.exportExcel(list, "rentNode");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商本地Agent节点;供应商直接关联共享用户,不另建成员详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentNodeService.selectRentNodeById(id,false));
|
||||
}
|
||||
/**
|
||||
* 获取供应商本地Agent节点;供应商直接关联共享用户,不另建成员详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:user-query')")
|
||||
@GetMapping(value = "/user/{id}")
|
||||
public AjaxResult userGetInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentNodeService.selectRentNodeById(id,true));
|
||||
}
|
||||
/**
|
||||
* 新增供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:add')")
|
||||
@Log(title = "供应商本地Agent节点;供应商直接关联共享用户,不另建成员", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentNode rentNode)
|
||||
{
|
||||
return toAjax(rentNodeService.insertRentNode(rentNode,false));
|
||||
}
|
||||
/**
|
||||
* 新增供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:user-add')")
|
||||
@Log(title = "供应商本地Agent节点;供应商直接关联共享用户,不另建成员", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user")
|
||||
public AjaxResult userAdd(@RequestBody RentNode rentNode)
|
||||
{
|
||||
return toAjax(rentNodeService.insertRentNode(rentNode,true));
|
||||
}
|
||||
/**
|
||||
* 修改供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:edit')")
|
||||
@Log(title = "供应商本地Agent节点;供应商直接关联共享用户,不另建成员", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentNode rentNode)
|
||||
{
|
||||
return toAjax(rentNodeService.updateRentNode(rentNode,false));
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:user-edit')")
|
||||
@Log(title = "供应商本地Agent节点;供应商直接关联共享用户,不另建成员", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user")
|
||||
public AjaxResult userEdit(@RequestBody RentNode rentNode)
|
||||
{
|
||||
return toAjax(rentNodeService.updateRentNode(rentNode,true));
|
||||
}
|
||||
/**
|
||||
* 删除供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:remove')")
|
||||
@Log(title = "供应商本地Agent节点;供应商直接关联共享用户,不另建成员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentNodeService.deleteRentNodeByIds(ids,false));
|
||||
}
|
||||
/**
|
||||
* 删除供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNode:user-remove')")
|
||||
@Log(title = "供应商本地Agent节点;供应商直接关联共享用户,不另建成员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}")
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentNodeService.deleteRentNodeByIds(ids,true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentNonce;
|
||||
import com.ruoyi.system.domain.RentNoncePlus;
|
||||
import com.ruoyi.system.service.IRentNonceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* HMAC请求防重放记录Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentNonce")
|
||||
public class RentNonceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentNonceService rentNonceService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNonce:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentNoncePlus> list = rentNonceService.getByIds(ids.getLongIds(),RentNoncePlus::getNonce,RentNoncePlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNonce:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentNonceService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询HMAC请求防重放记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNonce:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentNonce rentNonce)
|
||||
{
|
||||
startPage();
|
||||
List<RentNonce> list = rentNonceService.selectRentNonceList(rentNonce);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出HMAC请求防重放记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNonce:export')")
|
||||
@Log(title = "HMAC请求防重放记录", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentNonce rentNonce)
|
||||
{
|
||||
List<RentNonce> list = rentNonceService.selectRentNonceList(rentNonce);
|
||||
ExcelUtil<RentNonce> util = new ExcelUtil<RentNonce>(RentNonce.class);
|
||||
return util.exportExcel(list, "rentNonce");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取HMAC请求防重放记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNonce:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentNonceService.selectRentNonceById(id));
|
||||
}
|
||||
/**
|
||||
* 新增HMAC请求防重放记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNonce:add')")
|
||||
@Log(title = "HMAC请求防重放记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentNonce rentNonce)
|
||||
{
|
||||
return toAjax(rentNonceService.insertRentNonce(rentNonce));
|
||||
}
|
||||
/**
|
||||
* 修改HMAC请求防重放记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNonce:edit')")
|
||||
@Log(title = "HMAC请求防重放记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentNonce rentNonce)
|
||||
{
|
||||
return toAjax(rentNonceService.updateRentNonce(rentNonce));
|
||||
}
|
||||
/**
|
||||
* 删除HMAC请求防重放记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentNonce:remove')")
|
||||
@Log(title = "HMAC请求防重放记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentNonceService.deleteRentNonceByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentOrder;
|
||||
import com.ruoyi.system.domain.RentOrderPlus;
|
||||
import com.ruoyi.system.service.IRentOrderService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentOrder")
|
||||
public class RentOrderController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentOrderService rentOrderService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentOrder:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentOrderPlus> list = rentOrderService.getByIds(ids.getLongIds(),RentOrderPlus::getOrderNo,RentOrderPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentOrder:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentOrderService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentOrder:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentOrder rentOrder)
|
||||
{
|
||||
startPage();
|
||||
List<RentOrder> list = rentOrderService.selectRentOrderList(rentOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentOrder:export')")
|
||||
@Log(title = "能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentOrder rentOrder)
|
||||
{
|
||||
List<RentOrder> list = rentOrderService.selectRentOrderList(rentOrder);
|
||||
ExcelUtil<RentOrder> util = new ExcelUtil<RentOrder>(RentOrder.class);
|
||||
return util.exportExcel(list, "rentOrder");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentOrder:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentOrderService.selectRentOrderById(id));
|
||||
}
|
||||
/**
|
||||
* 新增能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentOrder:add')")
|
||||
@Log(title = "能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentOrder rentOrder)
|
||||
{
|
||||
return toAjax(rentOrderService.insertRentOrder(rentOrder));
|
||||
}
|
||||
/**
|
||||
* 修改能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentOrder:edit')")
|
||||
@Log(title = "能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentOrder rentOrder)
|
||||
{
|
||||
return toAjax(rentOrderService.updateRentOrder(rentOrder));
|
||||
}
|
||||
/**
|
||||
* 删除能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentOrder:remove')")
|
||||
@Log(title = "能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentOrderService.deleteRentOrderByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentPackage;
|
||||
import com.ruoyi.system.domain.RentPackagePlus;
|
||||
import com.ruoyi.system.service.IRentPackageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentPackage")
|
||||
public class RentPackageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentPackageService rentPackageService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentPackage:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentPackagePlus> list = rentPackageService.getByIds(ids.getLongIds(),RentPackagePlus::getName,RentPackagePlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentPackage:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentPackageService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentPackage:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentPackage rentPackage)
|
||||
{
|
||||
startPage();
|
||||
List<RentPackage> list = rentPackageService.selectRentPackageList(rentPackage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentPackage:export')")
|
||||
@Log(title = "能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentPackage rentPackage)
|
||||
{
|
||||
List<RentPackage> list = rentPackageService.selectRentPackageList(rentPackage);
|
||||
ExcelUtil<RentPackage> util = new ExcelUtil<RentPackage>(RentPackage.class);
|
||||
return util.exportExcel(list, "rentPackage");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentPackage:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentPackageService.selectRentPackageById(id));
|
||||
}
|
||||
/**
|
||||
* 新增能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentPackage:add')")
|
||||
@Log(title = "能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentPackage rentPackage)
|
||||
{
|
||||
return toAjax(rentPackageService.insertRentPackage(rentPackage));
|
||||
}
|
||||
/**
|
||||
* 修改能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentPackage:edit')")
|
||||
@Log(title = "能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentPackage rentPackage)
|
||||
{
|
||||
return toAjax(rentPackageService.updateRentPackage(rentPackage));
|
||||
}
|
||||
/**
|
||||
* 删除能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentPackage:remove')")
|
||||
@Log(title = "能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentPackageService.deleteRentPackageByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentRefund;
|
||||
import com.ruoyi.system.domain.RentRefundPlus;
|
||||
import com.ruoyi.system.service.IRentRefundService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentRefund")
|
||||
public class RentRefundController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentRefundService rentRefundService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentRefund:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentRefundPlus> list = rentRefundService.getByIds(ids.getLongIds(),RentRefundPlus::getRefundNo,RentRefundPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentRefund:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentRefundService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentRefund:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentRefund rentRefund)
|
||||
{
|
||||
startPage();
|
||||
List<RentRefund> list = rentRefundService.selectRentRefundList(rentRefund);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentRefund:export')")
|
||||
@Log(title = "内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentRefund rentRefund)
|
||||
{
|
||||
List<RentRefund> list = rentRefundService.selectRentRefundList(rentRefund);
|
||||
ExcelUtil<RentRefund> util = new ExcelUtil<RentRefund>(RentRefund.class);
|
||||
return util.exportExcel(list, "rentRefund");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentRefund:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentRefundService.selectRentRefundById(id));
|
||||
}
|
||||
/**
|
||||
* 新增内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentRefund:add')")
|
||||
@Log(title = "内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentRefund rentRefund)
|
||||
{
|
||||
return toAjax(rentRefundService.insertRentRefund(rentRefund));
|
||||
}
|
||||
/**
|
||||
* 修改内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentRefund:edit')")
|
||||
@Log(title = "内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentRefund rentRefund)
|
||||
{
|
||||
return toAjax(rentRefundService.updateRentRefund(rentRefund));
|
||||
}
|
||||
/**
|
||||
* 删除内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentRefund:remove')")
|
||||
@Log(title = "内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentRefundService.deleteRentRefundByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentSettlement;
|
||||
import com.ruoyi.system.domain.RentSettlementPlus;
|
||||
import com.ruoyi.system.service.IRentSettlementService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商人工结算单;不自动链上出金Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentSettlement")
|
||||
public class RentSettlementController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentSettlementService rentSettlementService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlement:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentSettlementPlus> list = rentSettlementService.getByIds(ids.getLongIds(),RentSettlementPlus::getSettlementNo,RentSettlementPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlement:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentSettlementService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询供应商人工结算单;不自动链上出金列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlement:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentSettlement rentSettlement)
|
||||
{
|
||||
startPage();
|
||||
List<RentSettlement> list = rentSettlementService.selectRentSettlementList(rentSettlement);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出供应商人工结算单;不自动链上出金列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlement:export')")
|
||||
@Log(title = "供应商人工结算单;不自动链上出金", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentSettlement rentSettlement)
|
||||
{
|
||||
List<RentSettlement> list = rentSettlementService.selectRentSettlementList(rentSettlement);
|
||||
ExcelUtil<RentSettlement> util = new ExcelUtil<RentSettlement>(RentSettlement.class);
|
||||
return util.exportExcel(list, "rentSettlement");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商人工结算单;不自动链上出金详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlement:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentSettlementService.selectRentSettlementById(id));
|
||||
}
|
||||
/**
|
||||
* 新增供应商人工结算单;不自动链上出金
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlement:add')")
|
||||
@Log(title = "供应商人工结算单;不自动链上出金", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentSettlement rentSettlement)
|
||||
{
|
||||
return toAjax(rentSettlementService.insertRentSettlement(rentSettlement));
|
||||
}
|
||||
/**
|
||||
* 修改供应商人工结算单;不自动链上出金
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlement:edit')")
|
||||
@Log(title = "供应商人工结算单;不自动链上出金", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentSettlement rentSettlement)
|
||||
{
|
||||
return toAjax(rentSettlementService.updateRentSettlement(rentSettlement));
|
||||
}
|
||||
/**
|
||||
* 删除供应商人工结算单;不自动链上出金
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlement:remove')")
|
||||
@Log(title = "供应商人工结算单;不自动链上出金", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentSettlementService.deleteRentSettlementByIds(ids));
|
||||
}
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentSettlementItem;
|
||||
import com.ruoyi.system.domain.RentSettlementItemPlus;
|
||||
import com.ruoyi.system.service.IRentSettlementItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商订单应收与结算关联;首版每单全额结算一次Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentSettlementItem")
|
||||
public class RentSettlementItemController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentSettlementItemService rentSettlementItemService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlementItem:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentSettlementItemPlus> list = rentSettlementItemService.getByIds(ids.getLongIds(),RentSettlementItemPlus::getOrderId,RentSettlementItemPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlementItem:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentSettlementItemService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询供应商订单应收与结算关联;首版每单全额结算一次列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlementItem:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentSettlementItem rentSettlementItem)
|
||||
{
|
||||
startPage();
|
||||
List<RentSettlementItem> list = rentSettlementItemService.selectRentSettlementItemList(rentSettlementItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出供应商订单应收与结算关联;首版每单全额结算一次列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlementItem:export')")
|
||||
@Log(title = "供应商订单应收与结算关联;首版每单全额结算一次", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentSettlementItem rentSettlementItem)
|
||||
{
|
||||
List<RentSettlementItem> list = rentSettlementItemService.selectRentSettlementItemList(rentSettlementItem);
|
||||
ExcelUtil<RentSettlementItem> util = new ExcelUtil<RentSettlementItem>(RentSettlementItem.class);
|
||||
return util.exportExcel(list, "rentSettlementItem");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商订单应收与结算关联;首版每单全额结算一次详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlementItem:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentSettlementItemService.selectRentSettlementItemById(id));
|
||||
}
|
||||
/**
|
||||
* 新增供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlementItem:add')")
|
||||
@Log(title = "供应商订单应收与结算关联;首版每单全额结算一次", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentSettlementItem rentSettlementItem)
|
||||
{
|
||||
return toAjax(rentSettlementItemService.insertRentSettlementItem(rentSettlementItem));
|
||||
}
|
||||
/**
|
||||
* 修改供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlementItem:edit')")
|
||||
@Log(title = "供应商订单应收与结算关联;首版每单全额结算一次", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentSettlementItem rentSettlementItem)
|
||||
{
|
||||
return toAjax(rentSettlementItemService.updateRentSettlementItem(rentSettlementItem));
|
||||
}
|
||||
/**
|
||||
* 删除供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentSettlementItem:remove')")
|
||||
@Log(title = "供应商订单应收与结算关联;首版每单全额结算一次", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentSettlementItemService.deleteRentSettlementItemByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentTask;
|
||||
import com.ruoyi.system.domain.RentTaskPlus;
|
||||
import com.ruoyi.system.service.IRentTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 委托或回收任务,兼作持久队列与资源预留明细Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentTask")
|
||||
public class RentTaskController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentTaskService rentTaskService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTask:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentTaskPlus> list = rentTaskService.getByIds(ids.getLongIds(),RentTaskPlus::getTaskNo,RentTaskPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTask:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentTaskService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询委托或回收任务,兼作持久队列与资源预留明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTask:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentTask rentTask)
|
||||
{
|
||||
startPage();
|
||||
List<RentTask> list = rentTaskService.selectRentTaskList(rentTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出委托或回收任务,兼作持久队列与资源预留明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTask:export')")
|
||||
@Log(title = "委托或回收任务,兼作持久队列与资源预留明细", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentTask rentTask)
|
||||
{
|
||||
List<RentTask> list = rentTaskService.selectRentTaskList(rentTask);
|
||||
ExcelUtil<RentTask> util = new ExcelUtil<RentTask>(RentTask.class);
|
||||
return util.exportExcel(list, "rentTask");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取委托或回收任务,兼作持久队列与资源预留明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTask:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentTaskService.selectRentTaskById(id));
|
||||
}
|
||||
/**
|
||||
* 新增委托或回收任务,兼作持久队列与资源预留明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTask:add')")
|
||||
@Log(title = "委托或回收任务,兼作持久队列与资源预留明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentTask rentTask)
|
||||
{
|
||||
return toAjax(rentTaskService.insertRentTask(rentTask));
|
||||
}
|
||||
/**
|
||||
* 修改委托或回收任务,兼作持久队列与资源预留明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTask:edit')")
|
||||
@Log(title = "委托或回收任务,兼作持久队列与资源预留明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentTask rentTask)
|
||||
{
|
||||
return toAjax(rentTaskService.updateRentTask(rentTask));
|
||||
}
|
||||
/**
|
||||
* 删除委托或回收任务,兼作持久队列与资源预留明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTask:remove')")
|
||||
@Log(title = "委托或回收任务,兼作持久队列与资源预留明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentTaskService.deleteRentTaskByIds(ids));
|
||||
}
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentTransaction;
|
||||
import com.ruoyi.system.domain.RentTransactionPlus;
|
||||
import com.ruoyi.system.service.IRentTransactionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 链上委托或回收证据;一任务只能构建一笔交易Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentTransaction")
|
||||
public class RentTransactionController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentTransactionService rentTransactionService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTransaction:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentTransactionPlus> list = rentTransactionService.getByIds(ids.getLongIds(),RentTransactionPlus::getTxId,RentTransactionPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTransaction:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentTransactionService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询链上委托或回收证据;一任务只能构建一笔交易列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTransaction:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentTransaction rentTransaction)
|
||||
{
|
||||
startPage();
|
||||
List<RentTransaction> list = rentTransactionService.selectRentTransactionList(rentTransaction);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出链上委托或回收证据;一任务只能构建一笔交易列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTransaction:export')")
|
||||
@Log(title = "链上委托或回收证据;一任务只能构建一笔交易", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentTransaction rentTransaction)
|
||||
{
|
||||
List<RentTransaction> list = rentTransactionService.selectRentTransactionList(rentTransaction);
|
||||
ExcelUtil<RentTransaction> util = new ExcelUtil<RentTransaction>(RentTransaction.class);
|
||||
return util.exportExcel(list, "rentTransaction");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取链上委托或回收证据;一任务只能构建一笔交易详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTransaction:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentTransactionService.selectRentTransactionById(id));
|
||||
}
|
||||
/**
|
||||
* 新增链上委托或回收证据;一任务只能构建一笔交易
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTransaction:add')")
|
||||
@Log(title = "链上委托或回收证据;一任务只能构建一笔交易", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentTransaction rentTransaction)
|
||||
{
|
||||
return toAjax(rentTransactionService.insertRentTransaction(rentTransaction));
|
||||
}
|
||||
/**
|
||||
* 修改链上委托或回收证据;一任务只能构建一笔交易
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTransaction:edit')")
|
||||
@Log(title = "链上委托或回收证据;一任务只能构建一笔交易", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentTransaction rentTransaction)
|
||||
{
|
||||
return toAjax(rentTransactionService.updateRentTransaction(rentTransaction));
|
||||
}
|
||||
/**
|
||||
* 删除链上委托或回收证据;一任务只能构建一笔交易
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentTransaction:remove')")
|
||||
@Log(title = "链上委托或回收证据;一任务只能构建一笔交易", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentTransactionService.deleteRentTransactionByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentWallet;
|
||||
import com.ruoyi.system.domain.RentWalletPlus;
|
||||
import com.ruoyi.system.service.IRentWalletService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentWallet")
|
||||
public class RentWalletController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentWalletService rentWalletService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWallet:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentWalletPlus> list = rentWalletService.getByIds(ids.getLongIds(),RentWalletPlus::getAddress,RentWalletPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWallet:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentWalletService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWallet:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentWallet rentWallet)
|
||||
{
|
||||
startPage();
|
||||
List<RentWallet> list = rentWalletService.selectRentWalletList(rentWallet);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWallet:export')")
|
||||
@Log(title = "供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentWallet rentWallet)
|
||||
{
|
||||
List<RentWallet> list = rentWalletService.selectRentWalletList(rentWallet);
|
||||
ExcelUtil<RentWallet> util = new ExcelUtil<RentWallet>(RentWallet.class);
|
||||
return util.exportExcel(list, "rentWallet");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWallet:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentWalletService.selectRentWalletById(id));
|
||||
}
|
||||
/**
|
||||
* 新增供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWallet:add')")
|
||||
@Log(title = "供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentWallet rentWallet)
|
||||
{
|
||||
return toAjax(rentWalletService.insertRentWallet(rentWallet));
|
||||
}
|
||||
/**
|
||||
* 修改供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWallet:edit')")
|
||||
@Log(title = "供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentWallet rentWallet)
|
||||
{
|
||||
return toAjax(rentWalletService.updateRentWallet(rentWallet));
|
||||
}
|
||||
/**
|
||||
* 删除供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWallet:remove')")
|
||||
@Log(title = "供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentWalletService.deleteRentWalletByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.RentWebhook;
|
||||
import com.ruoyi.system.domain.RentWebhookPlus;
|
||||
import com.ruoyi.system.service.IRentWebhookService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单回调持久队列;业务状态更新时同事务写入Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/rentWebhook")
|
||||
public class RentWebhookController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRentWebhookService rentWebhookService;
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWebhook:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<RentWebhookPlus> list = rentWebhookService.getByIds(ids.getLongIds(),RentWebhookPlus::getEventNo,RentWebhookPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWebhook:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = rentWebhookService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询订单回调持久队列;业务状态更新时同事务写入列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWebhook:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RentWebhook rentWebhook)
|
||||
{
|
||||
startPage();
|
||||
List<RentWebhook> list = rentWebhookService.selectRentWebhookList(rentWebhook);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出订单回调持久队列;业务状态更新时同事务写入列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWebhook:export')")
|
||||
@Log(title = "订单回调持久队列;业务状态更新时同事务写入", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(RentWebhook rentWebhook)
|
||||
{
|
||||
List<RentWebhook> list = rentWebhookService.selectRentWebhookList(rentWebhook);
|
||||
ExcelUtil<RentWebhook> util = new ExcelUtil<RentWebhook>(RentWebhook.class);
|
||||
return util.exportExcel(list, "rentWebhook");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单回调持久队列;业务状态更新时同事务写入详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWebhook:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rentWebhookService.selectRentWebhookById(id));
|
||||
}
|
||||
/**
|
||||
* 新增订单回调持久队列;业务状态更新时同事务写入
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWebhook:add')")
|
||||
@Log(title = "订单回调持久队列;业务状态更新时同事务写入", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RentWebhook rentWebhook)
|
||||
{
|
||||
return toAjax(rentWebhookService.insertRentWebhook(rentWebhook));
|
||||
}
|
||||
/**
|
||||
* 修改订单回调持久队列;业务状态更新时同事务写入
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWebhook:edit')")
|
||||
@Log(title = "订单回调持久队列;业务状态更新时同事务写入", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RentWebhook rentWebhook)
|
||||
{
|
||||
return toAjax(rentWebhookService.updateRentWebhook(rentWebhook));
|
||||
}
|
||||
/**
|
||||
* 删除订单回调持久队列;业务状态更新时同事务写入
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rentWebhook:remove')")
|
||||
@Log(title = "订单回调持久队列;业务状态更新时同事务写入", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rentWebhookService.deleteRentWebhookByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 独立租赁资金账户;仅USDT,按用户和网络隔离对象 rent_account
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentAccount extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** sys_user.user_id,同用户可同时是商户和供应商 */
|
||||
@Excel(name = "sys_user.user_id,同用户可同时是商户和供应商")
|
||||
private Long userId;
|
||||
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
|
||||
/** 可用USDT余额,不能为负 */
|
||||
@Excel(name = "可用USDT余额,不能为负")
|
||||
private BigDecimal availableAmount;
|
||||
|
||||
/** 订单冻结USDT,不能为负 */
|
||||
@Excel(name = "订单冻结USDT,不能为负")
|
||||
private BigDecimal frozenAmount;
|
||||
|
||||
/** 供应商已履约扣平台手续费后的净待结算USDT,不能为负 */
|
||||
@Excel(name = "供应商已履约扣平台手续费后的净待结算USDT,不能为负")
|
||||
private BigDecimal supplierPendingAmount;
|
||||
|
||||
/** ACTIVE可操作、FROZEN冻结业务 */
|
||||
@Excel(name = "ACTIVE可操作、FROZEN冻结业务")
|
||||
private String status;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setAvailableAmount(BigDecimal availableAmount)
|
||||
{
|
||||
this.availableAmount = availableAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getAvailableAmount()
|
||||
{
|
||||
return availableAmount;
|
||||
}
|
||||
public void setFrozenAmount(BigDecimal frozenAmount)
|
||||
{
|
||||
this.frozenAmount = frozenAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getFrozenAmount()
|
||||
{
|
||||
return frozenAmount;
|
||||
}
|
||||
public void setSupplierPendingAmount(BigDecimal supplierPendingAmount)
|
||||
{
|
||||
this.supplierPendingAmount = supplierPendingAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierPendingAmount()
|
||||
{
|
||||
return supplierPendingAmount;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("network", getNetwork())
|
||||
.append("availableAmount", getAvailableAmount())
|
||||
.append("frozenAmount", getFrozenAmount())
|
||||
.append("supplierPendingAmount", getSupplierPendingAmount())
|
||||
.append("status", getStatus())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 独立租赁资金账户;仅USDT,按用户和网络隔离对象 rent_account
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_account")
|
||||
public class RentAccountPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** sys_user.user_id,同用户可同时是商户和供应商 */
|
||||
@Excel(name = "sys_user.user_id,同用户可同时是商户和供应商")
|
||||
private Long userId;
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
/** 可用USDT余额,不能为负 */
|
||||
@Excel(name = "可用USDT余额,不能为负")
|
||||
private BigDecimal availableAmount;
|
||||
/** 订单冻结USDT,不能为负 */
|
||||
@Excel(name = "订单冻结USDT,不能为负")
|
||||
private BigDecimal frozenAmount;
|
||||
/** 供应商已履约扣平台手续费后的净待结算USDT,不能为负 */
|
||||
@Excel(name = "供应商已履约扣平台手续费后的净待结算USDT,不能为负")
|
||||
private BigDecimal supplierPendingAmount;
|
||||
/** ACTIVE可操作、FROZEN冻结业务 */
|
||||
@Excel(name = "ACTIVE可操作、FROZEN冻结业务")
|
||||
private String status;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setAvailableAmount(BigDecimal availableAmount)
|
||||
{
|
||||
this.availableAmount = availableAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getAvailableAmount()
|
||||
{
|
||||
return availableAmount;
|
||||
}
|
||||
public void setFrozenAmount(BigDecimal frozenAmount)
|
||||
{
|
||||
this.frozenAmount = frozenAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getFrozenAmount()
|
||||
{
|
||||
return frozenAmount;
|
||||
}
|
||||
public void setSupplierPendingAmount(BigDecimal supplierPendingAmount)
|
||||
{
|
||||
this.supplierPendingAmount = supplierPendingAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierPendingAmount()
|
||||
{
|
||||
return supplierPendingAmount;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("network", getNetwork())
|
||||
.append("availableAmount", getAvailableAmount())
|
||||
.append("frozenAmount", getFrozenAmount())
|
||||
.append("supplierPendingAmount", getSupplierPendingAmount())
|
||||
.append("status", getStatus())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 租赁独立商户应用;登录及权限共用若依对象 rent_app
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentApp extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 所有者sys_user.user_id */
|
||||
@Excel(name = "所有者sys_user.user_id")
|
||||
private Long userId;
|
||||
|
||||
/** 应用名称 */
|
||||
@Excel(name = "应用名称")
|
||||
private String name;
|
||||
|
||||
/** ACTIVE启用、DISABLED禁用 */
|
||||
@Excel(name = "ACTIVE启用、DISABLED禁用")
|
||||
private String status;
|
||||
|
||||
/** 默认HTTPS回调地址,必须检查SSRF */
|
||||
@Excel(name = "默认HTTPS回调地址,必须检查SSRF")
|
||||
private String notifyUrl;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setNotifyUrl(String notifyUrl)
|
||||
{
|
||||
this.notifyUrl = notifyUrl;
|
||||
}
|
||||
|
||||
public String getNotifyUrl()
|
||||
{
|
||||
return notifyUrl;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("name", getName())
|
||||
.append("status", getStatus())
|
||||
.append("notifyUrl", getNotifyUrl())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 租赁独立商户应用;登录及权限共用若依对象 rent_app
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_app")
|
||||
public class RentAppPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 所有者sys_user.user_id */
|
||||
@Excel(name = "所有者sys_user.user_id")
|
||||
private Long userId;
|
||||
/** 应用名称 */
|
||||
@Excel(name = "应用名称")
|
||||
private String name;
|
||||
/** ACTIVE启用、DISABLED禁用 */
|
||||
@Excel(name = "ACTIVE启用、DISABLED禁用")
|
||||
private String status;
|
||||
/** 默认HTTPS回调地址,必须检查SSRF */
|
||||
@Excel(name = "默认HTTPS回调地址,必须检查SSRF")
|
||||
private String notifyUrl;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setNotifyUrl(String notifyUrl)
|
||||
{
|
||||
this.notifyUrl = notifyUrl;
|
||||
}
|
||||
|
||||
public String getNotifyUrl()
|
||||
{
|
||||
return notifyUrl;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("name", getName())
|
||||
.append("status", getStatus())
|
||||
.append("notifyUrl", getNotifyUrl())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 商户及节点统一HMAC凭证版本;不含RSA对象 rent_credential
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentCredential extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** APP商户、NODE节点 */
|
||||
@Excel(name = "APP商户、NODE节点")
|
||||
private String ownerType;
|
||||
|
||||
/** APP时rent_app.id,NODE时rent_node.id */
|
||||
@Excel(name = "APP时rent_app.id,NODE时rent_node.id")
|
||||
private Long ownerId;
|
||||
|
||||
/** 永久唯一公开凭证标识 */
|
||||
@Excel(name = "永久唯一公开凭证标识")
|
||||
private String apiKey;
|
||||
|
||||
/** AES-GCM加密封装的API Secret,含IV和tag;禁止返回或记录明文 */
|
||||
@Excel(name = "AES-GCM加密封装的API Secret,含IV和tag;禁止返回或记录明文")
|
||||
private String apiSecret;
|
||||
|
||||
/** 外部AES主密钥版本,不存主密钥 */
|
||||
@Excel(name = "外部AES主密钥版本,不存主密钥")
|
||||
private String masterKeyVersion;
|
||||
|
||||
/** ACTIVE可签发新消息、VERIFY_ONLY仅验历史在途、REVOKED吊销 */
|
||||
@Excel(name = "ACTIVE可签发新消息、VERIFY_ONLY仅验历史在途、REVOKED吊销")
|
||||
private String status;
|
||||
|
||||
/** 凭证过期时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "凭证过期时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expiresAt;
|
||||
|
||||
/** 吊销时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "吊销时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date revokedAt;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOwnerType(String ownerType)
|
||||
{
|
||||
this.ownerType = ownerType;
|
||||
}
|
||||
|
||||
public String getOwnerType()
|
||||
{
|
||||
return ownerType;
|
||||
}
|
||||
public void setOwnerId(Long ownerId)
|
||||
{
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public Long getOwnerId()
|
||||
{
|
||||
return ownerId;
|
||||
}
|
||||
public void setApiKey(String apiKey)
|
||||
{
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
public String getApiKey()
|
||||
{
|
||||
return apiKey;
|
||||
}
|
||||
public void setApiSecret(String apiSecret)
|
||||
{
|
||||
this.apiSecret = apiSecret;
|
||||
}
|
||||
|
||||
public String getApiSecret()
|
||||
{
|
||||
return apiSecret;
|
||||
}
|
||||
public void setMasterKeyVersion(String masterKeyVersion)
|
||||
{
|
||||
this.masterKeyVersion = masterKeyVersion;
|
||||
}
|
||||
|
||||
public String getMasterKeyVersion()
|
||||
{
|
||||
return masterKeyVersion;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setExpiresAt(Date expiresAt)
|
||||
{
|
||||
this.expiresAt = expiresAt;
|
||||
}
|
||||
|
||||
public Date getExpiresAt()
|
||||
{
|
||||
return expiresAt;
|
||||
}
|
||||
public void setRevokedAt(Date revokedAt)
|
||||
{
|
||||
this.revokedAt = revokedAt;
|
||||
}
|
||||
|
||||
public Date getRevokedAt()
|
||||
{
|
||||
return revokedAt;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("ownerType", getOwnerType())
|
||||
.append("ownerId", getOwnerId())
|
||||
.append("apiKey", getApiKey())
|
||||
.append("apiSecret", getApiSecret())
|
||||
.append("masterKeyVersion", getMasterKeyVersion())
|
||||
.append("status", getStatus())
|
||||
.append("expiresAt", getExpiresAt())
|
||||
.append("revokedAt", getRevokedAt())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 商户及节点统一HMAC凭证版本;不含RSA对象 rent_credential
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_credential")
|
||||
public class RentCredentialPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** APP商户、NODE节点 */
|
||||
@Excel(name = "APP商户、NODE节点")
|
||||
private String ownerType;
|
||||
/** APP时rent_app.id,NODE时rent_node.id */
|
||||
@Excel(name = "APP时rent_app.id,NODE时rent_node.id")
|
||||
private Long ownerId;
|
||||
/** 永久唯一公开凭证标识 */
|
||||
@Excel(name = "永久唯一公开凭证标识")
|
||||
private String apiKey;
|
||||
/** AES-GCM加密封装的API Secret,含IV和tag;禁止返回或记录明文 */
|
||||
@Excel(name = "AES-GCM加密封装的API Secret,含IV和tag;禁止返回或记录明文")
|
||||
private String apiSecret;
|
||||
/** 外部AES主密钥版本,不存主密钥 */
|
||||
@Excel(name = "外部AES主密钥版本,不存主密钥")
|
||||
private String masterKeyVersion;
|
||||
/** ACTIVE可签发新消息、VERIFY_ONLY仅验历史在途、REVOKED吊销 */
|
||||
@Excel(name = "ACTIVE可签发新消息、VERIFY_ONLY仅验历史在途、REVOKED吊销")
|
||||
private String status;
|
||||
/** 凭证过期时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "凭证过期时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expiresAt;
|
||||
/** 吊销时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "吊销时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date revokedAt;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOwnerType(String ownerType)
|
||||
{
|
||||
this.ownerType = ownerType;
|
||||
}
|
||||
|
||||
public String getOwnerType()
|
||||
{
|
||||
return ownerType;
|
||||
}
|
||||
public void setOwnerId(Long ownerId)
|
||||
{
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public Long getOwnerId()
|
||||
{
|
||||
return ownerId;
|
||||
}
|
||||
public void setApiKey(String apiKey)
|
||||
{
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
public String getApiKey()
|
||||
{
|
||||
return apiKey;
|
||||
}
|
||||
public void setApiSecret(String apiSecret)
|
||||
{
|
||||
this.apiSecret = apiSecret;
|
||||
}
|
||||
|
||||
public String getApiSecret()
|
||||
{
|
||||
return apiSecret;
|
||||
}
|
||||
public void setMasterKeyVersion(String masterKeyVersion)
|
||||
{
|
||||
this.masterKeyVersion = masterKeyVersion;
|
||||
}
|
||||
|
||||
public String getMasterKeyVersion()
|
||||
{
|
||||
return masterKeyVersion;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setExpiresAt(Date expiresAt)
|
||||
{
|
||||
this.expiresAt = expiresAt;
|
||||
}
|
||||
|
||||
public Date getExpiresAt()
|
||||
{
|
||||
return expiresAt;
|
||||
}
|
||||
public void setRevokedAt(Date revokedAt)
|
||||
{
|
||||
this.revokedAt = revokedAt;
|
||||
}
|
||||
|
||||
public Date getRevokedAt()
|
||||
{
|
||||
return revokedAt;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("ownerType", getOwnerType())
|
||||
.append("ownerId", getOwnerId())
|
||||
.append("apiKey", getApiKey())
|
||||
.append("apiSecret", getApiSecret())
|
||||
.append("masterKeyVersion", getMasterKeyVersion())
|
||||
.append("status", getStatus())
|
||||
.append("expiresAt", getExpiresAt())
|
||||
.append("revokedAt", getRevokedAt())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 业务操作和状态变更追加审计;关键事务同写对象 rent_event
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentEvent extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 全局事件编号;节点按NODE:nodeId:eventId构造,限制eventId长度使总长不超过96 */
|
||||
@Excel(name = "全局事件编号;节点按NODE:nodeId:eventId构造,限制eventId长度使总长不超过96")
|
||||
private String eventNo;
|
||||
|
||||
/** APP、NODE、WALLET、PACKAGE、ORDER、TASK、ACCOUNT、SETTLEMENT、REFUND */
|
||||
@Excel(name = "APP、NODE、WALLET、PACKAGE、ORDER、TASK、ACCOUNT、SETTLEMENT、REFUND")
|
||||
private String objectType;
|
||||
|
||||
/** 对应业务表id */
|
||||
@Excel(name = "对应业务表id")
|
||||
private Long objectId;
|
||||
|
||||
/** 状态变更或操作代码 */
|
||||
@Excel(name = "状态变更或操作代码")
|
||||
private String action;
|
||||
|
||||
/** sys_user.user_id,节点或系统处理为0 */
|
||||
@Excel(name = "sys_user.user_id,节点或系统处理为0")
|
||||
private Long actorUserId;
|
||||
|
||||
/** 节点事件来源rent_node.id */
|
||||
@Excel(name = "节点事件来源rent_node.id")
|
||||
private Long nodeId;
|
||||
|
||||
/** 脱敏前后状态、结果与核验证据,不含Secret */
|
||||
@Excel(name = "脱敏前后状态、结果与核验证据,不含Secret")
|
||||
private String detail;
|
||||
|
||||
/** 操作依据或状态转换说明 */
|
||||
@Excel(name = "操作依据或状态转换说明")
|
||||
private String reason;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setEventNo(String eventNo)
|
||||
{
|
||||
this.eventNo = eventNo;
|
||||
}
|
||||
|
||||
public String getEventNo()
|
||||
{
|
||||
return eventNo;
|
||||
}
|
||||
public void setObjectType(String objectType)
|
||||
{
|
||||
this.objectType = objectType;
|
||||
}
|
||||
|
||||
public String getObjectType()
|
||||
{
|
||||
return objectType;
|
||||
}
|
||||
public void setObjectId(Long objectId)
|
||||
{
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public Long getObjectId()
|
||||
{
|
||||
return objectId;
|
||||
}
|
||||
public void setAction(String action)
|
||||
{
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public String getAction()
|
||||
{
|
||||
return action;
|
||||
}
|
||||
public void setActorUserId(Long actorUserId)
|
||||
{
|
||||
this.actorUserId = actorUserId;
|
||||
}
|
||||
|
||||
public Long getActorUserId()
|
||||
{
|
||||
return actorUserId;
|
||||
}
|
||||
public void setNodeId(Long nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public Long getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
public void setDetail(String detail)
|
||||
{
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
public String getDetail()
|
||||
{
|
||||
return detail;
|
||||
}
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("eventNo", getEventNo())
|
||||
.append("objectType", getObjectType())
|
||||
.append("objectId", getObjectId())
|
||||
.append("action", getAction())
|
||||
.append("actorUserId", getActorUserId())
|
||||
.append("nodeId", getNodeId())
|
||||
.append("detail", getDetail())
|
||||
.append("reason", getReason())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 业务操作和状态变更追加审计;关键事务同写对象 rent_event
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_event")
|
||||
public class RentEventPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 全局事件编号;节点按NODE:nodeId:eventId构造,限制eventId长度使总长不超过96 */
|
||||
@Excel(name = "全局事件编号;节点按NODE:nodeId:eventId构造,限制eventId长度使总长不超过96")
|
||||
private String eventNo;
|
||||
/** APP、NODE、WALLET、PACKAGE、ORDER、TASK、ACCOUNT、SETTLEMENT、REFUND */
|
||||
@Excel(name = "APP、NODE、WALLET、PACKAGE、ORDER、TASK、ACCOUNT、SETTLEMENT、REFUND")
|
||||
private String objectType;
|
||||
/** 对应业务表id */
|
||||
@Excel(name = "对应业务表id")
|
||||
private Long objectId;
|
||||
/** 状态变更或操作代码 */
|
||||
@Excel(name = "状态变更或操作代码")
|
||||
private String action;
|
||||
/** sys_user.user_id,节点或系统处理为0 */
|
||||
@Excel(name = "sys_user.user_id,节点或系统处理为0")
|
||||
private Long actorUserId;
|
||||
/** 节点事件来源rent_node.id */
|
||||
@Excel(name = "节点事件来源rent_node.id")
|
||||
private Long nodeId;
|
||||
/** 脱敏前后状态、结果与核验证据,不含Secret */
|
||||
@Excel(name = "脱敏前后状态、结果与核验证据,不含Secret")
|
||||
private String detail;
|
||||
/** 操作依据或状态转换说明 */
|
||||
@Excel(name = "操作依据或状态转换说明")
|
||||
private String reason;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setEventNo(String eventNo)
|
||||
{
|
||||
this.eventNo = eventNo;
|
||||
}
|
||||
|
||||
public String getEventNo()
|
||||
{
|
||||
return eventNo;
|
||||
}
|
||||
public void setObjectType(String objectType)
|
||||
{
|
||||
this.objectType = objectType;
|
||||
}
|
||||
|
||||
public String getObjectType()
|
||||
{
|
||||
return objectType;
|
||||
}
|
||||
public void setObjectId(Long objectId)
|
||||
{
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public Long getObjectId()
|
||||
{
|
||||
return objectId;
|
||||
}
|
||||
public void setAction(String action)
|
||||
{
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public String getAction()
|
||||
{
|
||||
return action;
|
||||
}
|
||||
public void setActorUserId(Long actorUserId)
|
||||
{
|
||||
this.actorUserId = actorUserId;
|
||||
}
|
||||
|
||||
public Long getActorUserId()
|
||||
{
|
||||
return actorUserId;
|
||||
}
|
||||
public void setNodeId(Long nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public Long getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
public void setDetail(String detail)
|
||||
{
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
public String getDetail()
|
||||
{
|
||||
return detail;
|
||||
}
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("eventNo", getEventNo())
|
||||
.append("objectType", getObjectType())
|
||||
.append("objectId", getObjectId())
|
||||
.append("action", getAction())
|
||||
.append("actorUserId", getActorUserId())
|
||||
.append("nodeId", getNodeId())
|
||||
.append("detail", getDetail())
|
||||
.append("reason", getReason())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖对象 rent_ledger
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentLedger extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** rent_account.id */
|
||||
@Excel(name = "rent_account.id")
|
||||
private Long accountId;
|
||||
|
||||
/** 全局唯一记账键;普通业务含事件及账户,TOPUP仅按网络及链上事件唯一标识构造,不含账户以防跨用户重复充值 */
|
||||
@Excel(name = "全局唯一记账键;普通业务含事件及账户,TOPUP仅按网络及链上事件唯一标识构造,不含账户以防跨用户重复充值")
|
||||
private String businessKey;
|
||||
|
||||
/** TOPUP充值、HOLD冻结、CHARGE扣款、RELEASE解冻、SUPPLIER_EARN毛应收、SUPPLIER_FEE供应商手续费、SETTLE净额结算、REFUND退款、REVERSAL冲正 */
|
||||
@Excel(name = "TOPUP充值、HOLD冻结、CHARGE扣款、RELEASE解冻、SUPPLIER_EARN毛应收、SUPPLIER_FEE供应商手续费、SETTLE净额结算、REFUND退款、REVERSAL冲正")
|
||||
private String eventType;
|
||||
|
||||
/** 可用余额变化,有正负 */
|
||||
@Excel(name = "可用余额变化,有正负")
|
||||
private BigDecimal deltaAvailable;
|
||||
|
||||
/** 冻结余额变化,有正负 */
|
||||
@Excel(name = "冻结余额变化,有正负")
|
||||
private BigDecimal deltaFrozen;
|
||||
|
||||
/** 供应商待结算变化,有正负 */
|
||||
@Excel(name = "供应商待结算变化,有正负")
|
||||
private BigDecimal deltaSupplierPending;
|
||||
|
||||
/** 平台供应商手续费收入变动USDT;扣费为正、退费为负;退商户增加可用,退供应商增加待结算,不是用户账户余额 */
|
||||
@Excel(name = "平台供应商手续费收入变动USDT;扣费为正、退费为负;退商户增加可用,退供应商增加待结算,不是用户账户余额")
|
||||
private BigDecimal deltaPlatformFee;
|
||||
|
||||
/** 变更后可用USDT */
|
||||
@Excel(name = "变更后可用USDT")
|
||||
private BigDecimal afterAvailable;
|
||||
|
||||
/** 变更后冻结USDT */
|
||||
@Excel(name = "变更后冻结USDT")
|
||||
private BigDecimal afterFrozen;
|
||||
|
||||
/** 变更后待结算USDT */
|
||||
@Excel(name = "变更后待结算USDT")
|
||||
private BigDecimal afterSupplierPending;
|
||||
|
||||
/** 关联rent_order.id */
|
||||
@Excel(name = "关联rent_order.id")
|
||||
private Long orderId;
|
||||
|
||||
/** 关联rent_settlement.id */
|
||||
@Excel(name = "关联rent_settlement.id")
|
||||
private Long settlementId;
|
||||
|
||||
/** 退款或相关冲正关联rent_refund.id,每个退款内各事件使用独立business_key */
|
||||
@Excel(name = "退款或相关冲正关联rent_refund.id,每个退款内各事件使用独立business_key")
|
||||
private Long refundId;
|
||||
|
||||
/** 冲正的rent_ledger.id */
|
||||
@Excel(name = "冲正的rent_ledger.id")
|
||||
private Long reversalOfId;
|
||||
|
||||
/** 操作者sys_user.user_id,后台系统为0 */
|
||||
@Excel(name = "操作者sys_user.user_id,后台系统为0")
|
||||
private Long operatorUserId;
|
||||
|
||||
/** 人工充值、付款或补偿审核依据编号;充值凭据必须全局防重复 */
|
||||
@Excel(name = "人工充值、付款或补偿审核依据编号;充值凭据必须全局防重复")
|
||||
private String evidenceRef;
|
||||
|
||||
/** 记账或人工调整原因,必填 */
|
||||
@Excel(name = "记账或人工调整原因,必填")
|
||||
private String reason;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setAccountId(Long accountId)
|
||||
{
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public Long getAccountId()
|
||||
{
|
||||
return accountId;
|
||||
}
|
||||
public void setBusinessKey(String businessKey)
|
||||
{
|
||||
this.businessKey = businessKey;
|
||||
}
|
||||
|
||||
public String getBusinessKey()
|
||||
{
|
||||
return businessKey;
|
||||
}
|
||||
public void setEventType(String eventType)
|
||||
{
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
public void setDeltaAvailable(BigDecimal deltaAvailable)
|
||||
{
|
||||
this.deltaAvailable = deltaAvailable;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaAvailable()
|
||||
{
|
||||
return deltaAvailable;
|
||||
}
|
||||
public void setDeltaFrozen(BigDecimal deltaFrozen)
|
||||
{
|
||||
this.deltaFrozen = deltaFrozen;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaFrozen()
|
||||
{
|
||||
return deltaFrozen;
|
||||
}
|
||||
public void setDeltaSupplierPending(BigDecimal deltaSupplierPending)
|
||||
{
|
||||
this.deltaSupplierPending = deltaSupplierPending;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaSupplierPending()
|
||||
{
|
||||
return deltaSupplierPending;
|
||||
}
|
||||
public void setDeltaPlatformFee(BigDecimal deltaPlatformFee)
|
||||
{
|
||||
this.deltaPlatformFee = deltaPlatformFee;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaPlatformFee()
|
||||
{
|
||||
return deltaPlatformFee;
|
||||
}
|
||||
public void setAfterAvailable(BigDecimal afterAvailable)
|
||||
{
|
||||
this.afterAvailable = afterAvailable;
|
||||
}
|
||||
|
||||
public BigDecimal getAfterAvailable()
|
||||
{
|
||||
return afterAvailable;
|
||||
}
|
||||
public void setAfterFrozen(BigDecimal afterFrozen)
|
||||
{
|
||||
this.afterFrozen = afterFrozen;
|
||||
}
|
||||
|
||||
public BigDecimal getAfterFrozen()
|
||||
{
|
||||
return afterFrozen;
|
||||
}
|
||||
public void setAfterSupplierPending(BigDecimal afterSupplierPending)
|
||||
{
|
||||
this.afterSupplierPending = afterSupplierPending;
|
||||
}
|
||||
|
||||
public BigDecimal getAfterSupplierPending()
|
||||
{
|
||||
return afterSupplierPending;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setSettlementId(Long settlementId)
|
||||
{
|
||||
this.settlementId = settlementId;
|
||||
}
|
||||
|
||||
public Long getSettlementId()
|
||||
{
|
||||
return settlementId;
|
||||
}
|
||||
public void setRefundId(Long refundId)
|
||||
{
|
||||
this.refundId = refundId;
|
||||
}
|
||||
|
||||
public Long getRefundId()
|
||||
{
|
||||
return refundId;
|
||||
}
|
||||
public void setReversalOfId(Long reversalOfId)
|
||||
{
|
||||
this.reversalOfId = reversalOfId;
|
||||
}
|
||||
|
||||
public Long getReversalOfId()
|
||||
{
|
||||
return reversalOfId;
|
||||
}
|
||||
public void setOperatorUserId(Long operatorUserId)
|
||||
{
|
||||
this.operatorUserId = operatorUserId;
|
||||
}
|
||||
|
||||
public Long getOperatorUserId()
|
||||
{
|
||||
return operatorUserId;
|
||||
}
|
||||
public void setEvidenceRef(String evidenceRef)
|
||||
{
|
||||
this.evidenceRef = evidenceRef;
|
||||
}
|
||||
|
||||
public String getEvidenceRef()
|
||||
{
|
||||
return evidenceRef;
|
||||
}
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("accountId", getAccountId())
|
||||
.append("businessKey", getBusinessKey())
|
||||
.append("eventType", getEventType())
|
||||
.append("deltaAvailable", getDeltaAvailable())
|
||||
.append("deltaFrozen", getDeltaFrozen())
|
||||
.append("deltaSupplierPending", getDeltaSupplierPending())
|
||||
.append("deltaPlatformFee", getDeltaPlatformFee())
|
||||
.append("afterAvailable", getAfterAvailable())
|
||||
.append("afterFrozen", getAfterFrozen())
|
||||
.append("afterSupplierPending", getAfterSupplierPending())
|
||||
.append("orderId", getOrderId())
|
||||
.append("settlementId", getSettlementId())
|
||||
.append("refundId", getRefundId())
|
||||
.append("reversalOfId", getReversalOfId())
|
||||
.append("operatorUserId", getOperatorUserId())
|
||||
.append("evidenceRef", getEvidenceRef())
|
||||
.append("reason", getReason())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖对象 rent_ledger
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_ledger")
|
||||
public class RentLedgerPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** rent_account.id */
|
||||
@Excel(name = "rent_account.id")
|
||||
private Long accountId;
|
||||
/** 全局唯一记账键;普通业务含事件及账户,TOPUP仅按网络及链上事件唯一标识构造,不含账户以防跨用户重复充值 */
|
||||
@Excel(name = "全局唯一记账键;普通业务含事件及账户,TOPUP仅按网络及链上事件唯一标识构造,不含账户以防跨用户重复充值")
|
||||
private String businessKey;
|
||||
/** TOPUP充值、HOLD冻结、CHARGE扣款、RELEASE解冻、SUPPLIER_EARN毛应收、SUPPLIER_FEE供应商手续费、SETTLE净额结算、REFUND退款、REVERSAL冲正 */
|
||||
@Excel(name = "TOPUP充值、HOLD冻结、CHARGE扣款、RELEASE解冻、SUPPLIER_EARN毛应收、SUPPLIER_FEE供应商手续费、SETTLE净额结算、REFUND退款、REVERSAL冲正")
|
||||
private String eventType;
|
||||
/** 可用余额变化,有正负 */
|
||||
@Excel(name = "可用余额变化,有正负")
|
||||
private BigDecimal deltaAvailable;
|
||||
/** 冻结余额变化,有正负 */
|
||||
@Excel(name = "冻结余额变化,有正负")
|
||||
private BigDecimal deltaFrozen;
|
||||
/** 供应商待结算变化,有正负 */
|
||||
@Excel(name = "供应商待结算变化,有正负")
|
||||
private BigDecimal deltaSupplierPending;
|
||||
/** 平台供应商手续费收入变动USDT;扣费为正、退费为负;退商户增加可用,退供应商增加待结算,不是用户账户余额 */
|
||||
@Excel(name = "平台供应商手续费收入变动USDT;扣费为正、退费为负;退商户增加可用,退供应商增加待结算,不是用户账户余额")
|
||||
private BigDecimal deltaPlatformFee;
|
||||
/** 变更后可用USDT */
|
||||
@Excel(name = "变更后可用USDT")
|
||||
private BigDecimal afterAvailable;
|
||||
/** 变更后冻结USDT */
|
||||
@Excel(name = "变更后冻结USDT")
|
||||
private BigDecimal afterFrozen;
|
||||
/** 变更后待结算USDT */
|
||||
@Excel(name = "变更后待结算USDT")
|
||||
private BigDecimal afterSupplierPending;
|
||||
/** 关联rent_order.id */
|
||||
@Excel(name = "关联rent_order.id")
|
||||
private Long orderId;
|
||||
/** 关联rent_settlement.id */
|
||||
@Excel(name = "关联rent_settlement.id")
|
||||
private Long settlementId;
|
||||
/** 退款或相关冲正关联rent_refund.id,每个退款内各事件使用独立business_key */
|
||||
@Excel(name = "退款或相关冲正关联rent_refund.id,每个退款内各事件使用独立business_key")
|
||||
private Long refundId;
|
||||
/** 冲正的rent_ledger.id */
|
||||
@Excel(name = "冲正的rent_ledger.id")
|
||||
private Long reversalOfId;
|
||||
/** 操作者sys_user.user_id,后台系统为0 */
|
||||
@Excel(name = "操作者sys_user.user_id,后台系统为0")
|
||||
private Long operatorUserId;
|
||||
/** 人工充值、付款或补偿审核依据编号;充值凭据必须全局防重复 */
|
||||
@Excel(name = "人工充值、付款或补偿审核依据编号;充值凭据必须全局防重复")
|
||||
private String evidenceRef;
|
||||
/** 记账或人工调整原因,必填 */
|
||||
@Excel(name = "记账或人工调整原因,必填")
|
||||
private String reason;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setAccountId(Long accountId)
|
||||
{
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public Long getAccountId()
|
||||
{
|
||||
return accountId;
|
||||
}
|
||||
public void setBusinessKey(String businessKey)
|
||||
{
|
||||
this.businessKey = businessKey;
|
||||
}
|
||||
|
||||
public String getBusinessKey()
|
||||
{
|
||||
return businessKey;
|
||||
}
|
||||
public void setEventType(String eventType)
|
||||
{
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
public void setDeltaAvailable(BigDecimal deltaAvailable)
|
||||
{
|
||||
this.deltaAvailable = deltaAvailable;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaAvailable()
|
||||
{
|
||||
return deltaAvailable;
|
||||
}
|
||||
public void setDeltaFrozen(BigDecimal deltaFrozen)
|
||||
{
|
||||
this.deltaFrozen = deltaFrozen;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaFrozen()
|
||||
{
|
||||
return deltaFrozen;
|
||||
}
|
||||
public void setDeltaSupplierPending(BigDecimal deltaSupplierPending)
|
||||
{
|
||||
this.deltaSupplierPending = deltaSupplierPending;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaSupplierPending()
|
||||
{
|
||||
return deltaSupplierPending;
|
||||
}
|
||||
public void setDeltaPlatformFee(BigDecimal deltaPlatformFee)
|
||||
{
|
||||
this.deltaPlatformFee = deltaPlatformFee;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaPlatformFee()
|
||||
{
|
||||
return deltaPlatformFee;
|
||||
}
|
||||
public void setAfterAvailable(BigDecimal afterAvailable)
|
||||
{
|
||||
this.afterAvailable = afterAvailable;
|
||||
}
|
||||
|
||||
public BigDecimal getAfterAvailable()
|
||||
{
|
||||
return afterAvailable;
|
||||
}
|
||||
public void setAfterFrozen(BigDecimal afterFrozen)
|
||||
{
|
||||
this.afterFrozen = afterFrozen;
|
||||
}
|
||||
|
||||
public BigDecimal getAfterFrozen()
|
||||
{
|
||||
return afterFrozen;
|
||||
}
|
||||
public void setAfterSupplierPending(BigDecimal afterSupplierPending)
|
||||
{
|
||||
this.afterSupplierPending = afterSupplierPending;
|
||||
}
|
||||
|
||||
public BigDecimal getAfterSupplierPending()
|
||||
{
|
||||
return afterSupplierPending;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setSettlementId(Long settlementId)
|
||||
{
|
||||
this.settlementId = settlementId;
|
||||
}
|
||||
|
||||
public Long getSettlementId()
|
||||
{
|
||||
return settlementId;
|
||||
}
|
||||
public void setRefundId(Long refundId)
|
||||
{
|
||||
this.refundId = refundId;
|
||||
}
|
||||
|
||||
public Long getRefundId()
|
||||
{
|
||||
return refundId;
|
||||
}
|
||||
public void setReversalOfId(Long reversalOfId)
|
||||
{
|
||||
this.reversalOfId = reversalOfId;
|
||||
}
|
||||
|
||||
public Long getReversalOfId()
|
||||
{
|
||||
return reversalOfId;
|
||||
}
|
||||
public void setOperatorUserId(Long operatorUserId)
|
||||
{
|
||||
this.operatorUserId = operatorUserId;
|
||||
}
|
||||
|
||||
public Long getOperatorUserId()
|
||||
{
|
||||
return operatorUserId;
|
||||
}
|
||||
public void setEvidenceRef(String evidenceRef)
|
||||
{
|
||||
this.evidenceRef = evidenceRef;
|
||||
}
|
||||
|
||||
public String getEvidenceRef()
|
||||
{
|
||||
return evidenceRef;
|
||||
}
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("accountId", getAccountId())
|
||||
.append("businessKey", getBusinessKey())
|
||||
.append("eventType", getEventType())
|
||||
.append("deltaAvailable", getDeltaAvailable())
|
||||
.append("deltaFrozen", getDeltaFrozen())
|
||||
.append("deltaSupplierPending", getDeltaSupplierPending())
|
||||
.append("deltaPlatformFee", getDeltaPlatformFee())
|
||||
.append("afterAvailable", getAfterAvailable())
|
||||
.append("afterFrozen", getAfterFrozen())
|
||||
.append("afterSupplierPending", getAfterSupplierPending())
|
||||
.append("orderId", getOrderId())
|
||||
.append("settlementId", getSettlementId())
|
||||
.append("refundId", getRefundId())
|
||||
.append("reversalOfId", getReversalOfId())
|
||||
.append("operatorUserId", getOperatorUserId())
|
||||
.append("evidenceRef", getEvidenceRef())
|
||||
.append("reason", getReason())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 供应商本地Agent节点;供应商直接关联共享用户,不另建成员对象 rent_node
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentNode extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 供应商sys_user.user_id */
|
||||
@Excel(name = "供应商sys_user.user_id")
|
||||
private Long userId;
|
||||
|
||||
/** 节点全局编号 */
|
||||
@Excel(name = "节点全局编号")
|
||||
private String nodeNo;
|
||||
|
||||
/** 节点名称 */
|
||||
@Excel(name = "节点名称")
|
||||
private String name;
|
||||
|
||||
/** PENDING审核中、ACTIVE接单、PAUSED暂停、REVOKED吊销 */
|
||||
@Excel(name = "PENDING审核中、ACTIVE接单、PAUSED暂停、REVOKED吊销")
|
||||
private String status;
|
||||
|
||||
/** Agent版本 */
|
||||
@Excel(name = "Agent版本")
|
||||
private String agentVersion;
|
||||
|
||||
/** 最近认证心跳时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最近认证心跳时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date heartbeatAt;
|
||||
|
||||
/** 连接状态:OFFLINE离线、SYNCING已认证恢复中、ONLINE可通信;不替代审核及接单status */
|
||||
@Excel(name = "连接状态:OFFLINE离线、SYNCING已认证恢复中、ONLINE可通信;不替代审核及接单status")
|
||||
private String connectionStatus;
|
||||
|
||||
/** 云端认证成功后生成的随机WebSocket会话编号,当前会话唯一,非登录Token */
|
||||
@Excel(name = "云端认证成功后生成的随机WebSocket会话编号,当前会话唯一,非登录Token")
|
||||
private String sessionId;
|
||||
|
||||
/** 连接代次fencing token,新认证连接原子递增;旧会话消息和断开事件不能修改新会话 */
|
||||
@Excel(name = "连接代次fencing token,新认证连接原子递增;旧会话消息和断开事件不能修改新会话")
|
||||
private Long sessionEpoch;
|
||||
|
||||
/** 持有当前WebSocket连接的云端实例标识,仅路由及恢复使用,不存Socket对象 */
|
||||
@Excel(name = "持有当前WebSocket连接的云端实例标识,仅路由及恢复使用,不存Socket对象")
|
||||
private String serverInstanceId;
|
||||
|
||||
/** 本次会话认证完成UTC时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "本次会话认证完成UTC时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date connectedAt;
|
||||
|
||||
/** 当前会话断开或超时UTC时间,仅当前session_epoch可更新 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "当前会话断开或超时UTC时间,仅当前session_epoch可更新", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date disconnectedAt;
|
||||
|
||||
/** 应用层PING周期秒,默认15,由云端协商;须大于0 */
|
||||
@Excel(name = "应用层PING周期秒,默认15,由云端协商;须大于0")
|
||||
private Long heartbeatIntervalSeconds;
|
||||
|
||||
/** 未收到有效认证心跳的离线阈值秒,默认45;必须大于心跳周期 */
|
||||
@Excel(name = "未收到有效认证心跳的离线阈值秒,默认45;必须大于心跳周期")
|
||||
private Long heartbeatTimeoutSeconds;
|
||||
|
||||
/** 云端按有效心跳接收时间计算的在线租约截止UTC时间,节点本地时钟不作为判定来源 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "云端按有效心跳接收时间计算的在线租约截止UTC时间,节点本地时钟不作为判定来源", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date heartbeatExpiresAt;
|
||||
|
||||
/** 当前会话已接收客户端方向认证帧序号,从1递增;只用于会话去重,不替代业务message_id */
|
||||
@Excel(name = "当前会话已接收客户端方向认证帧序号,从1递增;只用于会话去重,不替代业务message_id")
|
||||
private Long lastClientSequence;
|
||||
|
||||
/** 注册操作者sys_user.user_id */
|
||||
@Excel(name = "注册操作者sys_user.user_id")
|
||||
private Long createdBy;
|
||||
|
||||
/** 审核sys_user.user_id */
|
||||
@Excel(name = "审核sys_user.user_id")
|
||||
private Long approvedBy;
|
||||
|
||||
/** 审核时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "审核时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date approvedAt;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setNodeNo(String nodeNo)
|
||||
{
|
||||
this.nodeNo = nodeNo;
|
||||
}
|
||||
|
||||
public String getNodeNo()
|
||||
{
|
||||
return nodeNo;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setAgentVersion(String agentVersion)
|
||||
{
|
||||
this.agentVersion = agentVersion;
|
||||
}
|
||||
|
||||
public String getAgentVersion()
|
||||
{
|
||||
return agentVersion;
|
||||
}
|
||||
public void setHeartbeatAt(Date heartbeatAt)
|
||||
{
|
||||
this.heartbeatAt = heartbeatAt;
|
||||
}
|
||||
|
||||
public Date getHeartbeatAt()
|
||||
{
|
||||
return heartbeatAt;
|
||||
}
|
||||
public void setConnectionStatus(String connectionStatus)
|
||||
{
|
||||
this.connectionStatus = connectionStatus;
|
||||
}
|
||||
|
||||
public String getConnectionStatus()
|
||||
{
|
||||
return connectionStatus;
|
||||
}
|
||||
public void setSessionId(String sessionId)
|
||||
{
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
public String getSessionId()
|
||||
{
|
||||
return sessionId;
|
||||
}
|
||||
public void setSessionEpoch(Long sessionEpoch)
|
||||
{
|
||||
this.sessionEpoch = sessionEpoch;
|
||||
}
|
||||
|
||||
public Long getSessionEpoch()
|
||||
{
|
||||
return sessionEpoch;
|
||||
}
|
||||
public void setServerInstanceId(String serverInstanceId)
|
||||
{
|
||||
this.serverInstanceId = serverInstanceId;
|
||||
}
|
||||
|
||||
public String getServerInstanceId()
|
||||
{
|
||||
return serverInstanceId;
|
||||
}
|
||||
public void setConnectedAt(Date connectedAt)
|
||||
{
|
||||
this.connectedAt = connectedAt;
|
||||
}
|
||||
|
||||
public Date getConnectedAt()
|
||||
{
|
||||
return connectedAt;
|
||||
}
|
||||
public void setDisconnectedAt(Date disconnectedAt)
|
||||
{
|
||||
this.disconnectedAt = disconnectedAt;
|
||||
}
|
||||
|
||||
public Date getDisconnectedAt()
|
||||
{
|
||||
return disconnectedAt;
|
||||
}
|
||||
public void setHeartbeatIntervalSeconds(Long heartbeatIntervalSeconds)
|
||||
{
|
||||
this.heartbeatIntervalSeconds = heartbeatIntervalSeconds;
|
||||
}
|
||||
|
||||
public Long getHeartbeatIntervalSeconds()
|
||||
{
|
||||
return heartbeatIntervalSeconds;
|
||||
}
|
||||
public void setHeartbeatTimeoutSeconds(Long heartbeatTimeoutSeconds)
|
||||
{
|
||||
this.heartbeatTimeoutSeconds = heartbeatTimeoutSeconds;
|
||||
}
|
||||
|
||||
public Long getHeartbeatTimeoutSeconds()
|
||||
{
|
||||
return heartbeatTimeoutSeconds;
|
||||
}
|
||||
public void setHeartbeatExpiresAt(Date heartbeatExpiresAt)
|
||||
{
|
||||
this.heartbeatExpiresAt = heartbeatExpiresAt;
|
||||
}
|
||||
|
||||
public Date getHeartbeatExpiresAt()
|
||||
{
|
||||
return heartbeatExpiresAt;
|
||||
}
|
||||
public void setLastClientSequence(Long lastClientSequence)
|
||||
{
|
||||
this.lastClientSequence = lastClientSequence;
|
||||
}
|
||||
|
||||
public Long getLastClientSequence()
|
||||
{
|
||||
return lastClientSequence;
|
||||
}
|
||||
public void setCreatedBy(Long createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Long getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setApprovedBy(Long approvedBy)
|
||||
{
|
||||
this.approvedBy = approvedBy;
|
||||
}
|
||||
|
||||
public Long getApprovedBy()
|
||||
{
|
||||
return approvedBy;
|
||||
}
|
||||
public void setApprovedAt(Date approvedAt)
|
||||
{
|
||||
this.approvedAt = approvedAt;
|
||||
}
|
||||
|
||||
public Date getApprovedAt()
|
||||
{
|
||||
return approvedAt;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("nodeNo", getNodeNo())
|
||||
.append("name", getName())
|
||||
.append("status", getStatus())
|
||||
.append("agentVersion", getAgentVersion())
|
||||
.append("heartbeatAt", getHeartbeatAt())
|
||||
.append("connectionStatus", getConnectionStatus())
|
||||
.append("sessionId", getSessionId())
|
||||
.append("sessionEpoch", getSessionEpoch())
|
||||
.append("serverInstanceId", getServerInstanceId())
|
||||
.append("connectedAt", getConnectedAt())
|
||||
.append("disconnectedAt", getDisconnectedAt())
|
||||
.append("heartbeatIntervalSeconds", getHeartbeatIntervalSeconds())
|
||||
.append("heartbeatTimeoutSeconds", getHeartbeatTimeoutSeconds())
|
||||
.append("heartbeatExpiresAt", getHeartbeatExpiresAt())
|
||||
.append("lastClientSequence", getLastClientSequence())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("approvedBy", getApprovedBy())
|
||||
.append("approvedAt", getApprovedAt())
|
||||
.append("remark", getRemark())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 供应商本地Agent节点;供应商直接关联共享用户,不另建成员对象 rent_node
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_node")
|
||||
public class RentNodePlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 供应商sys_user.user_id */
|
||||
@Excel(name = "供应商sys_user.user_id")
|
||||
private Long userId;
|
||||
/** 节点全局编号 */
|
||||
@Excel(name = "节点全局编号")
|
||||
private String nodeNo;
|
||||
/** 节点名称 */
|
||||
@Excel(name = "节点名称")
|
||||
private String name;
|
||||
/** PENDING审核中、ACTIVE接单、PAUSED暂停、REVOKED吊销 */
|
||||
@Excel(name = "PENDING审核中、ACTIVE接单、PAUSED暂停、REVOKED吊销")
|
||||
private String status;
|
||||
/** Agent版本 */
|
||||
@Excel(name = "Agent版本")
|
||||
private String agentVersion;
|
||||
/** 最近认证心跳时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最近认证心跳时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date heartbeatAt;
|
||||
/** 连接状态:OFFLINE离线、SYNCING已认证恢复中、ONLINE可通信;不替代审核及接单status */
|
||||
@Excel(name = "连接状态:OFFLINE离线、SYNCING已认证恢复中、ONLINE可通信;不替代审核及接单status")
|
||||
private String connectionStatus;
|
||||
/** 云端认证成功后生成的随机WebSocket会话编号,当前会话唯一,非登录Token */
|
||||
@Excel(name = "云端认证成功后生成的随机WebSocket会话编号,当前会话唯一,非登录Token")
|
||||
private String sessionId;
|
||||
/** 连接代次fencing token,新认证连接原子递增;旧会话消息和断开事件不能修改新会话 */
|
||||
@Excel(name = "连接代次fencing token,新认证连接原子递增;旧会话消息和断开事件不能修改新会话")
|
||||
private Long sessionEpoch;
|
||||
/** 持有当前WebSocket连接的云端实例标识,仅路由及恢复使用,不存Socket对象 */
|
||||
@Excel(name = "持有当前WebSocket连接的云端实例标识,仅路由及恢复使用,不存Socket对象")
|
||||
private String serverInstanceId;
|
||||
/** 本次会话认证完成UTC时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "本次会话认证完成UTC时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date connectedAt;
|
||||
/** 当前会话断开或超时UTC时间,仅当前session_epoch可更新 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "当前会话断开或超时UTC时间,仅当前session_epoch可更新", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date disconnectedAt;
|
||||
/** 应用层PING周期秒,默认15,由云端协商;须大于0 */
|
||||
@Excel(name = "应用层PING周期秒,默认15,由云端协商;须大于0")
|
||||
private Long heartbeatIntervalSeconds;
|
||||
/** 未收到有效认证心跳的离线阈值秒,默认45;必须大于心跳周期 */
|
||||
@Excel(name = "未收到有效认证心跳的离线阈值秒,默认45;必须大于心跳周期")
|
||||
private Long heartbeatTimeoutSeconds;
|
||||
/** 云端按有效心跳接收时间计算的在线租约截止UTC时间,节点本地时钟不作为判定来源 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "云端按有效心跳接收时间计算的在线租约截止UTC时间,节点本地时钟不作为判定来源", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date heartbeatExpiresAt;
|
||||
/** 当前会话已接收客户端方向认证帧序号,从1递增;只用于会话去重,不替代业务message_id */
|
||||
@Excel(name = "当前会话已接收客户端方向认证帧序号,从1递增;只用于会话去重,不替代业务message_id")
|
||||
private Long lastClientSequence;
|
||||
/** 注册操作者sys_user.user_id */
|
||||
@Excel(name = "注册操作者sys_user.user_id")
|
||||
private Long createdBy;
|
||||
/** 审核sys_user.user_id */
|
||||
@Excel(name = "审核sys_user.user_id")
|
||||
private Long approvedBy;
|
||||
/** 审核时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "审核时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date approvedAt;
|
||||
/** 审核或暂停原因 */
|
||||
@Excel(name = "审核或暂停原因")
|
||||
private String remark;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setNodeNo(String nodeNo)
|
||||
{
|
||||
this.nodeNo = nodeNo;
|
||||
}
|
||||
|
||||
public String getNodeNo()
|
||||
{
|
||||
return nodeNo;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setAgentVersion(String agentVersion)
|
||||
{
|
||||
this.agentVersion = agentVersion;
|
||||
}
|
||||
|
||||
public String getAgentVersion()
|
||||
{
|
||||
return agentVersion;
|
||||
}
|
||||
public void setHeartbeatAt(Date heartbeatAt)
|
||||
{
|
||||
this.heartbeatAt = heartbeatAt;
|
||||
}
|
||||
|
||||
public Date getHeartbeatAt()
|
||||
{
|
||||
return heartbeatAt;
|
||||
}
|
||||
public void setConnectionStatus(String connectionStatus)
|
||||
{
|
||||
this.connectionStatus = connectionStatus;
|
||||
}
|
||||
|
||||
public String getConnectionStatus()
|
||||
{
|
||||
return connectionStatus;
|
||||
}
|
||||
public void setSessionId(String sessionId)
|
||||
{
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
public String getSessionId()
|
||||
{
|
||||
return sessionId;
|
||||
}
|
||||
public void setSessionEpoch(Long sessionEpoch)
|
||||
{
|
||||
this.sessionEpoch = sessionEpoch;
|
||||
}
|
||||
|
||||
public Long getSessionEpoch()
|
||||
{
|
||||
return sessionEpoch;
|
||||
}
|
||||
public void setServerInstanceId(String serverInstanceId)
|
||||
{
|
||||
this.serverInstanceId = serverInstanceId;
|
||||
}
|
||||
|
||||
public String getServerInstanceId()
|
||||
{
|
||||
return serverInstanceId;
|
||||
}
|
||||
public void setConnectedAt(Date connectedAt)
|
||||
{
|
||||
this.connectedAt = connectedAt;
|
||||
}
|
||||
|
||||
public Date getConnectedAt()
|
||||
{
|
||||
return connectedAt;
|
||||
}
|
||||
public void setDisconnectedAt(Date disconnectedAt)
|
||||
{
|
||||
this.disconnectedAt = disconnectedAt;
|
||||
}
|
||||
|
||||
public Date getDisconnectedAt()
|
||||
{
|
||||
return disconnectedAt;
|
||||
}
|
||||
public void setHeartbeatIntervalSeconds(Long heartbeatIntervalSeconds)
|
||||
{
|
||||
this.heartbeatIntervalSeconds = heartbeatIntervalSeconds;
|
||||
}
|
||||
|
||||
public Long getHeartbeatIntervalSeconds()
|
||||
{
|
||||
return heartbeatIntervalSeconds;
|
||||
}
|
||||
public void setHeartbeatTimeoutSeconds(Long heartbeatTimeoutSeconds)
|
||||
{
|
||||
this.heartbeatTimeoutSeconds = heartbeatTimeoutSeconds;
|
||||
}
|
||||
|
||||
public Long getHeartbeatTimeoutSeconds()
|
||||
{
|
||||
return heartbeatTimeoutSeconds;
|
||||
}
|
||||
public void setHeartbeatExpiresAt(Date heartbeatExpiresAt)
|
||||
{
|
||||
this.heartbeatExpiresAt = heartbeatExpiresAt;
|
||||
}
|
||||
|
||||
public Date getHeartbeatExpiresAt()
|
||||
{
|
||||
return heartbeatExpiresAt;
|
||||
}
|
||||
public void setLastClientSequence(Long lastClientSequence)
|
||||
{
|
||||
this.lastClientSequence = lastClientSequence;
|
||||
}
|
||||
|
||||
public Long getLastClientSequence()
|
||||
{
|
||||
return lastClientSequence;
|
||||
}
|
||||
public void setCreatedBy(Long createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Long getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setApprovedBy(Long approvedBy)
|
||||
{
|
||||
this.approvedBy = approvedBy;
|
||||
}
|
||||
|
||||
public Long getApprovedBy()
|
||||
{
|
||||
return approvedBy;
|
||||
}
|
||||
public void setApprovedAt(Date approvedAt)
|
||||
{
|
||||
this.approvedAt = approvedAt;
|
||||
}
|
||||
|
||||
public Date getApprovedAt()
|
||||
{
|
||||
return approvedAt;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("nodeNo", getNodeNo())
|
||||
.append("name", getName())
|
||||
.append("status", getStatus())
|
||||
.append("agentVersion", getAgentVersion())
|
||||
.append("heartbeatAt", getHeartbeatAt())
|
||||
.append("connectionStatus", getConnectionStatus())
|
||||
.append("sessionId", getSessionId())
|
||||
.append("sessionEpoch", getSessionEpoch())
|
||||
.append("serverInstanceId", getServerInstanceId())
|
||||
.append("connectedAt", getConnectedAt())
|
||||
.append("disconnectedAt", getDisconnectedAt())
|
||||
.append("heartbeatIntervalSeconds", getHeartbeatIntervalSeconds())
|
||||
.append("heartbeatTimeoutSeconds", getHeartbeatTimeoutSeconds())
|
||||
.append("heartbeatExpiresAt", getHeartbeatExpiresAt())
|
||||
.append("lastClientSequence", getLastClientSequence())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("approvedBy", getApprovedBy())
|
||||
.append("approvedAt", getApprovedAt())
|
||||
.append("remark", getRemark())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* HMAC请求防重放记录对象 rent_nonce
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentNonce extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** rent_credential.api_key */
|
||||
@Excel(name = "rent_credential.api_key")
|
||||
private String apiKey;
|
||||
|
||||
/** API、NODE、TASK、WEBHOOK,签名须覆盖该域 */
|
||||
@Excel(name = "API、NODE、TASK、WEBHOOK,签名须覆盖该域")
|
||||
private String scope;
|
||||
|
||||
/** 高熵随机数 */
|
||||
@Excel(name = "高熵随机数")
|
||||
private String nonce;
|
||||
|
||||
/** 可清理时间UTC,必须晚于消息有效期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "可清理时间UTC,必须晚于消息有效期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expiresAt;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setApiKey(String apiKey)
|
||||
{
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
public String getApiKey()
|
||||
{
|
||||
return apiKey;
|
||||
}
|
||||
public void setScope(String scope)
|
||||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getScope()
|
||||
{
|
||||
return scope;
|
||||
}
|
||||
public void setNonce(String nonce)
|
||||
{
|
||||
this.nonce = nonce;
|
||||
}
|
||||
|
||||
public String getNonce()
|
||||
{
|
||||
return nonce;
|
||||
}
|
||||
public void setExpiresAt(Date expiresAt)
|
||||
{
|
||||
this.expiresAt = expiresAt;
|
||||
}
|
||||
|
||||
public Date getExpiresAt()
|
||||
{
|
||||
return expiresAt;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("apiKey", getApiKey())
|
||||
.append("scope", getScope())
|
||||
.append("nonce", getNonce())
|
||||
.append("expiresAt", getExpiresAt())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* HMAC请求防重放记录对象 rent_nonce
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_nonce")
|
||||
public class RentNoncePlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** rent_credential.api_key */
|
||||
@Excel(name = "rent_credential.api_key")
|
||||
private String apiKey;
|
||||
/** API、NODE、TASK、WEBHOOK,签名须覆盖该域 */
|
||||
@Excel(name = "API、NODE、TASK、WEBHOOK,签名须覆盖该域")
|
||||
private String scope;
|
||||
/** 高熵随机数 */
|
||||
@Excel(name = "高熵随机数")
|
||||
private String nonce;
|
||||
/** 可清理时间UTC,必须晚于消息有效期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "可清理时间UTC,必须晚于消息有效期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expiresAt;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setApiKey(String apiKey)
|
||||
{
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
public String getApiKey()
|
||||
{
|
||||
return apiKey;
|
||||
}
|
||||
public void setScope(String scope)
|
||||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getScope()
|
||||
{
|
||||
return scope;
|
||||
}
|
||||
public void setNonce(String nonce)
|
||||
{
|
||||
this.nonce = nonce;
|
||||
}
|
||||
|
||||
public String getNonce()
|
||||
{
|
||||
return nonce;
|
||||
}
|
||||
public void setExpiresAt(Date expiresAt)
|
||||
{
|
||||
this.expiresAt = expiresAt;
|
||||
}
|
||||
|
||||
public Date getExpiresAt()
|
||||
{
|
||||
return expiresAt;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("apiKey", getApiKey())
|
||||
.append("scope", getScope())
|
||||
.append("nonce", getNonce())
|
||||
.append("expiresAt", getExpiresAt())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,593 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开对象 rent_order
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 平台订单编号 */
|
||||
@Excel(name = "平台订单编号")
|
||||
private String orderNo;
|
||||
|
||||
/** rent_app.id */
|
||||
@Excel(name = "rent_app.id")
|
||||
private Long appId;
|
||||
|
||||
/** 商户订单号,兼作业务幂等键 */
|
||||
@Excel(name = "商户订单号,兼作业务幂等键")
|
||||
private String merchantOrderNo;
|
||||
|
||||
/** 原请求规范化摘要,同编号不同内容拒绝 */
|
||||
@Excel(name = "原请求规范化摘要,同编号不同内容拒绝")
|
||||
private String requestHash;
|
||||
|
||||
/** rent_package.id */
|
||||
@Excel(name = "rent_package.id")
|
||||
private Long packageId;
|
||||
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
|
||||
/** 资源接收者,TRON Base58Check地址 */
|
||||
@Excel(name = "资源接收者,TRON Base58Check地址")
|
||||
private String receiverAddress;
|
||||
|
||||
/** 套餐资源类型快照:ENERGY能量、BANDWIDTH带宽,订单创建后不可修改 */
|
||||
@Excel(name = "套餐资源类型快照:ENERGY能量、BANDWIDTH带宽,订单创建后不可修改")
|
||||
private String resourceType;
|
||||
|
||||
/** 套餐资源数量快照:ENERGY单位Energy、BANDWIDTH单位bytes,必须大于零 */
|
||||
@Excel(name = "套餐资源数量快照:ENERGY单位Energy、BANDWIDTH单位bytes,必须大于零")
|
||||
private Long resourceQuantity;
|
||||
|
||||
/** 订单锁定冗余百分数,必须大于0,不能被套餐后续改价或调参覆盖 */
|
||||
@Excel(name = "订单锁定冗余百分数,必须大于0,不能被套餐后续改价或调参覆盖")
|
||||
private BigDecimal redundancyPercent;
|
||||
|
||||
/** 含冗余最低交付目标max(请求量+1,ceil(请求量乘以(1+冗余百分数/100))),严格大于resource_quantity */
|
||||
@Excel(name = "含冗余最低交付目标max(请求量+1,ceil(请求量乘以(1+冗余百分数/100))),严格大于resource_quantity")
|
||||
private Long targetResourceQuantity;
|
||||
|
||||
/** 租期秒快照 */
|
||||
@Excel(name = "租期秒快照")
|
||||
private Long durationSeconds;
|
||||
|
||||
/** USDT售价快照 */
|
||||
@Excel(name = "USDT售价快照")
|
||||
private BigDecimal saleAmount;
|
||||
|
||||
/** 供应商扣费前毛收入USDT快照,不能因费率变更被覆盖 */
|
||||
@Excel(name = "供应商扣费前毛收入USDT快照,不能因费率变更被覆盖")
|
||||
private BigDecimal supplierAmount;
|
||||
|
||||
/** 订单锁定供应商手续费百分数,必须大于0小于100 */
|
||||
@Excel(name = "订单锁定供应商手续费百分数,必须大于0小于100")
|
||||
private BigDecimal supplierFeePercent;
|
||||
|
||||
/** 平台手续费USDT快照=毛收入乘费率除100,按6位小数HALF_UP;必须大于0且小于毛收入 */
|
||||
@Excel(name = "平台手续费USDT快照=毛收入乘费率除100,按6位小数HALF_UP;必须大于0且小于毛收入")
|
||||
private BigDecimal supplierFeeAmount;
|
||||
|
||||
/** 供应商净应收USDT快照=供应商毛收入减平台手续费,必须大于0,结算以此为基数 */
|
||||
@Excel(name = "供应商净应收USDT快照=供应商毛收入减平台手续费,必须大于0,结算以此为基数")
|
||||
private BigDecimal supplierNetAmount;
|
||||
|
||||
/** 已冲正供应商净应收USDT累计,不超过supplier_net_amount,按审核退款规则追加流水 */
|
||||
@Excel(name = "已冲正供应商净应收USDT累计,不超过supplier_net_amount,按审核退款规则追加流水")
|
||||
private BigDecimal supplierReversedAmount;
|
||||
|
||||
/** 已退回或冲正平台手续费USDT累计,不超过supplier_fee_amount,不因退款自动推定全退 */
|
||||
@Excel(name = "已退回或冲正平台手续费USDT累计,不超过supplier_fee_amount,不因退款自动推定全退")
|
||||
private BigDecimal supplierFeeReversedAmount;
|
||||
|
||||
/** 手续费冲正中返还供应商的累计USDT,不超过supplier_fee_reversed_amount,增加本单可结算净额 */
|
||||
@Excel(name = "手续费冲正中返还供应商的累计USDT,不超过supplier_fee_reversed_amount,增加本单可结算净额")
|
||||
private BigDecimal supplierFeeReturnedAmount;
|
||||
|
||||
/** 套餐、费用预算、偏差、锁定和退款规则快照 */
|
||||
@Excel(name = "套餐、费用预算、偏差、锁定和退款规则快照")
|
||||
private String packageSnapshot;
|
||||
|
||||
/** WAITING待调度、EXECUTING委托中、VERIFYING核验中、SUCCESS履约成功、FAILED明确失败、CANCELLED未执行取消、MANUAL_REVIEW人工核对 */
|
||||
@Excel(name = "WAITING待调度、EXECUTING委托中、VERIFYING核验中、SUCCESS履约成功、FAILED明确失败、CANCELLED未执行取消、MANUAL_REVIEW人工核对")
|
||||
private String status;
|
||||
|
||||
/** 选定rent_wallet.id;未知执行结果时不能改派 */
|
||||
@Excel(name = "选定rent_wallet.id;未知执行结果时不能改派")
|
||||
private Long walletId;
|
||||
|
||||
/** 选定供应商sys_user.user_id快照 */
|
||||
@Excel(name = "选定供应商sys_user.user_id快照")
|
||||
private Long supplierUserId;
|
||||
|
||||
/** 调度时固定供应商rent_account.id,与供应商用户及订单网络一致 */
|
||||
@Excel(name = "调度时固定供应商rent_account.id,与供应商用户及订单网络一致")
|
||||
private Long supplierAccountId;
|
||||
|
||||
/** 分配钱包时取1,明确未执行终结或本金回收且资源恢复后置NULL;未知保留,禁止同钱包同接收者同类型并行租赁 */
|
||||
@Excel(name = "分配钱包时取1,明确未执行终结或本金回收且资源恢复后置NULL;未知保留,禁止同钱包同接收者同类型并行租赁")
|
||||
private Integer relationSlot;
|
||||
|
||||
/** 商户rent_account.id */
|
||||
@Excel(name = "商户rent_account.id")
|
||||
private Long payerAccountId;
|
||||
|
||||
/** 资金:HELD冻结、CHARGED扣款、RELEASED释放 */
|
||||
@Excel(name = "资金:HELD冻结、CHARGED扣款、RELEASED释放")
|
||||
private String fundStatus;
|
||||
|
||||
/** 累计已退USDT,仅可按规则退租赁内部余额 */
|
||||
@Excel(name = "累计已退USDT,仅可按规则退租赁内部余额")
|
||||
private BigDecimal refundedAmount;
|
||||
|
||||
/** 创建时锁定的最晚新任务执行时间UTC;WAITING超时取消,已投递不能仅凭过期判未执行 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时锁定的最晚新任务执行时间UTC;WAITING超时取消,已投递不能仅凭过期判未执行", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dispatchDeadline;
|
||||
|
||||
/** 已独立核验委托交易所在区块的UTC时间,不使用核验完成时间延长租期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "已独立核验委托交易所在区块的UTC时间,不使用核验完成时间延长租期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date serviceStartedAt;
|
||||
|
||||
/** 业务租期结束,不等于自动回收,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "业务租期结束,不等于自动回收,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date serviceExpiresAt;
|
||||
|
||||
/** 回收:NOT_STARTED、WAITING、RUNNING、RECOVERING、DONE、MANUAL_REVIEW */
|
||||
@Excel(name = "回收:NOT_STARTED、WAITING、RUNNING、RECOVERING、DONE、MANUAL_REVIEW")
|
||||
private String reclaimStatus;
|
||||
|
||||
/** 下次到期或资源恢复核对,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次到期或资源恢复核对,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextReclaimAt;
|
||||
|
||||
/** 该单回调URL快照,允许为空 */
|
||||
@Excel(name = "该单回调URL快照,允许为空")
|
||||
private String notifyUrl;
|
||||
|
||||
/** 稳定错误码 */
|
||||
@Excel(name = "稳定错误码")
|
||||
private String errorCode;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderNo(String orderNo)
|
||||
{
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public String getOrderNo()
|
||||
{
|
||||
return orderNo;
|
||||
}
|
||||
public void setAppId(Long appId)
|
||||
{
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public Long getAppId()
|
||||
{
|
||||
return appId;
|
||||
}
|
||||
public void setMerchantOrderNo(String merchantOrderNo)
|
||||
{
|
||||
this.merchantOrderNo = merchantOrderNo;
|
||||
}
|
||||
|
||||
public String getMerchantOrderNo()
|
||||
{
|
||||
return merchantOrderNo;
|
||||
}
|
||||
public void setRequestHash(String requestHash)
|
||||
{
|
||||
this.requestHash = requestHash;
|
||||
}
|
||||
|
||||
public String getRequestHash()
|
||||
{
|
||||
return requestHash;
|
||||
}
|
||||
public void setPackageId(Long packageId)
|
||||
{
|
||||
this.packageId = packageId;
|
||||
}
|
||||
|
||||
public Long getPackageId()
|
||||
{
|
||||
return packageId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setReceiverAddress(String receiverAddress)
|
||||
{
|
||||
this.receiverAddress = receiverAddress;
|
||||
}
|
||||
|
||||
public String getReceiverAddress()
|
||||
{
|
||||
return receiverAddress;
|
||||
}
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
public void setResourceQuantity(Long resourceQuantity)
|
||||
{
|
||||
this.resourceQuantity = resourceQuantity;
|
||||
}
|
||||
|
||||
public Long getResourceQuantity()
|
||||
{
|
||||
return resourceQuantity;
|
||||
}
|
||||
public void setRedundancyPercent(BigDecimal redundancyPercent)
|
||||
{
|
||||
this.redundancyPercent = redundancyPercent;
|
||||
}
|
||||
|
||||
public BigDecimal getRedundancyPercent()
|
||||
{
|
||||
return redundancyPercent;
|
||||
}
|
||||
public void setTargetResourceQuantity(Long targetResourceQuantity)
|
||||
{
|
||||
this.targetResourceQuantity = targetResourceQuantity;
|
||||
}
|
||||
|
||||
public Long getTargetResourceQuantity()
|
||||
{
|
||||
return targetResourceQuantity;
|
||||
}
|
||||
public void setDurationSeconds(Long durationSeconds)
|
||||
{
|
||||
this.durationSeconds = durationSeconds;
|
||||
}
|
||||
|
||||
public Long getDurationSeconds()
|
||||
{
|
||||
return durationSeconds;
|
||||
}
|
||||
public void setSaleAmount(BigDecimal saleAmount)
|
||||
{
|
||||
this.saleAmount = saleAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSaleAmount()
|
||||
{
|
||||
return saleAmount;
|
||||
}
|
||||
public void setSupplierAmount(BigDecimal supplierAmount)
|
||||
{
|
||||
this.supplierAmount = supplierAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierAmount()
|
||||
{
|
||||
return supplierAmount;
|
||||
}
|
||||
public void setSupplierFeePercent(BigDecimal supplierFeePercent)
|
||||
{
|
||||
this.supplierFeePercent = supplierFeePercent;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeePercent()
|
||||
{
|
||||
return supplierFeePercent;
|
||||
}
|
||||
public void setSupplierFeeAmount(BigDecimal supplierFeeAmount)
|
||||
{
|
||||
this.supplierFeeAmount = supplierFeeAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeeAmount()
|
||||
{
|
||||
return supplierFeeAmount;
|
||||
}
|
||||
public void setSupplierNetAmount(BigDecimal supplierNetAmount)
|
||||
{
|
||||
this.supplierNetAmount = supplierNetAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierNetAmount()
|
||||
{
|
||||
return supplierNetAmount;
|
||||
}
|
||||
public void setSupplierReversedAmount(BigDecimal supplierReversedAmount)
|
||||
{
|
||||
this.supplierReversedAmount = supplierReversedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierReversedAmount()
|
||||
{
|
||||
return supplierReversedAmount;
|
||||
}
|
||||
public void setSupplierFeeReversedAmount(BigDecimal supplierFeeReversedAmount)
|
||||
{
|
||||
this.supplierFeeReversedAmount = supplierFeeReversedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeeReversedAmount()
|
||||
{
|
||||
return supplierFeeReversedAmount;
|
||||
}
|
||||
public void setSupplierFeeReturnedAmount(BigDecimal supplierFeeReturnedAmount)
|
||||
{
|
||||
this.supplierFeeReturnedAmount = supplierFeeReturnedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeeReturnedAmount()
|
||||
{
|
||||
return supplierFeeReturnedAmount;
|
||||
}
|
||||
public void setPackageSnapshot(String packageSnapshot)
|
||||
{
|
||||
this.packageSnapshot = packageSnapshot;
|
||||
}
|
||||
|
||||
public String getPackageSnapshot()
|
||||
{
|
||||
return packageSnapshot;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setWalletId(Long walletId)
|
||||
{
|
||||
this.walletId = walletId;
|
||||
}
|
||||
|
||||
public Long getWalletId()
|
||||
{
|
||||
return walletId;
|
||||
}
|
||||
public void setSupplierUserId(Long supplierUserId)
|
||||
{
|
||||
this.supplierUserId = supplierUserId;
|
||||
}
|
||||
|
||||
public Long getSupplierUserId()
|
||||
{
|
||||
return supplierUserId;
|
||||
}
|
||||
public void setSupplierAccountId(Long supplierAccountId)
|
||||
{
|
||||
this.supplierAccountId = supplierAccountId;
|
||||
}
|
||||
|
||||
public Long getSupplierAccountId()
|
||||
{
|
||||
return supplierAccountId;
|
||||
}
|
||||
public void setRelationSlot(Integer relationSlot)
|
||||
{
|
||||
this.relationSlot = relationSlot;
|
||||
}
|
||||
|
||||
public Integer getRelationSlot()
|
||||
{
|
||||
return relationSlot;
|
||||
}
|
||||
public void setPayerAccountId(Long payerAccountId)
|
||||
{
|
||||
this.payerAccountId = payerAccountId;
|
||||
}
|
||||
|
||||
public Long getPayerAccountId()
|
||||
{
|
||||
return payerAccountId;
|
||||
}
|
||||
public void setFundStatus(String fundStatus)
|
||||
{
|
||||
this.fundStatus = fundStatus;
|
||||
}
|
||||
|
||||
public String getFundStatus()
|
||||
{
|
||||
return fundStatus;
|
||||
}
|
||||
public void setRefundedAmount(BigDecimal refundedAmount)
|
||||
{
|
||||
this.refundedAmount = refundedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getRefundedAmount()
|
||||
{
|
||||
return refundedAmount;
|
||||
}
|
||||
public void setDispatchDeadline(Date dispatchDeadline)
|
||||
{
|
||||
this.dispatchDeadline = dispatchDeadline;
|
||||
}
|
||||
|
||||
public Date getDispatchDeadline()
|
||||
{
|
||||
return dispatchDeadline;
|
||||
}
|
||||
public void setServiceStartedAt(Date serviceStartedAt)
|
||||
{
|
||||
this.serviceStartedAt = serviceStartedAt;
|
||||
}
|
||||
|
||||
public Date getServiceStartedAt()
|
||||
{
|
||||
return serviceStartedAt;
|
||||
}
|
||||
public void setServiceExpiresAt(Date serviceExpiresAt)
|
||||
{
|
||||
this.serviceExpiresAt = serviceExpiresAt;
|
||||
}
|
||||
|
||||
public Date getServiceExpiresAt()
|
||||
{
|
||||
return serviceExpiresAt;
|
||||
}
|
||||
public void setReclaimStatus(String reclaimStatus)
|
||||
{
|
||||
this.reclaimStatus = reclaimStatus;
|
||||
}
|
||||
|
||||
public String getReclaimStatus()
|
||||
{
|
||||
return reclaimStatus;
|
||||
}
|
||||
public void setNextReclaimAt(Date nextReclaimAt)
|
||||
{
|
||||
this.nextReclaimAt = nextReclaimAt;
|
||||
}
|
||||
|
||||
public Date getNextReclaimAt()
|
||||
{
|
||||
return nextReclaimAt;
|
||||
}
|
||||
public void setNotifyUrl(String notifyUrl)
|
||||
{
|
||||
this.notifyUrl = notifyUrl;
|
||||
}
|
||||
|
||||
public String getNotifyUrl()
|
||||
{
|
||||
return notifyUrl;
|
||||
}
|
||||
public void setErrorCode(String errorCode)
|
||||
{
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getErrorCode()
|
||||
{
|
||||
return errorCode;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("appId", getAppId())
|
||||
.append("merchantOrderNo", getMerchantOrderNo())
|
||||
.append("requestHash", getRequestHash())
|
||||
.append("packageId", getPackageId())
|
||||
.append("network", getNetwork())
|
||||
.append("receiverAddress", getReceiverAddress())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("resourceQuantity", getResourceQuantity())
|
||||
.append("redundancyPercent", getRedundancyPercent())
|
||||
.append("targetResourceQuantity", getTargetResourceQuantity())
|
||||
.append("durationSeconds", getDurationSeconds())
|
||||
.append("saleAmount", getSaleAmount())
|
||||
.append("supplierAmount", getSupplierAmount())
|
||||
.append("supplierFeePercent", getSupplierFeePercent())
|
||||
.append("supplierFeeAmount", getSupplierFeeAmount())
|
||||
.append("supplierNetAmount", getSupplierNetAmount())
|
||||
.append("supplierReversedAmount", getSupplierReversedAmount())
|
||||
.append("supplierFeeReversedAmount", getSupplierFeeReversedAmount())
|
||||
.append("supplierFeeReturnedAmount", getSupplierFeeReturnedAmount())
|
||||
.append("packageSnapshot", getPackageSnapshot())
|
||||
.append("status", getStatus())
|
||||
.append("walletId", getWalletId())
|
||||
.append("supplierUserId", getSupplierUserId())
|
||||
.append("supplierAccountId", getSupplierAccountId())
|
||||
.append("relationSlot", getRelationSlot())
|
||||
.append("payerAccountId", getPayerAccountId())
|
||||
.append("fundStatus", getFundStatus())
|
||||
.append("refundedAmount", getRefundedAmount())
|
||||
.append("dispatchDeadline", getDispatchDeadline())
|
||||
.append("serviceStartedAt", getServiceStartedAt())
|
||||
.append("serviceExpiresAt", getServiceExpiresAt())
|
||||
.append("reclaimStatus", getReclaimStatus())
|
||||
.append("nextReclaimAt", getNextReclaimAt())
|
||||
.append("notifyUrl", getNotifyUrl())
|
||||
.append("errorCode", getErrorCode())
|
||||
.append("remark", getRemark())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,568 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开对象 rent_order
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_order")
|
||||
public class RentOrderPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 平台订单编号 */
|
||||
@Excel(name = "平台订单编号")
|
||||
private String orderNo;
|
||||
/** rent_app.id */
|
||||
@Excel(name = "rent_app.id")
|
||||
private Long appId;
|
||||
/** 商户订单号,兼作业务幂等键 */
|
||||
@Excel(name = "商户订单号,兼作业务幂等键")
|
||||
private String merchantOrderNo;
|
||||
/** 原请求规范化摘要,同编号不同内容拒绝 */
|
||||
@Excel(name = "原请求规范化摘要,同编号不同内容拒绝")
|
||||
private String requestHash;
|
||||
/** rent_package.id */
|
||||
@Excel(name = "rent_package.id")
|
||||
private Long packageId;
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
/** 资源接收者,TRON Base58Check地址 */
|
||||
@Excel(name = "资源接收者,TRON Base58Check地址")
|
||||
private String receiverAddress;
|
||||
/** 套餐资源类型快照:ENERGY能量、BANDWIDTH带宽,订单创建后不可修改 */
|
||||
@Excel(name = "套餐资源类型快照:ENERGY能量、BANDWIDTH带宽,订单创建后不可修改")
|
||||
private String resourceType;
|
||||
/** 套餐资源数量快照:ENERGY单位Energy、BANDWIDTH单位bytes,必须大于零 */
|
||||
@Excel(name = "套餐资源数量快照:ENERGY单位Energy、BANDWIDTH单位bytes,必须大于零")
|
||||
private Long resourceQuantity;
|
||||
/** 订单锁定冗余百分数,必须大于0,不能被套餐后续改价或调参覆盖 */
|
||||
@Excel(name = "订单锁定冗余百分数,必须大于0,不能被套餐后续改价或调参覆盖")
|
||||
private BigDecimal redundancyPercent;
|
||||
/** 含冗余最低交付目标max(请求量+1,ceil(请求量乘以(1+冗余百分数/100))),严格大于resource_quantity */
|
||||
@Excel(name = "含冗余最低交付目标max(请求量+1,ceil(请求量乘以(1+冗余百分数/100))),严格大于resource_quantity")
|
||||
private Long targetResourceQuantity;
|
||||
/** 租期秒快照 */
|
||||
@Excel(name = "租期秒快照")
|
||||
private Long durationSeconds;
|
||||
/** USDT售价快照 */
|
||||
@Excel(name = "USDT售价快照")
|
||||
private BigDecimal saleAmount;
|
||||
/** 供应商扣费前毛收入USDT快照,不能因费率变更被覆盖 */
|
||||
@Excel(name = "供应商扣费前毛收入USDT快照,不能因费率变更被覆盖")
|
||||
private BigDecimal supplierAmount;
|
||||
/** 订单锁定供应商手续费百分数,必须大于0小于100 */
|
||||
@Excel(name = "订单锁定供应商手续费百分数,必须大于0小于100")
|
||||
private BigDecimal supplierFeePercent;
|
||||
/** 平台手续费USDT快照=毛收入乘费率除100,按6位小数HALF_UP;必须大于0且小于毛收入 */
|
||||
@Excel(name = "平台手续费USDT快照=毛收入乘费率除100,按6位小数HALF_UP;必须大于0且小于毛收入")
|
||||
private BigDecimal supplierFeeAmount;
|
||||
/** 供应商净应收USDT快照=供应商毛收入减平台手续费,必须大于0,结算以此为基数 */
|
||||
@Excel(name = "供应商净应收USDT快照=供应商毛收入减平台手续费,必须大于0,结算以此为基数")
|
||||
private BigDecimal supplierNetAmount;
|
||||
/** 已冲正供应商净应收USDT累计,不超过supplier_net_amount,按审核退款规则追加流水 */
|
||||
@Excel(name = "已冲正供应商净应收USDT累计,不超过supplier_net_amount,按审核退款规则追加流水")
|
||||
private BigDecimal supplierReversedAmount;
|
||||
/** 已退回或冲正平台手续费USDT累计,不超过supplier_fee_amount,不因退款自动推定全退 */
|
||||
@Excel(name = "已退回或冲正平台手续费USDT累计,不超过supplier_fee_amount,不因退款自动推定全退")
|
||||
private BigDecimal supplierFeeReversedAmount;
|
||||
/** 手续费冲正中返还供应商的累计USDT,不超过supplier_fee_reversed_amount,增加本单可结算净额 */
|
||||
@Excel(name = "手续费冲正中返还供应商的累计USDT,不超过supplier_fee_reversed_amount,增加本单可结算净额")
|
||||
private BigDecimal supplierFeeReturnedAmount;
|
||||
/** 套餐、费用预算、偏差、锁定和退款规则快照 */
|
||||
@Excel(name = "套餐、费用预算、偏差、锁定和退款规则快照")
|
||||
private String packageSnapshot;
|
||||
/** WAITING待调度、EXECUTING委托中、VERIFYING核验中、SUCCESS履约成功、FAILED明确失败、CANCELLED未执行取消、MANUAL_REVIEW人工核对 */
|
||||
@Excel(name = "WAITING待调度、EXECUTING委托中、VERIFYING核验中、SUCCESS履约成功、FAILED明确失败、CANCELLED未执行取消、MANUAL_REVIEW人工核对")
|
||||
private String status;
|
||||
/** 选定rent_wallet.id;未知执行结果时不能改派 */
|
||||
@Excel(name = "选定rent_wallet.id;未知执行结果时不能改派")
|
||||
private Long walletId;
|
||||
/** 选定供应商sys_user.user_id快照 */
|
||||
@Excel(name = "选定供应商sys_user.user_id快照")
|
||||
private Long supplierUserId;
|
||||
/** 调度时固定供应商rent_account.id,与供应商用户及订单网络一致 */
|
||||
@Excel(name = "调度时固定供应商rent_account.id,与供应商用户及订单网络一致")
|
||||
private Long supplierAccountId;
|
||||
/** 分配钱包时取1,明确未执行终结或本金回收且资源恢复后置NULL;未知保留,禁止同钱包同接收者同类型并行租赁 */
|
||||
@Excel(name = "分配钱包时取1,明确未执行终结或本金回收且资源恢复后置NULL;未知保留,禁止同钱包同接收者同类型并行租赁")
|
||||
private Integer relationSlot;
|
||||
/** 商户rent_account.id */
|
||||
@Excel(name = "商户rent_account.id")
|
||||
private Long payerAccountId;
|
||||
/** 资金:HELD冻结、CHARGED扣款、RELEASED释放 */
|
||||
@Excel(name = "资金:HELD冻结、CHARGED扣款、RELEASED释放")
|
||||
private String fundStatus;
|
||||
/** 累计已退USDT,仅可按规则退租赁内部余额 */
|
||||
@Excel(name = "累计已退USDT,仅可按规则退租赁内部余额")
|
||||
private BigDecimal refundedAmount;
|
||||
/** 创建时锁定的最晚新任务执行时间UTC;WAITING超时取消,已投递不能仅凭过期判未执行 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时锁定的最晚新任务执行时间UTC;WAITING超时取消,已投递不能仅凭过期判未执行", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dispatchDeadline;
|
||||
/** 已独立核验委托交易所在区块的UTC时间,不使用核验完成时间延长租期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "已独立核验委托交易所在区块的UTC时间,不使用核验完成时间延长租期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date serviceStartedAt;
|
||||
/** 业务租期结束,不等于自动回收,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "业务租期结束,不等于自动回收,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date serviceExpiresAt;
|
||||
/** 回收:NOT_STARTED、WAITING、RUNNING、RECOVERING、DONE、MANUAL_REVIEW */
|
||||
@Excel(name = "回收:NOT_STARTED、WAITING、RUNNING、RECOVERING、DONE、MANUAL_REVIEW")
|
||||
private String reclaimStatus;
|
||||
/** 下次到期或资源恢复核对,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次到期或资源恢复核对,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextReclaimAt;
|
||||
/** 该单回调URL快照,允许为空 */
|
||||
@Excel(name = "该单回调URL快照,允许为空")
|
||||
private String notifyUrl;
|
||||
/** 稳定错误码 */
|
||||
@Excel(name = "稳定错误码")
|
||||
private String errorCode;
|
||||
/** 脱敏结果说明 */
|
||||
@Excel(name = "脱敏结果说明")
|
||||
private String remark;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderNo(String orderNo)
|
||||
{
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public String getOrderNo()
|
||||
{
|
||||
return orderNo;
|
||||
}
|
||||
public void setAppId(Long appId)
|
||||
{
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public Long getAppId()
|
||||
{
|
||||
return appId;
|
||||
}
|
||||
public void setMerchantOrderNo(String merchantOrderNo)
|
||||
{
|
||||
this.merchantOrderNo = merchantOrderNo;
|
||||
}
|
||||
|
||||
public String getMerchantOrderNo()
|
||||
{
|
||||
return merchantOrderNo;
|
||||
}
|
||||
public void setRequestHash(String requestHash)
|
||||
{
|
||||
this.requestHash = requestHash;
|
||||
}
|
||||
|
||||
public String getRequestHash()
|
||||
{
|
||||
return requestHash;
|
||||
}
|
||||
public void setPackageId(Long packageId)
|
||||
{
|
||||
this.packageId = packageId;
|
||||
}
|
||||
|
||||
public Long getPackageId()
|
||||
{
|
||||
return packageId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setReceiverAddress(String receiverAddress)
|
||||
{
|
||||
this.receiverAddress = receiverAddress;
|
||||
}
|
||||
|
||||
public String getReceiverAddress()
|
||||
{
|
||||
return receiverAddress;
|
||||
}
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
public void setResourceQuantity(Long resourceQuantity)
|
||||
{
|
||||
this.resourceQuantity = resourceQuantity;
|
||||
}
|
||||
|
||||
public Long getResourceQuantity()
|
||||
{
|
||||
return resourceQuantity;
|
||||
}
|
||||
public void setRedundancyPercent(BigDecimal redundancyPercent)
|
||||
{
|
||||
this.redundancyPercent = redundancyPercent;
|
||||
}
|
||||
|
||||
public BigDecimal getRedundancyPercent()
|
||||
{
|
||||
return redundancyPercent;
|
||||
}
|
||||
public void setTargetResourceQuantity(Long targetResourceQuantity)
|
||||
{
|
||||
this.targetResourceQuantity = targetResourceQuantity;
|
||||
}
|
||||
|
||||
public Long getTargetResourceQuantity()
|
||||
{
|
||||
return targetResourceQuantity;
|
||||
}
|
||||
public void setDurationSeconds(Long durationSeconds)
|
||||
{
|
||||
this.durationSeconds = durationSeconds;
|
||||
}
|
||||
|
||||
public Long getDurationSeconds()
|
||||
{
|
||||
return durationSeconds;
|
||||
}
|
||||
public void setSaleAmount(BigDecimal saleAmount)
|
||||
{
|
||||
this.saleAmount = saleAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSaleAmount()
|
||||
{
|
||||
return saleAmount;
|
||||
}
|
||||
public void setSupplierAmount(BigDecimal supplierAmount)
|
||||
{
|
||||
this.supplierAmount = supplierAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierAmount()
|
||||
{
|
||||
return supplierAmount;
|
||||
}
|
||||
public void setSupplierFeePercent(BigDecimal supplierFeePercent)
|
||||
{
|
||||
this.supplierFeePercent = supplierFeePercent;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeePercent()
|
||||
{
|
||||
return supplierFeePercent;
|
||||
}
|
||||
public void setSupplierFeeAmount(BigDecimal supplierFeeAmount)
|
||||
{
|
||||
this.supplierFeeAmount = supplierFeeAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeeAmount()
|
||||
{
|
||||
return supplierFeeAmount;
|
||||
}
|
||||
public void setSupplierNetAmount(BigDecimal supplierNetAmount)
|
||||
{
|
||||
this.supplierNetAmount = supplierNetAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierNetAmount()
|
||||
{
|
||||
return supplierNetAmount;
|
||||
}
|
||||
public void setSupplierReversedAmount(BigDecimal supplierReversedAmount)
|
||||
{
|
||||
this.supplierReversedAmount = supplierReversedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierReversedAmount()
|
||||
{
|
||||
return supplierReversedAmount;
|
||||
}
|
||||
public void setSupplierFeeReversedAmount(BigDecimal supplierFeeReversedAmount)
|
||||
{
|
||||
this.supplierFeeReversedAmount = supplierFeeReversedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeeReversedAmount()
|
||||
{
|
||||
return supplierFeeReversedAmount;
|
||||
}
|
||||
public void setSupplierFeeReturnedAmount(BigDecimal supplierFeeReturnedAmount)
|
||||
{
|
||||
this.supplierFeeReturnedAmount = supplierFeeReturnedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeeReturnedAmount()
|
||||
{
|
||||
return supplierFeeReturnedAmount;
|
||||
}
|
||||
public void setPackageSnapshot(String packageSnapshot)
|
||||
{
|
||||
this.packageSnapshot = packageSnapshot;
|
||||
}
|
||||
|
||||
public String getPackageSnapshot()
|
||||
{
|
||||
return packageSnapshot;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setWalletId(Long walletId)
|
||||
{
|
||||
this.walletId = walletId;
|
||||
}
|
||||
|
||||
public Long getWalletId()
|
||||
{
|
||||
return walletId;
|
||||
}
|
||||
public void setSupplierUserId(Long supplierUserId)
|
||||
{
|
||||
this.supplierUserId = supplierUserId;
|
||||
}
|
||||
|
||||
public Long getSupplierUserId()
|
||||
{
|
||||
return supplierUserId;
|
||||
}
|
||||
public void setSupplierAccountId(Long supplierAccountId)
|
||||
{
|
||||
this.supplierAccountId = supplierAccountId;
|
||||
}
|
||||
|
||||
public Long getSupplierAccountId()
|
||||
{
|
||||
return supplierAccountId;
|
||||
}
|
||||
public void setRelationSlot(Integer relationSlot)
|
||||
{
|
||||
this.relationSlot = relationSlot;
|
||||
}
|
||||
|
||||
public Integer getRelationSlot()
|
||||
{
|
||||
return relationSlot;
|
||||
}
|
||||
public void setPayerAccountId(Long payerAccountId)
|
||||
{
|
||||
this.payerAccountId = payerAccountId;
|
||||
}
|
||||
|
||||
public Long getPayerAccountId()
|
||||
{
|
||||
return payerAccountId;
|
||||
}
|
||||
public void setFundStatus(String fundStatus)
|
||||
{
|
||||
this.fundStatus = fundStatus;
|
||||
}
|
||||
|
||||
public String getFundStatus()
|
||||
{
|
||||
return fundStatus;
|
||||
}
|
||||
public void setRefundedAmount(BigDecimal refundedAmount)
|
||||
{
|
||||
this.refundedAmount = refundedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getRefundedAmount()
|
||||
{
|
||||
return refundedAmount;
|
||||
}
|
||||
public void setDispatchDeadline(Date dispatchDeadline)
|
||||
{
|
||||
this.dispatchDeadline = dispatchDeadline;
|
||||
}
|
||||
|
||||
public Date getDispatchDeadline()
|
||||
{
|
||||
return dispatchDeadline;
|
||||
}
|
||||
public void setServiceStartedAt(Date serviceStartedAt)
|
||||
{
|
||||
this.serviceStartedAt = serviceStartedAt;
|
||||
}
|
||||
|
||||
public Date getServiceStartedAt()
|
||||
{
|
||||
return serviceStartedAt;
|
||||
}
|
||||
public void setServiceExpiresAt(Date serviceExpiresAt)
|
||||
{
|
||||
this.serviceExpiresAt = serviceExpiresAt;
|
||||
}
|
||||
|
||||
public Date getServiceExpiresAt()
|
||||
{
|
||||
return serviceExpiresAt;
|
||||
}
|
||||
public void setReclaimStatus(String reclaimStatus)
|
||||
{
|
||||
this.reclaimStatus = reclaimStatus;
|
||||
}
|
||||
|
||||
public String getReclaimStatus()
|
||||
{
|
||||
return reclaimStatus;
|
||||
}
|
||||
public void setNextReclaimAt(Date nextReclaimAt)
|
||||
{
|
||||
this.nextReclaimAt = nextReclaimAt;
|
||||
}
|
||||
|
||||
public Date getNextReclaimAt()
|
||||
{
|
||||
return nextReclaimAt;
|
||||
}
|
||||
public void setNotifyUrl(String notifyUrl)
|
||||
{
|
||||
this.notifyUrl = notifyUrl;
|
||||
}
|
||||
|
||||
public String getNotifyUrl()
|
||||
{
|
||||
return notifyUrl;
|
||||
}
|
||||
public void setErrorCode(String errorCode)
|
||||
{
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getErrorCode()
|
||||
{
|
||||
return errorCode;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("appId", getAppId())
|
||||
.append("merchantOrderNo", getMerchantOrderNo())
|
||||
.append("requestHash", getRequestHash())
|
||||
.append("packageId", getPackageId())
|
||||
.append("network", getNetwork())
|
||||
.append("receiverAddress", getReceiverAddress())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("resourceQuantity", getResourceQuantity())
|
||||
.append("redundancyPercent", getRedundancyPercent())
|
||||
.append("targetResourceQuantity", getTargetResourceQuantity())
|
||||
.append("durationSeconds", getDurationSeconds())
|
||||
.append("saleAmount", getSaleAmount())
|
||||
.append("supplierAmount", getSupplierAmount())
|
||||
.append("supplierFeePercent", getSupplierFeePercent())
|
||||
.append("supplierFeeAmount", getSupplierFeeAmount())
|
||||
.append("supplierNetAmount", getSupplierNetAmount())
|
||||
.append("supplierReversedAmount", getSupplierReversedAmount())
|
||||
.append("supplierFeeReversedAmount", getSupplierFeeReversedAmount())
|
||||
.append("supplierFeeReturnedAmount", getSupplierFeeReturnedAmount())
|
||||
.append("packageSnapshot", getPackageSnapshot())
|
||||
.append("status", getStatus())
|
||||
.append("walletId", getWalletId())
|
||||
.append("supplierUserId", getSupplierUserId())
|
||||
.append("supplierAccountId", getSupplierAccountId())
|
||||
.append("relationSlot", getRelationSlot())
|
||||
.append("payerAccountId", getPayerAccountId())
|
||||
.append("fundStatus", getFundStatus())
|
||||
.append("refundedAmount", getRefundedAmount())
|
||||
.append("dispatchDeadline", getDispatchDeadline())
|
||||
.append("serviceStartedAt", getServiceStartedAt())
|
||||
.append("serviceExpiresAt", getServiceExpiresAt())
|
||||
.append("reclaimStatus", getReclaimStatus())
|
||||
.append("nextReclaimAt", getNextReclaimAt())
|
||||
.append("notifyUrl", getNotifyUrl())
|
||||
.append("errorCode", getErrorCode())
|
||||
.append("remark", getRemark())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,294 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变对象 rent_package
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentPackage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 套餐代码 */
|
||||
@Excel(name = "套餐代码")
|
||||
private String packageCode;
|
||||
|
||||
/** 套餐版本递增 */
|
||||
@Excel(name = "套餐版本递增")
|
||||
private Long revision;
|
||||
|
||||
/** 套餐名称 */
|
||||
@Excel(name = "套餐名称")
|
||||
private String name;
|
||||
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
|
||||
/** 资源类型:ENERGY能量、BANDWIDTH带宽;必须显式填写,无默认值 */
|
||||
@Excel(name = "资源类型:ENERGY能量、BANDWIDTH带宽;必须显式填写,无默认值")
|
||||
private String resourceType;
|
||||
|
||||
/** 交付资源正整数数量:ENERGY单位Energy、BANDWIDTH单位bytes,不是TRX或SUN */
|
||||
@Excel(name = "交付资源正整数数量:ENERGY单位Energy、BANDWIDTH单位bytes,不是TRX或SUN")
|
||||
private Long resourceQuantity;
|
||||
|
||||
/** 资源冗余百分数,20表示20%,必须大于0;目标量必须严格大于请求量,创建订单锁定 */
|
||||
@Excel(name = "资源冗余百分数,20表示20%,必须大于0;目标量必须严格大于请求量,创建订单锁定")
|
||||
private BigDecimal redundancyPercent;
|
||||
|
||||
/** 业务租期秒,不代表链上自动撤销 */
|
||||
@Excel(name = "业务租期秒,不代表链上自动撤销")
|
||||
private Long durationSeconds;
|
||||
|
||||
/** 售价USDT */
|
||||
@Excel(name = "售价USDT")
|
||||
private BigDecimal saleAmount;
|
||||
|
||||
/** 供应商扣平台手续费前毛收入USDT,包含约定链上操作成本,不是净结算额 */
|
||||
@Excel(name = "供应商扣平台手续费前毛收入USDT,包含约定链上操作成本,不是净结算额")
|
||||
private BigDecimal supplierAmount;
|
||||
|
||||
/** 平台向供应商收取的手续费百分数,必须显式配置且大于0小于100,5表示5%;下单锁定 */
|
||||
@Excel(name = "平台向供应商收取的手续费百分数,必须显式配置且大于0小于100,5表示5%;下单锁定")
|
||||
private BigDecimal supplierFeePercent;
|
||||
|
||||
/** 节点单笔操作本地费用预算SUN,零不可广播;委托撤销非合约交易,不假定协议支持fee_limit硬上限 */
|
||||
@Excel(name = "节点单笔操作本地费用预算SUN,零不可广播;委托撤销非合约交易,不假定协议支持fee_limit硬上限")
|
||||
private Long feeLimitSun;
|
||||
|
||||
/** 首版仅允许0非锁定委托;1拒绝上架,不能把租期秒当链上锁定参数 */
|
||||
@Excel(name = "首版仅允许0非锁定委托;1拒绝上架,不能把租期秒当链上锁定参数")
|
||||
private Integer delegateLock;
|
||||
|
||||
/** ACTIVE上架、DISABLED下架 */
|
||||
@Excel(name = "ACTIVE上架、DISABLED下架")
|
||||
private String status;
|
||||
|
||||
/** 委托锁定模式、允许偏差、退款及费用承担规则;启用前必须配置 */
|
||||
@Excel(name = "委托锁定模式、允许偏差、退款及费用承担规则;启用前必须配置")
|
||||
private String rules;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPackageCode(String packageCode)
|
||||
{
|
||||
this.packageCode = packageCode;
|
||||
}
|
||||
|
||||
public String getPackageCode()
|
||||
{
|
||||
return packageCode;
|
||||
}
|
||||
public void setRevision(Long revision)
|
||||
{
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public Long getRevision()
|
||||
{
|
||||
return revision;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
public void setResourceQuantity(Long resourceQuantity)
|
||||
{
|
||||
this.resourceQuantity = resourceQuantity;
|
||||
}
|
||||
|
||||
public Long getResourceQuantity()
|
||||
{
|
||||
return resourceQuantity;
|
||||
}
|
||||
public void setRedundancyPercent(BigDecimal redundancyPercent)
|
||||
{
|
||||
this.redundancyPercent = redundancyPercent;
|
||||
}
|
||||
|
||||
public BigDecimal getRedundancyPercent()
|
||||
{
|
||||
return redundancyPercent;
|
||||
}
|
||||
public void setDurationSeconds(Long durationSeconds)
|
||||
{
|
||||
this.durationSeconds = durationSeconds;
|
||||
}
|
||||
|
||||
public Long getDurationSeconds()
|
||||
{
|
||||
return durationSeconds;
|
||||
}
|
||||
public void setSaleAmount(BigDecimal saleAmount)
|
||||
{
|
||||
this.saleAmount = saleAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSaleAmount()
|
||||
{
|
||||
return saleAmount;
|
||||
}
|
||||
public void setSupplierAmount(BigDecimal supplierAmount)
|
||||
{
|
||||
this.supplierAmount = supplierAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierAmount()
|
||||
{
|
||||
return supplierAmount;
|
||||
}
|
||||
public void setSupplierFeePercent(BigDecimal supplierFeePercent)
|
||||
{
|
||||
this.supplierFeePercent = supplierFeePercent;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeePercent()
|
||||
{
|
||||
return supplierFeePercent;
|
||||
}
|
||||
public void setFeeLimitSun(Long feeLimitSun)
|
||||
{
|
||||
this.feeLimitSun = feeLimitSun;
|
||||
}
|
||||
|
||||
public Long getFeeLimitSun()
|
||||
{
|
||||
return feeLimitSun;
|
||||
}
|
||||
public void setDelegateLock(Integer delegateLock)
|
||||
{
|
||||
this.delegateLock = delegateLock;
|
||||
}
|
||||
|
||||
public Integer getDelegateLock()
|
||||
{
|
||||
return delegateLock;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setRules(String rules)
|
||||
{
|
||||
this.rules = rules;
|
||||
}
|
||||
|
||||
public String getRules()
|
||||
{
|
||||
return rules;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("packageCode", getPackageCode())
|
||||
.append("revision", getRevision())
|
||||
.append("name", getName())
|
||||
.append("network", getNetwork())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("resourceQuantity", getResourceQuantity())
|
||||
.append("redundancyPercent", getRedundancyPercent())
|
||||
.append("durationSeconds", getDurationSeconds())
|
||||
.append("saleAmount", getSaleAmount())
|
||||
.append("supplierAmount", getSupplierAmount())
|
||||
.append("supplierFeePercent", getSupplierFeePercent())
|
||||
.append("feeLimitSun", getFeeLimitSun())
|
||||
.append("delegateLock", getDelegateLock())
|
||||
.append("status", getStatus())
|
||||
.append("rules", getRules())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变对象 rent_package
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_package")
|
||||
public class RentPackagePlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 套餐代码 */
|
||||
@Excel(name = "套餐代码")
|
||||
private String packageCode;
|
||||
/** 套餐版本递增 */
|
||||
@Excel(name = "套餐版本递增")
|
||||
private Long revision;
|
||||
/** 套餐名称 */
|
||||
@Excel(name = "套餐名称")
|
||||
private String name;
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
/** 资源类型:ENERGY能量、BANDWIDTH带宽;必须显式填写,无默认值 */
|
||||
@Excel(name = "资源类型:ENERGY能量、BANDWIDTH带宽;必须显式填写,无默认值")
|
||||
private String resourceType;
|
||||
/** 交付资源正整数数量:ENERGY单位Energy、BANDWIDTH单位bytes,不是TRX或SUN */
|
||||
@Excel(name = "交付资源正整数数量:ENERGY单位Energy、BANDWIDTH单位bytes,不是TRX或SUN")
|
||||
private Long resourceQuantity;
|
||||
/** 资源冗余百分数,20表示20%,必须大于0;目标量必须严格大于请求量,创建订单锁定 */
|
||||
@Excel(name = "资源冗余百分数,20表示20%,必须大于0;目标量必须严格大于请求量,创建订单锁定")
|
||||
private BigDecimal redundancyPercent;
|
||||
/** 业务租期秒,不代表链上自动撤销 */
|
||||
@Excel(name = "业务租期秒,不代表链上自动撤销")
|
||||
private Long durationSeconds;
|
||||
/** 售价USDT */
|
||||
@Excel(name = "售价USDT")
|
||||
private BigDecimal saleAmount;
|
||||
/** 供应商扣平台手续费前毛收入USDT,包含约定链上操作成本,不是净结算额 */
|
||||
@Excel(name = "供应商扣平台手续费前毛收入USDT,包含约定链上操作成本,不是净结算额")
|
||||
private BigDecimal supplierAmount;
|
||||
/** 平台向供应商收取的手续费百分数,必须显式配置且大于0小于100,5表示5%;下单锁定 */
|
||||
@Excel(name = "平台向供应商收取的手续费百分数,必须显式配置且大于0小于100,5表示5%;下单锁定")
|
||||
private BigDecimal supplierFeePercent;
|
||||
/** 节点单笔操作本地费用预算SUN,零不可广播;委托撤销非合约交易,不假定协议支持fee_limit硬上限 */
|
||||
@Excel(name = "节点单笔操作本地费用预算SUN,零不可广播;委托撤销非合约交易,不假定协议支持fee_limit硬上限")
|
||||
private Long feeLimitSun;
|
||||
/** 首版仅允许0非锁定委托;1拒绝上架,不能把租期秒当链上锁定参数 */
|
||||
@Excel(name = "首版仅允许0非锁定委托;1拒绝上架,不能把租期秒当链上锁定参数")
|
||||
private Integer delegateLock;
|
||||
/** ACTIVE上架、DISABLED下架 */
|
||||
@Excel(name = "ACTIVE上架、DISABLED下架")
|
||||
private String status;
|
||||
/** 委托锁定模式、允许偏差、退款及费用承担规则;启用前必须配置 */
|
||||
@Excel(name = "委托锁定模式、允许偏差、退款及费用承担规则;启用前必须配置")
|
||||
private String rules;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPackageCode(String packageCode)
|
||||
{
|
||||
this.packageCode = packageCode;
|
||||
}
|
||||
|
||||
public String getPackageCode()
|
||||
{
|
||||
return packageCode;
|
||||
}
|
||||
public void setRevision(Long revision)
|
||||
{
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public Long getRevision()
|
||||
{
|
||||
return revision;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
public void setResourceQuantity(Long resourceQuantity)
|
||||
{
|
||||
this.resourceQuantity = resourceQuantity;
|
||||
}
|
||||
|
||||
public Long getResourceQuantity()
|
||||
{
|
||||
return resourceQuantity;
|
||||
}
|
||||
public void setRedundancyPercent(BigDecimal redundancyPercent)
|
||||
{
|
||||
this.redundancyPercent = redundancyPercent;
|
||||
}
|
||||
|
||||
public BigDecimal getRedundancyPercent()
|
||||
{
|
||||
return redundancyPercent;
|
||||
}
|
||||
public void setDurationSeconds(Long durationSeconds)
|
||||
{
|
||||
this.durationSeconds = durationSeconds;
|
||||
}
|
||||
|
||||
public Long getDurationSeconds()
|
||||
{
|
||||
return durationSeconds;
|
||||
}
|
||||
public void setSaleAmount(BigDecimal saleAmount)
|
||||
{
|
||||
this.saleAmount = saleAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSaleAmount()
|
||||
{
|
||||
return saleAmount;
|
||||
}
|
||||
public void setSupplierAmount(BigDecimal supplierAmount)
|
||||
{
|
||||
this.supplierAmount = supplierAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierAmount()
|
||||
{
|
||||
return supplierAmount;
|
||||
}
|
||||
public void setSupplierFeePercent(BigDecimal supplierFeePercent)
|
||||
{
|
||||
this.supplierFeePercent = supplierFeePercent;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierFeePercent()
|
||||
{
|
||||
return supplierFeePercent;
|
||||
}
|
||||
public void setFeeLimitSun(Long feeLimitSun)
|
||||
{
|
||||
this.feeLimitSun = feeLimitSun;
|
||||
}
|
||||
|
||||
public Long getFeeLimitSun()
|
||||
{
|
||||
return feeLimitSun;
|
||||
}
|
||||
public void setDelegateLock(Integer delegateLock)
|
||||
{
|
||||
this.delegateLock = delegateLock;
|
||||
}
|
||||
|
||||
public Integer getDelegateLock()
|
||||
{
|
||||
return delegateLock;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setRules(String rules)
|
||||
{
|
||||
this.rules = rules;
|
||||
}
|
||||
|
||||
public String getRules()
|
||||
{
|
||||
return rules;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("packageCode", getPackageCode())
|
||||
.append("revision", getRevision())
|
||||
.append("name", getName())
|
||||
.append("network", getNetwork())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("resourceQuantity", getResourceQuantity())
|
||||
.append("redundancyPercent", getRedundancyPercent())
|
||||
.append("durationSeconds", getDurationSeconds())
|
||||
.append("saleAmount", getSaleAmount())
|
||||
.append("supplierAmount", getSupplierAmount())
|
||||
.append("supplierFeePercent", getSupplierFeePercent())
|
||||
.append("feeLimitSun", getFeeLimitSun())
|
||||
.append("delegateLock", getDelegateLock())
|
||||
.append("status", getStatus())
|
||||
.append("rules", getRules())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史对象 rent_refund
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentRefund extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 平台全局唯一退款编号 */
|
||||
@Excel(name = "平台全局唯一退款编号")
|
||||
private String refundNo;
|
||||
|
||||
/** rent_order.id,仅CHARGED且已确认收入的订单可退款;HELD订单用释放流程 */
|
||||
@Excel(name = "rent_order.id,仅CHARGED且已确认收入的订单可退款;HELD订单用释放流程")
|
||||
private Long orderId;
|
||||
|
||||
/** 同订单退款请求幂等编号,调用方重试保持不变 */
|
||||
@Excel(name = "同订单退款请求幂等编号,调用方重试保持不变")
|
||||
private String requestNo;
|
||||
|
||||
/** 规范化退款请求SHA256,同编号不同内容拒绝 */
|
||||
@Excel(name = "规范化退款请求SHA256,同编号不同内容拒绝")
|
||||
private String requestHash;
|
||||
|
||||
/** 本次返还商户内部可用余额USDT,必须大于0,包含退商户的平台手续费部分 */
|
||||
@Excel(name = "本次返还商户内部可用余额USDT,必须大于0,包含退商户的平台手续费部分")
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/** 本次冲正供应商原净应收USDT,累计不能超过订单supplier_net_amount */
|
||||
@Excel(name = "本次冲正供应商原净应收USDT,累计不能超过订单supplier_net_amount")
|
||||
private BigDecimal supplierReverseAmount;
|
||||
|
||||
/** 本次退回平台手续费USDT,累计不能超过订单supplier_fee_amount */
|
||||
@Excel(name = "本次退回平台手续费USDT,累计不能超过订单supplier_fee_amount")
|
||||
private BigDecimal platformFeeReverseAmount;
|
||||
|
||||
/** NONE无退费、MERCHANT已包含在refund_amount、SUPPLIER增加供应商待结算及订单返还累计;无自动推定 */
|
||||
@Excel(name = "NONE无退费、MERCHANT已包含在refund_amount、SUPPLIER增加供应商待结算及订单返还累计;无自动推定")
|
||||
private String feeReturnTo;
|
||||
|
||||
/** PENDING待审核、APPLIED已同事务入账、REJECTED已拒绝;无外部退款中状态 */
|
||||
@Excel(name = "PENDING待审核、APPLIED已同事务入账、REJECTED已拒绝;无外部退款中状态")
|
||||
private String status;
|
||||
|
||||
/** 发起sys_user.user_id */
|
||||
@Excel(name = "发起sys_user.user_id")
|
||||
private Long createdBy;
|
||||
|
||||
/** 审批sys_user.user_id,必须与发起人不同 */
|
||||
@Excel(name = "审批sys_user.user_id,必须与发起人不同")
|
||||
private Long approvedBy;
|
||||
|
||||
/** 余额、流水、订单累计、回调及审计原子提交UTC时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "余额、流水、订单累计、回调及审计原子提交UTC时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date appliedAt;
|
||||
|
||||
/** 退款及费用承担审核依据,必填 */
|
||||
@Excel(name = "退款及费用承担审核依据,必填")
|
||||
private String reason;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setRefundNo(String refundNo)
|
||||
{
|
||||
this.refundNo = refundNo;
|
||||
}
|
||||
|
||||
public String getRefundNo()
|
||||
{
|
||||
return refundNo;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setRequestNo(String requestNo)
|
||||
{
|
||||
this.requestNo = requestNo;
|
||||
}
|
||||
|
||||
public String getRequestNo()
|
||||
{
|
||||
return requestNo;
|
||||
}
|
||||
public void setRequestHash(String requestHash)
|
||||
{
|
||||
this.requestHash = requestHash;
|
||||
}
|
||||
|
||||
public String getRequestHash()
|
||||
{
|
||||
return requestHash;
|
||||
}
|
||||
public void setRefundAmount(BigDecimal refundAmount)
|
||||
{
|
||||
this.refundAmount = refundAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getRefundAmount()
|
||||
{
|
||||
return refundAmount;
|
||||
}
|
||||
public void setSupplierReverseAmount(BigDecimal supplierReverseAmount)
|
||||
{
|
||||
this.supplierReverseAmount = supplierReverseAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierReverseAmount()
|
||||
{
|
||||
return supplierReverseAmount;
|
||||
}
|
||||
public void setPlatformFeeReverseAmount(BigDecimal platformFeeReverseAmount)
|
||||
{
|
||||
this.platformFeeReverseAmount = platformFeeReverseAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPlatformFeeReverseAmount()
|
||||
{
|
||||
return platformFeeReverseAmount;
|
||||
}
|
||||
public void setFeeReturnTo(String feeReturnTo)
|
||||
{
|
||||
this.feeReturnTo = feeReturnTo;
|
||||
}
|
||||
|
||||
public String getFeeReturnTo()
|
||||
{
|
||||
return feeReturnTo;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setCreatedBy(Long createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Long getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setApprovedBy(Long approvedBy)
|
||||
{
|
||||
this.approvedBy = approvedBy;
|
||||
}
|
||||
|
||||
public Long getApprovedBy()
|
||||
{
|
||||
return approvedBy;
|
||||
}
|
||||
public void setAppliedAt(Date appliedAt)
|
||||
{
|
||||
this.appliedAt = appliedAt;
|
||||
}
|
||||
|
||||
public Date getAppliedAt()
|
||||
{
|
||||
return appliedAt;
|
||||
}
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("refundNo", getRefundNo())
|
||||
.append("orderId", getOrderId())
|
||||
.append("requestNo", getRequestNo())
|
||||
.append("requestHash", getRequestHash())
|
||||
.append("refundAmount", getRefundAmount())
|
||||
.append("supplierReverseAmount", getSupplierReverseAmount())
|
||||
.append("platformFeeReverseAmount", getPlatformFeeReverseAmount())
|
||||
.append("feeReturnTo", getFeeReturnTo())
|
||||
.append("status", getStatus())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("approvedBy", getApprovedBy())
|
||||
.append("appliedAt", getAppliedAt())
|
||||
.append("reason", getReason())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史对象 rent_refund
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_refund")
|
||||
public class RentRefundPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 平台全局唯一退款编号 */
|
||||
@Excel(name = "平台全局唯一退款编号")
|
||||
private String refundNo;
|
||||
/** rent_order.id,仅CHARGED且已确认收入的订单可退款;HELD订单用释放流程 */
|
||||
@Excel(name = "rent_order.id,仅CHARGED且已确认收入的订单可退款;HELD订单用释放流程")
|
||||
private Long orderId;
|
||||
/** 同订单退款请求幂等编号,调用方重试保持不变 */
|
||||
@Excel(name = "同订单退款请求幂等编号,调用方重试保持不变")
|
||||
private String requestNo;
|
||||
/** 规范化退款请求SHA256,同编号不同内容拒绝 */
|
||||
@Excel(name = "规范化退款请求SHA256,同编号不同内容拒绝")
|
||||
private String requestHash;
|
||||
/** 本次返还商户内部可用余额USDT,必须大于0,包含退商户的平台手续费部分 */
|
||||
@Excel(name = "本次返还商户内部可用余额USDT,必须大于0,包含退商户的平台手续费部分")
|
||||
private BigDecimal refundAmount;
|
||||
/** 本次冲正供应商原净应收USDT,累计不能超过订单supplier_net_amount */
|
||||
@Excel(name = "本次冲正供应商原净应收USDT,累计不能超过订单supplier_net_amount")
|
||||
private BigDecimal supplierReverseAmount;
|
||||
/** 本次退回平台手续费USDT,累计不能超过订单supplier_fee_amount */
|
||||
@Excel(name = "本次退回平台手续费USDT,累计不能超过订单supplier_fee_amount")
|
||||
private BigDecimal platformFeeReverseAmount;
|
||||
/** NONE无退费、MERCHANT已包含在refund_amount、SUPPLIER增加供应商待结算及订单返还累计;无自动推定 */
|
||||
@Excel(name = "NONE无退费、MERCHANT已包含在refund_amount、SUPPLIER增加供应商待结算及订单返还累计;无自动推定")
|
||||
private String feeReturnTo;
|
||||
/** PENDING待审核、APPLIED已同事务入账、REJECTED已拒绝;无外部退款中状态 */
|
||||
@Excel(name = "PENDING待审核、APPLIED已同事务入账、REJECTED已拒绝;无外部退款中状态")
|
||||
private String status;
|
||||
/** 发起sys_user.user_id */
|
||||
@Excel(name = "发起sys_user.user_id")
|
||||
private Long createdBy;
|
||||
/** 审批sys_user.user_id,必须与发起人不同 */
|
||||
@Excel(name = "审批sys_user.user_id,必须与发起人不同")
|
||||
private Long approvedBy;
|
||||
/** 余额、流水、订单累计、回调及审计原子提交UTC时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "余额、流水、订单累计、回调及审计原子提交UTC时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date appliedAt;
|
||||
/** 退款及费用承担审核依据,必填 */
|
||||
@Excel(name = "退款及费用承担审核依据,必填")
|
||||
private String reason;
|
||||
/** CAS乐观锁版本,更新须条件递增 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setRefundNo(String refundNo)
|
||||
{
|
||||
this.refundNo = refundNo;
|
||||
}
|
||||
|
||||
public String getRefundNo()
|
||||
{
|
||||
return refundNo;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setRequestNo(String requestNo)
|
||||
{
|
||||
this.requestNo = requestNo;
|
||||
}
|
||||
|
||||
public String getRequestNo()
|
||||
{
|
||||
return requestNo;
|
||||
}
|
||||
public void setRequestHash(String requestHash)
|
||||
{
|
||||
this.requestHash = requestHash;
|
||||
}
|
||||
|
||||
public String getRequestHash()
|
||||
{
|
||||
return requestHash;
|
||||
}
|
||||
public void setRefundAmount(BigDecimal refundAmount)
|
||||
{
|
||||
this.refundAmount = refundAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getRefundAmount()
|
||||
{
|
||||
return refundAmount;
|
||||
}
|
||||
public void setSupplierReverseAmount(BigDecimal supplierReverseAmount)
|
||||
{
|
||||
this.supplierReverseAmount = supplierReverseAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSupplierReverseAmount()
|
||||
{
|
||||
return supplierReverseAmount;
|
||||
}
|
||||
public void setPlatformFeeReverseAmount(BigDecimal platformFeeReverseAmount)
|
||||
{
|
||||
this.platformFeeReverseAmount = platformFeeReverseAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPlatformFeeReverseAmount()
|
||||
{
|
||||
return platformFeeReverseAmount;
|
||||
}
|
||||
public void setFeeReturnTo(String feeReturnTo)
|
||||
{
|
||||
this.feeReturnTo = feeReturnTo;
|
||||
}
|
||||
|
||||
public String getFeeReturnTo()
|
||||
{
|
||||
return feeReturnTo;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setCreatedBy(Long createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Long getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setApprovedBy(Long approvedBy)
|
||||
{
|
||||
this.approvedBy = approvedBy;
|
||||
}
|
||||
|
||||
public Long getApprovedBy()
|
||||
{
|
||||
return approvedBy;
|
||||
}
|
||||
public void setAppliedAt(Date appliedAt)
|
||||
{
|
||||
this.appliedAt = appliedAt;
|
||||
}
|
||||
|
||||
public Date getAppliedAt()
|
||||
{
|
||||
return appliedAt;
|
||||
}
|
||||
public void setReason(String reason)
|
||||
{
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("refundNo", getRefundNo())
|
||||
.append("orderId", getOrderId())
|
||||
.append("requestNo", getRequestNo())
|
||||
.append("requestHash", getRequestHash())
|
||||
.append("refundAmount", getRefundAmount())
|
||||
.append("supplierReverseAmount", getSupplierReverseAmount())
|
||||
.append("platformFeeReverseAmount", getPlatformFeeReverseAmount())
|
||||
.append("feeReturnTo", getFeeReturnTo())
|
||||
.append("status", getStatus())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("approvedBy", getApprovedBy())
|
||||
.append("appliedAt", getAppliedAt())
|
||||
.append("reason", getReason())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 供应商人工结算单;不自动链上出金对象 rent_settlement
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentSettlement extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 结算单号 */
|
||||
@Excel(name = "结算单号")
|
||||
private String settlementNo;
|
||||
|
||||
/** 供应商rent_account.id */
|
||||
@Excel(name = "供应商rent_account.id")
|
||||
private Long accountId;
|
||||
|
||||
/** 本次人工结算USDT总额,必须大于零 */
|
||||
@Excel(name = "本次人工结算USDT总额,必须大于零")
|
||||
private BigDecimal amount;
|
||||
|
||||
/** PENDING待审、APPROVED待付款、PAYING已占用付款授权、PAID付款核验完成、REJECTED明确未付拒绝、UNKNOWN付款待核对 */
|
||||
@Excel(name = "PENDING待审、APPROVED待付款、PAYING已占用付款授权、PAID付款核验完成、REJECTED明确未付拒绝、UNKNOWN付款待核对")
|
||||
private String status;
|
||||
|
||||
/** 人工付款授权唯一编号;先同事务进入PAYING并持久化该编号再付款,重试查询原付款,不重新授权 */
|
||||
@Excel(name = "人工付款授权唯一编号;先同事务进入PAYING并持久化该编号再付款,重试查询原付款,不重新授权")
|
||||
private String payoutNo;
|
||||
|
||||
/** 进入PAYING的UTC时间;PAYING或UNKNOWN不能因超时释放来源 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "进入PAYING的UTC时间;PAYING或UNKNOWN不能因超时释放来源", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date paymentStartedAt;
|
||||
|
||||
/** 收款信息、唯一付款凭据和独立核对结果;没有确认不能记已付 */
|
||||
@Excel(name = "收款信息、唯一付款凭据和独立核对结果;没有确认不能记已付")
|
||||
private String paymentEvidence;
|
||||
|
||||
/** 唯一标准化付款凭据,例如network:txid:index,防重复登记 */
|
||||
@Excel(name = "唯一标准化付款凭据,例如network:txid:index,防重复登记")
|
||||
private String paymentReference;
|
||||
|
||||
/** 发起sys_user.user_id */
|
||||
@Excel(name = "发起sys_user.user_id")
|
||||
private Long createdBy;
|
||||
|
||||
/** 审批sys_user.user_id,职责分离 */
|
||||
@Excel(name = "审批sys_user.user_id,职责分离")
|
||||
private Long approvedBy;
|
||||
|
||||
/** 付款核验UTC时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "付款核验UTC时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date paidAt;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSettlementNo(String settlementNo)
|
||||
{
|
||||
this.settlementNo = settlementNo;
|
||||
}
|
||||
|
||||
public String getSettlementNo()
|
||||
{
|
||||
return settlementNo;
|
||||
}
|
||||
public void setAccountId(Long accountId)
|
||||
{
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public Long getAccountId()
|
||||
{
|
||||
return accountId;
|
||||
}
|
||||
public void setAmount(BigDecimal amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setPayoutNo(String payoutNo)
|
||||
{
|
||||
this.payoutNo = payoutNo;
|
||||
}
|
||||
|
||||
public String getPayoutNo()
|
||||
{
|
||||
return payoutNo;
|
||||
}
|
||||
public void setPaymentStartedAt(Date paymentStartedAt)
|
||||
{
|
||||
this.paymentStartedAt = paymentStartedAt;
|
||||
}
|
||||
|
||||
public Date getPaymentStartedAt()
|
||||
{
|
||||
return paymentStartedAt;
|
||||
}
|
||||
public void setPaymentEvidence(String paymentEvidence)
|
||||
{
|
||||
this.paymentEvidence = paymentEvidence;
|
||||
}
|
||||
|
||||
public String getPaymentEvidence()
|
||||
{
|
||||
return paymentEvidence;
|
||||
}
|
||||
public void setPaymentReference(String paymentReference)
|
||||
{
|
||||
this.paymentReference = paymentReference;
|
||||
}
|
||||
|
||||
public String getPaymentReference()
|
||||
{
|
||||
return paymentReference;
|
||||
}
|
||||
public void setCreatedBy(Long createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Long getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setApprovedBy(Long approvedBy)
|
||||
{
|
||||
this.approvedBy = approvedBy;
|
||||
}
|
||||
|
||||
public Long getApprovedBy()
|
||||
{
|
||||
return approvedBy;
|
||||
}
|
||||
public void setPaidAt(Date paidAt)
|
||||
{
|
||||
this.paidAt = paidAt;
|
||||
}
|
||||
|
||||
public Date getPaidAt()
|
||||
{
|
||||
return paidAt;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("settlementNo", getSettlementNo())
|
||||
.append("accountId", getAccountId())
|
||||
.append("amount", getAmount())
|
||||
.append("status", getStatus())
|
||||
.append("payoutNo", getPayoutNo())
|
||||
.append("paymentStartedAt", getPaymentStartedAt())
|
||||
.append("paymentEvidence", getPaymentEvidence())
|
||||
.append("paymentReference", getPaymentReference())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("approvedBy", getApprovedBy())
|
||||
.append("paidAt", getPaidAt())
|
||||
.append("remark", getRemark())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 供应商订单应收与结算关联;首版每单全额结算一次对象 rent_settlement_item
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentSettlementItem extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** rent_settlement.id */
|
||||
@Excel(name = "rent_settlement.id")
|
||||
private Long settlementId;
|
||||
|
||||
/** 已履约rent_order.id */
|
||||
@Excel(name = "已履约rent_order.id")
|
||||
private Long orderId;
|
||||
|
||||
/** 本单净可结算USDT=supplier_net_amount减supplier_reversed_amount加supplier_fee_returned_amount;手续费不重复扣 */
|
||||
@Excel(name = "本单净可结算USDT=supplier_net_amount减supplier_reversed_amount加supplier_fee_returned_amount;手续费不重复扣")
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 占用或已支付为1;明确拒绝且未付款可置NULL,UNKNOWN不可释放 */
|
||||
@Excel(name = "占用或已支付为1;明确拒绝且未付款可置NULL,UNKNOWN不可释放")
|
||||
private Integer activeSlot;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSettlementId(Long settlementId)
|
||||
{
|
||||
this.settlementId = settlementId;
|
||||
}
|
||||
|
||||
public Long getSettlementId()
|
||||
{
|
||||
return settlementId;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setAmount(BigDecimal amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
public void setActiveSlot(Integer activeSlot)
|
||||
{
|
||||
this.activeSlot = activeSlot;
|
||||
}
|
||||
|
||||
public Integer getActiveSlot()
|
||||
{
|
||||
return activeSlot;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("settlementId", getSettlementId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("amount", getAmount())
|
||||
.append("activeSlot", getActiveSlot())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 供应商订单应收与结算关联;首版每单全额结算一次对象 rent_settlement_item
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_settlement_item")
|
||||
public class RentSettlementItemPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** rent_settlement.id */
|
||||
@Excel(name = "rent_settlement.id")
|
||||
private Long settlementId;
|
||||
/** 已履约rent_order.id */
|
||||
@Excel(name = "已履约rent_order.id")
|
||||
private Long orderId;
|
||||
/** 本单净可结算USDT=supplier_net_amount减supplier_reversed_amount加supplier_fee_returned_amount;手续费不重复扣 */
|
||||
@Excel(name = "本单净可结算USDT=supplier_net_amount减supplier_reversed_amount加supplier_fee_returned_amount;手续费不重复扣")
|
||||
private BigDecimal amount;
|
||||
/** 占用或已支付为1;明确拒绝且未付款可置NULL,UNKNOWN不可释放 */
|
||||
@Excel(name = "占用或已支付为1;明确拒绝且未付款可置NULL,UNKNOWN不可释放")
|
||||
private Integer activeSlot;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSettlementId(Long settlementId)
|
||||
{
|
||||
this.settlementId = settlementId;
|
||||
}
|
||||
|
||||
public Long getSettlementId()
|
||||
{
|
||||
return settlementId;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setAmount(BigDecimal amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
public void setActiveSlot(Integer activeSlot)
|
||||
{
|
||||
this.activeSlot = activeSlot;
|
||||
}
|
||||
|
||||
public Integer getActiveSlot()
|
||||
{
|
||||
return activeSlot;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("settlementId", getSettlementId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("amount", getAmount())
|
||||
.append("activeSlot", getActiveSlot())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 供应商人工结算单;不自动链上出金对象 rent_settlement
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_settlement")
|
||||
public class RentSettlementPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 结算单号 */
|
||||
@Excel(name = "结算单号")
|
||||
private String settlementNo;
|
||||
/** 供应商rent_account.id */
|
||||
@Excel(name = "供应商rent_account.id")
|
||||
private Long accountId;
|
||||
/** 本次人工结算USDT总额,必须大于零 */
|
||||
@Excel(name = "本次人工结算USDT总额,必须大于零")
|
||||
private BigDecimal amount;
|
||||
/** PENDING待审、APPROVED待付款、PAYING已占用付款授权、PAID付款核验完成、REJECTED明确未付拒绝、UNKNOWN付款待核对 */
|
||||
@Excel(name = "PENDING待审、APPROVED待付款、PAYING已占用付款授权、PAID付款核验完成、REJECTED明确未付拒绝、UNKNOWN付款待核对")
|
||||
private String status;
|
||||
/** 人工付款授权唯一编号;先同事务进入PAYING并持久化该编号再付款,重试查询原付款,不重新授权 */
|
||||
@Excel(name = "人工付款授权唯一编号;先同事务进入PAYING并持久化该编号再付款,重试查询原付款,不重新授权")
|
||||
private String payoutNo;
|
||||
/** 进入PAYING的UTC时间;PAYING或UNKNOWN不能因超时释放来源 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "进入PAYING的UTC时间;PAYING或UNKNOWN不能因超时释放来源", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date paymentStartedAt;
|
||||
/** 收款信息、唯一付款凭据和独立核对结果;没有确认不能记已付 */
|
||||
@Excel(name = "收款信息、唯一付款凭据和独立核对结果;没有确认不能记已付")
|
||||
private String paymentEvidence;
|
||||
/** 唯一标准化付款凭据,例如network:txid:index,防重复登记 */
|
||||
@Excel(name = "唯一标准化付款凭据,例如network:txid:index,防重复登记")
|
||||
private String paymentReference;
|
||||
/** 发起sys_user.user_id */
|
||||
@Excel(name = "发起sys_user.user_id")
|
||||
private Long createdBy;
|
||||
/** 审批sys_user.user_id,职责分离 */
|
||||
@Excel(name = "审批sys_user.user_id,职责分离")
|
||||
private Long approvedBy;
|
||||
/** 付款核验UTC时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "付款核验UTC时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date paidAt;
|
||||
/** 审核说明 */
|
||||
@Excel(name = "审核说明")
|
||||
private String remark;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSettlementNo(String settlementNo)
|
||||
{
|
||||
this.settlementNo = settlementNo;
|
||||
}
|
||||
|
||||
public String getSettlementNo()
|
||||
{
|
||||
return settlementNo;
|
||||
}
|
||||
public void setAccountId(Long accountId)
|
||||
{
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public Long getAccountId()
|
||||
{
|
||||
return accountId;
|
||||
}
|
||||
public void setAmount(BigDecimal amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setPayoutNo(String payoutNo)
|
||||
{
|
||||
this.payoutNo = payoutNo;
|
||||
}
|
||||
|
||||
public String getPayoutNo()
|
||||
{
|
||||
return payoutNo;
|
||||
}
|
||||
public void setPaymentStartedAt(Date paymentStartedAt)
|
||||
{
|
||||
this.paymentStartedAt = paymentStartedAt;
|
||||
}
|
||||
|
||||
public Date getPaymentStartedAt()
|
||||
{
|
||||
return paymentStartedAt;
|
||||
}
|
||||
public void setPaymentEvidence(String paymentEvidence)
|
||||
{
|
||||
this.paymentEvidence = paymentEvidence;
|
||||
}
|
||||
|
||||
public String getPaymentEvidence()
|
||||
{
|
||||
return paymentEvidence;
|
||||
}
|
||||
public void setPaymentReference(String paymentReference)
|
||||
{
|
||||
this.paymentReference = paymentReference;
|
||||
}
|
||||
|
||||
public String getPaymentReference()
|
||||
{
|
||||
return paymentReference;
|
||||
}
|
||||
public void setCreatedBy(Long createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Long getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setApprovedBy(Long approvedBy)
|
||||
{
|
||||
this.approvedBy = approvedBy;
|
||||
}
|
||||
|
||||
public Long getApprovedBy()
|
||||
{
|
||||
return approvedBy;
|
||||
}
|
||||
public void setPaidAt(Date paidAt)
|
||||
{
|
||||
this.paidAt = paidAt;
|
||||
}
|
||||
|
||||
public Date getPaidAt()
|
||||
{
|
||||
return paidAt;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("settlementNo", getSettlementNo())
|
||||
.append("accountId", getAccountId())
|
||||
.append("amount", getAmount())
|
||||
.append("status", getStatus())
|
||||
.append("payoutNo", getPayoutNo())
|
||||
.append("paymentStartedAt", getPaymentStartedAt())
|
||||
.append("paymentEvidence", getPaymentEvidence())
|
||||
.append("paymentReference", getPaymentReference())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("approvedBy", getApprovedBy())
|
||||
.append("paidAt", getPaidAt())
|
||||
.append("remark", getRemark())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,623 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 委托或回收任务,兼作持久队列与资源预留明细对象 rent_task
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentTask extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 任务编号 */
|
||||
@Excel(name = "任务编号")
|
||||
private String taskNo;
|
||||
|
||||
/** rent_order.id */
|
||||
@Excel(name = "rent_order.id")
|
||||
private Long orderId;
|
||||
|
||||
/** rent_wallet.id */
|
||||
@Excel(name = "rent_wallet.id")
|
||||
private Long walletId;
|
||||
|
||||
/** rent_node.id */
|
||||
@Excel(name = "rent_node.id")
|
||||
private Long nodeId;
|
||||
|
||||
/** 与订单钱包及实际链上交易一致的网络,纳入HMAC */
|
||||
@Excel(name = "与订单钱包及实际链上交易一致的网络,纳入HMAC")
|
||||
private String network;
|
||||
|
||||
/** RECLAIM必须指向原已确认DELEGATE的rent_transaction.id;DELEGATE为空,不允许回收任务引用回收交易 */
|
||||
@Excel(name = "RECLAIM必须指向原已确认DELEGATE的rent_transaction.id;DELEGATE为空,不允许回收任务引用回收交易")
|
||||
private Long sourceTransactionId;
|
||||
|
||||
/** 同钱包同资源类型最多一个在途链上操作;未知保留1,终结且写入快照屏障后置NULL;与订单地址对占位独立 */
|
||||
@Excel(name = "同钱包同资源类型最多一个在途链上操作;未知保留1,终结且写入快照屏障后置NULL;与订单地址对占位独立")
|
||||
private Integer walletExecutionSlot;
|
||||
|
||||
/** DELEGATE委托、RECLAIM回收,不支持转账 */
|
||||
@Excel(name = "DELEGATE委托、RECLAIM回收,不支持转账")
|
||||
private String taskType;
|
||||
|
||||
/** 资源类型:ENERGY或BANDWIDTH,必须与订单及链上交易一致并纳入HMAC */
|
||||
@Excel(name = "资源类型:ENERGY或BANDWIDTH,必须与订单及链上交易一致并纳入HMAC")
|
||||
private String resourceType;
|
||||
|
||||
/** 本任务资源数量快照:ENERGY单位Energy、BANDWIDTH单位bytes,不得跨类型换算 */
|
||||
@Excel(name = "本任务资源数量快照:ENERGY单位Energy、BANDWIDTH单位bytes,不得跨类型换算")
|
||||
private Long resourceQuantity;
|
||||
|
||||
/** 原订单含冗余目标快照;委托必须覆盖该量,回收任务仅用于追溯原委托目标 */
|
||||
@Excel(name = "原订单含冗余目标快照;委托必须覆盖该量,回收任务仅用于追溯原委托目标")
|
||||
private Long targetResourceQuantity;
|
||||
|
||||
/** 换算时该资源全网总额度:ENERGY为Energy,BANDWIDTH为质押带宽bytes,必须大于0 */
|
||||
@Excel(name = "换算时该资源全网总额度:ENERGY为Energy,BANDWIDTH为质押带宽bytes,必须大于0")
|
||||
private Long conversionTotalLimit;
|
||||
|
||||
/** 换算时该资源全网总权重,单位为协议TRX权重,不能当作SUN;必须大于0 */
|
||||
@Excel(name = "换算时该资源全网总权重,单位为协议TRX权重,不能当作SUN;必须大于0")
|
||||
private Long conversionTotalWeight;
|
||||
|
||||
/** 可信换算查询对应区块高度,结合时间检查快照有效期 */
|
||||
@Excel(name = "可信换算查询对应区块高度,结合时间检查快照有效期")
|
||||
private Long conversionBlockHeight;
|
||||
|
||||
/** 本次换算参数查询UTC时间,Agent签名前必须重新检查参数及额度 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "本次换算参数查询UTC时间,Agent签名前必须重新检查参数及额度", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date conversionAt;
|
||||
|
||||
/** 按本次换算参数和delegate_sun向下计算的资源量,委托任务必须不小于target_resource_quantity */
|
||||
@Excel(name = "按本次换算参数和delegate_sun向下计算的资源量,委托任务必须不小于target_resource_quantity")
|
||||
private Long estimatedResourceQuantity;
|
||||
|
||||
/** 同订单同类型的尝试序号 */
|
||||
@Excel(name = "同订单同类型的尝试序号")
|
||||
private Long attemptNo;
|
||||
|
||||
/** 有效或已成功取1,仅明确未执行失败可置NULL;UNKNOWN不得释放 */
|
||||
@Excel(name = "有效或已成功取1,仅明确未执行失败可置NULL;UNKNOWN不得释放")
|
||||
private Integer activeSlot;
|
||||
|
||||
/** 委托本金SUN=ceil(目标资源量乘全网权重除全网额度)乘1000000,TRX向上取整;回收取原确认本金,禁止重新按资源量换算 */
|
||||
@Excel(name = "委托本金SUN=ceil(目标资源量乘全网权重除全网额度)乘1000000,TRX向上取整;回收取原确认本金,禁止重新按资源量换算")
|
||||
private Long delegateSun;
|
||||
|
||||
/** 本地操作费用预算SUN;按当前网络费用、签名权限及资源评估,不作为协议fee_limit硬上限 */
|
||||
@Excel(name = "本地操作费用预算SUN;按当前网络费用、签名权限及资源评估,不作为协议fee_limit硬上限")
|
||||
private Long feeLimitSun;
|
||||
|
||||
/** 目标节点rent_credential.id */
|
||||
@Excel(name = "目标节点rent_credential.id")
|
||||
private Long credentialId;
|
||||
|
||||
/** 任务防重放随机数 */
|
||||
@Excel(name = "任务防重放随机数")
|
||||
private String nonce;
|
||||
|
||||
/** HMAC签发UTC时间,按Unix毫秒参与签名 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "HMAC签发UTC时间,按Unix毫秒参与签名", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date signedAt;
|
||||
|
||||
/** 允许新签名及新广播截止UTC时间;委托不晚于订单dispatch_deadline,回收使用独立有效期;过期仍允许原交易核对 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "允许新签名及新广播截止UTC时间;委托不晚于订单dispatch_deadline,回收使用独立有效期;过期仍允许原交易核对", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date deadline;
|
||||
|
||||
/** RENT_TASK_V2冻结意图:网络、类型、请求及目标、换算证据、精确本金SUN、owner/receiver、非锁定、预算、期限、节点、原委托来源及txId,全部纳入HMAC且与标量字段一致 */
|
||||
@Excel(name = "RENT_TASK_V2冻结意图:网络、类型、请求及目标、换算证据、精确本金SUN、owner/receiver、非锁定、预算、期限、节点、原委托来源及txId,全部纳入HMAC且与标量字段一致")
|
||||
private String intent;
|
||||
|
||||
/** TASK域的HMAC-SHA256小写十六进制,不含自身 */
|
||||
@Excel(name = "TASK域的HMAC-SHA256小写十六进制,不含自身")
|
||||
private String signature;
|
||||
|
||||
/** PENDING待接单、ACCEPTED接受、BROADCASTED已广播、VERIFIED核验成功、REJECTED明确未执行拒绝、FAILED明确失败、UNKNOWN未知 */
|
||||
@Excel(name = "PENDING待接单、ACCEPTED接受、BROADCASTED已广播、VERIFIED核验成功、REJECTED明确未执行拒绝、FAILED明确失败、UNKNOWN未知")
|
||||
private String status;
|
||||
|
||||
/** 委托资源占用HELD、COMMITTED、RELEASED;未知委托保持HELD;回收任务固定NONE,不新增可委托本金预留 */
|
||||
@Excel(name = "委托资源占用HELD、COMMITTED、RELEASED;未知委托保持HELD;回收任务固定NONE,不新增可委托本金预留")
|
||||
private String reservationStatus;
|
||||
|
||||
/** 云端worker抢占标识,非节点身份 */
|
||||
@Excel(name = "云端worker抢占标识,非节点身份")
|
||||
private String leaseOwner;
|
||||
|
||||
/** worker租约截止,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "worker租约截止,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date leaseUntil;
|
||||
|
||||
/** 节点接受时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "节点接受时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date acceptedAt;
|
||||
|
||||
/** 本逻辑任务推送的稳定消息编号,重发保持不变;仅新业务任务使用新编号 */
|
||||
@Excel(name = "本逻辑任务推送的稳定消息编号,重发保持不变;仅新业务任务使用新编号")
|
||||
private String deliveryMessageId;
|
||||
|
||||
/** 最近推送所用节点会话代次,重连重新投递时更新;不修改原任务签名意图 */
|
||||
@Excel(name = "最近推送所用节点会话代次,重连重新投递时更新;不修改原任务签名意图")
|
||||
private Long deliverySessionEpoch;
|
||||
|
||||
/** Socket任务发送次数,仅表示投递尝试,不是链上执行次数 */
|
||||
@Excel(name = "Socket任务发送次数,仅表示投递尝试,不是链上执行次数")
|
||||
private Long deliveryCount;
|
||||
|
||||
/** 最近一次向节点写入任务帧的UTC时间,不代表对端已持久化 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最近一次向节点写入任务帧的UTC时间,不代表对端已持久化", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date lastSentAt;
|
||||
|
||||
/** 节点本地持久化任务后返回接收ACK的云端UTC时间,不代表接受、广播或执行成功 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "节点本地持久化任务后返回接收ACK的云端UTC时间,不代表接受、广播或执行成功", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date deliveryAckedAt;
|
||||
|
||||
/** 下次处理时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次处理时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextCheckAt;
|
||||
|
||||
/** 脱敏原因 */
|
||||
@Excel(name = "脱敏原因")
|
||||
private String error;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setTaskNo(String taskNo)
|
||||
{
|
||||
this.taskNo = taskNo;
|
||||
}
|
||||
|
||||
public String getTaskNo()
|
||||
{
|
||||
return taskNo;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setWalletId(Long walletId)
|
||||
{
|
||||
this.walletId = walletId;
|
||||
}
|
||||
|
||||
public Long getWalletId()
|
||||
{
|
||||
return walletId;
|
||||
}
|
||||
public void setNodeId(Long nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public Long getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setSourceTransactionId(Long sourceTransactionId)
|
||||
{
|
||||
this.sourceTransactionId = sourceTransactionId;
|
||||
}
|
||||
|
||||
public Long getSourceTransactionId()
|
||||
{
|
||||
return sourceTransactionId;
|
||||
}
|
||||
public void setWalletExecutionSlot(Integer walletExecutionSlot)
|
||||
{
|
||||
this.walletExecutionSlot = walletExecutionSlot;
|
||||
}
|
||||
|
||||
public Integer getWalletExecutionSlot()
|
||||
{
|
||||
return walletExecutionSlot;
|
||||
}
|
||||
public void setTaskType(String taskType)
|
||||
{
|
||||
this.taskType = taskType;
|
||||
}
|
||||
|
||||
public String getTaskType()
|
||||
{
|
||||
return taskType;
|
||||
}
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
public void setResourceQuantity(Long resourceQuantity)
|
||||
{
|
||||
this.resourceQuantity = resourceQuantity;
|
||||
}
|
||||
|
||||
public Long getResourceQuantity()
|
||||
{
|
||||
return resourceQuantity;
|
||||
}
|
||||
public void setTargetResourceQuantity(Long targetResourceQuantity)
|
||||
{
|
||||
this.targetResourceQuantity = targetResourceQuantity;
|
||||
}
|
||||
|
||||
public Long getTargetResourceQuantity()
|
||||
{
|
||||
return targetResourceQuantity;
|
||||
}
|
||||
public void setConversionTotalLimit(Long conversionTotalLimit)
|
||||
{
|
||||
this.conversionTotalLimit = conversionTotalLimit;
|
||||
}
|
||||
|
||||
public Long getConversionTotalLimit()
|
||||
{
|
||||
return conversionTotalLimit;
|
||||
}
|
||||
public void setConversionTotalWeight(Long conversionTotalWeight)
|
||||
{
|
||||
this.conversionTotalWeight = conversionTotalWeight;
|
||||
}
|
||||
|
||||
public Long getConversionTotalWeight()
|
||||
{
|
||||
return conversionTotalWeight;
|
||||
}
|
||||
public void setConversionBlockHeight(Long conversionBlockHeight)
|
||||
{
|
||||
this.conversionBlockHeight = conversionBlockHeight;
|
||||
}
|
||||
|
||||
public Long getConversionBlockHeight()
|
||||
{
|
||||
return conversionBlockHeight;
|
||||
}
|
||||
public void setConversionAt(Date conversionAt)
|
||||
{
|
||||
this.conversionAt = conversionAt;
|
||||
}
|
||||
|
||||
public Date getConversionAt()
|
||||
{
|
||||
return conversionAt;
|
||||
}
|
||||
public void setEstimatedResourceQuantity(Long estimatedResourceQuantity)
|
||||
{
|
||||
this.estimatedResourceQuantity = estimatedResourceQuantity;
|
||||
}
|
||||
|
||||
public Long getEstimatedResourceQuantity()
|
||||
{
|
||||
return estimatedResourceQuantity;
|
||||
}
|
||||
public void setAttemptNo(Long attemptNo)
|
||||
{
|
||||
this.attemptNo = attemptNo;
|
||||
}
|
||||
|
||||
public Long getAttemptNo()
|
||||
{
|
||||
return attemptNo;
|
||||
}
|
||||
public void setActiveSlot(Integer activeSlot)
|
||||
{
|
||||
this.activeSlot = activeSlot;
|
||||
}
|
||||
|
||||
public Integer getActiveSlot()
|
||||
{
|
||||
return activeSlot;
|
||||
}
|
||||
public void setDelegateSun(Long delegateSun)
|
||||
{
|
||||
this.delegateSun = delegateSun;
|
||||
}
|
||||
|
||||
public Long getDelegateSun()
|
||||
{
|
||||
return delegateSun;
|
||||
}
|
||||
public void setFeeLimitSun(Long feeLimitSun)
|
||||
{
|
||||
this.feeLimitSun = feeLimitSun;
|
||||
}
|
||||
|
||||
public Long getFeeLimitSun()
|
||||
{
|
||||
return feeLimitSun;
|
||||
}
|
||||
public void setCredentialId(Long credentialId)
|
||||
{
|
||||
this.credentialId = credentialId;
|
||||
}
|
||||
|
||||
public Long getCredentialId()
|
||||
{
|
||||
return credentialId;
|
||||
}
|
||||
public void setNonce(String nonce)
|
||||
{
|
||||
this.nonce = nonce;
|
||||
}
|
||||
|
||||
public String getNonce()
|
||||
{
|
||||
return nonce;
|
||||
}
|
||||
public void setSignedAt(Date signedAt)
|
||||
{
|
||||
this.signedAt = signedAt;
|
||||
}
|
||||
|
||||
public Date getSignedAt()
|
||||
{
|
||||
return signedAt;
|
||||
}
|
||||
public void setDeadline(Date deadline)
|
||||
{
|
||||
this.deadline = deadline;
|
||||
}
|
||||
|
||||
public Date getDeadline()
|
||||
{
|
||||
return deadline;
|
||||
}
|
||||
public void setIntent(String intent)
|
||||
{
|
||||
this.intent = intent;
|
||||
}
|
||||
|
||||
public String getIntent()
|
||||
{
|
||||
return intent;
|
||||
}
|
||||
public void setSignature(String signature)
|
||||
{
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public String getSignature()
|
||||
{
|
||||
return signature;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setReservationStatus(String reservationStatus)
|
||||
{
|
||||
this.reservationStatus = reservationStatus;
|
||||
}
|
||||
|
||||
public String getReservationStatus()
|
||||
{
|
||||
return reservationStatus;
|
||||
}
|
||||
public void setLeaseOwner(String leaseOwner)
|
||||
{
|
||||
this.leaseOwner = leaseOwner;
|
||||
}
|
||||
|
||||
public String getLeaseOwner()
|
||||
{
|
||||
return leaseOwner;
|
||||
}
|
||||
public void setLeaseUntil(Date leaseUntil)
|
||||
{
|
||||
this.leaseUntil = leaseUntil;
|
||||
}
|
||||
|
||||
public Date getLeaseUntil()
|
||||
{
|
||||
return leaseUntil;
|
||||
}
|
||||
public void setAcceptedAt(Date acceptedAt)
|
||||
{
|
||||
this.acceptedAt = acceptedAt;
|
||||
}
|
||||
|
||||
public Date getAcceptedAt()
|
||||
{
|
||||
return acceptedAt;
|
||||
}
|
||||
public void setDeliveryMessageId(String deliveryMessageId)
|
||||
{
|
||||
this.deliveryMessageId = deliveryMessageId;
|
||||
}
|
||||
|
||||
public String getDeliveryMessageId()
|
||||
{
|
||||
return deliveryMessageId;
|
||||
}
|
||||
public void setDeliverySessionEpoch(Long deliverySessionEpoch)
|
||||
{
|
||||
this.deliverySessionEpoch = deliverySessionEpoch;
|
||||
}
|
||||
|
||||
public Long getDeliverySessionEpoch()
|
||||
{
|
||||
return deliverySessionEpoch;
|
||||
}
|
||||
public void setDeliveryCount(Long deliveryCount)
|
||||
{
|
||||
this.deliveryCount = deliveryCount;
|
||||
}
|
||||
|
||||
public Long getDeliveryCount()
|
||||
{
|
||||
return deliveryCount;
|
||||
}
|
||||
public void setLastSentAt(Date lastSentAt)
|
||||
{
|
||||
this.lastSentAt = lastSentAt;
|
||||
}
|
||||
|
||||
public Date getLastSentAt()
|
||||
{
|
||||
return lastSentAt;
|
||||
}
|
||||
public void setDeliveryAckedAt(Date deliveryAckedAt)
|
||||
{
|
||||
this.deliveryAckedAt = deliveryAckedAt;
|
||||
}
|
||||
|
||||
public Date getDeliveryAckedAt()
|
||||
{
|
||||
return deliveryAckedAt;
|
||||
}
|
||||
public void setNextCheckAt(Date nextCheckAt)
|
||||
{
|
||||
this.nextCheckAt = nextCheckAt;
|
||||
}
|
||||
|
||||
public Date getNextCheckAt()
|
||||
{
|
||||
return nextCheckAt;
|
||||
}
|
||||
public void setError(String error)
|
||||
{
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public String getError()
|
||||
{
|
||||
return error;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskNo", getTaskNo())
|
||||
.append("orderId", getOrderId())
|
||||
.append("walletId", getWalletId())
|
||||
.append("nodeId", getNodeId())
|
||||
.append("network", getNetwork())
|
||||
.append("sourceTransactionId", getSourceTransactionId())
|
||||
.append("walletExecutionSlot", getWalletExecutionSlot())
|
||||
.append("taskType", getTaskType())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("resourceQuantity", getResourceQuantity())
|
||||
.append("targetResourceQuantity", getTargetResourceQuantity())
|
||||
.append("conversionTotalLimit", getConversionTotalLimit())
|
||||
.append("conversionTotalWeight", getConversionTotalWeight())
|
||||
.append("conversionBlockHeight", getConversionBlockHeight())
|
||||
.append("conversionAt", getConversionAt())
|
||||
.append("estimatedResourceQuantity", getEstimatedResourceQuantity())
|
||||
.append("attemptNo", getAttemptNo())
|
||||
.append("activeSlot", getActiveSlot())
|
||||
.append("delegateSun", getDelegateSun())
|
||||
.append("feeLimitSun", getFeeLimitSun())
|
||||
.append("credentialId", getCredentialId())
|
||||
.append("nonce", getNonce())
|
||||
.append("signedAt", getSignedAt())
|
||||
.append("deadline", getDeadline())
|
||||
.append("intent", getIntent())
|
||||
.append("signature", getSignature())
|
||||
.append("status", getStatus())
|
||||
.append("reservationStatus", getReservationStatus())
|
||||
.append("leaseOwner", getLeaseOwner())
|
||||
.append("leaseUntil", getLeaseUntil())
|
||||
.append("acceptedAt", getAcceptedAt())
|
||||
.append("deliveryMessageId", getDeliveryMessageId())
|
||||
.append("deliverySessionEpoch", getDeliverySessionEpoch())
|
||||
.append("deliveryCount", getDeliveryCount())
|
||||
.append("lastSentAt", getLastSentAt())
|
||||
.append("deliveryAckedAt", getDeliveryAckedAt())
|
||||
.append("nextCheckAt", getNextCheckAt())
|
||||
.append("error", getError())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,584 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 委托或回收任务,兼作持久队列与资源预留明细对象 rent_task
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_task")
|
||||
public class RentTaskPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 任务编号 */
|
||||
@Excel(name = "任务编号")
|
||||
private String taskNo;
|
||||
/** rent_order.id */
|
||||
@Excel(name = "rent_order.id")
|
||||
private Long orderId;
|
||||
/** rent_wallet.id */
|
||||
@Excel(name = "rent_wallet.id")
|
||||
private Long walletId;
|
||||
/** rent_node.id */
|
||||
@Excel(name = "rent_node.id")
|
||||
private Long nodeId;
|
||||
/** 与订单钱包及实际链上交易一致的网络,纳入HMAC */
|
||||
@Excel(name = "与订单钱包及实际链上交易一致的网络,纳入HMAC")
|
||||
private String network;
|
||||
/** RECLAIM必须指向原已确认DELEGATE的rent_transaction.id;DELEGATE为空,不允许回收任务引用回收交易 */
|
||||
@Excel(name = "RECLAIM必须指向原已确认DELEGATE的rent_transaction.id;DELEGATE为空,不允许回收任务引用回收交易")
|
||||
private Long sourceTransactionId;
|
||||
/** 同钱包同资源类型最多一个在途链上操作;未知保留1,终结且写入快照屏障后置NULL;与订单地址对占位独立 */
|
||||
@Excel(name = "同钱包同资源类型最多一个在途链上操作;未知保留1,终结且写入快照屏障后置NULL;与订单地址对占位独立")
|
||||
private Integer walletExecutionSlot;
|
||||
/** DELEGATE委托、RECLAIM回收,不支持转账 */
|
||||
@Excel(name = "DELEGATE委托、RECLAIM回收,不支持转账")
|
||||
private String taskType;
|
||||
/** 资源类型:ENERGY或BANDWIDTH,必须与订单及链上交易一致并纳入HMAC */
|
||||
@Excel(name = "资源类型:ENERGY或BANDWIDTH,必须与订单及链上交易一致并纳入HMAC")
|
||||
private String resourceType;
|
||||
/** 本任务资源数量快照:ENERGY单位Energy、BANDWIDTH单位bytes,不得跨类型换算 */
|
||||
@Excel(name = "本任务资源数量快照:ENERGY单位Energy、BANDWIDTH单位bytes,不得跨类型换算")
|
||||
private Long resourceQuantity;
|
||||
/** 原订单含冗余目标快照;委托必须覆盖该量,回收任务仅用于追溯原委托目标 */
|
||||
@Excel(name = "原订单含冗余目标快照;委托必须覆盖该量,回收任务仅用于追溯原委托目标")
|
||||
private Long targetResourceQuantity;
|
||||
/** 换算时该资源全网总额度:ENERGY为Energy,BANDWIDTH为质押带宽bytes,必须大于0 */
|
||||
@Excel(name = "换算时该资源全网总额度:ENERGY为Energy,BANDWIDTH为质押带宽bytes,必须大于0")
|
||||
private Long conversionTotalLimit;
|
||||
/** 换算时该资源全网总权重,单位为协议TRX权重,不能当作SUN;必须大于0 */
|
||||
@Excel(name = "换算时该资源全网总权重,单位为协议TRX权重,不能当作SUN;必须大于0")
|
||||
private Long conversionTotalWeight;
|
||||
/** 可信换算查询对应区块高度,结合时间检查快照有效期 */
|
||||
@Excel(name = "可信换算查询对应区块高度,结合时间检查快照有效期")
|
||||
private Long conversionBlockHeight;
|
||||
/** 本次换算参数查询UTC时间,Agent签名前必须重新检查参数及额度 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "本次换算参数查询UTC时间,Agent签名前必须重新检查参数及额度", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date conversionAt;
|
||||
/** 按本次换算参数和delegate_sun向下计算的资源量,委托任务必须不小于target_resource_quantity */
|
||||
@Excel(name = "按本次换算参数和delegate_sun向下计算的资源量,委托任务必须不小于target_resource_quantity")
|
||||
private Long estimatedResourceQuantity;
|
||||
/** 同订单同类型的尝试序号 */
|
||||
@Excel(name = "同订单同类型的尝试序号")
|
||||
private Long attemptNo;
|
||||
/** 有效或已成功取1,仅明确未执行失败可置NULL;UNKNOWN不得释放 */
|
||||
@Excel(name = "有效或已成功取1,仅明确未执行失败可置NULL;UNKNOWN不得释放")
|
||||
private Integer activeSlot;
|
||||
/** 委托本金SUN=ceil(目标资源量乘全网权重除全网额度)乘1000000,TRX向上取整;回收取原确认本金,禁止重新按资源量换算 */
|
||||
@Excel(name = "委托本金SUN=ceil(目标资源量乘全网权重除全网额度)乘1000000,TRX向上取整;回收取原确认本金,禁止重新按资源量换算")
|
||||
private Long delegateSun;
|
||||
/** 本地操作费用预算SUN;按当前网络费用、签名权限及资源评估,不作为协议fee_limit硬上限 */
|
||||
@Excel(name = "本地操作费用预算SUN;按当前网络费用、签名权限及资源评估,不作为协议fee_limit硬上限")
|
||||
private Long feeLimitSun;
|
||||
/** 目标节点rent_credential.id */
|
||||
@Excel(name = "目标节点rent_credential.id")
|
||||
private Long credentialId;
|
||||
/** 任务防重放随机数 */
|
||||
@Excel(name = "任务防重放随机数")
|
||||
private String nonce;
|
||||
/** HMAC签发UTC时间,按Unix毫秒参与签名 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "HMAC签发UTC时间,按Unix毫秒参与签名", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date signedAt;
|
||||
/** 允许新签名及新广播截止UTC时间;委托不晚于订单dispatch_deadline,回收使用独立有效期;过期仍允许原交易核对 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "允许新签名及新广播截止UTC时间;委托不晚于订单dispatch_deadline,回收使用独立有效期;过期仍允许原交易核对", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date deadline;
|
||||
/** RENT_TASK_V2冻结意图:网络、类型、请求及目标、换算证据、精确本金SUN、owner/receiver、非锁定、预算、期限、节点、原委托来源及txId,全部纳入HMAC且与标量字段一致 */
|
||||
@Excel(name = "RENT_TASK_V2冻结意图:网络、类型、请求及目标、换算证据、精确本金SUN、owner/receiver、非锁定、预算、期限、节点、原委托来源及txId,全部纳入HMAC且与标量字段一致")
|
||||
private String intent;
|
||||
/** TASK域的HMAC-SHA256小写十六进制,不含自身 */
|
||||
@Excel(name = "TASK域的HMAC-SHA256小写十六进制,不含自身")
|
||||
private String signature;
|
||||
/** PENDING待接单、ACCEPTED接受、BROADCASTED已广播、VERIFIED核验成功、REJECTED明确未执行拒绝、FAILED明确失败、UNKNOWN未知 */
|
||||
@Excel(name = "PENDING待接单、ACCEPTED接受、BROADCASTED已广播、VERIFIED核验成功、REJECTED明确未执行拒绝、FAILED明确失败、UNKNOWN未知")
|
||||
private String status;
|
||||
/** 委托资源占用HELD、COMMITTED、RELEASED;未知委托保持HELD;回收任务固定NONE,不新增可委托本金预留 */
|
||||
@Excel(name = "委托资源占用HELD、COMMITTED、RELEASED;未知委托保持HELD;回收任务固定NONE,不新增可委托本金预留")
|
||||
private String reservationStatus;
|
||||
/** 云端worker抢占标识,非节点身份 */
|
||||
@Excel(name = "云端worker抢占标识,非节点身份")
|
||||
private String leaseOwner;
|
||||
/** worker租约截止,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "worker租约截止,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date leaseUntil;
|
||||
/** 节点接受时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "节点接受时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date acceptedAt;
|
||||
/** 本逻辑任务推送的稳定消息编号,重发保持不变;仅新业务任务使用新编号 */
|
||||
@Excel(name = "本逻辑任务推送的稳定消息编号,重发保持不变;仅新业务任务使用新编号")
|
||||
private String deliveryMessageId;
|
||||
/** 最近推送所用节点会话代次,重连重新投递时更新;不修改原任务签名意图 */
|
||||
@Excel(name = "最近推送所用节点会话代次,重连重新投递时更新;不修改原任务签名意图")
|
||||
private Long deliverySessionEpoch;
|
||||
/** Socket任务发送次数,仅表示投递尝试,不是链上执行次数 */
|
||||
@Excel(name = "Socket任务发送次数,仅表示投递尝试,不是链上执行次数")
|
||||
private Long deliveryCount;
|
||||
/** 最近一次向节点写入任务帧的UTC时间,不代表对端已持久化 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最近一次向节点写入任务帧的UTC时间,不代表对端已持久化", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date lastSentAt;
|
||||
/** 节点本地持久化任务后返回接收ACK的云端UTC时间,不代表接受、广播或执行成功 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "节点本地持久化任务后返回接收ACK的云端UTC时间,不代表接受、广播或执行成功", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date deliveryAckedAt;
|
||||
/** 下次处理时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次处理时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextCheckAt;
|
||||
/** 脱敏原因 */
|
||||
@Excel(name = "脱敏原因")
|
||||
private String error;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setTaskNo(String taskNo)
|
||||
{
|
||||
this.taskNo = taskNo;
|
||||
}
|
||||
|
||||
public String getTaskNo()
|
||||
{
|
||||
return taskNo;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setWalletId(Long walletId)
|
||||
{
|
||||
this.walletId = walletId;
|
||||
}
|
||||
|
||||
public Long getWalletId()
|
||||
{
|
||||
return walletId;
|
||||
}
|
||||
public void setNodeId(Long nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public Long getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setSourceTransactionId(Long sourceTransactionId)
|
||||
{
|
||||
this.sourceTransactionId = sourceTransactionId;
|
||||
}
|
||||
|
||||
public Long getSourceTransactionId()
|
||||
{
|
||||
return sourceTransactionId;
|
||||
}
|
||||
public void setWalletExecutionSlot(Integer walletExecutionSlot)
|
||||
{
|
||||
this.walletExecutionSlot = walletExecutionSlot;
|
||||
}
|
||||
|
||||
public Integer getWalletExecutionSlot()
|
||||
{
|
||||
return walletExecutionSlot;
|
||||
}
|
||||
public void setTaskType(String taskType)
|
||||
{
|
||||
this.taskType = taskType;
|
||||
}
|
||||
|
||||
public String getTaskType()
|
||||
{
|
||||
return taskType;
|
||||
}
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
public void setResourceQuantity(Long resourceQuantity)
|
||||
{
|
||||
this.resourceQuantity = resourceQuantity;
|
||||
}
|
||||
|
||||
public Long getResourceQuantity()
|
||||
{
|
||||
return resourceQuantity;
|
||||
}
|
||||
public void setTargetResourceQuantity(Long targetResourceQuantity)
|
||||
{
|
||||
this.targetResourceQuantity = targetResourceQuantity;
|
||||
}
|
||||
|
||||
public Long getTargetResourceQuantity()
|
||||
{
|
||||
return targetResourceQuantity;
|
||||
}
|
||||
public void setConversionTotalLimit(Long conversionTotalLimit)
|
||||
{
|
||||
this.conversionTotalLimit = conversionTotalLimit;
|
||||
}
|
||||
|
||||
public Long getConversionTotalLimit()
|
||||
{
|
||||
return conversionTotalLimit;
|
||||
}
|
||||
public void setConversionTotalWeight(Long conversionTotalWeight)
|
||||
{
|
||||
this.conversionTotalWeight = conversionTotalWeight;
|
||||
}
|
||||
|
||||
public Long getConversionTotalWeight()
|
||||
{
|
||||
return conversionTotalWeight;
|
||||
}
|
||||
public void setConversionBlockHeight(Long conversionBlockHeight)
|
||||
{
|
||||
this.conversionBlockHeight = conversionBlockHeight;
|
||||
}
|
||||
|
||||
public Long getConversionBlockHeight()
|
||||
{
|
||||
return conversionBlockHeight;
|
||||
}
|
||||
public void setConversionAt(Date conversionAt)
|
||||
{
|
||||
this.conversionAt = conversionAt;
|
||||
}
|
||||
|
||||
public Date getConversionAt()
|
||||
{
|
||||
return conversionAt;
|
||||
}
|
||||
public void setEstimatedResourceQuantity(Long estimatedResourceQuantity)
|
||||
{
|
||||
this.estimatedResourceQuantity = estimatedResourceQuantity;
|
||||
}
|
||||
|
||||
public Long getEstimatedResourceQuantity()
|
||||
{
|
||||
return estimatedResourceQuantity;
|
||||
}
|
||||
public void setAttemptNo(Long attemptNo)
|
||||
{
|
||||
this.attemptNo = attemptNo;
|
||||
}
|
||||
|
||||
public Long getAttemptNo()
|
||||
{
|
||||
return attemptNo;
|
||||
}
|
||||
public void setActiveSlot(Integer activeSlot)
|
||||
{
|
||||
this.activeSlot = activeSlot;
|
||||
}
|
||||
|
||||
public Integer getActiveSlot()
|
||||
{
|
||||
return activeSlot;
|
||||
}
|
||||
public void setDelegateSun(Long delegateSun)
|
||||
{
|
||||
this.delegateSun = delegateSun;
|
||||
}
|
||||
|
||||
public Long getDelegateSun()
|
||||
{
|
||||
return delegateSun;
|
||||
}
|
||||
public void setFeeLimitSun(Long feeLimitSun)
|
||||
{
|
||||
this.feeLimitSun = feeLimitSun;
|
||||
}
|
||||
|
||||
public Long getFeeLimitSun()
|
||||
{
|
||||
return feeLimitSun;
|
||||
}
|
||||
public void setCredentialId(Long credentialId)
|
||||
{
|
||||
this.credentialId = credentialId;
|
||||
}
|
||||
|
||||
public Long getCredentialId()
|
||||
{
|
||||
return credentialId;
|
||||
}
|
||||
public void setNonce(String nonce)
|
||||
{
|
||||
this.nonce = nonce;
|
||||
}
|
||||
|
||||
public String getNonce()
|
||||
{
|
||||
return nonce;
|
||||
}
|
||||
public void setSignedAt(Date signedAt)
|
||||
{
|
||||
this.signedAt = signedAt;
|
||||
}
|
||||
|
||||
public Date getSignedAt()
|
||||
{
|
||||
return signedAt;
|
||||
}
|
||||
public void setDeadline(Date deadline)
|
||||
{
|
||||
this.deadline = deadline;
|
||||
}
|
||||
|
||||
public Date getDeadline()
|
||||
{
|
||||
return deadline;
|
||||
}
|
||||
public void setIntent(String intent)
|
||||
{
|
||||
this.intent = intent;
|
||||
}
|
||||
|
||||
public String getIntent()
|
||||
{
|
||||
return intent;
|
||||
}
|
||||
public void setSignature(String signature)
|
||||
{
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public String getSignature()
|
||||
{
|
||||
return signature;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setReservationStatus(String reservationStatus)
|
||||
{
|
||||
this.reservationStatus = reservationStatus;
|
||||
}
|
||||
|
||||
public String getReservationStatus()
|
||||
{
|
||||
return reservationStatus;
|
||||
}
|
||||
public void setLeaseOwner(String leaseOwner)
|
||||
{
|
||||
this.leaseOwner = leaseOwner;
|
||||
}
|
||||
|
||||
public String getLeaseOwner()
|
||||
{
|
||||
return leaseOwner;
|
||||
}
|
||||
public void setLeaseUntil(Date leaseUntil)
|
||||
{
|
||||
this.leaseUntil = leaseUntil;
|
||||
}
|
||||
|
||||
public Date getLeaseUntil()
|
||||
{
|
||||
return leaseUntil;
|
||||
}
|
||||
public void setAcceptedAt(Date acceptedAt)
|
||||
{
|
||||
this.acceptedAt = acceptedAt;
|
||||
}
|
||||
|
||||
public Date getAcceptedAt()
|
||||
{
|
||||
return acceptedAt;
|
||||
}
|
||||
public void setDeliveryMessageId(String deliveryMessageId)
|
||||
{
|
||||
this.deliveryMessageId = deliveryMessageId;
|
||||
}
|
||||
|
||||
public String getDeliveryMessageId()
|
||||
{
|
||||
return deliveryMessageId;
|
||||
}
|
||||
public void setDeliverySessionEpoch(Long deliverySessionEpoch)
|
||||
{
|
||||
this.deliverySessionEpoch = deliverySessionEpoch;
|
||||
}
|
||||
|
||||
public Long getDeliverySessionEpoch()
|
||||
{
|
||||
return deliverySessionEpoch;
|
||||
}
|
||||
public void setDeliveryCount(Long deliveryCount)
|
||||
{
|
||||
this.deliveryCount = deliveryCount;
|
||||
}
|
||||
|
||||
public Long getDeliveryCount()
|
||||
{
|
||||
return deliveryCount;
|
||||
}
|
||||
public void setLastSentAt(Date lastSentAt)
|
||||
{
|
||||
this.lastSentAt = lastSentAt;
|
||||
}
|
||||
|
||||
public Date getLastSentAt()
|
||||
{
|
||||
return lastSentAt;
|
||||
}
|
||||
public void setDeliveryAckedAt(Date deliveryAckedAt)
|
||||
{
|
||||
this.deliveryAckedAt = deliveryAckedAt;
|
||||
}
|
||||
|
||||
public Date getDeliveryAckedAt()
|
||||
{
|
||||
return deliveryAckedAt;
|
||||
}
|
||||
public void setNextCheckAt(Date nextCheckAt)
|
||||
{
|
||||
this.nextCheckAt = nextCheckAt;
|
||||
}
|
||||
|
||||
public Date getNextCheckAt()
|
||||
{
|
||||
return nextCheckAt;
|
||||
}
|
||||
public void setError(String error)
|
||||
{
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public String getError()
|
||||
{
|
||||
return error;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskNo", getTaskNo())
|
||||
.append("orderId", getOrderId())
|
||||
.append("walletId", getWalletId())
|
||||
.append("nodeId", getNodeId())
|
||||
.append("network", getNetwork())
|
||||
.append("sourceTransactionId", getSourceTransactionId())
|
||||
.append("walletExecutionSlot", getWalletExecutionSlot())
|
||||
.append("taskType", getTaskType())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("resourceQuantity", getResourceQuantity())
|
||||
.append("targetResourceQuantity", getTargetResourceQuantity())
|
||||
.append("conversionTotalLimit", getConversionTotalLimit())
|
||||
.append("conversionTotalWeight", getConversionTotalWeight())
|
||||
.append("conversionBlockHeight", getConversionBlockHeight())
|
||||
.append("conversionAt", getConversionAt())
|
||||
.append("estimatedResourceQuantity", getEstimatedResourceQuantity())
|
||||
.append("attemptNo", getAttemptNo())
|
||||
.append("activeSlot", getActiveSlot())
|
||||
.append("delegateSun", getDelegateSun())
|
||||
.append("feeLimitSun", getFeeLimitSun())
|
||||
.append("credentialId", getCredentialId())
|
||||
.append("nonce", getNonce())
|
||||
.append("signedAt", getSignedAt())
|
||||
.append("deadline", getDeadline())
|
||||
.append("intent", getIntent())
|
||||
.append("signature", getSignature())
|
||||
.append("status", getStatus())
|
||||
.append("reservationStatus", getReservationStatus())
|
||||
.append("leaseOwner", getLeaseOwner())
|
||||
.append("leaseUntil", getLeaseUntil())
|
||||
.append("acceptedAt", getAcceptedAt())
|
||||
.append("deliveryMessageId", getDeliveryMessageId())
|
||||
.append("deliverySessionEpoch", getDeliverySessionEpoch())
|
||||
.append("deliveryCount", getDeliveryCount())
|
||||
.append("lastSentAt", getLastSentAt())
|
||||
.append("deliveryAckedAt", getDeliveryAckedAt())
|
||||
.append("nextCheckAt", getNextCheckAt())
|
||||
.append("error", getError())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 链上委托或回收证据;一任务只能构建一笔交易对象 rent_transaction
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentTransaction extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** rent_task.id */
|
||||
@Excel(name = "rent_task.id")
|
||||
private Long taskId;
|
||||
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
|
||||
/** 链上交易哈希 */
|
||||
@Excel(name = "链上交易哈希")
|
||||
private String txId;
|
||||
|
||||
/** 实际资源owner,TRON Base58Check地址 */
|
||||
@Excel(name = "实际资源owner,TRON Base58Check地址")
|
||||
private String ownerAddress;
|
||||
|
||||
/** 实际receiver,TRON Base58Check地址 */
|
||||
@Excel(name = "实际receiver,TRON Base58Check地址")
|
||||
private String receiverAddress;
|
||||
|
||||
/** DELEGATE委托、RECLAIM撤销 */
|
||||
@Excel(name = "DELEGATE委托、RECLAIM撤销")
|
||||
private String transactionType;
|
||||
|
||||
/** 实际链上资源类型:ENERGY对应resource_code=1、BANDWIDTH对应resource_code=0,独立核验 */
|
||||
@Excel(name = "实际链上资源类型:ENERGY对应resource_code=1、BANDWIDTH对应resource_code=0,独立核验")
|
||||
private String resourceType;
|
||||
|
||||
/** 链上实际本金SUN */
|
||||
@Excel(name = "链上实际本金SUN")
|
||||
private Long amountSun;
|
||||
|
||||
/** 独立核验区块该资源全网额度,确认前可空,确认委托时必须有有效正值 */
|
||||
@Excel(name = "独立核验区块该资源全网额度,确认前可空,确认委托时必须有有效正值")
|
||||
private Long verifiedTotalLimit;
|
||||
|
||||
/** 独立核验区块该资源全网TRX权重,确认前可空,不能与SUN混用 */
|
||||
@Excel(name = "独立核验区块该资源全网TRX权重,确认前可空,不能与SUN混用")
|
||||
private Long verifiedTotalWeight;
|
||||
|
||||
/** 实际本金对应资源额度;不足目标仍保留真实值并确认链上事实,但订单转人工不能记履约成功;撤销不作新交付 */
|
||||
@Excel(name = "实际本金对应资源额度;不足目标仍保留真实值并确认链上事实,但订单转人工不能记履约成功;撤销不作新交付")
|
||||
private Long verifiedResourceQuantity;
|
||||
|
||||
/** 执行前同owner/receiver及相同resource_type的委托本金SUN,能量带宽分别计算 */
|
||||
@Excel(name = "执行前同owner/receiver及相同resource_type的委托本金SUN,能量带宽分别计算")
|
||||
private Long baselineSun;
|
||||
|
||||
/** 核验后同地址对及相同resource_type的本金SUN,不混入另一资源类型 */
|
||||
@Excel(name = "核验后同地址对及相同resource_type的本金SUN,不混入另一资源类型")
|
||||
private Long afterSun;
|
||||
|
||||
/** 确认区块高度 */
|
||||
@Excel(name = "确认区块高度")
|
||||
private Long blockHeight;
|
||||
|
||||
/** 交易所在确认区块UTC时间,独立查询,用于委托服务起点及到期判断 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "交易所在确认区块UTC时间,独立查询,用于委托服务起点及到期判断", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date blockTime;
|
||||
|
||||
/** REPORTED已报、CONFIRMED已独立核验、FAILED已证实失败、UNKNOWN未知 */
|
||||
@Excel(name = "REPORTED已报、CONFIRMED已独立核验、FAILED已证实失败、UNKNOWN未知")
|
||||
private String status;
|
||||
|
||||
/** 云端回执、交易参数、前后关系及确认规则证据,不含密钥 */
|
||||
@Excel(name = "云端回执、交易参数、前后关系及确认规则证据,不含密钥")
|
||||
private String evidence;
|
||||
|
||||
/** 原签名交易过期时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "原签名交易过期时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expiresAt;
|
||||
|
||||
/** 独立确认时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "独立确认时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date confirmedAt;
|
||||
|
||||
/** 下次链上核对,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次链上核对,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextCheckAt;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setTxId(String txId)
|
||||
{
|
||||
this.txId = txId;
|
||||
}
|
||||
|
||||
public String getTxId()
|
||||
{
|
||||
return txId;
|
||||
}
|
||||
public void setOwnerAddress(String ownerAddress)
|
||||
{
|
||||
this.ownerAddress = ownerAddress;
|
||||
}
|
||||
|
||||
public String getOwnerAddress()
|
||||
{
|
||||
return ownerAddress;
|
||||
}
|
||||
public void setReceiverAddress(String receiverAddress)
|
||||
{
|
||||
this.receiverAddress = receiverAddress;
|
||||
}
|
||||
|
||||
public String getReceiverAddress()
|
||||
{
|
||||
return receiverAddress;
|
||||
}
|
||||
public void setTransactionType(String transactionType)
|
||||
{
|
||||
this.transactionType = transactionType;
|
||||
}
|
||||
|
||||
public String getTransactionType()
|
||||
{
|
||||
return transactionType;
|
||||
}
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
public void setAmountSun(Long amountSun)
|
||||
{
|
||||
this.amountSun = amountSun;
|
||||
}
|
||||
|
||||
public Long getAmountSun()
|
||||
{
|
||||
return amountSun;
|
||||
}
|
||||
public void setVerifiedTotalLimit(Long verifiedTotalLimit)
|
||||
{
|
||||
this.verifiedTotalLimit = verifiedTotalLimit;
|
||||
}
|
||||
|
||||
public Long getVerifiedTotalLimit()
|
||||
{
|
||||
return verifiedTotalLimit;
|
||||
}
|
||||
public void setVerifiedTotalWeight(Long verifiedTotalWeight)
|
||||
{
|
||||
this.verifiedTotalWeight = verifiedTotalWeight;
|
||||
}
|
||||
|
||||
public Long getVerifiedTotalWeight()
|
||||
{
|
||||
return verifiedTotalWeight;
|
||||
}
|
||||
public void setVerifiedResourceQuantity(Long verifiedResourceQuantity)
|
||||
{
|
||||
this.verifiedResourceQuantity = verifiedResourceQuantity;
|
||||
}
|
||||
|
||||
public Long getVerifiedResourceQuantity()
|
||||
{
|
||||
return verifiedResourceQuantity;
|
||||
}
|
||||
public void setBaselineSun(Long baselineSun)
|
||||
{
|
||||
this.baselineSun = baselineSun;
|
||||
}
|
||||
|
||||
public Long getBaselineSun()
|
||||
{
|
||||
return baselineSun;
|
||||
}
|
||||
public void setAfterSun(Long afterSun)
|
||||
{
|
||||
this.afterSun = afterSun;
|
||||
}
|
||||
|
||||
public Long getAfterSun()
|
||||
{
|
||||
return afterSun;
|
||||
}
|
||||
public void setBlockHeight(Long blockHeight)
|
||||
{
|
||||
this.blockHeight = blockHeight;
|
||||
}
|
||||
|
||||
public Long getBlockHeight()
|
||||
{
|
||||
return blockHeight;
|
||||
}
|
||||
public void setBlockTime(Date blockTime)
|
||||
{
|
||||
this.blockTime = blockTime;
|
||||
}
|
||||
|
||||
public Date getBlockTime()
|
||||
{
|
||||
return blockTime;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setEvidence(String evidence)
|
||||
{
|
||||
this.evidence = evidence;
|
||||
}
|
||||
|
||||
public String getEvidence()
|
||||
{
|
||||
return evidence;
|
||||
}
|
||||
public void setExpiresAt(Date expiresAt)
|
||||
{
|
||||
this.expiresAt = expiresAt;
|
||||
}
|
||||
|
||||
public Date getExpiresAt()
|
||||
{
|
||||
return expiresAt;
|
||||
}
|
||||
public void setConfirmedAt(Date confirmedAt)
|
||||
{
|
||||
this.confirmedAt = confirmedAt;
|
||||
}
|
||||
|
||||
public Date getConfirmedAt()
|
||||
{
|
||||
return confirmedAt;
|
||||
}
|
||||
public void setNextCheckAt(Date nextCheckAt)
|
||||
{
|
||||
this.nextCheckAt = nextCheckAt;
|
||||
}
|
||||
|
||||
public Date getNextCheckAt()
|
||||
{
|
||||
return nextCheckAt;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("network", getNetwork())
|
||||
.append("txId", getTxId())
|
||||
.append("ownerAddress", getOwnerAddress())
|
||||
.append("receiverAddress", getReceiverAddress())
|
||||
.append("transactionType", getTransactionType())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("amountSun", getAmountSun())
|
||||
.append("verifiedTotalLimit", getVerifiedTotalLimit())
|
||||
.append("verifiedTotalWeight", getVerifiedTotalWeight())
|
||||
.append("verifiedResourceQuantity", getVerifiedResourceQuantity())
|
||||
.append("baselineSun", getBaselineSun())
|
||||
.append("afterSun", getAfterSun())
|
||||
.append("blockHeight", getBlockHeight())
|
||||
.append("blockTime", getBlockTime())
|
||||
.append("status", getStatus())
|
||||
.append("evidence", getEvidence())
|
||||
.append("expiresAt", getExpiresAt())
|
||||
.append("confirmedAt", getConfirmedAt())
|
||||
.append("nextCheckAt", getNextCheckAt())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 链上委托或回收证据;一任务只能构建一笔交易对象 rent_transaction
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_transaction")
|
||||
public class RentTransactionPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** rent_task.id */
|
||||
@Excel(name = "rent_task.id")
|
||||
private Long taskId;
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
/** 链上交易哈希 */
|
||||
@Excel(name = "链上交易哈希")
|
||||
private String txId;
|
||||
/** 实际资源owner,TRON Base58Check地址 */
|
||||
@Excel(name = "实际资源owner,TRON Base58Check地址")
|
||||
private String ownerAddress;
|
||||
/** 实际receiver,TRON Base58Check地址 */
|
||||
@Excel(name = "实际receiver,TRON Base58Check地址")
|
||||
private String receiverAddress;
|
||||
/** DELEGATE委托、RECLAIM撤销 */
|
||||
@Excel(name = "DELEGATE委托、RECLAIM撤销")
|
||||
private String transactionType;
|
||||
/** 实际链上资源类型:ENERGY对应resource_code=1、BANDWIDTH对应resource_code=0,独立核验 */
|
||||
@Excel(name = "实际链上资源类型:ENERGY对应resource_code=1、BANDWIDTH对应resource_code=0,独立核验")
|
||||
private String resourceType;
|
||||
/** 链上实际本金SUN */
|
||||
@Excel(name = "链上实际本金SUN")
|
||||
private Long amountSun;
|
||||
/** 独立核验区块该资源全网额度,确认前可空,确认委托时必须有有效正值 */
|
||||
@Excel(name = "独立核验区块该资源全网额度,确认前可空,确认委托时必须有有效正值")
|
||||
private Long verifiedTotalLimit;
|
||||
/** 独立核验区块该资源全网TRX权重,确认前可空,不能与SUN混用 */
|
||||
@Excel(name = "独立核验区块该资源全网TRX权重,确认前可空,不能与SUN混用")
|
||||
private Long verifiedTotalWeight;
|
||||
/** 实际本金对应资源额度;不足目标仍保留真实值并确认链上事实,但订单转人工不能记履约成功;撤销不作新交付 */
|
||||
@Excel(name = "实际本金对应资源额度;不足目标仍保留真实值并确认链上事实,但订单转人工不能记履约成功;撤销不作新交付")
|
||||
private Long verifiedResourceQuantity;
|
||||
/** 执行前同owner/receiver及相同resource_type的委托本金SUN,能量带宽分别计算 */
|
||||
@Excel(name = "执行前同owner/receiver及相同resource_type的委托本金SUN,能量带宽分别计算")
|
||||
private Long baselineSun;
|
||||
/** 核验后同地址对及相同resource_type的本金SUN,不混入另一资源类型 */
|
||||
@Excel(name = "核验后同地址对及相同resource_type的本金SUN,不混入另一资源类型")
|
||||
private Long afterSun;
|
||||
/** 确认区块高度 */
|
||||
@Excel(name = "确认区块高度")
|
||||
private Long blockHeight;
|
||||
/** 交易所在确认区块UTC时间,独立查询,用于委托服务起点及到期判断 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "交易所在确认区块UTC时间,独立查询,用于委托服务起点及到期判断", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date blockTime;
|
||||
/** REPORTED已报、CONFIRMED已独立核验、FAILED已证实失败、UNKNOWN未知 */
|
||||
@Excel(name = "REPORTED已报、CONFIRMED已独立核验、FAILED已证实失败、UNKNOWN未知")
|
||||
private String status;
|
||||
/** 云端回执、交易参数、前后关系及确认规则证据,不含密钥 */
|
||||
@Excel(name = "云端回执、交易参数、前后关系及确认规则证据,不含密钥")
|
||||
private String evidence;
|
||||
/** 原签名交易过期时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "原签名交易过期时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expiresAt;
|
||||
/** 独立确认时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "独立确认时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date confirmedAt;
|
||||
/** 下次链上核对,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次链上核对,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextCheckAt;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setTxId(String txId)
|
||||
{
|
||||
this.txId = txId;
|
||||
}
|
||||
|
||||
public String getTxId()
|
||||
{
|
||||
return txId;
|
||||
}
|
||||
public void setOwnerAddress(String ownerAddress)
|
||||
{
|
||||
this.ownerAddress = ownerAddress;
|
||||
}
|
||||
|
||||
public String getOwnerAddress()
|
||||
{
|
||||
return ownerAddress;
|
||||
}
|
||||
public void setReceiverAddress(String receiverAddress)
|
||||
{
|
||||
this.receiverAddress = receiverAddress;
|
||||
}
|
||||
|
||||
public String getReceiverAddress()
|
||||
{
|
||||
return receiverAddress;
|
||||
}
|
||||
public void setTransactionType(String transactionType)
|
||||
{
|
||||
this.transactionType = transactionType;
|
||||
}
|
||||
|
||||
public String getTransactionType()
|
||||
{
|
||||
return transactionType;
|
||||
}
|
||||
public void setResourceType(String resourceType)
|
||||
{
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceType()
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
public void setAmountSun(Long amountSun)
|
||||
{
|
||||
this.amountSun = amountSun;
|
||||
}
|
||||
|
||||
public Long getAmountSun()
|
||||
{
|
||||
return amountSun;
|
||||
}
|
||||
public void setVerifiedTotalLimit(Long verifiedTotalLimit)
|
||||
{
|
||||
this.verifiedTotalLimit = verifiedTotalLimit;
|
||||
}
|
||||
|
||||
public Long getVerifiedTotalLimit()
|
||||
{
|
||||
return verifiedTotalLimit;
|
||||
}
|
||||
public void setVerifiedTotalWeight(Long verifiedTotalWeight)
|
||||
{
|
||||
this.verifiedTotalWeight = verifiedTotalWeight;
|
||||
}
|
||||
|
||||
public Long getVerifiedTotalWeight()
|
||||
{
|
||||
return verifiedTotalWeight;
|
||||
}
|
||||
public void setVerifiedResourceQuantity(Long verifiedResourceQuantity)
|
||||
{
|
||||
this.verifiedResourceQuantity = verifiedResourceQuantity;
|
||||
}
|
||||
|
||||
public Long getVerifiedResourceQuantity()
|
||||
{
|
||||
return verifiedResourceQuantity;
|
||||
}
|
||||
public void setBaselineSun(Long baselineSun)
|
||||
{
|
||||
this.baselineSun = baselineSun;
|
||||
}
|
||||
|
||||
public Long getBaselineSun()
|
||||
{
|
||||
return baselineSun;
|
||||
}
|
||||
public void setAfterSun(Long afterSun)
|
||||
{
|
||||
this.afterSun = afterSun;
|
||||
}
|
||||
|
||||
public Long getAfterSun()
|
||||
{
|
||||
return afterSun;
|
||||
}
|
||||
public void setBlockHeight(Long blockHeight)
|
||||
{
|
||||
this.blockHeight = blockHeight;
|
||||
}
|
||||
|
||||
public Long getBlockHeight()
|
||||
{
|
||||
return blockHeight;
|
||||
}
|
||||
public void setBlockTime(Date blockTime)
|
||||
{
|
||||
this.blockTime = blockTime;
|
||||
}
|
||||
|
||||
public Date getBlockTime()
|
||||
{
|
||||
return blockTime;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setEvidence(String evidence)
|
||||
{
|
||||
this.evidence = evidence;
|
||||
}
|
||||
|
||||
public String getEvidence()
|
||||
{
|
||||
return evidence;
|
||||
}
|
||||
public void setExpiresAt(Date expiresAt)
|
||||
{
|
||||
this.expiresAt = expiresAt;
|
||||
}
|
||||
|
||||
public Date getExpiresAt()
|
||||
{
|
||||
return expiresAt;
|
||||
}
|
||||
public void setConfirmedAt(Date confirmedAt)
|
||||
{
|
||||
this.confirmedAt = confirmedAt;
|
||||
}
|
||||
|
||||
public Date getConfirmedAt()
|
||||
{
|
||||
return confirmedAt;
|
||||
}
|
||||
public void setNextCheckAt(Date nextCheckAt)
|
||||
{
|
||||
this.nextCheckAt = nextCheckAt;
|
||||
}
|
||||
|
||||
public Date getNextCheckAt()
|
||||
{
|
||||
return nextCheckAt;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("network", getNetwork())
|
||||
.append("txId", getTxId())
|
||||
.append("ownerAddress", getOwnerAddress())
|
||||
.append("receiverAddress", getReceiverAddress())
|
||||
.append("transactionType", getTransactionType())
|
||||
.append("resourceType", getResourceType())
|
||||
.append("amountSun", getAmountSun())
|
||||
.append("verifiedTotalLimit", getVerifiedTotalLimit())
|
||||
.append("verifiedTotalWeight", getVerifiedTotalWeight())
|
||||
.append("verifiedResourceQuantity", getVerifiedResourceQuantity())
|
||||
.append("baselineSun", getBaselineSun())
|
||||
.append("afterSun", getAfterSun())
|
||||
.append("blockHeight", getBlockHeight())
|
||||
.append("blockTime", getBlockTime())
|
||||
.append("status", getStatus())
|
||||
.append("evidence", getEvidence())
|
||||
.append("expiresAt", getExpiresAt())
|
||||
.append("confirmedAt", getConfirmedAt())
|
||||
.append("nextCheckAt", getNextCheckAt())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,565 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点对象 rent_wallet
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentWallet extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** rent_node.id,供应商归属由节点user_id取得 */
|
||||
@Excel(name = "rent_node.id,供应商归属由节点user_id取得")
|
||||
private Long nodeId;
|
||||
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
|
||||
/** 资源所有者,TRON Base58Check地址 */
|
||||
@Excel(name = "资源所有者,TRON Base58Check地址")
|
||||
private String address;
|
||||
|
||||
/** PENDING待核验、ACTIVE可调度、PAUSED暂停 */
|
||||
@Excel(name = "PENDING待核验、ACTIVE可调度、PAUSED暂停")
|
||||
private String status;
|
||||
|
||||
/** TRON链上权限编号,与平台HMAC无关 */
|
||||
@Excel(name = "TRON链上权限编号,与平台HMAC无关")
|
||||
private Long permissionId;
|
||||
|
||||
/** 钱包验证方式:TRONLINK_SIGN_MESSAGE_V2,离线消息签名,不广播交易,不使用RSA */
|
||||
@Excel(name = "钱包验证方式:TRONLINK_SIGN_MESSAGE_V2,离线消息签名,不广播交易,不使用RSA")
|
||||
private String ownershipMethod;
|
||||
|
||||
/** 平台生成的高熵一次性随机挑战,绑定登录用户、钱包、网络和业务域;重新签发使旧挑战失效 */
|
||||
@Excel(name = "平台生成的高熵一次性随机挑战,绑定登录用户、钱包、网络和业务域;重新签发使旧挑战失效")
|
||||
private String ownershipChallenge;
|
||||
|
||||
/** 平台生成并保存的完整UTF-8待签文本,含域名、用途、user_id、wallet_id、地址、网络、nonce、签发及到期时间,后端不得信任客户端重建文本 */
|
||||
@Excel(name = "平台生成并保存的完整UTF-8待签文本,含域名、用途、user_id、wallet_id、地址、网络、nonce、签发及到期时间,后端不得信任客户端重建文本")
|
||||
private String ownershipMessage;
|
||||
|
||||
/** TronLink的tronWeb.trx.signMessageV2对上述原文生成的签名;非私钥,仅用于钱包验证,禁止作为交易或API签名复用 */
|
||||
@Excel(name = "TronLink的tronWeb.trx.signMessageV2对上述原文生成的签名;非私钥,仅用于钱包验证,禁止作为交易或API签名复用")
|
||||
private String ownershipSignature;
|
||||
|
||||
/** 后端按TRON消息签名规则恢复并验证的Base58Check地址,必须与address完全一致 */
|
||||
@Excel(name = "后端按TRON消息签名规则恢复并验证的Base58Check地址,必须与address完全一致")
|
||||
private String ownershipVerifiedAddress;
|
||||
|
||||
/** 挑战签发UTC时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "挑战签发UTC时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date challengeIssuedAt;
|
||||
|
||||
/** 控制权证明挑战期限,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "控制权证明挑战期限,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date challengeExpiresAt;
|
||||
|
||||
/** 挑战原子消费UTC时间;非空不可再次使用,签名失败不设置 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "挑战原子消费UTC时间;非空不可再次使用,签名失败不设置", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date challengeConsumedAt;
|
||||
|
||||
/** 钱包离线消息签名验证通过的UTC时间,不等于供应商审核通过或交易权限已具备 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "钱包离线消息签名验证通过的UTC时间,不等于供应商审核通过或交易权限已具备", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date ownershipVerifiedAt;
|
||||
|
||||
/** 签名版本、原文摘要、恢复地址及当前链上权限核验结果,不包含私钥或助记词;历史验证事件写rent_event */
|
||||
@Excel(name = "签名版本、原文摘要、恢复地址及当前链上权限核验结果,不包含私钥或助记词;历史验证事件写rent_event")
|
||||
private String ownershipEvidence;
|
||||
|
||||
/** 可用能量max(0,limit-used),仅查询投影 */
|
||||
@Excel(name = "可用能量max(0,limit-used),仅查询投影")
|
||||
private Long energyAvailable;
|
||||
|
||||
/** 可用质押带宽max(0,limit-used),单位bytes,不含不可出租的免费带宽 */
|
||||
@Excel(name = "可用质押带宽max(0,limit-used),单位bytes,不含不可出租的免费带宽")
|
||||
private Long bandwidthAvailable;
|
||||
|
||||
/** 是否允许出租能量:0关闭、1开启,须本地策略及审核同时允许 */
|
||||
@Excel(name = "是否允许出租能量:0关闭、1开启,须本地策略及审核同时允许")
|
||||
private Integer energyEnabled;
|
||||
|
||||
/** 是否允许出租带宽:0关闭、1开启,须本地策略及审核同时允许 */
|
||||
@Excel(name = "是否允许出租带宽:0关闭、1开启,须本地策略及审核同时允许")
|
||||
private Integer bandwidthEnabled;
|
||||
|
||||
/** 链上能量类型可委托本金SUN,不能用TRX余额或带宽本金替代 */
|
||||
@Excel(name = "链上能量类型可委托本金SUN,不能用TRX余额或带宽本金替代")
|
||||
private Long energyDelegatableSun;
|
||||
|
||||
/** 待执行及未知能量任务预留本金SUN,钱包行锁原子更新 */
|
||||
@Excel(name = "待执行及未知能量任务预留本金SUN,钱包行锁原子更新")
|
||||
private Long energyReservedSun;
|
||||
|
||||
/** 供应商要求保留的能量质押本金SUN */
|
||||
@Excel(name = "供应商要求保留的能量质押本金SUN")
|
||||
private Long energyRetainSun;
|
||||
|
||||
/** 链上带宽类型可委托本金SUN,不包含免费带宽或能量本金 */
|
||||
@Excel(name = "链上带宽类型可委托本金SUN,不包含免费带宽或能量本金")
|
||||
private Long bandwidthDelegatableSun;
|
||||
|
||||
/** 待执行及未知带宽任务预留本金SUN,钱包行锁原子更新 */
|
||||
@Excel(name = "待执行及未知带宽任务预留本金SUN,钱包行锁原子更新")
|
||||
private Long bandwidthReservedSun;
|
||||
|
||||
/** 供应商要求保留的带宽质押本金SUN */
|
||||
@Excel(name = "供应商要求保留的带宽质押本金SUN")
|
||||
private Long bandwidthRetainSun;
|
||||
|
||||
/** 全网能量额度,用于动态换算 */
|
||||
@Excel(name = "全网能量额度,用于动态换算")
|
||||
private Long totalEnergyLimit;
|
||||
|
||||
/** 全网能量权重,零时拒绝估算 */
|
||||
@Excel(name = "全网能量权重,零时拒绝估算")
|
||||
private Long totalEnergyWeight;
|
||||
|
||||
/** 全网质押带宽额度bytes,不能使用免费带宽额度换算 */
|
||||
@Excel(name = "全网质押带宽额度bytes,不能使用免费带宽额度换算")
|
||||
private Long totalBandwidthLimit;
|
||||
|
||||
/** 全网带宽权重,零时拒绝带宽估算 */
|
||||
@Excel(name = "全网带宽权重,零时拒绝带宽估算")
|
||||
private Long totalBandwidthWeight;
|
||||
|
||||
/** 云端可信快照时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "云端可信快照时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date snapshotAt;
|
||||
|
||||
/** 快照失效时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "快照失效时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date snapshotExpiresAt;
|
||||
|
||||
/** 两类可信资源快照对应确认区块;不得回退,须不小于snapshot_min_block_height */
|
||||
@Excel(name = "两类可信资源快照对应确认区块;不得回退,须不小于snapshot_min_block_height")
|
||||
private Long snapshotBlockHeight;
|
||||
|
||||
/** 已确认委托或撤销要求的最低快照区块;提高时使旧快照失效 */
|
||||
@Excel(name = "已确认委托或撤销要求的最低快照区块;提高时使旧快照失效")
|
||||
private Long snapshotMinBlockHeight;
|
||||
|
||||
/** 本地额度、费用保留、允许锁定模式等非敏感策略 */
|
||||
@Excel(name = "本地额度、费用保留、允许锁定模式等非敏感策略")
|
||||
private String policy;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setNodeId(Long nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public Long getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setAddress(String address)
|
||||
{
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setPermissionId(Long permissionId)
|
||||
{
|
||||
this.permissionId = permissionId;
|
||||
}
|
||||
|
||||
public Long getPermissionId()
|
||||
{
|
||||
return permissionId;
|
||||
}
|
||||
public void setOwnershipMethod(String ownershipMethod)
|
||||
{
|
||||
this.ownershipMethod = ownershipMethod;
|
||||
}
|
||||
|
||||
public String getOwnershipMethod()
|
||||
{
|
||||
return ownershipMethod;
|
||||
}
|
||||
public void setOwnershipChallenge(String ownershipChallenge)
|
||||
{
|
||||
this.ownershipChallenge = ownershipChallenge;
|
||||
}
|
||||
|
||||
public String getOwnershipChallenge()
|
||||
{
|
||||
return ownershipChallenge;
|
||||
}
|
||||
public void setOwnershipMessage(String ownershipMessage)
|
||||
{
|
||||
this.ownershipMessage = ownershipMessage;
|
||||
}
|
||||
|
||||
public String getOwnershipMessage()
|
||||
{
|
||||
return ownershipMessage;
|
||||
}
|
||||
public void setOwnershipSignature(String ownershipSignature)
|
||||
{
|
||||
this.ownershipSignature = ownershipSignature;
|
||||
}
|
||||
|
||||
public String getOwnershipSignature()
|
||||
{
|
||||
return ownershipSignature;
|
||||
}
|
||||
public void setOwnershipVerifiedAddress(String ownershipVerifiedAddress)
|
||||
{
|
||||
this.ownershipVerifiedAddress = ownershipVerifiedAddress;
|
||||
}
|
||||
|
||||
public String getOwnershipVerifiedAddress()
|
||||
{
|
||||
return ownershipVerifiedAddress;
|
||||
}
|
||||
public void setChallengeIssuedAt(Date challengeIssuedAt)
|
||||
{
|
||||
this.challengeIssuedAt = challengeIssuedAt;
|
||||
}
|
||||
|
||||
public Date getChallengeIssuedAt()
|
||||
{
|
||||
return challengeIssuedAt;
|
||||
}
|
||||
public void setChallengeExpiresAt(Date challengeExpiresAt)
|
||||
{
|
||||
this.challengeExpiresAt = challengeExpiresAt;
|
||||
}
|
||||
|
||||
public Date getChallengeExpiresAt()
|
||||
{
|
||||
return challengeExpiresAt;
|
||||
}
|
||||
public void setChallengeConsumedAt(Date challengeConsumedAt)
|
||||
{
|
||||
this.challengeConsumedAt = challengeConsumedAt;
|
||||
}
|
||||
|
||||
public Date getChallengeConsumedAt()
|
||||
{
|
||||
return challengeConsumedAt;
|
||||
}
|
||||
public void setOwnershipVerifiedAt(Date ownershipVerifiedAt)
|
||||
{
|
||||
this.ownershipVerifiedAt = ownershipVerifiedAt;
|
||||
}
|
||||
|
||||
public Date getOwnershipVerifiedAt()
|
||||
{
|
||||
return ownershipVerifiedAt;
|
||||
}
|
||||
public void setOwnershipEvidence(String ownershipEvidence)
|
||||
{
|
||||
this.ownershipEvidence = ownershipEvidence;
|
||||
}
|
||||
|
||||
public String getOwnershipEvidence()
|
||||
{
|
||||
return ownershipEvidence;
|
||||
}
|
||||
public void setEnergyAvailable(Long energyAvailable)
|
||||
{
|
||||
this.energyAvailable = energyAvailable;
|
||||
}
|
||||
|
||||
public Long getEnergyAvailable()
|
||||
{
|
||||
return energyAvailable;
|
||||
}
|
||||
public void setBandwidthAvailable(Long bandwidthAvailable)
|
||||
{
|
||||
this.bandwidthAvailable = bandwidthAvailable;
|
||||
}
|
||||
|
||||
public Long getBandwidthAvailable()
|
||||
{
|
||||
return bandwidthAvailable;
|
||||
}
|
||||
public void setEnergyEnabled(Integer energyEnabled)
|
||||
{
|
||||
this.energyEnabled = energyEnabled;
|
||||
}
|
||||
|
||||
public Integer getEnergyEnabled()
|
||||
{
|
||||
return energyEnabled;
|
||||
}
|
||||
public void setBandwidthEnabled(Integer bandwidthEnabled)
|
||||
{
|
||||
this.bandwidthEnabled = bandwidthEnabled;
|
||||
}
|
||||
|
||||
public Integer getBandwidthEnabled()
|
||||
{
|
||||
return bandwidthEnabled;
|
||||
}
|
||||
public void setEnergyDelegatableSun(Long energyDelegatableSun)
|
||||
{
|
||||
this.energyDelegatableSun = energyDelegatableSun;
|
||||
}
|
||||
|
||||
public Long getEnergyDelegatableSun()
|
||||
{
|
||||
return energyDelegatableSun;
|
||||
}
|
||||
public void setEnergyReservedSun(Long energyReservedSun)
|
||||
{
|
||||
this.energyReservedSun = energyReservedSun;
|
||||
}
|
||||
|
||||
public Long getEnergyReservedSun()
|
||||
{
|
||||
return energyReservedSun;
|
||||
}
|
||||
public void setEnergyRetainSun(Long energyRetainSun)
|
||||
{
|
||||
this.energyRetainSun = energyRetainSun;
|
||||
}
|
||||
|
||||
public Long getEnergyRetainSun()
|
||||
{
|
||||
return energyRetainSun;
|
||||
}
|
||||
public void setBandwidthDelegatableSun(Long bandwidthDelegatableSun)
|
||||
{
|
||||
this.bandwidthDelegatableSun = bandwidthDelegatableSun;
|
||||
}
|
||||
|
||||
public Long getBandwidthDelegatableSun()
|
||||
{
|
||||
return bandwidthDelegatableSun;
|
||||
}
|
||||
public void setBandwidthReservedSun(Long bandwidthReservedSun)
|
||||
{
|
||||
this.bandwidthReservedSun = bandwidthReservedSun;
|
||||
}
|
||||
|
||||
public Long getBandwidthReservedSun()
|
||||
{
|
||||
return bandwidthReservedSun;
|
||||
}
|
||||
public void setBandwidthRetainSun(Long bandwidthRetainSun)
|
||||
{
|
||||
this.bandwidthRetainSun = bandwidthRetainSun;
|
||||
}
|
||||
|
||||
public Long getBandwidthRetainSun()
|
||||
{
|
||||
return bandwidthRetainSun;
|
||||
}
|
||||
public void setTotalEnergyLimit(Long totalEnergyLimit)
|
||||
{
|
||||
this.totalEnergyLimit = totalEnergyLimit;
|
||||
}
|
||||
|
||||
public Long getTotalEnergyLimit()
|
||||
{
|
||||
return totalEnergyLimit;
|
||||
}
|
||||
public void setTotalEnergyWeight(Long totalEnergyWeight)
|
||||
{
|
||||
this.totalEnergyWeight = totalEnergyWeight;
|
||||
}
|
||||
|
||||
public Long getTotalEnergyWeight()
|
||||
{
|
||||
return totalEnergyWeight;
|
||||
}
|
||||
public void setTotalBandwidthLimit(Long totalBandwidthLimit)
|
||||
{
|
||||
this.totalBandwidthLimit = totalBandwidthLimit;
|
||||
}
|
||||
|
||||
public Long getTotalBandwidthLimit()
|
||||
{
|
||||
return totalBandwidthLimit;
|
||||
}
|
||||
public void setTotalBandwidthWeight(Long totalBandwidthWeight)
|
||||
{
|
||||
this.totalBandwidthWeight = totalBandwidthWeight;
|
||||
}
|
||||
|
||||
public Long getTotalBandwidthWeight()
|
||||
{
|
||||
return totalBandwidthWeight;
|
||||
}
|
||||
public void setSnapshotAt(Date snapshotAt)
|
||||
{
|
||||
this.snapshotAt = snapshotAt;
|
||||
}
|
||||
|
||||
public Date getSnapshotAt()
|
||||
{
|
||||
return snapshotAt;
|
||||
}
|
||||
public void setSnapshotExpiresAt(Date snapshotExpiresAt)
|
||||
{
|
||||
this.snapshotExpiresAt = snapshotExpiresAt;
|
||||
}
|
||||
|
||||
public Date getSnapshotExpiresAt()
|
||||
{
|
||||
return snapshotExpiresAt;
|
||||
}
|
||||
public void setSnapshotBlockHeight(Long snapshotBlockHeight)
|
||||
{
|
||||
this.snapshotBlockHeight = snapshotBlockHeight;
|
||||
}
|
||||
|
||||
public Long getSnapshotBlockHeight()
|
||||
{
|
||||
return snapshotBlockHeight;
|
||||
}
|
||||
public void setSnapshotMinBlockHeight(Long snapshotMinBlockHeight)
|
||||
{
|
||||
this.snapshotMinBlockHeight = snapshotMinBlockHeight;
|
||||
}
|
||||
|
||||
public Long getSnapshotMinBlockHeight()
|
||||
{
|
||||
return snapshotMinBlockHeight;
|
||||
}
|
||||
public void setPolicy(String policy)
|
||||
{
|
||||
this.policy = policy;
|
||||
}
|
||||
|
||||
public String getPolicy()
|
||||
{
|
||||
return policy;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("nodeId", getNodeId())
|
||||
.append("network", getNetwork())
|
||||
.append("address", getAddress())
|
||||
.append("status", getStatus())
|
||||
.append("permissionId", getPermissionId())
|
||||
.append("ownershipMethod", getOwnershipMethod())
|
||||
.append("ownershipChallenge", getOwnershipChallenge())
|
||||
.append("ownershipMessage", getOwnershipMessage())
|
||||
.append("ownershipSignature", getOwnershipSignature())
|
||||
.append("ownershipVerifiedAddress", getOwnershipVerifiedAddress())
|
||||
.append("challengeIssuedAt", getChallengeIssuedAt())
|
||||
.append("challengeExpiresAt", getChallengeExpiresAt())
|
||||
.append("challengeConsumedAt", getChallengeConsumedAt())
|
||||
.append("ownershipVerifiedAt", getOwnershipVerifiedAt())
|
||||
.append("ownershipEvidence", getOwnershipEvidence())
|
||||
.append("energyAvailable", getEnergyAvailable())
|
||||
.append("bandwidthAvailable", getBandwidthAvailable())
|
||||
.append("energyEnabled", getEnergyEnabled())
|
||||
.append("bandwidthEnabled", getBandwidthEnabled())
|
||||
.append("energyDelegatableSun", getEnergyDelegatableSun())
|
||||
.append("energyReservedSun", getEnergyReservedSun())
|
||||
.append("energyRetainSun", getEnergyRetainSun())
|
||||
.append("bandwidthDelegatableSun", getBandwidthDelegatableSun())
|
||||
.append("bandwidthReservedSun", getBandwidthReservedSun())
|
||||
.append("bandwidthRetainSun", getBandwidthRetainSun())
|
||||
.append("totalEnergyLimit", getTotalEnergyLimit())
|
||||
.append("totalEnergyWeight", getTotalEnergyWeight())
|
||||
.append("totalBandwidthLimit", getTotalBandwidthLimit())
|
||||
.append("totalBandwidthWeight", getTotalBandwidthWeight())
|
||||
.append("snapshotAt", getSnapshotAt())
|
||||
.append("snapshotExpiresAt", getSnapshotExpiresAt())
|
||||
.append("snapshotBlockHeight", getSnapshotBlockHeight())
|
||||
.append("snapshotMinBlockHeight", getSnapshotMinBlockHeight())
|
||||
.append("policy", getPolicy())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,530 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点对象 rent_wallet
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_wallet")
|
||||
public class RentWalletPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** rent_node.id,供应商归属由节点user_id取得 */
|
||||
@Excel(name = "rent_node.id,供应商归属由节点user_id取得")
|
||||
private Long nodeId;
|
||||
/** 网络:NILE、MAINNET,必须与所有关联对象一致 */
|
||||
@Excel(name = "网络:NILE、MAINNET,必须与所有关联对象一致")
|
||||
private String network;
|
||||
/** 资源所有者,TRON Base58Check地址 */
|
||||
@Excel(name = "资源所有者,TRON Base58Check地址")
|
||||
private String address;
|
||||
/** PENDING待核验、ACTIVE可调度、PAUSED暂停 */
|
||||
@Excel(name = "PENDING待核验、ACTIVE可调度、PAUSED暂停")
|
||||
private String status;
|
||||
/** TRON链上权限编号,与平台HMAC无关 */
|
||||
@Excel(name = "TRON链上权限编号,与平台HMAC无关")
|
||||
private Long permissionId;
|
||||
/** 钱包验证方式:TRONLINK_SIGN_MESSAGE_V2,离线消息签名,不广播交易,不使用RSA */
|
||||
@Excel(name = "钱包验证方式:TRONLINK_SIGN_MESSAGE_V2,离线消息签名,不广播交易,不使用RSA")
|
||||
private String ownershipMethod;
|
||||
/** 平台生成的高熵一次性随机挑战,绑定登录用户、钱包、网络和业务域;重新签发使旧挑战失效 */
|
||||
@Excel(name = "平台生成的高熵一次性随机挑战,绑定登录用户、钱包、网络和业务域;重新签发使旧挑战失效")
|
||||
private String ownershipChallenge;
|
||||
/** 平台生成并保存的完整UTF-8待签文本,含域名、用途、user_id、wallet_id、地址、网络、nonce、签发及到期时间,后端不得信任客户端重建文本 */
|
||||
@Excel(name = "平台生成并保存的完整UTF-8待签文本,含域名、用途、user_id、wallet_id、地址、网络、nonce、签发及到期时间,后端不得信任客户端重建文本")
|
||||
private String ownershipMessage;
|
||||
/** TronLink的tronWeb.trx.signMessageV2对上述原文生成的签名;非私钥,仅用于钱包验证,禁止作为交易或API签名复用 */
|
||||
@Excel(name = "TronLink的tronWeb.trx.signMessageV2对上述原文生成的签名;非私钥,仅用于钱包验证,禁止作为交易或API签名复用")
|
||||
private String ownershipSignature;
|
||||
/** 后端按TRON消息签名规则恢复并验证的Base58Check地址,必须与address完全一致 */
|
||||
@Excel(name = "后端按TRON消息签名规则恢复并验证的Base58Check地址,必须与address完全一致")
|
||||
private String ownershipVerifiedAddress;
|
||||
/** 挑战签发UTC时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "挑战签发UTC时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date challengeIssuedAt;
|
||||
/** 控制权证明挑战期限,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "控制权证明挑战期限,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date challengeExpiresAt;
|
||||
/** 挑战原子消费UTC时间;非空不可再次使用,签名失败不设置 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "挑战原子消费UTC时间;非空不可再次使用,签名失败不设置", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date challengeConsumedAt;
|
||||
/** 钱包离线消息签名验证通过的UTC时间,不等于供应商审核通过或交易权限已具备 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "钱包离线消息签名验证通过的UTC时间,不等于供应商审核通过或交易权限已具备", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date ownershipVerifiedAt;
|
||||
/** 签名版本、原文摘要、恢复地址及当前链上权限核验结果,不包含私钥或助记词;历史验证事件写rent_event */
|
||||
@Excel(name = "签名版本、原文摘要、恢复地址及当前链上权限核验结果,不包含私钥或助记词;历史验证事件写rent_event")
|
||||
private String ownershipEvidence;
|
||||
/** 可用能量max(0,limit-used),仅查询投影 */
|
||||
@Excel(name = "可用能量max(0,limit-used),仅查询投影")
|
||||
private Long energyAvailable;
|
||||
/** 可用质押带宽max(0,limit-used),单位bytes,不含不可出租的免费带宽 */
|
||||
@Excel(name = "可用质押带宽max(0,limit-used),单位bytes,不含不可出租的免费带宽")
|
||||
private Long bandwidthAvailable;
|
||||
/** 是否允许出租能量:0关闭、1开启,须本地策略及审核同时允许 */
|
||||
@Excel(name = "是否允许出租能量:0关闭、1开启,须本地策略及审核同时允许")
|
||||
private Integer energyEnabled;
|
||||
/** 是否允许出租带宽:0关闭、1开启,须本地策略及审核同时允许 */
|
||||
@Excel(name = "是否允许出租带宽:0关闭、1开启,须本地策略及审核同时允许")
|
||||
private Integer bandwidthEnabled;
|
||||
/** 链上能量类型可委托本金SUN,不能用TRX余额或带宽本金替代 */
|
||||
@Excel(name = "链上能量类型可委托本金SUN,不能用TRX余额或带宽本金替代")
|
||||
private Long energyDelegatableSun;
|
||||
/** 待执行及未知能量任务预留本金SUN,钱包行锁原子更新 */
|
||||
@Excel(name = "待执行及未知能量任务预留本金SUN,钱包行锁原子更新")
|
||||
private Long energyReservedSun;
|
||||
/** 供应商要求保留的能量质押本金SUN */
|
||||
@Excel(name = "供应商要求保留的能量质押本金SUN")
|
||||
private Long energyRetainSun;
|
||||
/** 链上带宽类型可委托本金SUN,不包含免费带宽或能量本金 */
|
||||
@Excel(name = "链上带宽类型可委托本金SUN,不包含免费带宽或能量本金")
|
||||
private Long bandwidthDelegatableSun;
|
||||
/** 待执行及未知带宽任务预留本金SUN,钱包行锁原子更新 */
|
||||
@Excel(name = "待执行及未知带宽任务预留本金SUN,钱包行锁原子更新")
|
||||
private Long bandwidthReservedSun;
|
||||
/** 供应商要求保留的带宽质押本金SUN */
|
||||
@Excel(name = "供应商要求保留的带宽质押本金SUN")
|
||||
private Long bandwidthRetainSun;
|
||||
/** 全网能量额度,用于动态换算 */
|
||||
@Excel(name = "全网能量额度,用于动态换算")
|
||||
private Long totalEnergyLimit;
|
||||
/** 全网能量权重,零时拒绝估算 */
|
||||
@Excel(name = "全网能量权重,零时拒绝估算")
|
||||
private Long totalEnergyWeight;
|
||||
/** 全网质押带宽额度bytes,不能使用免费带宽额度换算 */
|
||||
@Excel(name = "全网质押带宽额度bytes,不能使用免费带宽额度换算")
|
||||
private Long totalBandwidthLimit;
|
||||
/** 全网带宽权重,零时拒绝带宽估算 */
|
||||
@Excel(name = "全网带宽权重,零时拒绝带宽估算")
|
||||
private Long totalBandwidthWeight;
|
||||
/** 云端可信快照时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "云端可信快照时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date snapshotAt;
|
||||
/** 快照失效时间,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "快照失效时间,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date snapshotExpiresAt;
|
||||
/** 两类可信资源快照对应确认区块;不得回退,须不小于snapshot_min_block_height */
|
||||
@Excel(name = "两类可信资源快照对应确认区块;不得回退,须不小于snapshot_min_block_height")
|
||||
private Long snapshotBlockHeight;
|
||||
/** 已确认委托或撤销要求的最低快照区块;提高时使旧快照失效 */
|
||||
@Excel(name = "已确认委托或撤销要求的最低快照区块;提高时使旧快照失效")
|
||||
private Long snapshotMinBlockHeight;
|
||||
/** 本地额度、费用保留、允许锁定模式等非敏感策略 */
|
||||
@Excel(name = "本地额度、费用保留、允许锁定模式等非敏感策略")
|
||||
private String policy;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setNodeId(Long nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public Long getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
public void setNetwork(String network)
|
||||
{
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
public String getNetwork()
|
||||
{
|
||||
return network;
|
||||
}
|
||||
public void setAddress(String address)
|
||||
{
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setPermissionId(Long permissionId)
|
||||
{
|
||||
this.permissionId = permissionId;
|
||||
}
|
||||
|
||||
public Long getPermissionId()
|
||||
{
|
||||
return permissionId;
|
||||
}
|
||||
public void setOwnershipMethod(String ownershipMethod)
|
||||
{
|
||||
this.ownershipMethod = ownershipMethod;
|
||||
}
|
||||
|
||||
public String getOwnershipMethod()
|
||||
{
|
||||
return ownershipMethod;
|
||||
}
|
||||
public void setOwnershipChallenge(String ownershipChallenge)
|
||||
{
|
||||
this.ownershipChallenge = ownershipChallenge;
|
||||
}
|
||||
|
||||
public String getOwnershipChallenge()
|
||||
{
|
||||
return ownershipChallenge;
|
||||
}
|
||||
public void setOwnershipMessage(String ownershipMessage)
|
||||
{
|
||||
this.ownershipMessage = ownershipMessage;
|
||||
}
|
||||
|
||||
public String getOwnershipMessage()
|
||||
{
|
||||
return ownershipMessage;
|
||||
}
|
||||
public void setOwnershipSignature(String ownershipSignature)
|
||||
{
|
||||
this.ownershipSignature = ownershipSignature;
|
||||
}
|
||||
|
||||
public String getOwnershipSignature()
|
||||
{
|
||||
return ownershipSignature;
|
||||
}
|
||||
public void setOwnershipVerifiedAddress(String ownershipVerifiedAddress)
|
||||
{
|
||||
this.ownershipVerifiedAddress = ownershipVerifiedAddress;
|
||||
}
|
||||
|
||||
public String getOwnershipVerifiedAddress()
|
||||
{
|
||||
return ownershipVerifiedAddress;
|
||||
}
|
||||
public void setChallengeIssuedAt(Date challengeIssuedAt)
|
||||
{
|
||||
this.challengeIssuedAt = challengeIssuedAt;
|
||||
}
|
||||
|
||||
public Date getChallengeIssuedAt()
|
||||
{
|
||||
return challengeIssuedAt;
|
||||
}
|
||||
public void setChallengeExpiresAt(Date challengeExpiresAt)
|
||||
{
|
||||
this.challengeExpiresAt = challengeExpiresAt;
|
||||
}
|
||||
|
||||
public Date getChallengeExpiresAt()
|
||||
{
|
||||
return challengeExpiresAt;
|
||||
}
|
||||
public void setChallengeConsumedAt(Date challengeConsumedAt)
|
||||
{
|
||||
this.challengeConsumedAt = challengeConsumedAt;
|
||||
}
|
||||
|
||||
public Date getChallengeConsumedAt()
|
||||
{
|
||||
return challengeConsumedAt;
|
||||
}
|
||||
public void setOwnershipVerifiedAt(Date ownershipVerifiedAt)
|
||||
{
|
||||
this.ownershipVerifiedAt = ownershipVerifiedAt;
|
||||
}
|
||||
|
||||
public Date getOwnershipVerifiedAt()
|
||||
{
|
||||
return ownershipVerifiedAt;
|
||||
}
|
||||
public void setOwnershipEvidence(String ownershipEvidence)
|
||||
{
|
||||
this.ownershipEvidence = ownershipEvidence;
|
||||
}
|
||||
|
||||
public String getOwnershipEvidence()
|
||||
{
|
||||
return ownershipEvidence;
|
||||
}
|
||||
public void setEnergyAvailable(Long energyAvailable)
|
||||
{
|
||||
this.energyAvailable = energyAvailable;
|
||||
}
|
||||
|
||||
public Long getEnergyAvailable()
|
||||
{
|
||||
return energyAvailable;
|
||||
}
|
||||
public void setBandwidthAvailable(Long bandwidthAvailable)
|
||||
{
|
||||
this.bandwidthAvailable = bandwidthAvailable;
|
||||
}
|
||||
|
||||
public Long getBandwidthAvailable()
|
||||
{
|
||||
return bandwidthAvailable;
|
||||
}
|
||||
public void setEnergyEnabled(Integer energyEnabled)
|
||||
{
|
||||
this.energyEnabled = energyEnabled;
|
||||
}
|
||||
|
||||
public Integer getEnergyEnabled()
|
||||
{
|
||||
return energyEnabled;
|
||||
}
|
||||
public void setBandwidthEnabled(Integer bandwidthEnabled)
|
||||
{
|
||||
this.bandwidthEnabled = bandwidthEnabled;
|
||||
}
|
||||
|
||||
public Integer getBandwidthEnabled()
|
||||
{
|
||||
return bandwidthEnabled;
|
||||
}
|
||||
public void setEnergyDelegatableSun(Long energyDelegatableSun)
|
||||
{
|
||||
this.energyDelegatableSun = energyDelegatableSun;
|
||||
}
|
||||
|
||||
public Long getEnergyDelegatableSun()
|
||||
{
|
||||
return energyDelegatableSun;
|
||||
}
|
||||
public void setEnergyReservedSun(Long energyReservedSun)
|
||||
{
|
||||
this.energyReservedSun = energyReservedSun;
|
||||
}
|
||||
|
||||
public Long getEnergyReservedSun()
|
||||
{
|
||||
return energyReservedSun;
|
||||
}
|
||||
public void setEnergyRetainSun(Long energyRetainSun)
|
||||
{
|
||||
this.energyRetainSun = energyRetainSun;
|
||||
}
|
||||
|
||||
public Long getEnergyRetainSun()
|
||||
{
|
||||
return energyRetainSun;
|
||||
}
|
||||
public void setBandwidthDelegatableSun(Long bandwidthDelegatableSun)
|
||||
{
|
||||
this.bandwidthDelegatableSun = bandwidthDelegatableSun;
|
||||
}
|
||||
|
||||
public Long getBandwidthDelegatableSun()
|
||||
{
|
||||
return bandwidthDelegatableSun;
|
||||
}
|
||||
public void setBandwidthReservedSun(Long bandwidthReservedSun)
|
||||
{
|
||||
this.bandwidthReservedSun = bandwidthReservedSun;
|
||||
}
|
||||
|
||||
public Long getBandwidthReservedSun()
|
||||
{
|
||||
return bandwidthReservedSun;
|
||||
}
|
||||
public void setBandwidthRetainSun(Long bandwidthRetainSun)
|
||||
{
|
||||
this.bandwidthRetainSun = bandwidthRetainSun;
|
||||
}
|
||||
|
||||
public Long getBandwidthRetainSun()
|
||||
{
|
||||
return bandwidthRetainSun;
|
||||
}
|
||||
public void setTotalEnergyLimit(Long totalEnergyLimit)
|
||||
{
|
||||
this.totalEnergyLimit = totalEnergyLimit;
|
||||
}
|
||||
|
||||
public Long getTotalEnergyLimit()
|
||||
{
|
||||
return totalEnergyLimit;
|
||||
}
|
||||
public void setTotalEnergyWeight(Long totalEnergyWeight)
|
||||
{
|
||||
this.totalEnergyWeight = totalEnergyWeight;
|
||||
}
|
||||
|
||||
public Long getTotalEnergyWeight()
|
||||
{
|
||||
return totalEnergyWeight;
|
||||
}
|
||||
public void setTotalBandwidthLimit(Long totalBandwidthLimit)
|
||||
{
|
||||
this.totalBandwidthLimit = totalBandwidthLimit;
|
||||
}
|
||||
|
||||
public Long getTotalBandwidthLimit()
|
||||
{
|
||||
return totalBandwidthLimit;
|
||||
}
|
||||
public void setTotalBandwidthWeight(Long totalBandwidthWeight)
|
||||
{
|
||||
this.totalBandwidthWeight = totalBandwidthWeight;
|
||||
}
|
||||
|
||||
public Long getTotalBandwidthWeight()
|
||||
{
|
||||
return totalBandwidthWeight;
|
||||
}
|
||||
public void setSnapshotAt(Date snapshotAt)
|
||||
{
|
||||
this.snapshotAt = snapshotAt;
|
||||
}
|
||||
|
||||
public Date getSnapshotAt()
|
||||
{
|
||||
return snapshotAt;
|
||||
}
|
||||
public void setSnapshotExpiresAt(Date snapshotExpiresAt)
|
||||
{
|
||||
this.snapshotExpiresAt = snapshotExpiresAt;
|
||||
}
|
||||
|
||||
public Date getSnapshotExpiresAt()
|
||||
{
|
||||
return snapshotExpiresAt;
|
||||
}
|
||||
public void setSnapshotBlockHeight(Long snapshotBlockHeight)
|
||||
{
|
||||
this.snapshotBlockHeight = snapshotBlockHeight;
|
||||
}
|
||||
|
||||
public Long getSnapshotBlockHeight()
|
||||
{
|
||||
return snapshotBlockHeight;
|
||||
}
|
||||
public void setSnapshotMinBlockHeight(Long snapshotMinBlockHeight)
|
||||
{
|
||||
this.snapshotMinBlockHeight = snapshotMinBlockHeight;
|
||||
}
|
||||
|
||||
public Long getSnapshotMinBlockHeight()
|
||||
{
|
||||
return snapshotMinBlockHeight;
|
||||
}
|
||||
public void setPolicy(String policy)
|
||||
{
|
||||
this.policy = policy;
|
||||
}
|
||||
|
||||
public String getPolicy()
|
||||
{
|
||||
return policy;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("nodeId", getNodeId())
|
||||
.append("network", getNetwork())
|
||||
.append("address", getAddress())
|
||||
.append("status", getStatus())
|
||||
.append("permissionId", getPermissionId())
|
||||
.append("ownershipMethod", getOwnershipMethod())
|
||||
.append("ownershipChallenge", getOwnershipChallenge())
|
||||
.append("ownershipMessage", getOwnershipMessage())
|
||||
.append("ownershipSignature", getOwnershipSignature())
|
||||
.append("ownershipVerifiedAddress", getOwnershipVerifiedAddress())
|
||||
.append("challengeIssuedAt", getChallengeIssuedAt())
|
||||
.append("challengeExpiresAt", getChallengeExpiresAt())
|
||||
.append("challengeConsumedAt", getChallengeConsumedAt())
|
||||
.append("ownershipVerifiedAt", getOwnershipVerifiedAt())
|
||||
.append("ownershipEvidence", getOwnershipEvidence())
|
||||
.append("energyAvailable", getEnergyAvailable())
|
||||
.append("bandwidthAvailable", getBandwidthAvailable())
|
||||
.append("energyEnabled", getEnergyEnabled())
|
||||
.append("bandwidthEnabled", getBandwidthEnabled())
|
||||
.append("energyDelegatableSun", getEnergyDelegatableSun())
|
||||
.append("energyReservedSun", getEnergyReservedSun())
|
||||
.append("energyRetainSun", getEnergyRetainSun())
|
||||
.append("bandwidthDelegatableSun", getBandwidthDelegatableSun())
|
||||
.append("bandwidthReservedSun", getBandwidthReservedSun())
|
||||
.append("bandwidthRetainSun", getBandwidthRetainSun())
|
||||
.append("totalEnergyLimit", getTotalEnergyLimit())
|
||||
.append("totalEnergyWeight", getTotalEnergyWeight())
|
||||
.append("totalBandwidthLimit", getTotalBandwidthLimit())
|
||||
.append("totalBandwidthWeight", getTotalBandwidthWeight())
|
||||
.append("snapshotAt", getSnapshotAt())
|
||||
.append("snapshotExpiresAt", getSnapshotExpiresAt())
|
||||
.append("snapshotBlockHeight", getSnapshotBlockHeight())
|
||||
.append("snapshotMinBlockHeight", getSnapshotMinBlockHeight())
|
||||
.append("policy", getPolicy())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 订单回调持久队列;业务状态更新时同事务写入对象 rent_webhook
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public class RentWebhook extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
|
||||
/** 商户回调事件编号 */
|
||||
@Excel(name = "商户回调事件编号")
|
||||
private String eventNo;
|
||||
|
||||
/** rent_order.id */
|
||||
@Excel(name = "rent_order.id")
|
||||
private Long orderId;
|
||||
|
||||
/** SUCCESS、FAILED、CANCELLED、REFUNDED、RECLAIMED */
|
||||
@Excel(name = "SUCCESS、FAILED、CANCELLED、REFUNDED、RECLAIMED")
|
||||
private String eventType;
|
||||
|
||||
/** 全局唯一业务事件键;普通事件ORDER:id:type,退款REFUND:refund_no,每次部分退款独立 */
|
||||
@Excel(name = "全局唯一业务事件键;普通事件ORDER:id:type,退款REFUND:refund_no,每次部分退款独立")
|
||||
private String eventKey;
|
||||
|
||||
/** 锁订单行后分配的递增事件序号;商户去重并按序号识别乱序,重试不变 */
|
||||
@Excel(name = "锁订单行后分配的递增事件序号;商户去重并按序号识别乱序,重试不变")
|
||||
private Long orderEventSequence;
|
||||
|
||||
/** 锁定回调业务内容,不含内部成本或Secret */
|
||||
@Excel(name = "锁定回调业务内容,不含内部成本或Secret")
|
||||
private String payload;
|
||||
|
||||
/** PENDING待发、SENDING发送、ACKED确认、DEAD重试超限 */
|
||||
@Excel(name = "PENDING待发、SENDING发送、ACKED确认、DEAD重试超限")
|
||||
private String status;
|
||||
|
||||
/** 重试次数,每次生成新nonce及timestamp */
|
||||
@Excel(name = "重试次数,每次生成新nonce及timestamp")
|
||||
private Long attemptCount;
|
||||
|
||||
/** 最近回调使用的APP主体rent_credential.id */
|
||||
@Excel(name = "最近回调使用的APP主体rent_credential.id")
|
||||
private Long credentialId;
|
||||
|
||||
/** 下次重试,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次重试,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextAttemptAt;
|
||||
|
||||
/** worker租约标识 */
|
||||
@Excel(name = "worker租约标识")
|
||||
private String lockOwner;
|
||||
|
||||
/** worker租约期限,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "worker租约期限,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date lockUntil;
|
||||
|
||||
/** 最近脱敏错误 */
|
||||
@Excel(name = "最近脱敏错误")
|
||||
private String lastError;
|
||||
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setEventNo(String eventNo)
|
||||
{
|
||||
this.eventNo = eventNo;
|
||||
}
|
||||
|
||||
public String getEventNo()
|
||||
{
|
||||
return eventNo;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setEventType(String eventType)
|
||||
{
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
public void setEventKey(String eventKey)
|
||||
{
|
||||
this.eventKey = eventKey;
|
||||
}
|
||||
|
||||
public String getEventKey()
|
||||
{
|
||||
return eventKey;
|
||||
}
|
||||
public void setOrderEventSequence(Long orderEventSequence)
|
||||
{
|
||||
this.orderEventSequence = orderEventSequence;
|
||||
}
|
||||
|
||||
public Long getOrderEventSequence()
|
||||
{
|
||||
return orderEventSequence;
|
||||
}
|
||||
public void setPayload(String payload)
|
||||
{
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public String getPayload()
|
||||
{
|
||||
return payload;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setAttemptCount(Long attemptCount)
|
||||
{
|
||||
this.attemptCount = attemptCount;
|
||||
}
|
||||
|
||||
public Long getAttemptCount()
|
||||
{
|
||||
return attemptCount;
|
||||
}
|
||||
public void setCredentialId(Long credentialId)
|
||||
{
|
||||
this.credentialId = credentialId;
|
||||
}
|
||||
|
||||
public Long getCredentialId()
|
||||
{
|
||||
return credentialId;
|
||||
}
|
||||
public void setNextAttemptAt(Date nextAttemptAt)
|
||||
{
|
||||
this.nextAttemptAt = nextAttemptAt;
|
||||
}
|
||||
|
||||
public Date getNextAttemptAt()
|
||||
{
|
||||
return nextAttemptAt;
|
||||
}
|
||||
public void setLockOwner(String lockOwner)
|
||||
{
|
||||
this.lockOwner = lockOwner;
|
||||
}
|
||||
|
||||
public String getLockOwner()
|
||||
{
|
||||
return lockOwner;
|
||||
}
|
||||
public void setLockUntil(Date lockUntil)
|
||||
{
|
||||
this.lockUntil = lockUntil;
|
||||
}
|
||||
|
||||
public Date getLockUntil()
|
||||
{
|
||||
return lockUntil;
|
||||
}
|
||||
public void setLastError(String lastError)
|
||||
{
|
||||
this.lastError = lastError;
|
||||
}
|
||||
|
||||
public String getLastError()
|
||||
{
|
||||
return lastError;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("eventNo", getEventNo())
|
||||
.append("orderId", getOrderId())
|
||||
.append("eventType", getEventType())
|
||||
.append("eventKey", getEventKey())
|
||||
.append("orderEventSequence", getOrderEventSequence())
|
||||
.append("payload", getPayload())
|
||||
.append("status", getStatus())
|
||||
.append("attemptCount", getAttemptCount())
|
||||
.append("credentialId", getCredentialId())
|
||||
.append("nextAttemptAt", getNextAttemptAt())
|
||||
.append("lockOwner", getLockOwner())
|
||||
.append("lockUntil", getLockUntil())
|
||||
.append("lastError", getLastError())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 订单回调持久队列;业务状态更新时同事务写入对象 rent_webhook
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@TableName(value = "rent_webhook")
|
||||
public class RentWebhookPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录主键 */
|
||||
private Long id;
|
||||
/** 商户回调事件编号 */
|
||||
@Excel(name = "商户回调事件编号")
|
||||
private String eventNo;
|
||||
/** rent_order.id */
|
||||
@Excel(name = "rent_order.id")
|
||||
private Long orderId;
|
||||
/** SUCCESS、FAILED、CANCELLED、REFUNDED、RECLAIMED */
|
||||
@Excel(name = "SUCCESS、FAILED、CANCELLED、REFUNDED、RECLAIMED")
|
||||
private String eventType;
|
||||
/** 全局唯一业务事件键;普通事件ORDER:id:type,退款REFUND:refund_no,每次部分退款独立 */
|
||||
@Excel(name = "全局唯一业务事件键;普通事件ORDER:id:type,退款REFUND:refund_no,每次部分退款独立")
|
||||
private String eventKey;
|
||||
/** 锁订单行后分配的递增事件序号;商户去重并按序号识别乱序,重试不变 */
|
||||
@Excel(name = "锁订单行后分配的递增事件序号;商户去重并按序号识别乱序,重试不变")
|
||||
private Long orderEventSequence;
|
||||
/** 锁定回调业务内容,不含内部成本或Secret */
|
||||
@Excel(name = "锁定回调业务内容,不含内部成本或Secret")
|
||||
private String payload;
|
||||
/** PENDING待发、SENDING发送、ACKED确认、DEAD重试超限 */
|
||||
@Excel(name = "PENDING待发、SENDING发送、ACKED确认、DEAD重试超限")
|
||||
private String status;
|
||||
/** 重试次数,每次生成新nonce及timestamp */
|
||||
@Excel(name = "重试次数,每次生成新nonce及timestamp")
|
||||
private Long attemptCount;
|
||||
/** 最近回调使用的APP主体rent_credential.id */
|
||||
@Excel(name = "最近回调使用的APP主体rent_credential.id")
|
||||
private Long credentialId;
|
||||
/** 下次重试,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次重试,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextAttemptAt;
|
||||
/** worker租约标识 */
|
||||
@Excel(name = "worker租约标识")
|
||||
private String lockOwner;
|
||||
/** worker租约期限,UTC */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "worker租约期限,UTC", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date lockUntil;
|
||||
/** 最近脱敏错误 */
|
||||
@Excel(name = "最近脱敏错误")
|
||||
private String lastError;
|
||||
/** CAS乐观锁版本,更新须条件递增;追加记录保持0 */
|
||||
@Excel(name = "CAS乐观锁版本,更新须条件递增;追加记录保持0")
|
||||
private Long version;
|
||||
/** 创建UTC时间,应用显式写入 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建UTC时间,应用显式写入", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
/** 更新UTC时间,追加记录与创建时间相同 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新UTC时间,追加记录与创建时间相同", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setEventNo(String eventNo)
|
||||
{
|
||||
this.eventNo = eventNo;
|
||||
}
|
||||
|
||||
public String getEventNo()
|
||||
{
|
||||
return eventNo;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setEventType(String eventType)
|
||||
{
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
public void setEventKey(String eventKey)
|
||||
{
|
||||
this.eventKey = eventKey;
|
||||
}
|
||||
|
||||
public String getEventKey()
|
||||
{
|
||||
return eventKey;
|
||||
}
|
||||
public void setOrderEventSequence(Long orderEventSequence)
|
||||
{
|
||||
this.orderEventSequence = orderEventSequence;
|
||||
}
|
||||
|
||||
public Long getOrderEventSequence()
|
||||
{
|
||||
return orderEventSequence;
|
||||
}
|
||||
public void setPayload(String payload)
|
||||
{
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public String getPayload()
|
||||
{
|
||||
return payload;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setAttemptCount(Long attemptCount)
|
||||
{
|
||||
this.attemptCount = attemptCount;
|
||||
}
|
||||
|
||||
public Long getAttemptCount()
|
||||
{
|
||||
return attemptCount;
|
||||
}
|
||||
public void setCredentialId(Long credentialId)
|
||||
{
|
||||
this.credentialId = credentialId;
|
||||
}
|
||||
|
||||
public Long getCredentialId()
|
||||
{
|
||||
return credentialId;
|
||||
}
|
||||
public void setNextAttemptAt(Date nextAttemptAt)
|
||||
{
|
||||
this.nextAttemptAt = nextAttemptAt;
|
||||
}
|
||||
|
||||
public Date getNextAttemptAt()
|
||||
{
|
||||
return nextAttemptAt;
|
||||
}
|
||||
public void setLockOwner(String lockOwner)
|
||||
{
|
||||
this.lockOwner = lockOwner;
|
||||
}
|
||||
|
||||
public String getLockOwner()
|
||||
{
|
||||
return lockOwner;
|
||||
}
|
||||
public void setLockUntil(Date lockUntil)
|
||||
{
|
||||
this.lockUntil = lockUntil;
|
||||
}
|
||||
|
||||
public Date getLockUntil()
|
||||
{
|
||||
return lockUntil;
|
||||
}
|
||||
public void setLastError(String lastError)
|
||||
{
|
||||
this.lastError = lastError;
|
||||
}
|
||||
|
||||
public String getLastError()
|
||||
{
|
||||
return lastError;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("eventNo", getEventNo())
|
||||
.append("orderId", getOrderId())
|
||||
.append("eventType", getEventType())
|
||||
.append("eventKey", getEventKey())
|
||||
.append("orderEventSequence", getOrderEventSequence())
|
||||
.append("payload", getPayload())
|
||||
.append("status", getStatus())
|
||||
.append("attemptCount", getAttemptCount())
|
||||
.append("credentialId", getCredentialId())
|
||||
.append("nextAttemptAt", getNextAttemptAt())
|
||||
.append("lockOwner", getLockOwner())
|
||||
.append("lockUntil", getLockUntil())
|
||||
.append("lastError", getLastError())
|
||||
.append("version", getVersion())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentAccount;
|
||||
import com.ruoyi.system.domain.RentAccountPlus;
|
||||
|
||||
/**
|
||||
* 独立租赁资金账户;仅USDT,按用户和网络隔离Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentAccountMapper extends BaseMapper<RentAccountPlus>
|
||||
{
|
||||
/**
|
||||
* 查询独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param id 独立租赁资金账户;仅USDT,按用户和网络隔离ID
|
||||
* @return 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
public RentAccount selectRentAccountById(Long id);
|
||||
|
||||
/**
|
||||
* 查询独立租赁资金账户;仅USDT,按用户和网络隔离列表
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 独立租赁资金账户;仅USDT,按用户和网络隔离集合
|
||||
*/
|
||||
public List<RentAccount> selectRentAccountList(RentAccount rentAccount);
|
||||
|
||||
/**
|
||||
* 新增独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentAccount(RentAccount rentAccount);
|
||||
|
||||
/**
|
||||
* 修改独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentAccount(RentAccount rentAccount);
|
||||
|
||||
/**
|
||||
* 删除独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param id 独立租赁资金账户;仅USDT,按用户和网络隔离ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentAccountById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentAccountByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentApp;
|
||||
import com.ruoyi.system.domain.RentAppPlus;
|
||||
|
||||
/**
|
||||
* 租赁独立商户应用;登录及权限共用若依Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentAppMapper extends BaseMapper<RentAppPlus>
|
||||
{
|
||||
/**
|
||||
* 查询租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param id 租赁独立商户应用;登录及权限共用若依ID
|
||||
* @return 租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
public RentApp selectRentAppById(Long id);
|
||||
|
||||
/**
|
||||
* 查询租赁独立商户应用;登录及权限共用若依列表
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 租赁独立商户应用;登录及权限共用若依集合
|
||||
*/
|
||||
public List<RentApp> selectRentAppList(RentApp rentApp);
|
||||
|
||||
/**
|
||||
* 新增租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentApp(RentApp rentApp);
|
||||
|
||||
/**
|
||||
* 修改租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentApp(RentApp rentApp);
|
||||
|
||||
/**
|
||||
* 删除租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param id 租赁独立商户应用;登录及权限共用若依ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentAppById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentAppByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentCredential;
|
||||
import com.ruoyi.system.domain.RentCredentialPlus;
|
||||
|
||||
/**
|
||||
* 商户及节点统一HMAC凭证版本;不含RSAMapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentCredentialMapper extends BaseMapper<RentCredentialPlus>
|
||||
{
|
||||
/**
|
||||
* 查询商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param id 商户及节点统一HMAC凭证版本;不含RSAID
|
||||
* @return 商户及节点统一HMAC凭证版本;不含RSA
|
||||
*/
|
||||
public RentCredential selectRentCredentialById(Long id);
|
||||
|
||||
/**
|
||||
* 查询商户及节点统一HMAC凭证版本;不含RSA列表
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 商户及节点统一HMAC凭证版本;不含RSA集合
|
||||
*/
|
||||
public List<RentCredential> selectRentCredentialList(RentCredential rentCredential);
|
||||
|
||||
/**
|
||||
* 新增商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentCredential(RentCredential rentCredential);
|
||||
|
||||
/**
|
||||
* 修改商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentCredential(RentCredential rentCredential);
|
||||
|
||||
/**
|
||||
* 删除商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param id 商户及节点统一HMAC凭证版本;不含RSAID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentCredentialById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentCredentialByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentEvent;
|
||||
import com.ruoyi.system.domain.RentEventPlus;
|
||||
|
||||
/**
|
||||
* 业务操作和状态变更追加审计;关键事务同写Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentEventMapper extends BaseMapper<RentEventPlus>
|
||||
{
|
||||
/**
|
||||
* 查询业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param id 业务操作和状态变更追加审计;关键事务同写ID
|
||||
* @return 业务操作和状态变更追加审计;关键事务同写
|
||||
*/
|
||||
public RentEvent selectRentEventById(Long id);
|
||||
|
||||
/**
|
||||
* 查询业务操作和状态变更追加审计;关键事务同写列表
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 业务操作和状态变更追加审计;关键事务同写集合
|
||||
*/
|
||||
public List<RentEvent> selectRentEventList(RentEvent rentEvent);
|
||||
|
||||
/**
|
||||
* 新增业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentEvent(RentEvent rentEvent);
|
||||
|
||||
/**
|
||||
* 修改业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentEvent(RentEvent rentEvent);
|
||||
|
||||
/**
|
||||
* 删除业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param id 业务操作和状态变更追加审计;关键事务同写ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentEventById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentEventByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentLedger;
|
||||
import com.ruoyi.system.domain.RentLedgerPlus;
|
||||
|
||||
/**
|
||||
* 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentLedgerMapper extends BaseMapper<RentLedgerPlus>
|
||||
{
|
||||
/**
|
||||
* 查询不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param id 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖ID
|
||||
* @return 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*/
|
||||
public RentLedger selectRentLedgerById(Long id);
|
||||
|
||||
/**
|
||||
* 查询不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖列表
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖集合
|
||||
*/
|
||||
public List<RentLedger> selectRentLedgerList(RentLedger rentLedger);
|
||||
|
||||
/**
|
||||
* 新增不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentLedger(RentLedger rentLedger);
|
||||
|
||||
/**
|
||||
* 修改不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentLedger(RentLedger rentLedger);
|
||||
|
||||
/**
|
||||
* 删除不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param id 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentLedgerById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentLedgerByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentNode;
|
||||
import com.ruoyi.system.domain.RentNodePlus;
|
||||
|
||||
/**
|
||||
* 供应商本地Agent节点;供应商直接关联共享用户,不另建成员Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentNodeMapper extends BaseMapper<RentNodePlus>
|
||||
{
|
||||
/**
|
||||
* 查询供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param id 供应商本地Agent节点;供应商直接关联共享用户,不另建成员ID
|
||||
* @return 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
public RentNode selectRentNodeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应商本地Agent节点;供应商直接关联共享用户,不另建成员列表
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 供应商本地Agent节点;供应商直接关联共享用户,不另建成员集合
|
||||
*/
|
||||
public List<RentNode> selectRentNodeList(RentNode rentNode);
|
||||
|
||||
/**
|
||||
* 新增供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentNode(RentNode rentNode);
|
||||
|
||||
/**
|
||||
* 修改供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentNode(RentNode rentNode);
|
||||
|
||||
/**
|
||||
* 删除供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param id 供应商本地Agent节点;供应商直接关联共享用户,不另建成员ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentNodeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentNodeByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentNonce;
|
||||
import com.ruoyi.system.domain.RentNoncePlus;
|
||||
|
||||
/**
|
||||
* HMAC请求防重放记录Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentNonceMapper extends BaseMapper<RentNoncePlus>
|
||||
{
|
||||
/**
|
||||
* 查询HMAC请求防重放记录
|
||||
*
|
||||
* @param id HMAC请求防重放记录ID
|
||||
* @return HMAC请求防重放记录
|
||||
*/
|
||||
public RentNonce selectRentNonceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询HMAC请求防重放记录列表
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return HMAC请求防重放记录集合
|
||||
*/
|
||||
public List<RentNonce> selectRentNonceList(RentNonce rentNonce);
|
||||
|
||||
/**
|
||||
* 新增HMAC请求防重放记录
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentNonce(RentNonce rentNonce);
|
||||
|
||||
/**
|
||||
* 修改HMAC请求防重放记录
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentNonce(RentNonce rentNonce);
|
||||
|
||||
/**
|
||||
* 删除HMAC请求防重放记录
|
||||
*
|
||||
* @param id HMAC请求防重放记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentNonceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除HMAC请求防重放记录
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentNonceByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentOrder;
|
||||
import com.ruoyi.system.domain.RentOrderPlus;
|
||||
|
||||
/**
|
||||
* 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentOrderMapper extends BaseMapper<RentOrderPlus>
|
||||
{
|
||||
/**
|
||||
* 查询能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param id 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开ID
|
||||
* @return 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*/
|
||||
public RentOrder selectRentOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 查询能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开列表
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开集合
|
||||
*/
|
||||
public List<RentOrder> selectRentOrderList(RentOrder rentOrder);
|
||||
|
||||
/**
|
||||
* 新增能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentOrder(RentOrder rentOrder);
|
||||
|
||||
/**
|
||||
* 修改能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentOrder(RentOrder rentOrder);
|
||||
|
||||
/**
|
||||
* 删除能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param id 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentOrderByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentPackage;
|
||||
import com.ruoyi.system.domain.RentPackagePlus;
|
||||
|
||||
/**
|
||||
* 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentPackageMapper extends BaseMapper<RentPackagePlus>
|
||||
{
|
||||
/**
|
||||
* 查询能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param id 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变ID
|
||||
* @return 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*/
|
||||
public RentPackage selectRentPackageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变列表
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变集合
|
||||
*/
|
||||
public List<RentPackage> selectRentPackageList(RentPackage rentPackage);
|
||||
|
||||
/**
|
||||
* 新增能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentPackage(RentPackage rentPackage);
|
||||
|
||||
/**
|
||||
* 修改能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentPackage(RentPackage rentPackage);
|
||||
|
||||
/**
|
||||
* 删除能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param id 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentPackageById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentPackageByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentRefund;
|
||||
import com.ruoyi.system.domain.RentRefundPlus;
|
||||
|
||||
/**
|
||||
* 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentRefundMapper extends BaseMapper<RentRefundPlus>
|
||||
{
|
||||
/**
|
||||
* 查询内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param id 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史ID
|
||||
* @return 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*/
|
||||
public RentRefund selectRentRefundById(Long id);
|
||||
|
||||
/**
|
||||
* 查询内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史列表
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史集合
|
||||
*/
|
||||
public List<RentRefund> selectRentRefundList(RentRefund rentRefund);
|
||||
|
||||
/**
|
||||
* 新增内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentRefund(RentRefund rentRefund);
|
||||
|
||||
/**
|
||||
* 修改内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentRefund(RentRefund rentRefund);
|
||||
|
||||
/**
|
||||
* 删除内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param id 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentRefundById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentRefundByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentSettlementItem;
|
||||
import com.ruoyi.system.domain.RentSettlementItemPlus;
|
||||
|
||||
/**
|
||||
* 供应商订单应收与结算关联;首版每单全额结算一次Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentSettlementItemMapper extends BaseMapper<RentSettlementItemPlus>
|
||||
{
|
||||
/**
|
||||
* 查询供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param id 供应商订单应收与结算关联;首版每单全额结算一次ID
|
||||
* @return 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*/
|
||||
public RentSettlementItem selectRentSettlementItemById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应商订单应收与结算关联;首版每单全额结算一次列表
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 供应商订单应收与结算关联;首版每单全额结算一次集合
|
||||
*/
|
||||
public List<RentSettlementItem> selectRentSettlementItemList(RentSettlementItem rentSettlementItem);
|
||||
|
||||
/**
|
||||
* 新增供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentSettlementItem(RentSettlementItem rentSettlementItem);
|
||||
|
||||
/**
|
||||
* 修改供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentSettlementItem(RentSettlementItem rentSettlementItem);
|
||||
|
||||
/**
|
||||
* 删除供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param id 供应商订单应收与结算关联;首版每单全额结算一次ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentSettlementItemById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentSettlementItemByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentSettlement;
|
||||
import com.ruoyi.system.domain.RentSettlementPlus;
|
||||
|
||||
/**
|
||||
* 供应商人工结算单;不自动链上出金Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentSettlementMapper extends BaseMapper<RentSettlementPlus>
|
||||
{
|
||||
/**
|
||||
* 查询供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param id 供应商人工结算单;不自动链上出金ID
|
||||
* @return 供应商人工结算单;不自动链上出金
|
||||
*/
|
||||
public RentSettlement selectRentSettlementById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应商人工结算单;不自动链上出金列表
|
||||
*
|
||||
* @param rentSettlement 供应商人工结算单;不自动链上出金
|
||||
* @return 供应商人工结算单;不自动链上出金集合
|
||||
*/
|
||||
public List<RentSettlement> selectRentSettlementList(RentSettlement rentSettlement);
|
||||
|
||||
/**
|
||||
* 新增供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param rentSettlement 供应商人工结算单;不自动链上出金
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentSettlement(RentSettlement rentSettlement);
|
||||
|
||||
/**
|
||||
* 修改供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param rentSettlement 供应商人工结算单;不自动链上出金
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentSettlement(RentSettlement rentSettlement);
|
||||
|
||||
/**
|
||||
* 删除供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param id 供应商人工结算单;不自动链上出金ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentSettlementById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentSettlementByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentTask;
|
||||
import com.ruoyi.system.domain.RentTaskPlus;
|
||||
|
||||
/**
|
||||
* 委托或回收任务,兼作持久队列与资源预留明细Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentTaskMapper extends BaseMapper<RentTaskPlus>
|
||||
{
|
||||
/**
|
||||
* 查询委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param id 委托或回收任务,兼作持久队列与资源预留明细ID
|
||||
* @return 委托或回收任务,兼作持久队列与资源预留明细
|
||||
*/
|
||||
public RentTask selectRentTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询委托或回收任务,兼作持久队列与资源预留明细列表
|
||||
*
|
||||
* @param rentTask 委托或回收任务,兼作持久队列与资源预留明细
|
||||
* @return 委托或回收任务,兼作持久队列与资源预留明细集合
|
||||
*/
|
||||
public List<RentTask> selectRentTaskList(RentTask rentTask);
|
||||
|
||||
/**
|
||||
* 新增委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param rentTask 委托或回收任务,兼作持久队列与资源预留明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentTask(RentTask rentTask);
|
||||
|
||||
/**
|
||||
* 修改委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param rentTask 委托或回收任务,兼作持久队列与资源预留明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentTask(RentTask rentTask);
|
||||
|
||||
/**
|
||||
* 删除委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param id 委托或回收任务,兼作持久队列与资源预留明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentTaskByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentTransaction;
|
||||
import com.ruoyi.system.domain.RentTransactionPlus;
|
||||
|
||||
/**
|
||||
* 链上委托或回收证据;一任务只能构建一笔交易Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentTransactionMapper extends BaseMapper<RentTransactionPlus>
|
||||
{
|
||||
/**
|
||||
* 查询链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param id 链上委托或回收证据;一任务只能构建一笔交易ID
|
||||
* @return 链上委托或回收证据;一任务只能构建一笔交易
|
||||
*/
|
||||
public RentTransaction selectRentTransactionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询链上委托或回收证据;一任务只能构建一笔交易列表
|
||||
*
|
||||
* @param rentTransaction 链上委托或回收证据;一任务只能构建一笔交易
|
||||
* @return 链上委托或回收证据;一任务只能构建一笔交易集合
|
||||
*/
|
||||
public List<RentTransaction> selectRentTransactionList(RentTransaction rentTransaction);
|
||||
|
||||
/**
|
||||
* 新增链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param rentTransaction 链上委托或回收证据;一任务只能构建一笔交易
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentTransaction(RentTransaction rentTransaction);
|
||||
|
||||
/**
|
||||
* 修改链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param rentTransaction 链上委托或回收证据;一任务只能构建一笔交易
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentTransaction(RentTransaction rentTransaction);
|
||||
|
||||
/**
|
||||
* 删除链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param id 链上委托或回收证据;一任务只能构建一笔交易ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentTransactionById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentTransactionByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentWallet;
|
||||
import com.ruoyi.system.domain.RentWalletPlus;
|
||||
|
||||
/**
|
||||
* 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentWalletMapper extends BaseMapper<RentWalletPlus>
|
||||
{
|
||||
/**
|
||||
* 查询供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param id 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点ID
|
||||
* @return 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*/
|
||||
public RentWallet selectRentWalletById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点列表
|
||||
*
|
||||
* @param rentWallet 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
* @return 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点集合
|
||||
*/
|
||||
public List<RentWallet> selectRentWalletList(RentWallet rentWallet);
|
||||
|
||||
/**
|
||||
* 新增供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param rentWallet 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentWallet(RentWallet rentWallet);
|
||||
|
||||
/**
|
||||
* 修改供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param rentWallet 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentWallet(RentWallet rentWallet);
|
||||
|
||||
/**
|
||||
* 删除供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param id 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentWalletById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentWalletByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.RentWebhook;
|
||||
import com.ruoyi.system.domain.RentWebhookPlus;
|
||||
|
||||
/**
|
||||
* 订单回调持久队列;业务状态更新时同事务写入Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface RentWebhookMapper extends BaseMapper<RentWebhookPlus>
|
||||
{
|
||||
/**
|
||||
* 查询订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param id 订单回调持久队列;业务状态更新时同事务写入ID
|
||||
* @return 订单回调持久队列;业务状态更新时同事务写入
|
||||
*/
|
||||
public RentWebhook selectRentWebhookById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单回调持久队列;业务状态更新时同事务写入列表
|
||||
*
|
||||
* @param rentWebhook 订单回调持久队列;业务状态更新时同事务写入
|
||||
* @return 订单回调持久队列;业务状态更新时同事务写入集合
|
||||
*/
|
||||
public List<RentWebhook> selectRentWebhookList(RentWebhook rentWebhook);
|
||||
|
||||
/**
|
||||
* 新增订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param rentWebhook 订单回调持久队列;业务状态更新时同事务写入
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentWebhook(RentWebhook rentWebhook);
|
||||
|
||||
/**
|
||||
* 修改订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param rentWebhook 订单回调持久队列;业务状态更新时同事务写入
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentWebhook(RentWebhook rentWebhook);
|
||||
|
||||
/**
|
||||
* 删除订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param id 订单回调持久队列;业务状态更新时同事务写入ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentWebhookById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentWebhookByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentAccount;
|
||||
import com.ruoyi.system.domain.RentAccountPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 独立租赁资金账户;仅USDT,按用户和网络隔离Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentAccountService extends IService<RentAccountPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword,boolean isUser);
|
||||
/**
|
||||
* 查询独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param id 独立租赁资金账户;仅USDT,按用户和网络隔离ID
|
||||
* @return 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
public RentAccount selectRentAccountById(Long id,boolean isUser);
|
||||
|
||||
/**
|
||||
* 查询独立租赁资金账户;仅USDT,按用户和网络隔离列表
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 独立租赁资金账户;仅USDT,按用户和网络隔离集合
|
||||
*/
|
||||
public List<RentAccount> selectRentAccountList(RentAccount rentAccount,boolean isUser);
|
||||
|
||||
/**
|
||||
* 新增独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentAccount(RentAccount rentAccount,boolean isUser);
|
||||
|
||||
/**
|
||||
* 修改独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentAccount(RentAccount rentAccount,boolean isUser);
|
||||
|
||||
/**
|
||||
* 批量删除独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param ids 需要删除的独立租赁资金账户;仅USDT,按用户和网络隔离ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentAccountByIds(Long[] ids,boolean isUser);
|
||||
|
||||
/**
|
||||
* 删除独立租赁资金账户;仅USDT,按用户和网络隔离信息
|
||||
*
|
||||
* @param id 独立租赁资金账户;仅USDT,按用户和网络隔离ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentAccountById(Long id,boolean isUser);
|
||||
|
||||
List<RentAccountPlus> getByIds(List<Long> ids,boolean isUser, SFunction<RentAccountPlus, ?>... columns);
|
||||
|
||||
RentAccountPlus getById(Long id, SFunction<RentAccountPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentAccountPlus> getMapByIds(List<Long> ids, SFunction<RentAccountPlus, ?>... columns);
|
||||
|
||||
List<RentAccountPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentAccountPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentApp;
|
||||
import com.ruoyi.system.domain.RentAppPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 租赁独立商户应用;登录及权限共用若依Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentAppService extends IService<RentAppPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword,boolean isUser);
|
||||
/**
|
||||
* 查询租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param id 租赁独立商户应用;登录及权限共用若依ID
|
||||
* @return 租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
public RentApp selectRentAppById(Long id,boolean isUser);
|
||||
|
||||
/**
|
||||
* 查询租赁独立商户应用;登录及权限共用若依列表
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 租赁独立商户应用;登录及权限共用若依集合
|
||||
*/
|
||||
public List<RentApp> selectRentAppList(RentApp rentApp,boolean isUser);
|
||||
|
||||
/**
|
||||
* 新增租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentApp(RentApp rentApp,boolean isUser);
|
||||
|
||||
/**
|
||||
* 修改租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentApp(RentApp rentApp,boolean isUser);
|
||||
|
||||
/**
|
||||
* 批量删除租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param ids 需要删除的租赁独立商户应用;登录及权限共用若依ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentAppByIds(Long[] ids,boolean isUser);
|
||||
|
||||
/**
|
||||
* 删除租赁独立商户应用;登录及权限共用若依信息
|
||||
*
|
||||
* @param id 租赁独立商户应用;登录及权限共用若依ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentAppById(Long id,boolean isUser);
|
||||
|
||||
List<RentAppPlus> getByIds(List<Long> ids,boolean isUser, SFunction<RentAppPlus, ?>... columns);
|
||||
|
||||
RentAppPlus getById(Long id, SFunction<RentAppPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentAppPlus> getMapByIds(List<Long> ids, SFunction<RentAppPlus, ?>... columns);
|
||||
|
||||
List<RentAppPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentAppPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentCredential;
|
||||
import com.ruoyi.system.domain.RentCredentialPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 商户及节点统一HMAC凭证版本;不含RSAService接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentCredentialService extends IService<RentCredentialPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param id 商户及节点统一HMAC凭证版本;不含RSAID
|
||||
* @return 商户及节点统一HMAC凭证版本;不含RSA
|
||||
*/
|
||||
public RentCredential selectRentCredentialById(Long id);
|
||||
|
||||
/**
|
||||
* 查询商户及节点统一HMAC凭证版本;不含RSA列表
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 商户及节点统一HMAC凭证版本;不含RSA集合
|
||||
*/
|
||||
public List<RentCredential> selectRentCredentialList(RentCredential rentCredential);
|
||||
|
||||
/**
|
||||
* 新增商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentCredential(RentCredential rentCredential);
|
||||
|
||||
/**
|
||||
* 修改商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentCredential(RentCredential rentCredential);
|
||||
|
||||
/**
|
||||
* 批量删除商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param ids 需要删除的商户及节点统一HMAC凭证版本;不含RSAID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentCredentialByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除商户及节点统一HMAC凭证版本;不含RSA信息
|
||||
*
|
||||
* @param id 商户及节点统一HMAC凭证版本;不含RSAID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentCredentialById(Long id);
|
||||
|
||||
List<RentCredentialPlus> getByIds(List<Long> ids, SFunction<RentCredentialPlus, ?>... columns);
|
||||
|
||||
RentCredentialPlus getById(Long id, SFunction<RentCredentialPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentCredentialPlus> getMapByIds(List<Long> ids, SFunction<RentCredentialPlus, ?>... columns);
|
||||
|
||||
List<RentCredentialPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentCredentialPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentEvent;
|
||||
import com.ruoyi.system.domain.RentEventPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 业务操作和状态变更追加审计;关键事务同写Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentEventService extends IService<RentEventPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param id 业务操作和状态变更追加审计;关键事务同写ID
|
||||
* @return 业务操作和状态变更追加审计;关键事务同写
|
||||
*/
|
||||
public RentEvent selectRentEventById(Long id);
|
||||
|
||||
/**
|
||||
* 查询业务操作和状态变更追加审计;关键事务同写列表
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 业务操作和状态变更追加审计;关键事务同写集合
|
||||
*/
|
||||
public List<RentEvent> selectRentEventList(RentEvent rentEvent);
|
||||
|
||||
/**
|
||||
* 新增业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentEvent(RentEvent rentEvent);
|
||||
|
||||
/**
|
||||
* 修改业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentEvent(RentEvent rentEvent);
|
||||
|
||||
/**
|
||||
* 批量删除业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param ids 需要删除的业务操作和状态变更追加审计;关键事务同写ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentEventByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除业务操作和状态变更追加审计;关键事务同写信息
|
||||
*
|
||||
* @param id 业务操作和状态变更追加审计;关键事务同写ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentEventById(Long id);
|
||||
|
||||
List<RentEventPlus> getByIds(List<Long> ids, SFunction<RentEventPlus, ?>... columns);
|
||||
|
||||
RentEventPlus getById(Long id, SFunction<RentEventPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentEventPlus> getMapByIds(List<Long> ids, SFunction<RentEventPlus, ?>... columns);
|
||||
|
||||
List<RentEventPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentEventPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentLedger;
|
||||
import com.ruoyi.system.domain.RentLedgerPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentLedgerService extends IService<RentLedgerPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param id 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖ID
|
||||
* @return 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*/
|
||||
public RentLedger selectRentLedgerById(Long id);
|
||||
|
||||
/**
|
||||
* 查询不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖列表
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖集合
|
||||
*/
|
||||
public List<RentLedger> selectRentLedgerList(RentLedger rentLedger);
|
||||
|
||||
/**
|
||||
* 新增不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentLedger(RentLedger rentLedger);
|
||||
|
||||
/**
|
||||
* 修改不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentLedger(RentLedger rentLedger);
|
||||
|
||||
/**
|
||||
* 批量删除不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param ids 需要删除的不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentLedgerByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖信息
|
||||
*
|
||||
* @param id 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentLedgerById(Long id);
|
||||
|
||||
List<RentLedgerPlus> getByIds(List<Long> ids, SFunction<RentLedgerPlus, ?>... columns);
|
||||
|
||||
RentLedgerPlus getById(Long id, SFunction<RentLedgerPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentLedgerPlus> getMapByIds(List<Long> ids, SFunction<RentLedgerPlus, ?>... columns);
|
||||
|
||||
List<RentLedgerPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentLedgerPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentNode;
|
||||
import com.ruoyi.system.domain.RentNodePlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 供应商本地Agent节点;供应商直接关联共享用户,不另建成员Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentNodeService extends IService<RentNodePlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword,boolean isUser);
|
||||
/**
|
||||
* 查询供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param id 供应商本地Agent节点;供应商直接关联共享用户,不另建成员ID
|
||||
* @return 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
public RentNode selectRentNodeById(Long id,boolean isUser);
|
||||
|
||||
/**
|
||||
* 查询供应商本地Agent节点;供应商直接关联共享用户,不另建成员列表
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 供应商本地Agent节点;供应商直接关联共享用户,不另建成员集合
|
||||
*/
|
||||
public List<RentNode> selectRentNodeList(RentNode rentNode,boolean isUser);
|
||||
|
||||
/**
|
||||
* 新增供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentNode(RentNode rentNode,boolean isUser);
|
||||
|
||||
/**
|
||||
* 修改供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentNode(RentNode rentNode,boolean isUser);
|
||||
|
||||
/**
|
||||
* 批量删除供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param ids 需要删除的供应商本地Agent节点;供应商直接关联共享用户,不另建成员ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentNodeByIds(Long[] ids,boolean isUser);
|
||||
|
||||
/**
|
||||
* 删除供应商本地Agent节点;供应商直接关联共享用户,不另建成员信息
|
||||
*
|
||||
* @param id 供应商本地Agent节点;供应商直接关联共享用户,不另建成员ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentNodeById(Long id,boolean isUser);
|
||||
|
||||
List<RentNodePlus> getByIds(List<Long> ids,boolean isUser, SFunction<RentNodePlus, ?>... columns);
|
||||
|
||||
RentNodePlus getById(Long id, SFunction<RentNodePlus, ?>... columns);
|
||||
|
||||
Map<Long, RentNodePlus> getMapByIds(List<Long> ids, SFunction<RentNodePlus, ?>... columns);
|
||||
|
||||
List<RentNodePlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentNodePlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentNonce;
|
||||
import com.ruoyi.system.domain.RentNoncePlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* HMAC请求防重放记录Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentNonceService extends IService<RentNoncePlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询HMAC请求防重放记录
|
||||
*
|
||||
* @param id HMAC请求防重放记录ID
|
||||
* @return HMAC请求防重放记录
|
||||
*/
|
||||
public RentNonce selectRentNonceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询HMAC请求防重放记录列表
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return HMAC请求防重放记录集合
|
||||
*/
|
||||
public List<RentNonce> selectRentNonceList(RentNonce rentNonce);
|
||||
|
||||
/**
|
||||
* 新增HMAC请求防重放记录
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentNonce(RentNonce rentNonce);
|
||||
|
||||
/**
|
||||
* 修改HMAC请求防重放记录
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentNonce(RentNonce rentNonce);
|
||||
|
||||
/**
|
||||
* 批量删除HMAC请求防重放记录
|
||||
*
|
||||
* @param ids 需要删除的HMAC请求防重放记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentNonceByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除HMAC请求防重放记录信息
|
||||
*
|
||||
* @param id HMAC请求防重放记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentNonceById(Long id);
|
||||
|
||||
List<RentNoncePlus> getByIds(List<Long> ids, SFunction<RentNoncePlus, ?>... columns);
|
||||
|
||||
RentNoncePlus getById(Long id, SFunction<RentNoncePlus, ?>... columns);
|
||||
|
||||
Map<Long, RentNoncePlus> getMapByIds(List<Long> ids, SFunction<RentNoncePlus, ?>... columns);
|
||||
|
||||
List<RentNoncePlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentNoncePlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentOrder;
|
||||
import com.ruoyi.system.domain.RentOrderPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentOrderService extends IService<RentOrderPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param id 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开ID
|
||||
* @return 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*/
|
||||
public RentOrder selectRentOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 查询能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开列表
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开集合
|
||||
*/
|
||||
public List<RentOrder> selectRentOrderList(RentOrder rentOrder);
|
||||
|
||||
/**
|
||||
* 新增能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentOrder(RentOrder rentOrder);
|
||||
|
||||
/**
|
||||
* 修改能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentOrder(RentOrder rentOrder);
|
||||
|
||||
/**
|
||||
* 批量删除能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param ids 需要删除的能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentOrderByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开信息
|
||||
*
|
||||
* @param id 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentOrderById(Long id);
|
||||
|
||||
List<RentOrderPlus> getByIds(List<Long> ids, SFunction<RentOrderPlus, ?>... columns);
|
||||
|
||||
RentOrderPlus getById(Long id, SFunction<RentOrderPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentOrderPlus> getMapByIds(List<Long> ids, SFunction<RentOrderPlus, ?>... columns);
|
||||
|
||||
List<RentOrderPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentOrderPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentPackage;
|
||||
import com.ruoyi.system.domain.RentPackagePlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentPackageService extends IService<RentPackagePlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param id 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变ID
|
||||
* @return 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*/
|
||||
public RentPackage selectRentPackageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变列表
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变集合
|
||||
*/
|
||||
public List<RentPackage> selectRentPackageList(RentPackage rentPackage);
|
||||
|
||||
/**
|
||||
* 新增能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentPackage(RentPackage rentPackage);
|
||||
|
||||
/**
|
||||
* 修改能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentPackage(RentPackage rentPackage);
|
||||
|
||||
/**
|
||||
* 批量删除能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param ids 需要删除的能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentPackageByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变信息
|
||||
*
|
||||
* @param id 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentPackageById(Long id);
|
||||
|
||||
List<RentPackagePlus> getByIds(List<Long> ids, SFunction<RentPackagePlus, ?>... columns);
|
||||
|
||||
RentPackagePlus getById(Long id, SFunction<RentPackagePlus, ?>... columns);
|
||||
|
||||
Map<Long, RentPackagePlus> getMapByIds(List<Long> ids, SFunction<RentPackagePlus, ?>... columns);
|
||||
|
||||
List<RentPackagePlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentPackagePlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentRefund;
|
||||
import com.ruoyi.system.domain.RentRefundPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentRefundService extends IService<RentRefundPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param id 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史ID
|
||||
* @return 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*/
|
||||
public RentRefund selectRentRefundById(Long id);
|
||||
|
||||
/**
|
||||
* 查询内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史列表
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史集合
|
||||
*/
|
||||
public List<RentRefund> selectRentRefundList(RentRefund rentRefund);
|
||||
|
||||
/**
|
||||
* 新增内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentRefund(RentRefund rentRefund);
|
||||
|
||||
/**
|
||||
* 修改内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentRefund(RentRefund rentRefund);
|
||||
|
||||
/**
|
||||
* 批量删除内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param ids 需要删除的内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentRefundByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史信息
|
||||
*
|
||||
* @param id 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentRefundById(Long id);
|
||||
|
||||
List<RentRefundPlus> getByIds(List<Long> ids, SFunction<RentRefundPlus, ?>... columns);
|
||||
|
||||
RentRefundPlus getById(Long id, SFunction<RentRefundPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentRefundPlus> getMapByIds(List<Long> ids, SFunction<RentRefundPlus, ?>... columns);
|
||||
|
||||
List<RentRefundPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentRefundPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentSettlementItem;
|
||||
import com.ruoyi.system.domain.RentSettlementItemPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 供应商订单应收与结算关联;首版每单全额结算一次Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentSettlementItemService extends IService<RentSettlementItemPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param id 供应商订单应收与结算关联;首版每单全额结算一次ID
|
||||
* @return 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*/
|
||||
public RentSettlementItem selectRentSettlementItemById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应商订单应收与结算关联;首版每单全额结算一次列表
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 供应商订单应收与结算关联;首版每单全额结算一次集合
|
||||
*/
|
||||
public List<RentSettlementItem> selectRentSettlementItemList(RentSettlementItem rentSettlementItem);
|
||||
|
||||
/**
|
||||
* 新增供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentSettlementItem(RentSettlementItem rentSettlementItem);
|
||||
|
||||
/**
|
||||
* 修改供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentSettlementItem(RentSettlementItem rentSettlementItem);
|
||||
|
||||
/**
|
||||
* 批量删除供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param ids 需要删除的供应商订单应收与结算关联;首版每单全额结算一次ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentSettlementItemByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除供应商订单应收与结算关联;首版每单全额结算一次信息
|
||||
*
|
||||
* @param id 供应商订单应收与结算关联;首版每单全额结算一次ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentSettlementItemById(Long id);
|
||||
|
||||
List<RentSettlementItemPlus> getByIds(List<Long> ids, SFunction<RentSettlementItemPlus, ?>... columns);
|
||||
|
||||
RentSettlementItemPlus getById(Long id, SFunction<RentSettlementItemPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentSettlementItemPlus> getMapByIds(List<Long> ids, SFunction<RentSettlementItemPlus, ?>... columns);
|
||||
|
||||
List<RentSettlementItemPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentSettlementItemPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentSettlement;
|
||||
import com.ruoyi.system.domain.RentSettlementPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 供应商人工结算单;不自动链上出金Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentSettlementService extends IService<RentSettlementPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param id 供应商人工结算单;不自动链上出金ID
|
||||
* @return 供应商人工结算单;不自动链上出金
|
||||
*/
|
||||
public RentSettlement selectRentSettlementById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应商人工结算单;不自动链上出金列表
|
||||
*
|
||||
* @param rentSettlement 供应商人工结算单;不自动链上出金
|
||||
* @return 供应商人工结算单;不自动链上出金集合
|
||||
*/
|
||||
public List<RentSettlement> selectRentSettlementList(RentSettlement rentSettlement);
|
||||
|
||||
/**
|
||||
* 新增供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param rentSettlement 供应商人工结算单;不自动链上出金
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentSettlement(RentSettlement rentSettlement);
|
||||
|
||||
/**
|
||||
* 修改供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param rentSettlement 供应商人工结算单;不自动链上出金
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentSettlement(RentSettlement rentSettlement);
|
||||
|
||||
/**
|
||||
* 批量删除供应商人工结算单;不自动链上出金
|
||||
*
|
||||
* @param ids 需要删除的供应商人工结算单;不自动链上出金ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentSettlementByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除供应商人工结算单;不自动链上出金信息
|
||||
*
|
||||
* @param id 供应商人工结算单;不自动链上出金ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentSettlementById(Long id);
|
||||
|
||||
List<RentSettlementPlus> getByIds(List<Long> ids, SFunction<RentSettlementPlus, ?>... columns);
|
||||
|
||||
RentSettlementPlus getById(Long id, SFunction<RentSettlementPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentSettlementPlus> getMapByIds(List<Long> ids, SFunction<RentSettlementPlus, ?>... columns);
|
||||
|
||||
List<RentSettlementPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentSettlementPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentTask;
|
||||
import com.ruoyi.system.domain.RentTaskPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 委托或回收任务,兼作持久队列与资源预留明细Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentTaskService extends IService<RentTaskPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param id 委托或回收任务,兼作持久队列与资源预留明细ID
|
||||
* @return 委托或回收任务,兼作持久队列与资源预留明细
|
||||
*/
|
||||
public RentTask selectRentTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询委托或回收任务,兼作持久队列与资源预留明细列表
|
||||
*
|
||||
* @param rentTask 委托或回收任务,兼作持久队列与资源预留明细
|
||||
* @return 委托或回收任务,兼作持久队列与资源预留明细集合
|
||||
*/
|
||||
public List<RentTask> selectRentTaskList(RentTask rentTask);
|
||||
|
||||
/**
|
||||
* 新增委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param rentTask 委托或回收任务,兼作持久队列与资源预留明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentTask(RentTask rentTask);
|
||||
|
||||
/**
|
||||
* 修改委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param rentTask 委托或回收任务,兼作持久队列与资源预留明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentTask(RentTask rentTask);
|
||||
|
||||
/**
|
||||
* 批量删除委托或回收任务,兼作持久队列与资源预留明细
|
||||
*
|
||||
* @param ids 需要删除的委托或回收任务,兼作持久队列与资源预留明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentTaskByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除委托或回收任务,兼作持久队列与资源预留明细信息
|
||||
*
|
||||
* @param id 委托或回收任务,兼作持久队列与资源预留明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentTaskById(Long id);
|
||||
|
||||
List<RentTaskPlus> getByIds(List<Long> ids, SFunction<RentTaskPlus, ?>... columns);
|
||||
|
||||
RentTaskPlus getById(Long id, SFunction<RentTaskPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentTaskPlus> getMapByIds(List<Long> ids, SFunction<RentTaskPlus, ?>... columns);
|
||||
|
||||
List<RentTaskPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentTaskPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentTransaction;
|
||||
import com.ruoyi.system.domain.RentTransactionPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 链上委托或回收证据;一任务只能构建一笔交易Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentTransactionService extends IService<RentTransactionPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param id 链上委托或回收证据;一任务只能构建一笔交易ID
|
||||
* @return 链上委托或回收证据;一任务只能构建一笔交易
|
||||
*/
|
||||
public RentTransaction selectRentTransactionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询链上委托或回收证据;一任务只能构建一笔交易列表
|
||||
*
|
||||
* @param rentTransaction 链上委托或回收证据;一任务只能构建一笔交易
|
||||
* @return 链上委托或回收证据;一任务只能构建一笔交易集合
|
||||
*/
|
||||
public List<RentTransaction> selectRentTransactionList(RentTransaction rentTransaction);
|
||||
|
||||
/**
|
||||
* 新增链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param rentTransaction 链上委托或回收证据;一任务只能构建一笔交易
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentTransaction(RentTransaction rentTransaction);
|
||||
|
||||
/**
|
||||
* 修改链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param rentTransaction 链上委托或回收证据;一任务只能构建一笔交易
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentTransaction(RentTransaction rentTransaction);
|
||||
|
||||
/**
|
||||
* 批量删除链上委托或回收证据;一任务只能构建一笔交易
|
||||
*
|
||||
* @param ids 需要删除的链上委托或回收证据;一任务只能构建一笔交易ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentTransactionByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除链上委托或回收证据;一任务只能构建一笔交易信息
|
||||
*
|
||||
* @param id 链上委托或回收证据;一任务只能构建一笔交易ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentTransactionById(Long id);
|
||||
|
||||
List<RentTransactionPlus> getByIds(List<Long> ids, SFunction<RentTransactionPlus, ?>... columns);
|
||||
|
||||
RentTransactionPlus getById(Long id, SFunction<RentTransactionPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentTransactionPlus> getMapByIds(List<Long> ids, SFunction<RentTransactionPlus, ?>... columns);
|
||||
|
||||
List<RentTransactionPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentTransactionPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentWallet;
|
||||
import com.ruoyi.system.domain.RentWalletPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentWalletService extends IService<RentWalletPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param id 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点ID
|
||||
* @return 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*/
|
||||
public RentWallet selectRentWalletById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点列表
|
||||
*
|
||||
* @param rentWallet 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
* @return 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点集合
|
||||
*/
|
||||
public List<RentWallet> selectRentWalletList(RentWallet rentWallet);
|
||||
|
||||
/**
|
||||
* 新增供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param rentWallet 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentWallet(RentWallet rentWallet);
|
||||
|
||||
/**
|
||||
* 修改供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param rentWallet 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentWallet(RentWallet rentWallet);
|
||||
|
||||
/**
|
||||
* 批量删除供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点
|
||||
*
|
||||
* @param ids 需要删除的供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentWalletByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点信息
|
||||
*
|
||||
* @param id 供应钱包及能量带宽独立资源池投影;一个钱包绑定一个执行节点ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentWalletById(Long id);
|
||||
|
||||
List<RentWalletPlus> getByIds(List<Long> ids, SFunction<RentWalletPlus, ?>... columns);
|
||||
|
||||
RentWalletPlus getById(Long id, SFunction<RentWalletPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentWalletPlus> getMapByIds(List<Long> ids, SFunction<RentWalletPlus, ?>... columns);
|
||||
|
||||
List<RentWalletPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentWalletPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.system.domain.RentWebhook;
|
||||
import com.ruoyi.system.domain.RentWebhookPlus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 订单回调持久队列;业务状态更新时同事务写入Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
public interface IRentWebhookService extends IService<RentWebhookPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param id 订单回调持久队列;业务状态更新时同事务写入ID
|
||||
* @return 订单回调持久队列;业务状态更新时同事务写入
|
||||
*/
|
||||
public RentWebhook selectRentWebhookById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单回调持久队列;业务状态更新时同事务写入列表
|
||||
*
|
||||
* @param rentWebhook 订单回调持久队列;业务状态更新时同事务写入
|
||||
* @return 订单回调持久队列;业务状态更新时同事务写入集合
|
||||
*/
|
||||
public List<RentWebhook> selectRentWebhookList(RentWebhook rentWebhook);
|
||||
|
||||
/**
|
||||
* 新增订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param rentWebhook 订单回调持久队列;业务状态更新时同事务写入
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRentWebhook(RentWebhook rentWebhook);
|
||||
|
||||
/**
|
||||
* 修改订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param rentWebhook 订单回调持久队列;业务状态更新时同事务写入
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRentWebhook(RentWebhook rentWebhook);
|
||||
|
||||
/**
|
||||
* 批量删除订单回调持久队列;业务状态更新时同事务写入
|
||||
*
|
||||
* @param ids 需要删除的订单回调持久队列;业务状态更新时同事务写入ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentWebhookByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单回调持久队列;业务状态更新时同事务写入信息
|
||||
*
|
||||
* @param id 订单回调持久队列;业务状态更新时同事务写入ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRentWebhookById(Long id);
|
||||
|
||||
List<RentWebhookPlus> getByIds(List<Long> ids, SFunction<RentWebhookPlus, ?>... columns);
|
||||
|
||||
RentWebhookPlus getById(Long id, SFunction<RentWebhookPlus, ?>... columns);
|
||||
|
||||
Map<Long, RentWebhookPlus> getMapByIds(List<Long> ids, SFunction<RentWebhookPlus, ?>... columns);
|
||||
|
||||
List<RentWebhookPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, RentWebhookPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentAccount;
|
||||
import com.ruoyi.system.domain.RentAccountPlus;
|
||||
import com.ruoyi.system.mapper.RentAccountMapper;
|
||||
import com.ruoyi.system.service.IRentAccountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 独立租赁资金账户;仅USDT,按用户和网络隔离Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentAccountServiceImpl extends ServiceImpl<RentAccountMapper, RentAccountPlus> implements IRentAccountService
|
||||
{
|
||||
@Autowired
|
||||
private RentAccountMapper rentAccountMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentAccountPlus> getByIds(List<Long> ids ,boolean isUser, SFunction<RentAccountPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentAccountPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentAccountPlus>()
|
||||
.select(columns).in(RentAccountPlus::getId, ids);
|
||||
if(isUser){
|
||||
lambdaQueryWrapper.eq(RentAccountPlus::getUserId, SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentAccountPlus> list = this.list(lambdaQueryWrapper);
|
||||
if(isUser){
|
||||
checkUserPlus(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
private void checkUserPlus(List<RentAccountPlus> list) {
|
||||
for (RentAccountPlus item : list){
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void checkUser(List<RentAccount> list) {
|
||||
for (RentAccount item : list){
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void checkUser(RentAccountPlus item) {
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
private void checkUser(RentAccount item) {
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword,boolean isUser) {
|
||||
LambdaQueryWrapper<RentAccountPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentAccountPlus>()
|
||||
.select(RentAccountPlus::getId,RentAccountPlus::getUserId, RentAccountPlus::getUserId)
|
||||
.like(RentAccountPlus::getUserId, keyword);
|
||||
if(isUser){
|
||||
lambdaQueryWrapper.eq(RentAccountPlus::getUserId, SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentAccountPlus> list = this.list(lambdaQueryWrapper);
|
||||
if(isUser){
|
||||
checkUserPlus(list);
|
||||
}
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentAccountPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(item.getUserId()+"");
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentAccountPlus getById(Long id, SFunction<RentAccountPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentAccountPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentAccountPlus>()
|
||||
.select(columns).eq(RentAccountPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentAccountPlus> getMapByIds(List<Long> ids, SFunction<RentAccountPlus, ?>... columns) {
|
||||
List<RentAccountPlus> list = this.getByIds(ids,false, columns);
|
||||
Map<Long, RentAccountPlus> map = new HashMap<>();
|
||||
for (RentAccountPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentAccountPlus> getMapByIds(List<Long> ids) {
|
||||
List<RentAccountPlus> list = this.getByIds(ids);
|
||||
Map<Long, RentAccountPlus> map = new HashMap<>();
|
||||
for (RentAccountPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentAccountPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentAccountPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentAccountPlus>().in(RentAccountPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_account ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_account ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_account ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param id 独立租赁资金账户;仅USDT,按用户和网络隔离ID
|
||||
* @return 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
@Override
|
||||
public RentAccount selectRentAccountById(Long id,boolean isUser)
|
||||
{
|
||||
RentAccount vo = rentAccountMapper.selectRentAccountById(id);
|
||||
if(isUser){
|
||||
checkUser(vo);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询独立租赁资金账户;仅USDT,按用户和网络隔离列表
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*/
|
||||
@Override
|
||||
public List<RentAccount> selectRentAccountList(RentAccount rentAccount,boolean isUser)
|
||||
{
|
||||
if(rentAccount == null){
|
||||
rentAccount = new RentAccount();
|
||||
}
|
||||
if(isUser){
|
||||
rentAccount.setUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentAccount> list = rentAccountMapper.selectRentAccountList(rentAccount);
|
||||
if(isUser){
|
||||
checkUser(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentAccount(RentAccount rentAccount,boolean isUser)
|
||||
{
|
||||
rentAccount.setCreatedAt(DateUtils.getNowDate());
|
||||
rentAccount.setUpdatedAt(DateUtils.getNowDate());
|
||||
if(isUser){
|
||||
rentAccount.setUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
return rentAccountMapper.insertRentAccount(rentAccount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param rentAccount 独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentAccount(RentAccount rentAccount,boolean isUser)
|
||||
{
|
||||
rentAccount.setUpdatedAt(DateUtils.getNowDate());
|
||||
if(isUser){
|
||||
checkUser(rentAccount);
|
||||
}
|
||||
return rentAccountMapper.updateRentAccount(rentAccount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除独立租赁资金账户;仅USDT,按用户和网络隔离
|
||||
*
|
||||
* @param ids 需要删除的独立租赁资金账户;仅USDT,按用户和网络隔离ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentAccountByIds(Long[] ids,boolean isUser)
|
||||
{
|
||||
if(isUser){
|
||||
List<RentAccountPlus> list= getByIds(Arrays.asList(ids),false,RentAccountPlus::getUserId,RentAccountPlus::getId);
|
||||
checkUserPlus(list);
|
||||
}
|
||||
return rentAccountMapper.deleteRentAccountByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除独立租赁资金账户;仅USDT,按用户和网络隔离信息
|
||||
*
|
||||
* @param id 独立租赁资金账户;仅USDT,按用户和网络隔离ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentAccountById(Long id,boolean isUser)
|
||||
{
|
||||
if(isUser){
|
||||
RentAccountPlus vo = getById(id,RentAccountPlus::getUserId,RentAccountPlus::getId);
|
||||
checkUser(vo);
|
||||
}
|
||||
return rentAccountMapper.deleteRentAccountById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentApp;
|
||||
import com.ruoyi.system.domain.RentAppPlus;
|
||||
import com.ruoyi.system.mapper.RentAppMapper;
|
||||
import com.ruoyi.system.service.IRentAppService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 租赁独立商户应用;登录及权限共用若依Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentAppServiceImpl extends ServiceImpl<RentAppMapper, RentAppPlus> implements IRentAppService
|
||||
{
|
||||
@Autowired
|
||||
private RentAppMapper rentAppMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentAppPlus> getByIds(List<Long> ids ,boolean isUser, SFunction<RentAppPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentAppPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentAppPlus>()
|
||||
.select(columns).in(RentAppPlus::getId, ids);
|
||||
if(isUser){
|
||||
lambdaQueryWrapper.eq(RentAppPlus::getUserId, SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentAppPlus> list = this.list(lambdaQueryWrapper);
|
||||
if(isUser){
|
||||
checkUserPlus(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
private void checkUserPlus(List<RentAppPlus> list) {
|
||||
for (RentAppPlus item : list){
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void checkUser(List<RentApp> list) {
|
||||
for (RentApp item : list){
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void checkUser(RentAppPlus item) {
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
private void checkUser(RentApp item) {
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword,boolean isUser) {
|
||||
LambdaQueryWrapper<RentAppPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentAppPlus>()
|
||||
.select(RentAppPlus::getId,RentAppPlus::getUserId, RentAppPlus::getName)
|
||||
.like(RentAppPlus::getName, keyword);
|
||||
if(isUser){
|
||||
lambdaQueryWrapper.eq(RentAppPlus::getUserId, SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentAppPlus> list = this.list(lambdaQueryWrapper);
|
||||
if(isUser){
|
||||
checkUserPlus(list);
|
||||
}
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentAppPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(item.getName());
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentAppPlus getById(Long id, SFunction<RentAppPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentAppPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentAppPlus>()
|
||||
.select(columns).eq(RentAppPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentAppPlus> getMapByIds(List<Long> ids, SFunction<RentAppPlus, ?>... columns) {
|
||||
List<RentAppPlus> list = this.getByIds(ids,false, columns);
|
||||
Map<Long, RentAppPlus> map = new HashMap<>();
|
||||
for (RentAppPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentAppPlus> getMapByIds(List<Long> ids) {
|
||||
List<RentAppPlus> list = this.getByIds(ids);
|
||||
Map<Long, RentAppPlus> map = new HashMap<>();
|
||||
for (RentAppPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentAppPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentAppPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentAppPlus>().in(RentAppPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_app ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_app ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_app ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param id 租赁独立商户应用;登录及权限共用若依ID
|
||||
* @return 租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
@Override
|
||||
public RentApp selectRentAppById(Long id,boolean isUser)
|
||||
{
|
||||
RentApp vo = rentAppMapper.selectRentAppById(id);
|
||||
if(isUser){
|
||||
checkUser(vo);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租赁独立商户应用;登录及权限共用若依列表
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 租赁独立商户应用;登录及权限共用若依
|
||||
*/
|
||||
@Override
|
||||
public List<RentApp> selectRentAppList(RentApp rentApp,boolean isUser)
|
||||
{
|
||||
if(rentApp == null){
|
||||
rentApp = new RentApp();
|
||||
}
|
||||
if(isUser){
|
||||
rentApp.setUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentApp> list = rentAppMapper.selectRentAppList(rentApp);
|
||||
if(isUser){
|
||||
checkUser(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentApp(RentApp rentApp,boolean isUser)
|
||||
{
|
||||
rentApp.setCreatedAt(DateUtils.getNowDate());
|
||||
rentApp.setUpdatedAt(DateUtils.getNowDate());
|
||||
if(isUser){
|
||||
rentApp.setUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
return rentAppMapper.insertRentApp(rentApp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param rentApp 租赁独立商户应用;登录及权限共用若依
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentApp(RentApp rentApp,boolean isUser)
|
||||
{
|
||||
rentApp.setUpdatedAt(DateUtils.getNowDate());
|
||||
if(isUser){
|
||||
checkUser(rentApp);
|
||||
}
|
||||
return rentAppMapper.updateRentApp(rentApp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租赁独立商户应用;登录及权限共用若依
|
||||
*
|
||||
* @param ids 需要删除的租赁独立商户应用;登录及权限共用若依ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentAppByIds(Long[] ids,boolean isUser)
|
||||
{
|
||||
if(isUser){
|
||||
List<RentAppPlus> list= getByIds(Arrays.asList(ids),false,RentAppPlus::getUserId,RentAppPlus::getId);
|
||||
checkUserPlus(list);
|
||||
}
|
||||
return rentAppMapper.deleteRentAppByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租赁独立商户应用;登录及权限共用若依信息
|
||||
*
|
||||
* @param id 租赁独立商户应用;登录及权限共用若依ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentAppById(Long id,boolean isUser)
|
||||
{
|
||||
if(isUser){
|
||||
RentAppPlus vo = getById(id,RentAppPlus::getUserId,RentAppPlus::getId);
|
||||
checkUser(vo);
|
||||
}
|
||||
return rentAppMapper.deleteRentAppById(id);
|
||||
}
|
||||
}
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentCredential;
|
||||
import com.ruoyi.system.domain.RentCredentialPlus;
|
||||
import com.ruoyi.system.mapper.RentCredentialMapper;
|
||||
import com.ruoyi.system.service.IRentCredentialService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 商户及节点统一HMAC凭证版本;不含RSAService业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentCredentialServiceImpl extends ServiceImpl<RentCredentialMapper, RentCredentialPlus> implements IRentCredentialService
|
||||
{
|
||||
@Autowired
|
||||
private RentCredentialMapper rentCredentialMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentCredentialPlus> getByIds(List<Long> ids, SFunction<RentCredentialPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentCredentialPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentCredentialPlus>()
|
||||
.select(columns).in(RentCredentialPlus::getId, ids);
|
||||
List<RentCredentialPlus> list = this.list(lambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<RentCredentialPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentCredentialPlus>()
|
||||
.select(RentCredentialPlus::getId, RentCredentialPlus::getApiKey)
|
||||
.like(RentCredentialPlus::getApiKey, keyword);
|
||||
List<RentCredentialPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentCredentialPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(String.valueOf(item.getApiKey()));
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentCredentialPlus getById(Long id, SFunction<RentCredentialPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentCredentialPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentCredentialPlus>()
|
||||
.select(columns).eq(RentCredentialPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentCredentialPlus> getMapByIds(List<Long> ids, SFunction<RentCredentialPlus, ?>... columns) {
|
||||
List<RentCredentialPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, RentCredentialPlus> map = new HashMap<>();
|
||||
for (RentCredentialPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentCredentialPlus> getMapByIds(List<Long> ids) {
|
||||
List<RentCredentialPlus> list = this.getByIds(ids);
|
||||
Map<Long, RentCredentialPlus> map = new HashMap<>();
|
||||
for (RentCredentialPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentCredentialPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentCredentialPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentCredentialPlus>().in(RentCredentialPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_credential ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_credential ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_credential ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param id 商户及节点统一HMAC凭证版本;不含RSAID
|
||||
* @return 商户及节点统一HMAC凭证版本;不含RSA
|
||||
*/
|
||||
@Override
|
||||
public RentCredential selectRentCredentialById(Long id)
|
||||
{
|
||||
RentCredential vo = rentCredentialMapper.selectRentCredentialById(id);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户及节点统一HMAC凭证版本;不含RSA列表
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 商户及节点统一HMAC凭证版本;不含RSA
|
||||
*/
|
||||
@Override
|
||||
public List<RentCredential> selectRentCredentialList(RentCredential rentCredential)
|
||||
{
|
||||
if(rentCredential == null){
|
||||
rentCredential = new RentCredential();
|
||||
}
|
||||
List<RentCredential> list = rentCredentialMapper.selectRentCredentialList(rentCredential);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentCredential(RentCredential rentCredential)
|
||||
{
|
||||
rentCredential.setCreatedAt(DateUtils.getNowDate());
|
||||
rentCredential.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentCredentialMapper.insertRentCredential(rentCredential);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param rentCredential 商户及节点统一HMAC凭证版本;不含RSA
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentCredential(RentCredential rentCredential)
|
||||
{
|
||||
rentCredential.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentCredentialMapper.updateRentCredential(rentCredential);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户及节点统一HMAC凭证版本;不含RSA
|
||||
*
|
||||
* @param ids 需要删除的商户及节点统一HMAC凭证版本;不含RSAID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentCredentialByIds(Long[] ids)
|
||||
{
|
||||
return rentCredentialMapper.deleteRentCredentialByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户及节点统一HMAC凭证版本;不含RSA信息
|
||||
*
|
||||
* @param id 商户及节点统一HMAC凭证版本;不含RSAID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentCredentialById(Long id)
|
||||
{
|
||||
return rentCredentialMapper.deleteRentCredentialById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentEvent;
|
||||
import com.ruoyi.system.domain.RentEventPlus;
|
||||
import com.ruoyi.system.mapper.RentEventMapper;
|
||||
import com.ruoyi.system.service.IRentEventService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 业务操作和状态变更追加审计;关键事务同写Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentEventServiceImpl extends ServiceImpl<RentEventMapper, RentEventPlus> implements IRentEventService
|
||||
{
|
||||
@Autowired
|
||||
private RentEventMapper rentEventMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentEventPlus> getByIds(List<Long> ids, SFunction<RentEventPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentEventPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentEventPlus>()
|
||||
.select(columns).in(RentEventPlus::getId, ids);
|
||||
List<RentEventPlus> list = this.list(lambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<RentEventPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentEventPlus>()
|
||||
.select(RentEventPlus::getId, RentEventPlus::getEventNo)
|
||||
.like(RentEventPlus::getEventNo, keyword);
|
||||
List<RentEventPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentEventPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(String.valueOf(item.getEventNo()));
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentEventPlus getById(Long id, SFunction<RentEventPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentEventPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentEventPlus>()
|
||||
.select(columns).eq(RentEventPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentEventPlus> getMapByIds(List<Long> ids, SFunction<RentEventPlus, ?>... columns) {
|
||||
List<RentEventPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, RentEventPlus> map = new HashMap<>();
|
||||
for (RentEventPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentEventPlus> getMapByIds(List<Long> ids) {
|
||||
List<RentEventPlus> list = this.getByIds(ids);
|
||||
Map<Long, RentEventPlus> map = new HashMap<>();
|
||||
for (RentEventPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentEventPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentEventPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentEventPlus>().in(RentEventPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_event ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_event ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_event ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param id 业务操作和状态变更追加审计;关键事务同写ID
|
||||
* @return 业务操作和状态变更追加审计;关键事务同写
|
||||
*/
|
||||
@Override
|
||||
public RentEvent selectRentEventById(Long id)
|
||||
{
|
||||
RentEvent vo = rentEventMapper.selectRentEventById(id);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询业务操作和状态变更追加审计;关键事务同写列表
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 业务操作和状态变更追加审计;关键事务同写
|
||||
*/
|
||||
@Override
|
||||
public List<RentEvent> selectRentEventList(RentEvent rentEvent)
|
||||
{
|
||||
if(rentEvent == null){
|
||||
rentEvent = new RentEvent();
|
||||
}
|
||||
List<RentEvent> list = rentEventMapper.selectRentEventList(rentEvent);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentEvent(RentEvent rentEvent)
|
||||
{
|
||||
rentEvent.setCreatedAt(DateUtils.getNowDate());
|
||||
rentEvent.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentEventMapper.insertRentEvent(rentEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param rentEvent 业务操作和状态变更追加审计;关键事务同写
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentEvent(RentEvent rentEvent)
|
||||
{
|
||||
rentEvent.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentEventMapper.updateRentEvent(rentEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除业务操作和状态变更追加审计;关键事务同写
|
||||
*
|
||||
* @param ids 需要删除的业务操作和状态变更追加审计;关键事务同写ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentEventByIds(Long[] ids)
|
||||
{
|
||||
return rentEventMapper.deleteRentEventByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除业务操作和状态变更追加审计;关键事务同写信息
|
||||
*
|
||||
* @param id 业务操作和状态变更追加审计;关键事务同写ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentEventById(Long id)
|
||||
{
|
||||
return rentEventMapper.deleteRentEventById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentLedger;
|
||||
import com.ruoyi.system.domain.RentLedgerPlus;
|
||||
import com.ruoyi.system.mapper.RentLedgerMapper;
|
||||
import com.ruoyi.system.service.IRentLedgerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentLedgerServiceImpl extends ServiceImpl<RentLedgerMapper, RentLedgerPlus> implements IRentLedgerService
|
||||
{
|
||||
@Autowired
|
||||
private RentLedgerMapper rentLedgerMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentLedgerPlus> getByIds(List<Long> ids, SFunction<RentLedgerPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentLedgerPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentLedgerPlus>()
|
||||
.select(columns).in(RentLedgerPlus::getId, ids);
|
||||
List<RentLedgerPlus> list = this.list(lambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<RentLedgerPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentLedgerPlus>()
|
||||
.select(RentLedgerPlus::getId, RentLedgerPlus::getBusinessKey)
|
||||
.like(RentLedgerPlus::getBusinessKey, keyword);
|
||||
List<RentLedgerPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentLedgerPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(String.valueOf(item.getBusinessKey()));
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentLedgerPlus getById(Long id, SFunction<RentLedgerPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentLedgerPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentLedgerPlus>()
|
||||
.select(columns).eq(RentLedgerPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentLedgerPlus> getMapByIds(List<Long> ids, SFunction<RentLedgerPlus, ?>... columns) {
|
||||
List<RentLedgerPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, RentLedgerPlus> map = new HashMap<>();
|
||||
for (RentLedgerPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentLedgerPlus> getMapByIds(List<Long> ids) {
|
||||
List<RentLedgerPlus> list = this.getByIds(ids);
|
||||
Map<Long, RentLedgerPlus> map = new HashMap<>();
|
||||
for (RentLedgerPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentLedgerPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentLedgerPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentLedgerPlus>().in(RentLedgerPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_ledger ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_ledger ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_ledger ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param id 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖ID
|
||||
* @return 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*/
|
||||
@Override
|
||||
public RentLedger selectRentLedgerById(Long id)
|
||||
{
|
||||
RentLedger vo = rentLedgerMapper.selectRentLedgerById(id);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖列表
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*/
|
||||
@Override
|
||||
public List<RentLedger> selectRentLedgerList(RentLedger rentLedger)
|
||||
{
|
||||
if(rentLedger == null){
|
||||
rentLedger = new RentLedger();
|
||||
}
|
||||
List<RentLedger> list = rentLedgerMapper.selectRentLedgerList(rentLedger);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentLedger(RentLedger rentLedger)
|
||||
{
|
||||
rentLedger.setCreatedAt(DateUtils.getNowDate());
|
||||
rentLedger.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentLedgerMapper.insertRentLedger(rentLedger);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param rentLedger 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentLedger(RentLedger rentLedger)
|
||||
{
|
||||
rentLedger.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentLedgerMapper.updateRentLedger(rentLedger);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖
|
||||
*
|
||||
* @param ids 需要删除的不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentLedgerByIds(Long[] ids)
|
||||
{
|
||||
return rentLedgerMapper.deleteRentLedgerByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖信息
|
||||
*
|
||||
* @param id 不可变租赁资金流水;余额与流水同事务,冲正追加不覆盖ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentLedgerById(Long id)
|
||||
{
|
||||
return rentLedgerMapper.deleteRentLedgerById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentNode;
|
||||
import com.ruoyi.system.domain.RentNodePlus;
|
||||
import com.ruoyi.system.mapper.RentNodeMapper;
|
||||
import com.ruoyi.system.service.IRentNodeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 供应商本地Agent节点;供应商直接关联共享用户,不另建成员Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentNodeServiceImpl extends ServiceImpl<RentNodeMapper, RentNodePlus> implements IRentNodeService
|
||||
{
|
||||
@Autowired
|
||||
private RentNodeMapper rentNodeMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentNodePlus> getByIds(List<Long> ids ,boolean isUser, SFunction<RentNodePlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentNodePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentNodePlus>()
|
||||
.select(columns).in(RentNodePlus::getId, ids);
|
||||
if(isUser){
|
||||
lambdaQueryWrapper.eq(RentNodePlus::getUserId, SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentNodePlus> list = this.list(lambdaQueryWrapper);
|
||||
if(isUser){
|
||||
checkUserPlus(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
private void checkUserPlus(List<RentNodePlus> list) {
|
||||
for (RentNodePlus item : list){
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void checkUser(List<RentNode> list) {
|
||||
for (RentNode item : list){
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void checkUser(RentNodePlus item) {
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
private void checkUser(RentNode item) {
|
||||
if(null != SecurityUtils.getUserId() && item.getUserId().longValue() != SecurityUtils.getUserId()){
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword,boolean isUser) {
|
||||
LambdaQueryWrapper<RentNodePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentNodePlus>()
|
||||
.select(RentNodePlus::getId,RentNodePlus::getUserId, RentNodePlus::getName)
|
||||
.like(RentNodePlus::getName, keyword);
|
||||
if(isUser){
|
||||
lambdaQueryWrapper.eq(RentNodePlus::getUserId, SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentNodePlus> list = this.list(lambdaQueryWrapper);
|
||||
if(isUser){
|
||||
checkUserPlus(list);
|
||||
}
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentNodePlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(item.getName());
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentNodePlus getById(Long id, SFunction<RentNodePlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentNodePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentNodePlus>()
|
||||
.select(columns).eq(RentNodePlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentNodePlus> getMapByIds(List<Long> ids, SFunction<RentNodePlus, ?>... columns) {
|
||||
List<RentNodePlus> list = this.getByIds(ids,false, columns);
|
||||
Map<Long, RentNodePlus> map = new HashMap<>();
|
||||
for (RentNodePlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentNodePlus> getMapByIds(List<Long> ids) {
|
||||
List<RentNodePlus> list = this.getByIds(ids);
|
||||
Map<Long, RentNodePlus> map = new HashMap<>();
|
||||
for (RentNodePlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentNodePlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentNodePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentNodePlus>().in(RentNodePlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_node ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_node ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_node ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param id 供应商本地Agent节点;供应商直接关联共享用户,不另建成员ID
|
||||
* @return 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
@Override
|
||||
public RentNode selectRentNodeById(Long id,boolean isUser)
|
||||
{
|
||||
RentNode vo = rentNodeMapper.selectRentNodeById(id);
|
||||
if(isUser){
|
||||
checkUser(vo);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商本地Agent节点;供应商直接关联共享用户,不另建成员列表
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*/
|
||||
@Override
|
||||
public List<RentNode> selectRentNodeList(RentNode rentNode,boolean isUser)
|
||||
{
|
||||
if(rentNode == null){
|
||||
rentNode = new RentNode();
|
||||
}
|
||||
if(isUser){
|
||||
rentNode.setUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
List<RentNode> list = rentNodeMapper.selectRentNodeList(rentNode);
|
||||
if(isUser){
|
||||
checkUser(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentNode(RentNode rentNode,boolean isUser)
|
||||
{
|
||||
rentNode.setCreatedAt(DateUtils.getNowDate());
|
||||
rentNode.setUpdatedAt(DateUtils.getNowDate());
|
||||
if(isUser){
|
||||
rentNode.setUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
return rentNodeMapper.insertRentNode(rentNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param rentNode 供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentNode(RentNode rentNode,boolean isUser)
|
||||
{
|
||||
rentNode.setUpdatedAt(DateUtils.getNowDate());
|
||||
if(isUser){
|
||||
checkUser(rentNode);
|
||||
}
|
||||
return rentNodeMapper.updateRentNode(rentNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除供应商本地Agent节点;供应商直接关联共享用户,不另建成员
|
||||
*
|
||||
* @param ids 需要删除的供应商本地Agent节点;供应商直接关联共享用户,不另建成员ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentNodeByIds(Long[] ids,boolean isUser)
|
||||
{
|
||||
if(isUser){
|
||||
List<RentNodePlus> list= getByIds(Arrays.asList(ids),false,RentNodePlus::getUserId,RentNodePlus::getId);
|
||||
checkUserPlus(list);
|
||||
}
|
||||
return rentNodeMapper.deleteRentNodeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商本地Agent节点;供应商直接关联共享用户,不另建成员信息
|
||||
*
|
||||
* @param id 供应商本地Agent节点;供应商直接关联共享用户,不另建成员ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentNodeById(Long id,boolean isUser)
|
||||
{
|
||||
if(isUser){
|
||||
RentNodePlus vo = getById(id,RentNodePlus::getUserId,RentNodePlus::getId);
|
||||
checkUser(vo);
|
||||
}
|
||||
return rentNodeMapper.deleteRentNodeById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentNonce;
|
||||
import com.ruoyi.system.domain.RentNoncePlus;
|
||||
import com.ruoyi.system.mapper.RentNonceMapper;
|
||||
import com.ruoyi.system.service.IRentNonceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* HMAC请求防重放记录Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentNonceServiceImpl extends ServiceImpl<RentNonceMapper, RentNoncePlus> implements IRentNonceService
|
||||
{
|
||||
@Autowired
|
||||
private RentNonceMapper rentNonceMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentNoncePlus> getByIds(List<Long> ids, SFunction<RentNoncePlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentNoncePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentNoncePlus>()
|
||||
.select(columns).in(RentNoncePlus::getId, ids);
|
||||
List<RentNoncePlus> list = this.list(lambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<RentNoncePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentNoncePlus>()
|
||||
.select(RentNoncePlus::getId, RentNoncePlus::getNonce)
|
||||
.like(RentNoncePlus::getNonce, keyword);
|
||||
List<RentNoncePlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentNoncePlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(String.valueOf(item.getNonce()));
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentNoncePlus getById(Long id, SFunction<RentNoncePlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentNoncePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentNoncePlus>()
|
||||
.select(columns).eq(RentNoncePlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentNoncePlus> getMapByIds(List<Long> ids, SFunction<RentNoncePlus, ?>... columns) {
|
||||
List<RentNoncePlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, RentNoncePlus> map = new HashMap<>();
|
||||
for (RentNoncePlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentNoncePlus> getMapByIds(List<Long> ids) {
|
||||
List<RentNoncePlus> list = this.getByIds(ids);
|
||||
Map<Long, RentNoncePlus> map = new HashMap<>();
|
||||
for (RentNoncePlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentNoncePlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentNoncePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentNoncePlus>().in(RentNoncePlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_nonce ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_nonce ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_nonce ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询HMAC请求防重放记录
|
||||
*
|
||||
* @param id HMAC请求防重放记录ID
|
||||
* @return HMAC请求防重放记录
|
||||
*/
|
||||
@Override
|
||||
public RentNonce selectRentNonceById(Long id)
|
||||
{
|
||||
RentNonce vo = rentNonceMapper.selectRentNonceById(id);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询HMAC请求防重放记录列表
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return HMAC请求防重放记录
|
||||
*/
|
||||
@Override
|
||||
public List<RentNonce> selectRentNonceList(RentNonce rentNonce)
|
||||
{
|
||||
if(rentNonce == null){
|
||||
rentNonce = new RentNonce();
|
||||
}
|
||||
List<RentNonce> list = rentNonceMapper.selectRentNonceList(rentNonce);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增HMAC请求防重放记录
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentNonce(RentNonce rentNonce)
|
||||
{
|
||||
rentNonce.setCreatedAt(DateUtils.getNowDate());
|
||||
rentNonce.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentNonceMapper.insertRentNonce(rentNonce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改HMAC请求防重放记录
|
||||
*
|
||||
* @param rentNonce HMAC请求防重放记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentNonce(RentNonce rentNonce)
|
||||
{
|
||||
rentNonce.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentNonceMapper.updateRentNonce(rentNonce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除HMAC请求防重放记录
|
||||
*
|
||||
* @param ids 需要删除的HMAC请求防重放记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentNonceByIds(Long[] ids)
|
||||
{
|
||||
return rentNonceMapper.deleteRentNonceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除HMAC请求防重放记录信息
|
||||
*
|
||||
* @param id HMAC请求防重放记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentNonceById(Long id)
|
||||
{
|
||||
return rentNonceMapper.deleteRentNonceById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentOrder;
|
||||
import com.ruoyi.system.domain.RentOrderPlus;
|
||||
import com.ruoyi.system.mapper.RentOrderMapper;
|
||||
import com.ruoyi.system.service.IRentOrderService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentOrderServiceImpl extends ServiceImpl<RentOrderMapper, RentOrderPlus> implements IRentOrderService
|
||||
{
|
||||
@Autowired
|
||||
private RentOrderMapper rentOrderMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentOrderPlus> getByIds(List<Long> ids, SFunction<RentOrderPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentOrderPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentOrderPlus>()
|
||||
.select(columns).in(RentOrderPlus::getId, ids);
|
||||
List<RentOrderPlus> list = this.list(lambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<RentOrderPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentOrderPlus>()
|
||||
.select(RentOrderPlus::getId, RentOrderPlus::getOrderNo)
|
||||
.like(RentOrderPlus::getOrderNo, keyword);
|
||||
List<RentOrderPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentOrderPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(String.valueOf(item.getOrderNo()));
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentOrderPlus getById(Long id, SFunction<RentOrderPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentOrderPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentOrderPlus>()
|
||||
.select(columns).eq(RentOrderPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentOrderPlus> getMapByIds(List<Long> ids, SFunction<RentOrderPlus, ?>... columns) {
|
||||
List<RentOrderPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, RentOrderPlus> map = new HashMap<>();
|
||||
for (RentOrderPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentOrderPlus> getMapByIds(List<Long> ids) {
|
||||
List<RentOrderPlus> list = this.getByIds(ids);
|
||||
Map<Long, RentOrderPlus> map = new HashMap<>();
|
||||
for (RentOrderPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentOrderPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentOrderPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentOrderPlus>().in(RentOrderPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_order ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_order ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_order ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param id 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开ID
|
||||
* @return 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*/
|
||||
@Override
|
||||
public RentOrder selectRentOrderById(Long id)
|
||||
{
|
||||
RentOrder vo = rentOrderMapper.selectRentOrderById(id);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开列表
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*/
|
||||
@Override
|
||||
public List<RentOrder> selectRentOrderList(RentOrder rentOrder)
|
||||
{
|
||||
if(rentOrder == null){
|
||||
rentOrder = new RentOrder();
|
||||
}
|
||||
List<RentOrder> list = rentOrderMapper.selectRentOrderList(rentOrder);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentOrder(RentOrder rentOrder)
|
||||
{
|
||||
rentOrder.setCreatedAt(DateUtils.getNowDate());
|
||||
rentOrder.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentOrderMapper.insertRentOrder(rentOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param rentOrder 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentOrder(RentOrder rentOrder)
|
||||
{
|
||||
rentOrder.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentOrderMapper.updateRentOrder(rentOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开
|
||||
*
|
||||
* @param ids 需要删除的能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentOrderByIds(Long[] ids)
|
||||
{
|
||||
return rentOrderMapper.deleteRentOrderByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开信息
|
||||
*
|
||||
* @param id 能量或带宽租赁订单;一单一种资源一个钱包,履约与回收分开ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentOrderById(Long id)
|
||||
{
|
||||
return rentOrderMapper.deleteRentOrderById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentPackage;
|
||||
import com.ruoyi.system.domain.RentPackagePlus;
|
||||
import com.ruoyi.system.mapper.RentPackageMapper;
|
||||
import com.ruoyi.system.service.IRentPackageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentPackageServiceImpl extends ServiceImpl<RentPackageMapper, RentPackagePlus> implements IRentPackageService
|
||||
{
|
||||
@Autowired
|
||||
private RentPackageMapper rentPackageMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentPackagePlus> getByIds(List<Long> ids, SFunction<RentPackagePlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentPackagePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentPackagePlus>()
|
||||
.select(columns).in(RentPackagePlus::getId, ids);
|
||||
List<RentPackagePlus> list = this.list(lambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<RentPackagePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentPackagePlus>()
|
||||
.select(RentPackagePlus::getId, RentPackagePlus::getName)
|
||||
.like(RentPackagePlus::getName, keyword);
|
||||
List<RentPackagePlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentPackagePlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(item.getName());
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentPackagePlus getById(Long id, SFunction<RentPackagePlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentPackagePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentPackagePlus>()
|
||||
.select(columns).eq(RentPackagePlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentPackagePlus> getMapByIds(List<Long> ids, SFunction<RentPackagePlus, ?>... columns) {
|
||||
List<RentPackagePlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, RentPackagePlus> map = new HashMap<>();
|
||||
for (RentPackagePlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentPackagePlus> getMapByIds(List<Long> ids) {
|
||||
List<RentPackagePlus> list = this.getByIds(ids);
|
||||
Map<Long, RentPackagePlus> map = new HashMap<>();
|
||||
for (RentPackagePlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentPackagePlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentPackagePlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentPackagePlus>().in(RentPackagePlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_package ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_package ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_package ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param id 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变ID
|
||||
* @return 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*/
|
||||
@Override
|
||||
public RentPackage selectRentPackageById(Long id)
|
||||
{
|
||||
RentPackage vo = rentPackageMapper.selectRentPackageById(id);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变列表
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*/
|
||||
@Override
|
||||
public List<RentPackage> selectRentPackageList(RentPackage rentPackage)
|
||||
{
|
||||
if(rentPackage == null){
|
||||
rentPackage = new RentPackage();
|
||||
}
|
||||
List<RentPackage> list = rentPackageMapper.selectRentPackageList(rentPackage);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentPackage(RentPackage rentPackage)
|
||||
{
|
||||
rentPackage.setCreatedAt(DateUtils.getNowDate());
|
||||
rentPackage.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentPackageMapper.insertRentPackage(rentPackage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param rentPackage 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentPackage(RentPackage rentPackage)
|
||||
{
|
||||
rentPackage.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentPackageMapper.updateRentPackage(rentPackage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变
|
||||
*
|
||||
* @param ids 需要删除的能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentPackageByIds(Long[] ids)
|
||||
{
|
||||
return rentPackageMapper.deleteRentPackageByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变信息
|
||||
*
|
||||
* @param id 能量或带宽固定套餐及价格版本;套餐代码的资源类型不可改变ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentPackageById(Long id)
|
||||
{
|
||||
return rentPackageMapper.deleteRentPackageById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentRefund;
|
||||
import com.ruoyi.system.domain.RentRefundPlus;
|
||||
import com.ruoyi.system.mapper.RentRefundMapper;
|
||||
import com.ruoyi.system.service.IRentRefundService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentRefundServiceImpl extends ServiceImpl<RentRefundMapper, RentRefundPlus> implements IRentRefundService
|
||||
{
|
||||
@Autowired
|
||||
private RentRefundMapper rentRefundMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentRefundPlus> getByIds(List<Long> ids, SFunction<RentRefundPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentRefundPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentRefundPlus>()
|
||||
.select(columns).in(RentRefundPlus::getId, ids);
|
||||
List<RentRefundPlus> list = this.list(lambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<RentRefundPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentRefundPlus>()
|
||||
.select(RentRefundPlus::getId, RentRefundPlus::getRefundNo)
|
||||
.like(RentRefundPlus::getRefundNo, keyword);
|
||||
List<RentRefundPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentRefundPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(String.valueOf(item.getRefundNo()));
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentRefundPlus getById(Long id, SFunction<RentRefundPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentRefundPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentRefundPlus>()
|
||||
.select(columns).eq(RentRefundPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentRefundPlus> getMapByIds(List<Long> ids, SFunction<RentRefundPlus, ?>... columns) {
|
||||
List<RentRefundPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, RentRefundPlus> map = new HashMap<>();
|
||||
for (RentRefundPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentRefundPlus> getMapByIds(List<Long> ids) {
|
||||
List<RentRefundPlus> list = this.getByIds(ids);
|
||||
Map<Long, RentRefundPlus> map = new HashMap<>();
|
||||
for (RentRefundPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentRefundPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentRefundPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentRefundPlus>().in(RentRefundPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_refund ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_refund ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_refund ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param id 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史ID
|
||||
* @return 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*/
|
||||
@Override
|
||||
public RentRefund selectRentRefundById(Long id)
|
||||
{
|
||||
RentRefund vo = rentRefundMapper.selectRentRefundById(id);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史列表
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*/
|
||||
@Override
|
||||
public List<RentRefund> selectRentRefundList(RentRefund rentRefund)
|
||||
{
|
||||
if(rentRefund == null){
|
||||
rentRefund = new RentRefund();
|
||||
}
|
||||
List<RentRefund> list = rentRefundMapper.selectRentRefundList(rentRefund);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentRefund(RentRefund rentRefund)
|
||||
{
|
||||
rentRefund.setCreatedAt(DateUtils.getNowDate());
|
||||
rentRefund.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentRefundMapper.insertRentRefund(rentRefund);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param rentRefund 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentRefund(RentRefund rentRefund)
|
||||
{
|
||||
rentRefund.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentRefundMapper.updateRentRefund(rentRefund);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史
|
||||
*
|
||||
* @param ids 需要删除的内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentRefundByIds(Long[] ids)
|
||||
{
|
||||
return rentRefundMapper.deleteRentRefundByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史信息
|
||||
*
|
||||
* @param id 内部余额退款审批与幂等来源;部分退款逐次新增,不覆盖历史ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentRefundById(Long id)
|
||||
{
|
||||
return rentRefundMapper.deleteRentRefundById(id);
|
||||
}
|
||||
}
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.RentSettlementItem;
|
||||
import com.ruoyi.system.domain.RentSettlementItemPlus;
|
||||
import com.ruoyi.system.mapper.RentSettlementItemMapper;
|
||||
import com.ruoyi.system.service.IRentSettlementItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
/**
|
||||
* 供应商订单应收与结算关联;首版每单全额结算一次Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-22
|
||||
*/
|
||||
@Service
|
||||
public class RentSettlementItemServiceImpl extends ServiceImpl<RentSettlementItemMapper, RentSettlementItemPlus> implements IRentSettlementItemService
|
||||
{
|
||||
@Autowired
|
||||
private RentSettlementItemMapper rentSettlementItemMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<RentSettlementItemPlus> getByIds(List<Long> ids, SFunction<RentSettlementItemPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentSettlementItemPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentSettlementItemPlus>()
|
||||
.select(columns).in(RentSettlementItemPlus::getId, ids);
|
||||
List<RentSettlementItemPlus> list = this.list(lambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<RentSettlementItemPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentSettlementItemPlus>()
|
||||
.select(RentSettlementItemPlus::getId, RentSettlementItemPlus::getOrderId)
|
||||
.like(RentSettlementItemPlus::getOrderId, keyword);
|
||||
List<RentSettlementItemPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (RentSettlementItemPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(String.valueOf(item.getOrderId()));
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public RentSettlementItemPlus getById(Long id, SFunction<RentSettlementItemPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<RentSettlementItemPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentSettlementItemPlus>()
|
||||
.select(columns).eq(RentSettlementItemPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentSettlementItemPlus> getMapByIds(List<Long> ids, SFunction<RentSettlementItemPlus, ?>... columns) {
|
||||
List<RentSettlementItemPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, RentSettlementItemPlus> map = new HashMap<>();
|
||||
for (RentSettlementItemPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, RentSettlementItemPlus> getMapByIds(List<Long> ids) {
|
||||
List<RentSettlementItemPlus> list = this.getByIds(ids);
|
||||
Map<Long, RentSettlementItemPlus> map = new HashMap<>();
|
||||
for (RentSettlementItemPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RentSettlementItemPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<RentSettlementItemPlus> lambdaQueryWrapper = new LambdaQueryWrapper<RentSettlementItemPlus>().in(RentSettlementItemPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from rent_settlement_item ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_settlement_item ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" rent_settlement_item ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param id 供应商订单应收与结算关联;首版每单全额结算一次ID
|
||||
* @return 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*/
|
||||
@Override
|
||||
public RentSettlementItem selectRentSettlementItemById(Long id)
|
||||
{
|
||||
RentSettlementItem vo = rentSettlementItemMapper.selectRentSettlementItemById(id);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商订单应收与结算关联;首版每单全额结算一次列表
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*/
|
||||
@Override
|
||||
public List<RentSettlementItem> selectRentSettlementItemList(RentSettlementItem rentSettlementItem)
|
||||
{
|
||||
if(rentSettlementItem == null){
|
||||
rentSettlementItem = new RentSettlementItem();
|
||||
}
|
||||
List<RentSettlementItem> list = rentSettlementItemMapper.selectRentSettlementItemList(rentSettlementItem);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRentSettlementItem(RentSettlementItem rentSettlementItem)
|
||||
{
|
||||
rentSettlementItem.setCreatedAt(DateUtils.getNowDate());
|
||||
rentSettlementItem.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentSettlementItemMapper.insertRentSettlementItem(rentSettlementItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param rentSettlementItem 供应商订单应收与结算关联;首版每单全额结算一次
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRentSettlementItem(RentSettlementItem rentSettlementItem)
|
||||
{
|
||||
rentSettlementItem.setUpdatedAt(DateUtils.getNowDate());
|
||||
return rentSettlementItemMapper.updateRentSettlementItem(rentSettlementItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除供应商订单应收与结算关联;首版每单全额结算一次
|
||||
*
|
||||
* @param ids 需要删除的供应商订单应收与结算关联;首版每单全额结算一次ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentSettlementItemByIds(Long[] ids)
|
||||
{
|
||||
return rentSettlementItemMapper.deleteRentSettlementItemByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商订单应收与结算关联;首版每单全额结算一次信息
|
||||
*
|
||||
* @param id 供应商订单应收与结算关联;首版每单全额结算一次ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRentSettlementItemById(Long id)
|
||||
{
|
||||
return rentSettlementItemMapper.deleteRentSettlementItemById(id);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user