Explorar el Código

防止重复提交 SAS-1384

xucaiqin hace 2 años
padre
commit
63858da7ed

+ 3 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpLedgerLogisticsController.java

@@ -1,5 +1,6 @@
 package com.sckw.payment.controller;
 
+import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.model.vo.TableTop;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
@@ -40,6 +41,7 @@ public class KwpLedgerLogisticsController {
      * @param logisticsReq 保存物流对账单参数
      * @return
      */
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     @PostMapping("sendDraft")
     public HttpResult sendDraft(@RequestBody @Valid LogisticsSendReq logisticsReq) {
         return HttpResult.ok(kwpLedgerLogisticsService.sendLedgerDraft(logisticsReq));
@@ -52,6 +54,7 @@ public class KwpLedgerLogisticsController {
      * @return
      */
     @PostMapping("send")
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     public HttpResult send(@RequestBody @Valid LogisticsSendReq logisticsReq) {
         return HttpResult.ok(kwpLedgerLogisticsService.sendLedger(logisticsReq));
     }

+ 3 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpLedgerTradeController.java

@@ -1,5 +1,6 @@
 package com.sckw.payment.controller;
 
+import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.model.vo.TableTop;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
@@ -41,6 +42,7 @@ public class KwpLedgerTradeController {
      * @param tradeSendReq
      * @return
      */
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     @PostMapping("sendDraft")
     public HttpResult sendDraft(@RequestBody @Valid TradeSendReq tradeSendReq) {
         return HttpResult.ok(kwpLedgerTradeService.sendLedgerDraft(tradeSendReq));
@@ -52,6 +54,7 @@ public class KwpLedgerTradeController {
      * @param tradeSendReq
      * @return
      */
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     @PostMapping("send")
     public HttpResult send(@RequestBody @Valid TradeSendReq tradeSendReq) {
         return HttpResult.ok(kwpLedgerTradeService.sendLedger(tradeSendReq));