生成调度工单时命名规范

This commit is contained in:
yanglei 2025-12-05 14:12:18 +08:00
parent eea1272d42
commit c5a730fe66

View File

@ -167,7 +167,7 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
List<EbikeInventoryRecord> list = new ArrayList<>(); List<EbikeInventoryRecord> list = new ArrayList<>();
if (!ecuInfo.getBindBattery()){ if (!ecuInfo.getBindBattery()) {
EbikeInventoryVo inventoryVo = EbikeInventoryVo.builder() EbikeInventoryVo inventoryVo = EbikeInventoryVo.builder()
.operatorId(operatorId) .operatorId(operatorId)
.inventoryType(1) .inventoryType(1)
@ -181,12 +181,12 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
.build(); .build();
list.add(inventoryRecord); list.add(inventoryRecord);
inventoryService.reduceInventory(inventoryVo); inventoryService.reduceInventory(inventoryVo);
}else { } else {
ecuInfo.setIsClaim(Boolean.TRUE); ecuInfo.setIsClaim(Boolean.TRUE);
ebikeEcuInfoService.updateById(ecuInfo); ebikeEcuInfoService.updateById(ecuInfo);
} }
if (bindVo.getHasHelme()){ if (bindVo.getHasHelme()) {
EbikeInventoryVo inventoryVo = EbikeInventoryVo.builder() EbikeInventoryVo inventoryVo = EbikeInventoryVo.builder()
.operatorId(operatorId) .operatorId(operatorId)
.inventoryType(2) .inventoryType(2)
@ -322,9 +322,9 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
} }
EbikeEcuInfo ebikeEcuInfo = ebikeEcuInfoService.getEcu(bikeCode); EbikeEcuInfo ebikeEcuInfo = ebikeEcuInfoService.getEcu(bikeCode);
ResGPSDto resGPSDto = (ResGPSDto)redisUtil.getEcu(ebikeEcuInfo.getEcuSn()); ResGPSDto resGPSDto = (ResGPSDto) redisUtil.getEcu(ebikeEcuInfo.getEcuSn());
if (resGPSDto.getSoc() < 20){ if (resGPSDto.getSoc() < 20) {
throw new EbikeException("该车辆电量低,暂不能骑行"); throw new EbikeException("该车辆电量低,暂不能骑行");
} }
@ -342,13 +342,13 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
.where(EBIKE_BIKE_ORDER.HANDLE_STATE.eq(OrderHandleState.PROCESSED)) .where(EBIKE_BIKE_ORDER.HANDLE_STATE.eq(OrderHandleState.PROCESSED))
.where(EBIKE_BIKE_ORDER.DISPATCH_STATE.eq(OrderDispatchState.PROCESSED)); .where(EBIKE_BIKE_ORDER.DISPATCH_STATE.eq(OrderDispatchState.PROCESSED));
EbikeBikeOrder bikeOrder = orderMapper.selectOneByQuery(query); EbikeBikeOrder bikeOrder = orderMapper.selectOneByQuery(query);
if (bikeOrder != null) { if (bikeOrder != null) {
redisUtil.deleteDispatchOrder(bikeOrder.getOrderId()); redisUtil.deleteDispatchOrder(bikeOrder.getOrderId());
bikeOrder.setDispatchState(OrderDispatchState.EFFECTIVE); bikeOrder.setDispatchState(OrderDispatchState.EFFECTIVE);
orderMapper.update(bikeOrder); orderMapper.update(bikeOrder);
} }
//若存在未处理/已接单的调度工单作废未处理的调度工单 //若存在未处理/已接单的调度工单作废未处理的调度工单
List<Integer> list = new ArrayList<>(); List<Integer> list = new ArrayList<>();
list.add(OrderHandleState.UNPROCESSED); list.add(OrderHandleState.UNPROCESSED);
list.add(OrderHandleState.ACCEPTED); list.add(OrderHandleState.ACCEPTED);
@ -469,7 +469,9 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
EbikeDispatchConfiguration configuration = dispatchConfigurationService.getConfigurationByOperationId(info.getOperatorId()); EbikeDispatchConfiguration configuration = dispatchConfigurationService.getConfigurationByOperationId(info.getOperatorId());
redisUtil.saveNoDocument(bikeCode, "2", configuration.getDispatchDuration(), TimeUnit.HOURS); if (configuration != null && configuration.getDispatchDuration() != null) {
redisUtil.saveNoDocument(bikeCode, LocalDateTime.now(), configuration.getDispatchDuration(), TimeUnit.HOURS);
}
this.mapper.update(info); this.mapper.update(info);