| | |
| | | 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; |
| | |
| | | |
| | | 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> |
| | |
| | | private final IXpTestPlanService xpTestPlanService; |
| | | private final XpVehicleClient xpVehicleClient; |
| | | private final IXpTestPlanPointService xpTestPlanPointService; |
| | | private final XpTestPointService xpTestPointService; |
| | | private final XpTestPointClient xpTestPointService; |
| | | private final IXpTestPlanVehicleService xpTestPlanVehicleService; |
| | | |
| | | |
| | |
| | | |
| | | @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(); |
| | |
| | | |
| | | @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(); |
| | |
| | | * @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); |
| | |
| | | * @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); |
| | |
| | | * @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); |
| | | } |
| | | |
| | |
| | | * @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) |