Browse Source

修改bug

JensionDzero 1 year ago
parent
commit
8588605147

+ 9 - 0
ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/EquipmentServiceImpl.java

@@ -204,9 +204,18 @@ public class EquipmentServiceImpl implements EquipmentService {
         queryWrapper.and(planItemBoQueryWrapper -> {
             planItemBoQueryWrapper.eq("dl_plan_item.deleted", 0);
         });
+        queryWrapper.and(planItemBoQueryWrapper -> {
+            planItemBoQueryWrapper.eq("dl_plan.state", 1);
+        });
+        queryWrapper.and(planItemBoQueryWrapper -> {
+            planItemBoQueryWrapper.eq("dl_plan.on_state", 1);
+        });
         queryWrapper.and(planItemBoQueryWrapper -> {
             planItemBoQueryWrapper.gt("plan_end_time", DateUtil.date());
         });
+        queryWrapper.and(planItemBoQueryWrapper -> {
+            planItemBoQueryWrapper.apply("dl_plan.plan_id = dl_plan_item.plan_id");
+        });
         Integer count = planItemMapper.getEuipmentPlanCont(queryWrapper);
         if (count > 0) {
             return R.fail("设备下存在广告计划,请移除广告后在删除设备");