liujie
2026-06-09 c96fbe6b0aeb413a17c429133ee6d81d138144b9
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTestPlanController.java
@@ -1,13 +1,17 @@
package com.xiaopeng.operation.controller;
import com.xiaopeng.api.feignClient.operation.XpTestPointClient;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.map.XpTestPoint;
import com.xiaopeng.api.model.operation.XpTestPlan;
import com.xiaopeng.api.model.operation.XpTestPlanPoint;
import com.xiaopeng.api.model.operation.XpTestPlanVehicle;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.operation.dto.XpTestPlanAddDTO;
import com.xiaopeng.common.log.annotation.AdminOperationLog;
import com.xiaopeng.common.log.enums.AdminBusinessType;
import com.xiaopeng.common.log.enums.AdminOperationType;
import com.xiaopeng.operation.dto.XpTestPlanEditDTO;
import com.xiaopeng.operation.query.TestPlanQuery;
import com.xiaopeng.operation.service.IXpTestPlanPointService;
@@ -23,6 +27,9 @@
import javax.validation.Valid;
import java.util.List;
import com.xiaopeng.common.log.annotation.AdminOperationLog;
import com.xiaopeng.common.log.enums.AdminBusinessType;
import com.xiaopeng.common.log.enums.AdminOperationType;
/**
 * <p>
@@ -39,7 +46,7 @@
    private final IXpTestPlanService xpTestPlanService;
    private final XpVehicleClient xpVehicleClient;
    private final IXpTestPlanPointService xpTestPlanPointService;
    private final XpTestPointService xpTestPointService;
    private final XpTestPointClient xpTestPointService;
    private final IXpTestPlanVehicleService xpTestPlanVehicleService;
@@ -52,13 +59,26 @@
    @ApiOperation(value = "新增测试计划", tags = {"管理后台-测试计划"})
    @PostMapping(value = {"/api/v1/xp-test-plan/add"})
    public R<?> add(@Valid @RequestBody XpTestPlanAddDTO dto) {
        xpTestPlanService.add(dto);
        return R.ok();
    @AdminOperationLog(
            businessType = AdminBusinessType.TEST_PLAN,
            operationType = AdminOperationType.ADD,
            content = "新增测试计划",
            appendRequestData = true
    )
    public R<Long> add() {
        XpTestPlan plan = new XpTestPlan();
        xpTestPlanService.save(plan);
        return R.ok(plan.getId());
    }
    @ApiOperation(value = "编辑测试计划", tags = {"管理后台-测试计划"})
    @PostMapping(value = {"/api/v1/xp-test-plan/edit"})
    @AdminOperationLog(
            businessType = AdminBusinessType.TEST_PLAN,
            operationType = AdminOperationType.EDIT,
            content = "编辑测试计划",
            appendRequestData = true
    )
    public R<?> edit(@Valid @RequestBody XpTestPlanEditDTO dto) {
        xpTestPlanService.edit(dto);
        return R.ok();
@@ -66,6 +86,12 @@
    @ApiOperation(value = "删除测试计划", tags = {"管理后台-测试计划"})
    @DeleteMapping(value = {"/api/v1/xp-test-plan/deleteById/{id}"})
    @AdminOperationLog(
            businessType = AdminBusinessType.TEST_PLAN,
            operationType = AdminOperationType.DELETE,
            content = "删除测试计划",
            appendRequestData = true
    )
    public R<?> deleteById(@ApiParam(name = "id", value = "测试计划ID") @PathVariable Long id) {
        xpTestPlanService.deleteById(id);
        return R.ok();
@@ -83,7 +109,7 @@
     * @param id
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanById")
    @PostMapping("/logan/inner/v1/xp-test-plan/getXpTestPlanById")
    public R<XpTestPlan> getXpTestPlanById(@RequestParam Long id){
        XpTestPlan xpTestPlan = xpTestPlanService.getById(id);
        return R.ok(xpTestPlan);
@@ -96,7 +122,7 @@
     * @param id
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanPointById")
    @PostMapping("/logan/inner/v1/xp-test-plan/getXpTestPlanPointById")
    public R<XpTestPlanPoint> getXpTestPlanPointById(@RequestParam Long id){
        XpTestPlanPoint xpTestPlanPoint = xpTestPlanPointService.getById(id);
        return R.ok(xpTestPlanPoint);
@@ -109,9 +135,9 @@
     * @param id
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPointById")
    @PostMapping("/logan/inner/v1/xp-test-plan/getXpTestPointById")
    public R<XpTestPoint> getXpTestPointById(@RequestParam Long id){
        XpTestPoint xpTestPoint = xpTestPointService.getById(id);
        XpTestPoint xpTestPoint = xpTestPointService.queryById(id).getData();
        return R.ok(xpTestPoint);
    }
@@ -121,7 +147,7 @@
     * @param testPlanId
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanVehicleByTestPlanId")
    @PostMapping("/logan/inner/v1/xp-test-plan/getXpTestPlanVehicleByTestPlanId")
    public R<List<XpTestPlanVehicle>> getXpTestPlanVehicleByTestPlanId(@RequestParam Long testPlanId){
        List<XpTestPlanVehicle> xpTestPlanVehicleList = xpTestPlanVehicleService.lambdaQuery()
                .eq(XpTestPlanVehicle::getTestPlanId, testPlanId)