| | |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType; |
| | | import org.apache.shardingsphere.transaction.core.TransactionType; |
| | |
| | | * @author xiaochen |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "车辆整备") |
| | | @RestController |
| | | @RequestMapping("") |
| | |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | @ApiOperation(value = "车辆运维-车辆运维-车辆整备", tags = {"运维APP-车辆管理"}) |
| | | @PostMapping("/api/v1/vehiclePreparation/savePreparation") |
| | | @PostMapping("/maintenance-app/api/v1/vehiclePreparation/savePreparation") |
| | | public R<String> savePreparation(@RequestBody XpVehiclePreparationDTO dto) { |
| | | Long id = tokenService.getLoginOperationUser().getId(); |
| | | dto.setOperationsUserId(id); |
| | |
| | | * 车辆运维-车辆运维-整备记录详情 |
| | | */ |
| | | @ApiOperation(value = "车辆运维-运维记录-整备记录详情", tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehiclePreparation/preparationDetail") |
| | | @GetMapping("/maintenance-app/api/v1/vehiclePreparation/preparationDetail") |
| | | public R<XpVehiclePreparationVO> preparationDetail(@RequestParam Long id) throws UnsupportedEncodingException { |
| | | XpVehiclePreparationVO xpVehiclePreparationVO = xpVehiclePreparationService.preparationDetail(id); |
| | | |
| | |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpVehiclePreparationVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | | |
| | | |
| | | |
| | | return R.ok(xpVehiclePreparationVO); |
| | | } |
| | | |