|
@@ -156,9 +156,15 @@ public class IsLotoStationServiceImpl extends ServiceImpl<IsLotoStationMapper, I
|
|
|
.eq(IsLotoStation::getLotoName, isLotoStation.getLotoName())
|
|
.eq(IsLotoStation::getLotoName, isLotoStation.getLotoName())
|
|
|
.ne(IsLotoStation::getLotoId, isLotoStation.getLotoId()));
|
|
.ne(IsLotoStation::getLotoId, isLotoStation.getLotoId()));
|
|
|
Assert.isTrue(list.isEmpty(), "该名称已被使用,请重新填写!");
|
|
Assert.isTrue(list.isEmpty(), "该名称已被使用,请重新填写!");
|
|
|
|
|
+ // 判断序列号重复
|
|
|
|
|
+ List<IsLotoStation> list1 = list(Wrappers.<IsLotoStation>lambdaQuery()
|
|
|
|
|
+ .eq(IsLotoStation::getLotoSerialNumber, isLotoStation.getLotoSerialNumber())
|
|
|
|
|
+ .ne(IsLotoStation::getLotoId, isLotoStation.getLotoId()));
|
|
|
|
|
+ Assert.isTrue(list1.isEmpty(), "该序列号已被使用,请重新填写!");
|
|
|
update(Wrappers.<IsLotoStation>lambdaUpdate()
|
|
update(Wrappers.<IsLotoStation>lambdaUpdate()
|
|
|
.eq(IsLotoStation::getLotoId, isLotoStation.getLotoId())
|
|
.eq(IsLotoStation::getLotoId, isLotoStation.getLotoId())
|
|
|
.set(IsLotoStation::getLotoName, isLotoStation.getLotoName())
|
|
.set(IsLotoStation::getLotoName, isLotoStation.getLotoName())
|
|
|
|
|
+ .set(IsLotoStation::getLotoSerialNumber, isLotoStation.getLotoSerialNumber())
|
|
|
.set(IsLotoStation::getOrderNum, isLotoStation.getOrderNum())
|
|
.set(IsLotoStation::getOrderNum, isLotoStation.getOrderNum())
|
|
|
.set(IsLotoStation::getMapId, isLotoStation.getMapId() != null ? isLotoStation.getMapId() : null)
|
|
.set(IsLotoStation::getMapId, isLotoStation.getMapId() != null ? isLotoStation.getMapId() : null)
|
|
|
.set(IsLotoStation::getWorkstationId, isLotoStation.getWorkstationId() != null ? isLotoStation.getWorkstationId() : null)
|
|
.set(IsLotoStation::getWorkstationId, isLotoStation.getWorkstationId() != null ? isLotoStation.getWorkstationId() : null)
|
|
@@ -173,6 +179,10 @@ public class IsLotoStationServiceImpl extends ServiceImpl<IsLotoStationMapper, I
|
|
|
List<IsLotoStation> list = list(Wrappers.<IsLotoStation>lambdaQuery()
|
|
List<IsLotoStation> list = list(Wrappers.<IsLotoStation>lambdaQuery()
|
|
|
.eq(IsLotoStation::getLotoName, isLotoStation.getLotoName()));
|
|
.eq(IsLotoStation::getLotoName, isLotoStation.getLotoName()));
|
|
|
Assert.isTrue(list.isEmpty(), "该名称已被使用,请重新填写!");
|
|
Assert.isTrue(list.isEmpty(), "该名称已被使用,请重新填写!");
|
|
|
|
|
+ // 判断序列号重复
|
|
|
|
|
+ List<IsLotoStation> list1 = list(Wrappers.<IsLotoStation>lambdaQuery()
|
|
|
|
|
+ .eq(IsLotoStation::getLotoSerialNumber, isLotoStation.getLotoSerialNumber()));
|
|
|
|
|
+ Assert.isTrue(list1.isEmpty(), "该序列号已被使用,请重新填写!");
|
|
|
return save(isLotoStation);
|
|
return save(isLotoStation);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -187,4 +197,12 @@ public class IsLotoStationServiceImpl extends ServiceImpl<IsLotoStationMapper, I
|
|
|
}
|
|
}
|
|
|
return byId;
|
|
return byId;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public IsLotoStation selectLotoBySerialNumber(String lotoSerialNumber) {
|
|
|
|
|
+ Assert.notBlank(lotoSerialNumber, "请提供loto柜序列号!");
|
|
|
|
|
+ IsLotoStation one = getOne(Wrappers.<IsLotoStation>lambdaQuery()
|
|
|
|
|
+ .eq(IsLotoStation::getLotoSerialNumber, lotoSerialNumber));
|
|
|
|
|
+ return one;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|