|
|
@@ -87,6 +87,15 @@ public class CarMessageApplyServiceImpl extends MPJBaseServiceImpl<CarMessageApp
|
|
|
if(countByCarNumber > 0){
|
|
|
throw new MyException("已存在该车牌号");
|
|
|
}
|
|
|
+
|
|
|
+ long count = this.count(
|
|
|
+ new QueryWrapper<CarMessageApply>().lambda()
|
|
|
+ .eq(CarMessageApply::getUserId, dto.getUserId())
|
|
|
+ .eq(CarMessageApply::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ );
|
|
|
+ if(count > 2){
|
|
|
+ throw new MyException("已添加2辆车,无法继续添加");
|
|
|
+ }
|
|
|
CarMessageApply carMessageApply = BeanUtil.toBean(dto, CarMessageApply.class);
|
|
|
this.save(carMessageApply);
|
|
|
return true;
|