Просмотр исходного кода

1.商品保存、提交、修改接口防重
2.采购/销售订单保存、提交、修改、受理接口防重
3.运需保存、提交、修改接口防重
4.求购保存、提交、修改接口防重

yzc 2 лет назад
Родитель
Сommit
1704c2eca2

+ 7 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTradeOrderController.java

@@ -1,5 +1,6 @@
 package com.sckw.order.controller;
 
+import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.order.model.vo.req.*;
 import com.sckw.order.serivce.KwoTradeOrderService;
@@ -29,6 +30,7 @@ public class KwoTradeOrderController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @GlobalTransactional(name = "default_tx_group")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addPurchaseOrderDraft", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addPurchaseOrderDraft(@RequestBody @Validated PurchaseOrderDraftParam param) {
         kwoTradeOrderService.addPurchaseOrderDraft(param);
@@ -43,6 +45,7 @@ public class KwoTradeOrderController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @GlobalTransactional(name = "default_tx_group")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addPurchaseOrderSubmit", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addPurchaseOrderSubmit(@RequestBody @Validated PurchaseOrderParam purchaseOrderParam) {
         kwoTradeOrderService.addPurchaseOrderSubmit(purchaseOrderParam);
@@ -57,6 +60,7 @@ public class KwoTradeOrderController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @GlobalTransactional(name = "default_tx_group")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addValetOrderDraft", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addValetOrderDraft(@RequestBody @Validated ValetOrderDraftParam param) {
         kwoTradeOrderService.addValetOrderDraft(param);
@@ -72,6 +76,7 @@ public class KwoTradeOrderController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @GlobalTransactional(name = "default_tx_group")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addValetOrderSubmit", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addValetOrderSubmit(@RequestBody @Validated ValetOrderParam valetOrderParam) {
         kwoTradeOrderService.addValetOrderSubmit(valetOrderParam);
@@ -98,6 +103,7 @@ public class KwoTradeOrderController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @GlobalTransactional(name = "default_tx_group")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult update(@RequestBody @Validated UpdateOrderParam updateOrderParam) {
         kwoTradeOrderService.update(updateOrderParam);
@@ -112,6 +118,7 @@ public class KwoTradeOrderController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @GlobalTransactional(name = "default_tx_group")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/acceptanceOrder", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult acceptanceOrder(@RequestBody @Validated AcceptanceOrderParam acceptanceOrderParam) {
         kwoTradeOrderService.acceptanceOrder(acceptanceOrderParam);

+ 4 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTransportDemandController.java

@@ -1,5 +1,6 @@
 package com.sckw.order.controller;
 
+import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
@@ -36,6 +37,7 @@ public class KwoTransportDemandController {
      * @Param param:
      * @return: com.sckw.core.web.response.HttpResult
      */
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addDraft", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addDraft(@RequestBody @Validated AddTransportDemandDraftParam param) {
         kwoTransportDemandService.addDraft(param);
@@ -50,6 +52,7 @@ public class KwoTransportDemandController {
      * @Param param:
      * @return: com.sckw.core.web.response.HttpResult
      */
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addShelves", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addShelves(@RequestBody @Validated AddTransportDemandParam param) {
         kwoTransportDemandService.addShelves(param);
@@ -76,6 +79,7 @@ public class KwoTransportDemandController {
      * @Param param:
      * @return: com.sckw.core.web.response.HttpResult
      */
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult update(@RequestBody @Validated UpdateTransportDemandParam param) {
         kwoTransportDemandService.update(param);

+ 4 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwpWantBuyController.java

@@ -1,5 +1,6 @@
 package com.sckw.order.controller;
 
+import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
@@ -68,6 +69,7 @@ public class KwpWantBuyController {
      * @Param addWantBuyParam:
      * @return: com.sckw.core.web.response.HttpResult
      */
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addDraft", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addDraft(@RequestBody @Validated AddDraftWantBuyParam addDraftWantBuyParam) {
         kwpWantBuyService.addDraft(addDraftWantBuyParam);
@@ -81,6 +83,7 @@ public class KwpWantBuyController {
      * @Param addWantBuyParam:
      * @return: com.sckw.core.web.response.HttpResult
      */
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addShelves", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addShelves(@RequestBody @Validated AddWantBuyParam addWantBuyParam) {
         kwpWantBuyService.addShelves(addWantBuyParam);
@@ -138,6 +141,7 @@ public class KwpWantBuyController {
      * @author lt
      * @Date 15:22 2023/7/26 0026
      **/
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult update(@RequestBody @Validated UpdateWantBuyParam updateWantBuyParam) {
         kwpWantBuyService.update(updateWantBuyParam);

+ 4 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/KwpGoodsController.java

@@ -1,5 +1,6 @@
 package com.sckw.product.controller;
 
+import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
@@ -36,6 +37,7 @@ public class KwpGoodsController {
      * @Param param:
      * @return: com.sckw.core.web.response.HttpResult
      */
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addDraft", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addDraft(@RequestBody @Validated AddGoodsDraftParam param) {
         kwpGoodsService.addDraft(param);
@@ -49,6 +51,7 @@ public class KwpGoodsController {
      * @Param addGoodsParam:
      * @return: com.sckw.core.web.response.HttpResult
      */
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @PostMapping(value = "/addShelves", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult addShelves(@RequestBody @Validated AddGoodsParam addGoodsParam) {
         kwpGoodsService.addShelves(addGoodsParam);
@@ -75,6 +78,7 @@ public class KwpGoodsController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     public HttpResult update(@RequestBody @Validated UpdateGoodsParam updateGoodsParam) {
         kwpGoodsService.update(updateGoodsParam);
         return HttpResult.ok("修改商品成功");