| | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.xiaopeng.api.feignClient.account.XpOperationUserClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetOperationsClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.account.SysUser; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private IXpErrorTypeService xpErrorTypeService; |
| | | @Resource |
| | | private XpOperationUserClient operationUserClient; |
| | | @Resource |
| | | private XpFleetOperationsClient xpFleetOperationsClient; |
| | | @Resource |
| | |
| | | xpTaskExportExcel.setTaskTypeName(task.getTaskTypeName()); |
| | | xpTaskExportExcel.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | xpTaskExportExcel.setTaskDescription(task.getTaskDescription()); |
| | | xpTaskExportExcel.setHandleUserName(task.getHandleUserName()); |
| | | if (StringUtils.hasLength(task.getHandleUserId())){ |
| | | String[] split = task.getHandleUserId().split(","); |
| | | |
| | | List<XpOperationsUser> users = operationUserClient.listByIds(Arrays.stream(split).map(Long::parseLong).collect(Collectors.toList())).getData(); |
| | | if (users!=null){ |
| | | StringBuilder handleUserName = new StringBuilder(); |
| | | for (XpOperationsUser user : users) { |
| | | handleUserName.append(user.getNickName()).append(";"); |
| | | } |
| | | xpTaskExportExcel.setHandleUserName(handleUserName.toString()); |
| | | } |
| | | } |
| | | xpTaskExportExcel.setNumber(num); |
| | | xpTaskExportExcel.setStatus(task.getStatus()); |
| | | LocalDateTime createTime = task.getCreateTime(); |
| | |
| | | xpTaskService.saveTask(dto, reportUserId); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "异常情况上传车辆事故") |
| | | @PostMapping("/inner/v1/task/saveVehicleAccidentError") |
| | | public R saveVehicleAccidentError(@RequestParam Long vehicleId) { |
| | | |
| | | xpTaskService.saveVehicleAccidentError(vehicleId); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "任务详情") |
| | | @GetMapping("/taskDetail") |
| | | public R<TaskManagementDetailVO> taskDetail(Long id) { |
| | | return xpTaskService.taskDetail(id); |
| | | } |
| | | @ApiOperation(value = "查询车辆不分页列表") |
| | | @PostMapping(" /listVehicle") |
| | | @PostMapping("/listVehicle") |
| | | public R<List<XpVehicle>> listVehicle() { |
| | | List<XpVehicle> vehicles = xpVehicleClient.listVehicle().getData(); |
| | | if (vehicles == null){ |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "事故类型列表", response = XpErrorType.class, tags = "管理后台-车辆管理-运营车辆管理") |
| | | @GetMapping(" /errorTypeTreeList") |
| | | @GetMapping("/errorTypeTreeList") |
| | | public R<List<XpErrorType>> errorTypeTreeList() { |
| | | return xpErrorTypeService.errorTypeList(); |
| | | } |