维修工单新增主键id返回

This commit is contained in:
yanglei 2026-01-19 12:58:48 +08:00
parent 99a554be9b
commit 1275b92ad1
3 changed files with 5 additions and 4 deletions

View File

@ -145,8 +145,8 @@ public class EbikeBikeOrderController {
*/
@PostMapping("faultOrder")
public JsonResult<?> faultOrder(@Validated @RequestBody FaultOrderVo faultOrderVo) {
ebikeBikeOrderService.faultOrder(faultOrderVo);
return JsonResult.success();
Long orderId = ebikeBikeOrderService.faultOrder(faultOrderVo);
return JsonResult.success(orderId);
}
/**

View File

@ -61,7 +61,7 @@ public interface EbikeBikeOrderService extends IService<EbikeBikeOrder> {
* 生成维修工单
* @param faultOrderVo 故障信息
*/
void faultOrder(FaultOrderVo faultOrderVo);
Long faultOrder(FaultOrderVo faultOrderVo);
/**
* 领取电池

View File

@ -247,7 +247,7 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
@Transactional
@Override
public void faultOrder(FaultOrderVo faultOrderVo) {
public Long faultOrder(FaultOrderVo faultOrderVo) {
EbikeBikeInfo bikeInfo = checkBikeCode(faultOrderVo.getBikeCode());
QueryWrapper queryWrapper = QueryWrapper.create()
@ -281,6 +281,7 @@ public class EbikeBikeOrderServiceImpl extends ServiceImpl<EbikeBikeOrderMapper,
//TODO:车辆状态
bikeInfo.setUsageStatus(BikeUsageStatus.REPAIR);
bikeInfoMapper.update(bikeInfo);
return orderId;
}
@Transactional