| | |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.maintenance.XpErrorType; |
| | | import com.xiaopeng.api.model.maintenance.XpTask; |
| | | import com.xiaopeng.api.model.maintenance.XpTaskHandleDetailRoutine; |
| | | import com.xiaopeng.api.model.maintenance.XpTaskRule; |
| | | import com.xiaopeng.api.model.order.XpCruiseOrder; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.TaskVO; |
| | | import com.xiaopeng.api.vo.account.LoginOperationUser; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.common.core.domain.R; |
| | |
| | | import com.xiaopeng.maintenance.schedule.InsuranceInspectionScheduleTask; |
| | | import com.xiaopeng.maintenance.service.IXpErrorTypeService; |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import com.xiaopeng.maintenance.vo.*; |
| | | import com.xiaopeng.maintenance.vo.TaskCleanDetailVO; |
| | | import com.xiaopeng.maintenance.vo.TaskDetectionDetailVO; |
| | | import com.xiaopeng.maintenance.vo.VehicleListVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.apache.shardingsphere.transaction.core.TransactionType; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private AccidentTaskQuartzScheduler accidentTaskQuartzScheduler; |
| | | |
| | | @ApiOperation(value = "事故类型列表", response = XpErrorType.class, tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/errorTypeList") |
| | | @GetMapping("/maintenance-app/api/v1/task/errorTypeList") |
| | | public R<List<XpErrorType>> errorTypeList() { |
| | | return xpErrorTypeService.errorTypeList(); |
| | | } |
| | | |
| | | @ApiOperation(value = "任务中心列表", response = TaskPageListVO.class, tags = "运维APP-任务中心") |
| | | @PostMapping("/api/v1/task/pageList") |
| | | @PostMapping("/maintenance-app/api/v1/task/pageList") |
| | | public R<PageInfo<TaskPageListVO>> pageList(@RequestBody TaskPageListQuery query) { |
| | | query.setUserId(tokenService.getLoginOperationUser().getXpOperationsUser().getId()); |
| | | PageInfo<TaskPageListVO> pageList = xpTaskService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value = "接收工单", tags = "运维APP-任务中心") |
| | | @PostMapping("/maintenance-app/api/v1/task/accept") |
| | | public R<?> accept(@RequestParam String taskId) { |
| | | xpTaskService.accept(taskId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "工单改派", tags = "运维APP-任务中心") |
| | | @PostMapping("/maintenance-app/api/v1/task/reassign") |
| | | public R<?> reassign(@RequestBody TaskReassignVo vo) { |
| | | xpTaskService.reassign(vo.getTaskId(), vo.getComment()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "事故任务确认到达", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/confirmArrive") |
| | | @GetMapping("/maintenance-app/api/v1/task/confirmArrive") |
| | | public R confirmArrive(Long id) { |
| | | Long userId = tokenService.getLoginOperationUser().getXpOperationsUser().getId(); |
| | | return xpTaskService.confirmArrive(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询车辆不分页列表", tags = "运维APP-任务中心") |
| | | @PostMapping("/api/v1/task/listVehicle") |
| | | @PostMapping("/maintenance-app/api/v1/task/listVehicle") |
| | | public R<List<VehicleListVO>> listVehicle() { |
| | | |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "上传车辆事故", tags = "运维APP-任务中心") |
| | | @PostMapping("/api/v1/task/saveVehicleAccident") |
| | | @PostMapping("/maintenance-app/api/v1/task/saveVehicleAccident") |
| | | public R saveVehicleAccident(@RequestBody SaveVehicleAccidentDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpOperationsUser xpOperationsUser = loginOperationUser.getXpOperationsUser(); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆事故任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/vehicleAccidentDetail") |
| | | @GetMapping("/maintenance-app/api/v1/task/vehicleAccidentDetail") |
| | | public R<TaskAccidentDetailVO> vehicleAccidentDetail(Long id) throws UnsupportedEncodingException { |
| | | return xpTaskService.vehicleAccidentDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆其他常规任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/vehicleRoutineDetail") |
| | | @GetMapping("/maintenance-app/api/v1/task/vehicleRoutineDetail") |
| | | public R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) throws UnsupportedEncodingException { |
| | | return xpTaskService.vehicleRoutineDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "上传车辆其他常规任务详情", tags = "运维APP-任务中心") |
| | | @PostMapping("/api/v1/task/saveRoutineDetail") |
| | | @PostMapping("/maintenance-app/api/v1/task/saveRoutineDetail") |
| | | public R saveRoutineDetail(@RequestBody SaveRoutineDetailDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | Long id = loginOperationUser.getId(); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆常规充电任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/chargingDetail") |
| | | @GetMapping("/maintenance-app/api/v1/task/chargingDetail") |
| | | public R<TaskChargingDetailVO> chargingDetail(Long id) { |
| | | return xpTaskService.chargingDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆常规维修任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/repairDetail") |
| | | @GetMapping("/maintenance-app/api/v1/task/repairDetail") |
| | | public R<TaskRepairDetailVO> repairDetail(Long id) { |
| | | return xpTaskService.repairDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆常规整备任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/preparationDetail") |
| | | @GetMapping("/maintenance-app/api/v1/task/preparationDetail") |
| | | public R<TaskPreparationDetailVO> preparationDetail(Long id) { |
| | | return xpTaskService.preparationDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆常规检测任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/detectionDetail") |
| | | @GetMapping("/maintenance-app/api/v1/task/detectionDetail") |
| | | public R<TaskDetectionDetailVO> detectionDetail(Long id) { |
| | | return xpTaskService.detectionDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆常规洗车任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/cleanDetail") |
| | | @GetMapping("/maintenance-app/api/v1/task/cleanDetail") |
| | | public R<TaskCleanDetailVO> cleanDetail(Long id) throws UnsupportedEncodingException { |
| | | return xpTaskService.cleanDetail(id); |
| | | } |
| | |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | @ApiOperation(value = "处理车辆事故", tags = "运维APP-任务中心") |
| | | @PostMapping("/api/v1/task/handleVehicleAccident") |
| | | @PostMapping("/maintenance-app/api/v1/task/handleVehicleAccident") |
| | | public R handleVehicleAccident(@RequestBody HandleVehicleAccidentDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpOperationsUser xpOperationsUser = loginOperationUser.getXpOperationsUser(); |
| | |
| | | * |
| | | * @param vehicleId 车辆ID |
| | | */ |
| | | @GetMapping("/inner/xpTask/queryInfoByVehicleId") |
| | | @GetMapping("/logan/inner/xpTask/queryInfoByVehicleId") |
| | | public R<XpTask> queryInfoByVehicleId(@RequestParam("vehicleId") Long vehicleId) { |
| | | XpTask xpTask = xpTaskService.queryInfoByVehicleId(vehicleId); |
| | | |
| | |
| | | return R.ok(xpTask); |
| | | } |
| | | |
| | | @ApiOperation(value = "待改派的工单分页列表", tags = {"管理后台-运维执行-任务工单-待改派工单"}) |
| | | @PostMapping("/api/v1/task/reassign/pageList") |
| | | public R<PageInfo<TaskVO>> reassignTaskPageList(@RequestBody TaskPageListQuery query) { |
| | | return R.ok(xpTaskService.reassignTaskPageList(query)); |
| | | } |
| | | |
| | | @ApiOperation(value = "可改派的运维人员列表", tags = {"管理后台-运维执行-任务工单-待改派工单"}) |
| | | @GetMapping("/api/v1/task/reassign/availableUsers") |
| | | public R<List<XpOperationsUser>> availableReassignUsers(@RequestParam Long taskId) { |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "改派详情", tags = {"管理后台-运维执行-任务工单-待改派工单"}) |
| | | @GetMapping("/api/v1/task/reassign/detail") |
| | | public R<TaskReassignDetailVO> reassignDetail(@RequestParam Long taskId) { |
| | | //包含任务信息和改派日志 |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "执行保险年检检测定时任务", tags = {"定时任务"}) |
| | | @GetMapping("/base/task/insurance/execute") |
| | |
| | | insuranceInspectionScheduleTask.executeInsuranceInspectionTask(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |