中控换绑
This commit is contained in:
parent
3560e5ca81
commit
a24aa7db13
@ -484,9 +484,27 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
||||
|
||||
@Override
|
||||
public void changeEcu(String bikeCode, String ecuSn) {
|
||||
|
||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||
.where(EBIKE_ECU_INFO.ECU_SN.eq(ecuSn));
|
||||
EbikeEcuInfo ebikeEcuInfo = ebikeEcuInfoService.getOne(queryWrapper);
|
||||
if (ebikeEcuInfo == null) {
|
||||
throw new EbikeException("中控编号错误,该中控仓库中不存在");
|
||||
}
|
||||
|
||||
queryWrapper.clear();
|
||||
queryWrapper.where(EBIKE_BIKE_INFO.BIKE_CODE.eq(bikeCode));
|
||||
EbikeBikeInfo bikeInfo = getOne(queryWrapper);
|
||||
if (bikeInfo == null) {
|
||||
throw new EbikeException("车辆编号错误");
|
||||
}
|
||||
bikeInfo.setEcuId(ebikeEcuInfo.getEcuId());
|
||||
if (bikeInfo.getUsageStatus() == BikeUsageStatus.CYCLING){
|
||||
throw new EbikeException("车辆骑行中暂时无法换绑");
|
||||
}
|
||||
updateById(bikeInfo);
|
||||
}
|
||||
|
||||
|
||||
static EbikeSpecialDay getEbikeSpecialDay(List<EbikeSpecialDay> ebikeSpecialDays) {
|
||||
LocalDate today = LocalDate.now();
|
||||
DayOfWeek dayOfWeek = today.getDayOfWeek();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user