车辆状态
This commit is contained in:
parent
2ff0acb9c3
commit
8caed9a0e7
@ -1,14 +1,14 @@
|
||||
package com.cdzy.operations.controller;
|
||||
|
||||
import com.cdzy.common.model.response.JsonResult;
|
||||
import com.cdzy.operations.model.entity.EbikeBikeInfo;
|
||||
import com.cdzy.operations.model.vo.EbikeBikeBindVo;
|
||||
import com.cdzy.operations.service.EbikeBikeInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 车辆基本信息 控制层。
|
||||
@ -34,25 +34,4 @@ public class EbikeBikeInfoController {
|
||||
ebikeBikeInfoService.bind(bindVo);
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆列表
|
||||
* @return 列表
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public JsonResult<?> list() {
|
||||
List<EbikeBikeInfo> list = ebikeBikeInfoService.list();
|
||||
return JsonResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成车辆
|
||||
* @return 列表
|
||||
*/
|
||||
@PostMapping("save")
|
||||
public JsonResult<?> save(@Validated @RequestBody EbikeBikeInfo ebikeBikeInfo) {
|
||||
ebikeBikeInfoService.save(ebikeBikeInfo);
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package com.cdzy.operations.enums;
|
||||
|
||||
/**
|
||||
* @author attiya
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface BikeUsageStatus {
|
||||
|
||||
/**
|
||||
* 初始状态:绑定完成
|
||||
*/
|
||||
int BIND = 0;
|
||||
|
||||
/**
|
||||
* 待单
|
||||
*/
|
||||
int WAIT = 1;
|
||||
|
||||
/**
|
||||
* 骑行
|
||||
*/
|
||||
int CYCLING = 2;
|
||||
|
||||
/**
|
||||
* 待维修
|
||||
*/
|
||||
int REPAIR = 3;
|
||||
|
||||
/**
|
||||
* 调度中
|
||||
*/
|
||||
int DISPATCH = 4;
|
||||
|
||||
|
||||
/**
|
||||
* 维修中
|
||||
*/
|
||||
int UNDER_REPAIR = 5;
|
||||
|
||||
/**
|
||||
* 待投放
|
||||
*/
|
||||
int DEPLOYED = 6;
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.cdzy.common.ex.EbikeException;
|
||||
import com.cdzy.operations.enums.BatteryStatus;
|
||||
import com.cdzy.operations.enums.BikeQrStatus;
|
||||
import com.cdzy.operations.enums.BikeStatus;
|
||||
import com.cdzy.operations.enums.BikeUsageStatus;
|
||||
import com.cdzy.operations.mapper.*;
|
||||
import com.cdzy.operations.model.entity.*;
|
||||
import com.cdzy.operations.model.vo.EbikeBikeBindVo;
|
||||
@ -139,6 +140,7 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
||||
.ecuId(ecuInfo.getEcuId())
|
||||
.hasHelme(bindVo.getHasHelme())
|
||||
.status(BikeStatus.UN_LAUNCH)
|
||||
.usageStatus(BikeUsageStatus.BIND)
|
||||
.createdBy(StpUtil.getLoginIdAsLong())
|
||||
.build();
|
||||
this.mapper.insert(bikeInfo);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user