| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.maintenance.XpCheckLocation; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.enums.DisabledEnum; |
| | |
| | | @RequiredArgsConstructor(onConstructor_ = @Lazy) |
| | | public class XpCheckLocationController { |
| | | private final IXpCheckLocationService xpCheckLocationService; |
| | | private final XpFleetClient xpFleetClient; |
| | | private final TokenService tokenService; |
| | | |
| | | @GetMapping("/api/v1/check-location/list") |
| | |
| | | @DeleteMapping("/api/v1/check-location/deleteById") |
| | | @ApiOperation(value = "删除打卡地", tags = {"管理后台-运维执行"}) |
| | | public R<String> deleteById(@RequestParam Long id){ |
| | | // 判断打卡地是否已被使用 |
| | | Long data = xpFleetClient.getUseCountByLocationId(id).getData(); |
| | | if (data > 0) { |
| | | return R.fail("打卡地已被使用,请先解除关联"); |
| | | } |
| | | xpCheckLocationService.removeById(id); |
| | | return R.ok(); |
| | | } |