Kaynağa Gözat

执行定时签收 执行拼团超时关闭拼团 订单支付超时定时关单任务

yubin 1 hafta önce
ebeveyn
işleme
794a724c38

+ 5 - 0
cif-service/pom.xml

@@ -126,6 +126,11 @@
             <!--            <scope>provided</scope>-->
         </dependency>
 
+        <dependency>
+            <groupId>com.txz</groupId>
+            <artifactId>mall-api</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
 
         <!--异维科技dubbo接口包依赖-->
         <dependency>

+ 48 - 0
cif-service/src/main/java/com/txz/cif/dubbo/client/OrderDubboServiceClient.java

@@ -0,0 +1,48 @@
+package com.txz.cif.dubbo.client;
+
+
+import com.txz.mall.service.OrderDubboService;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.Reference;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@Component
+public class OrderDubboServiceClient {
+
+    @Reference
+    private OrderDubboService orderDubboService;
+
+    /**
+     * 拼团超时定时任务
+     */
+    public void scheduledTaskStorePinkSummaryClose() {
+        log.info("cif:scheduledTaskStorePinkSummaryClose start");
+        orderDubboService.scheduledTaskStorePinkSummaryClose();
+        log.info("cif:scheduledTaskStorePinkSummaryClose end");
+    }
+
+    ;
+
+    /**
+     * 自动签收定时任务
+     */
+    public void scheduledTaskBatchSigning() {
+        log.info("cif:scheduledTaskBatchSigning start");
+        orderDubboService.scheduledTaskBatchSigning();
+        log.info("cif:scheduledTaskBatchSigning end");
+    }
+
+    ;
+
+
+    public void orderTimeoutAutomaticCancel() {
+        log.info("cif:orderTimeoutAutomaticCancel start");
+        orderDubboService.orderTimeoutAutomaticCancel();
+        log.info("cif:orderTimeoutAutomaticCancel end");
+    }
+
+    ;
+
+}

+ 49 - 0
cif-service/src/main/java/com/txz/cif/web/mng/OrderApiController.java

@@ -0,0 +1,49 @@
+package com.txz.cif.web.mng;
+
+import com.txz.cif.core.Result;
+
+import com.txz.cif.core.ResultGenerator;
+import com.txz.cif.dubbo.client.OrderDubboServiceClient;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+
+@Api(tags = "[后台]mall定时任务")
+@RestController
+@RequestMapping("/order/api/test")
+public class OrderApiController {
+
+    @Resource
+    private OrderDubboServiceClient orderDubboServiceClient;
+
+
+    @PostMapping("/scheduledTaskStorePinkSummaryClose")
+    @ApiOperation(value = "拼团超时定时任务",httpMethod = "POST")
+    public Result scheduledTaskStorePinkSummaryCloseTest() {
+        orderDubboServiceClient.scheduledTaskStorePinkSummaryClose();
+        return ResultGenerator.genSuccessResult();
+    }
+
+
+    @PostMapping("/scheduledTaskBatchSigning")
+    @ApiOperation(value = "自动签收定时任务",httpMethod = "POST")
+    public Result scheduledTaskBatchSigningTest() {
+        orderDubboServiceClient.scheduledTaskBatchSigning();
+        return ResultGenerator.genSuccessResult();
+    }
+
+    @PostMapping("/orderTimeoutAutomaticCancel")
+    @ApiOperation(value = "订单超时未支付定时取消",httpMethod = "POST")
+    public Result orderTimeoutAutomaticCancel() {
+        orderDubboServiceClient.orderTimeoutAutomaticCancel();
+        return ResultGenerator.genSuccessResult();
+    }
+
+}