|
@@ -354,6 +354,17 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
|
|
|
if (!tbFeeDetails.isEmpty()) {
|
|
|
return AjaxJson.getError("该车有付款记录,不能删除");
|
|
|
}
|
|
|
+ List<TbBusiness> businesses = tbBusinessService.findOtherBusinessByCarId(id);
|
|
|
+ if (!businesses.isEmpty()) {
|
|
|
+ return AjaxJson.getError("该车有业务,不能删除");
|
|
|
+ }
|
|
|
+ TbBusinessCar db = this.getById(id);
|
|
|
+ if (StrUtil.isNotEmpty(db.getBusinessId())) {
|
|
|
+ TbBusiness tbBusiness = tbBusinessService.getById(db.getBusinessId());
|
|
|
+ if (tbBusiness != null) {
|
|
|
+ return AjaxJson.getError("该车有业务,不能删除");
|
|
|
+ }
|
|
|
+ }
|
|
|
this.removeById(id);
|
|
|
return AjaxJson.getSuccess();
|
|
|
}
|