From 7f8f1608632048e301c7f9d7c05d551d8c2d3eea Mon Sep 17 00:00:00 2001
From: dzc <2388224167@qq.com>
Date: Wed, 29 Apr 2026 11:12:37 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E9=92=B1=E5=8C=85=E7=94=B3=E8=AF=B7?=
=?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../pjcloud-flow-task-biz/pom.xml | 4 ++++
.../flow/task/controller/TaskController.java | 3 ++-
.../recharge/WalletRechargeApplyController.java | 6 +++---
.../recharge/WalletRechargeInvoiceController.java | 15 ++++-----------
4 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/pjcloud-flow/pjcloud-flow-task/pjcloud-flow-task-biz/pom.xml b/pjcloud-flow/pjcloud-flow-task/pjcloud-flow-task-biz/pom.xml
index fa6c81aad..ef8f1ad62 100644
--- a/pjcloud-flow/pjcloud-flow-task/pjcloud-flow-task-biz/pom.xml
+++ b/pjcloud-flow/pjcloud-flow-task/pjcloud-flow-task-biz/pom.xml
@@ -98,6 +98,10 @@
org.springframework.boot
spring-boot-starter-test
+
+ com.bsd
+ pjcloud-common-idempotent
+
diff --git a/pjcloud-flow/pjcloud-flow-task/pjcloud-flow-task-biz/src/main/java/com/bsd/pjcloud/flow/task/controller/TaskController.java b/pjcloud-flow/pjcloud-flow-task/pjcloud-flow-task-biz/src/main/java/com/bsd/pjcloud/flow/task/controller/TaskController.java
index 9fb201efe..0033ed531 100644
--- a/pjcloud-flow/pjcloud-flow-task/pjcloud-flow-task-biz/src/main/java/com/bsd/pjcloud/flow/task/controller/TaskController.java
+++ b/pjcloud-flow/pjcloud-flow-task/pjcloud-flow-task-biz/src/main/java/com/bsd/pjcloud/flow/task/controller/TaskController.java
@@ -1,6 +1,7 @@
package com.bsd.pjcloud.flow.task.controller;
import com.bsd.pjcloud.common.core.util.R;
+import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
import com.bsd.pjcloud.flow.task.dto.BatchCompleteTaskDto;
import com.bsd.pjcloud.flow.task.dto.TaskParamDto;
import com.bsd.pjcloud.flow.task.service.ITaskService;
@@ -51,8 +52,8 @@ public class TaskController {
*/
@SneakyThrows
@PostMapping("completeTask")
+ @Idempotent(expireTime = 3, key = "'/task/completeTask/' + #completeParamDto.getTaskId()", info = "正在操作中,请勿重复操作")
public R completeTask(@RequestBody TaskParamDto completeParamDto) {
-
return taskService.completeTask(completeParamDto);
}
diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java
index 3ae259564..1372be199 100644
--- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java
+++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java
@@ -86,7 +86,7 @@ public class WalletRechargeApplyController {
@SysLog("提交申请")
@GetMapping("/apply")
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_apply')")
- @Idempotent(expireTime = 5, info = "正在申请中,请勿重复操作")
+ @Idempotent(expireTime = 5, key = "'/wallet-recharge-apply/apply/' + #id", info = "正在申请中,请勿重复操作")
public R apply(@RequestParam Long id) {
walletRechargeApplyService.apply(id);
return R.ok(true);
@@ -173,13 +173,13 @@ public class WalletRechargeApplyController {
}
@PostMapping("/read-excel")
- @Idempotent(expireTime = 3, info = "正在上传中,请勿重复操作")
+ @Idempotent(expireTime = 3, key = "'/wallet-recharge-apply/read-excel'", info = "正在上传中,请勿重复操作")
public R readExcel(@RequestExcel List excelVOList, BindingResult bindingResult, @RequestParam(required = false) String bizType) {
return walletRechargeApplyService.readExcel(excelVOList, bindingResult, bizType);
}
@PostMapping("/read-topup-excel")
- @Idempotent(expireTime = 3, info = "正在上传中,请勿重复操作")
+ @Idempotent(expireTime = 3, key = "'/wallet-recharge-apply/read-topup-excel'", info = "正在上传中,请勿重复操作")
public R readTopupExcel(@RequestExcel List excelVOList, BindingResult bindingResult) {
return walletRechargeApplyService.readTopupExcel(excelVOList, bindingResult);
}
diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java
index b06501219..b890d4f29 100644
--- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java
+++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java
@@ -1,21 +1,14 @@
package com.bsd.pjcloud.wallet.controller.recharge;
-import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.collection.CollUtil;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.bsd.pjcloud.admin.api.entity.SysUser;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
import com.bsd.pjcloud.common.log.annotation.SysLog;
import com.bsd.pjcloud.common.security.annotation.Inner;
-import com.bsd.pjcloud.common.security.service.PjcloudUser;
-import com.bsd.pjcloud.common.security.util.SecurityUtils;
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
-import com.bsd.pjcloud.wallet.api.constant.WalletInvoiceStatusCheckEnum;
-import com.bsd.pjcloud.wallet.api.dto.WalletManageBalanceDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeBindInvoiceDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceApplyDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceRefreshDto;
@@ -34,8 +27,6 @@ import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
-import java.util.List;
-
/**
* 充值/扣款申请发票记录
*/
@@ -59,7 +50,7 @@ public class WalletRechargeInvoiceController {
@Operation(summary = "重新生成发票", description = "重新生成发票")
@SysLog("重新生成发票")
@PostMapping("/refreshInvoice")
- @Idempotent(expireTime = 10, info = "正在重新生成发票中,请勿重复操作")
+ @Idempotent(expireTime = 3, key = "'/walletRechargeInvoice/refreshInvoice/' + #dto.getId()", info = "正在重新生成发票中,请勿重复操作")
public R refreshInvoice(@Valid @RequestBody WalletRechargeInvoiceRefreshDto dto) {
walletRechargeInvoiceService.refreshInvoice(dto);
return R.ok(true);
@@ -68,7 +59,7 @@ public class WalletRechargeInvoiceController {
@Operation(summary = "提交申请", description = "提交申请")
@SysLog("提交申请")
@PostMapping("/apply")
- @Idempotent(expireTime = 3, info = "正在申请中,请勿重复操作")
+ @Idempotent(expireTime = 3, key = "'/walletRechargeInvoice/apply/' + #body.getId()", info = "正在申请中,请勿重复操作")
public R apply(@Valid @RequestBody WalletRechargeInvoiceApplyDto body) {
walletRechargeInvoiceService.apply(body);
return R.ok(true);
@@ -83,6 +74,7 @@ public class WalletRechargeInvoiceController {
@GetMapping("/back")
@Operation(summary = "退回作废发票")
+ @Idempotent(expireTime = 3, key = "'/walletRechargeInvoice/back/' + #id", info = "正在退回中,请勿重复操作")
public R backInvoice(@RequestParam("id") Long id) {
walletRechargeInvoiceService.backInvoice(id);
return R.ok();
@@ -90,6 +82,7 @@ public class WalletRechargeInvoiceController {
@PostMapping("/bind-invoice")
@Operation(summary = "绑定发票")
+ @Idempotent(expireTime = 3, key = "'/walletRechargeInvoice/bind-invoice/' + #dto.getApplyId()", info = "正在申请中,请勿重复操作")
public R bindInvoice(@Valid @RequestBody WalletRechargeBindInvoiceDto dto) {
walletRechargeInvoiceService.bindInvoice(dto);
return R.ok();