无关风月
2026-02-13 3bcf097a22472426179941578d42a06efad22f11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.xiaopeng.automaticPilot.controller;
 
import com.xiaopeng.api.vo.automaticPilot.proto.down.ResponseMessage;
import com.xiaopeng.api.vo.automaticPilot.proto.down.StatusCode;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.RTTask;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.TaskStatus;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.TaskType;
import com.xiaopeng.automaticPilot.util.XPUUtil;
import com.xiaopeng.common.core.domain.R;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
@Slf4j
@RestController
@RequestMapping("")
@Api(tags = "订单任务Api")
public class OrderMissionController {
 
 
    private final XPUUtil xpuUtil;
 
    public OrderMissionController(XPUUtil xpuUtil) {
        this.xpuUtil = xpuUtil;
    }
 
 
    @PostMapping("/inner/pushOrder")
    public R<Boolean> pushOrder(@RequestParam Long orderId) {
 
        RTTask task = new RTTask();
        task.setOrder_id(orderId.toString());
        // TODO id处理 已经数据是否存储
        task.setTask_id(System.currentTimeMillis()+ "");
        task.setTask_type(TaskType.ROBOTAXI);
        task.setStatus(TaskStatus.PENDING);
 
        ResponseMessage responseMessage = xpuUtil.cloudCreateOrder(task);
        if (responseMessage.getCode()== StatusCode.OK) {
            return R.ok(true);
        }
        return R.ok(false);
    }
}