| | |
| | | |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleet; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.FleetAddDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.FleetEditDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.query.FleetPageQuery; |
| | | import com.xiaopeng.vehicleConvoy.model.query.FleetUserPageQuery; |
| | | import com.xiaopeng.vehicleConvoy.model.query.FleetVehiclePageQuery; |
| | | import com.xiaopeng.vehicleConvoy.model.vo.*; |
| | | import com.xiaopeng.vehicleConvoy.service.IXpFleetService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "车队管理") |
| | | @RequiredArgsConstructor(onConstructor_ = @Lazy) |
| | | @RestController |
| | | public class XpFleetController { |
| | | |
| | | @Resource |
| | | private IXpFleetService xpFleetService; |
| | | private final IXpFleetService xpFleetService; |
| | | |
| | | /** |
| | | * 根据ID列表批量查询车队信息(内部接口) |
| | |
| | | } |
| | | return R.ok(xpFleetService.listByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 添加车队 |
| | | * |
| | | * @param dto 添加车队DTO |
| | | * @return 操作结果 |
| | | */ |
| | | @ApiOperation(value = "添加车队", tags = {"管理后台-车队管理"}) |
| | | @PostMapping("/api/v1/fleet/add") |
| | | public R<Void> add(@Valid @RequestBody FleetAddDTO dto) { |
| | | return xpFleetService.add(dto); |
| | | } |
| | | |
| | | /** |
| | | * 编辑车队 |
| | | * |
| | | * @param dto 编辑车队DTO |
| | | * @return 操作结果 |
| | | */ |
| | | @ApiOperation(value = "编辑车队", tags = {"管理后台-车队管理"}, notes = "打卡地列表接口在xp-robotaxi-maintenance-boot,人员列表在xp-robotaxi-account-boot") |
| | | @PostMapping("/api/v1/fleet/edit") |
| | | public R<Void> edit(@Valid @RequestBody FleetEditDTO dto) { |
| | | return xpFleetService.edit(dto); |
| | | } |
| | | |
| | | /** |
| | | * 查询车队详情 |
| | | * |
| | | * @param id 车队id |
| | | * @return 车队详情 |
| | | */ |
| | | @ApiOperation(value = "查询车队详情", tags = {"管理后台-车队管理"}) |
| | | @GetMapping("/api/v1/fleet/queryById") |
| | | public R<FleetDetailVO> queryById(@RequestParam Long id) { |
| | | return xpFleetService.queryById(id); |
| | | } |
| | | |
| | | /** |
| | | * 车队分页列表 |
| | | * |
| | | * @param query 查询参数 |
| | | * @return 分页结果 |
| | | */ |
| | | @ApiOperation(value = "车队分页列表", tags = {"管理后台-车队管理"}) |
| | | @PostMapping("/api/v1/fleet/pageList") |
| | | public R<PageInfo<FleetPageVO>> pageList(@Valid @RequestBody FleetPageQuery query) { |
| | | return xpFleetService.pageList(query); |
| | | } |
| | | |
| | | /** |
| | | * 查询车队车辆分页列表 |
| | | * |
| | | * @param query 查询参数 |
| | | * @return 分页结果 |
| | | */ |
| | | @ApiOperation(value = "查询车队车辆分页列表", tags = {"管理后台-车队管理"}) |
| | | @PostMapping("/api/v1/fleet/queryVehiclePageList") |
| | | public R<PageInfo<FleetVehicleVO>> queryVehiclePageList(@Valid @RequestBody FleetVehiclePageQuery query) { |
| | | return xpFleetService.queryVehiclePageList(query); |
| | | } |
| | | |
| | | /** |
| | | * 查询车队人员分页列表 |
| | | * |
| | | * @param query 查询参数 |
| | | * @return 分页结果 |
| | | */ |
| | | @ApiOperation(value = "查询车队人员分页列表", tags = {"管理后台-车队管理"}) |
| | | @PostMapping("/api/v1/fleet/queryUserPageList") |
| | | public R<PageInfo<FleetUserVO>> queryUserPageList(@Valid @RequestBody FleetUserPageQuery query) { |
| | | return xpFleetService.queryUserPageList(query); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除车队", tags = {"管理后台-车队管理"}) |
| | | @DeleteMapping("/api/v1/fleet/delete/{id}") |
| | | public R<?> deleteById(@ApiParam(name = "id", value = "车队ID") @PathVariable Long id) { |
| | | xpFleetService.deleteById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "车队添加车辆成员", tags = {"管理后台-车队管理"}) |
| | | @PostMapping("/api/v1/fleet/vehicle/add") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "fleetId", value = "车队ID", dataTypeClass = Long.class), |
| | | @ApiImplicitParam(name = "vehicleId", value = "车辆ID", dataTypeClass = Long.class)}) |
| | | public R<?> addVehicle(Long fleetId, Long vehicleId) { |
| | | xpFleetService.addVehicle(fleetId, vehicleId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "车队添加人员成员", tags = {"管理后台-车队管理"}) |
| | | @PostMapping("/api/v1/fleet/operation-user/add") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "fleetId", value = "车队ID", dataTypeClass = Long.class), |
| | | @ApiImplicitParam(name = "operationUserId", value = "车辆ID", dataTypeClass = Long.class)}) |
| | | public R<?> addOperationUserId(Long fleetId, Long operationUserId) { |
| | | xpFleetService.addOperationUserId(fleetId, operationUserId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |