|
|
@@ -2,15 +2,15 @@ package com.cloud.sa.management.controller;
|
|
|
|
|
|
import com.cloud.sa.base.common.domain.PageResult;
|
|
|
import com.cloud.sa.base.common.domain.ResponseDTO;
|
|
|
+import com.cloud.sa.management.constant.MarketStageEvents;
|
|
|
import com.cloud.sa.management.domain.dto.BlinkCustomerDTO;
|
|
|
import com.cloud.sa.management.domain.qry.BlinkCustomerQry;
|
|
|
import com.cloud.sa.management.service.IBlinkCustomerService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.statemachine.StateMachine;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
@@ -23,6 +23,8 @@ import javax.validation.Valid;
|
|
|
@RestController
|
|
|
@Tag(name = "客户管理")
|
|
|
public class BlinkCustomerController {
|
|
|
+ @Autowired
|
|
|
+ private StateMachine orderSingleMachine;
|
|
|
|
|
|
@Resource
|
|
|
private IBlinkCustomerService customerService;
|
|
|
@@ -38,4 +40,21 @@ public class BlinkCustomerController {
|
|
|
public ResponseDTO<PageResult<BlinkCustomerDTO>> supportsCustomerQueryPage(BlinkCustomerQry qry) {
|
|
|
return ResponseDTO.ok(customerService.supportsCustomerQueryPage(qry));
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping("/testSingleOrderState")
|
|
|
+ public void testSingleOrderState() throws Exception {
|
|
|
+
|
|
|
+ // 创建流程
|
|
|
+ orderSingleMachine.start();
|
|
|
+
|
|
|
+ // 触发PAY事件
|
|
|
+ orderSingleMachine.sendEvent(MarketStageEvents.CLUEEVENTS);
|
|
|
+
|
|
|
+ // 触发RECEIVE事件
|
|
|
+ orderSingleMachine.sendEvent(MarketStageEvents.RISKEVENTS);
|
|
|
+
|
|
|
+ // 获取最终状态
|
|
|
+ System.out.println("最终状态:" + orderSingleMachine.getState().getId());
|
|
|
+ }
|
|
|
+
|
|
|
}
|