jiangbiao 2 лет назад
Родитель
Сommit
8f66f7c3da

+ 3 - 0
master/src/main/java/com/ruoyi/project/statistics/controller/StatisticsController.java

@@ -247,6 +247,9 @@ public class StatisticsController extends BaseController {
         Statistics result = null;
         for (Statistics point : xlcdByPoint) {
             String pointType = point.getPointType();
+            if (pointType.contains("取样连接系统")) {
+                pointType = "取样连接系统";
+            }
             Integer count = point.getCount();
             if (map.get(pointType) == null) {
                 result = new Statistics();

+ 10 - 0
master/src/main/java/com/ruoyi/project/task/controller/TTaskInspectionPlanController.java

@@ -161,6 +161,9 @@ public class TTaskInspectionPlanController extends BaseController {
                         pointTypes.add(lawitem.getPointType());
                     }
                 }
+                if (CollectionUtils.isEmpty(pointTypes)){
+                    return AjaxResult.success();
+                }
                 points.in("point_type", pointTypes);
             }
             Integer count = tBasePointMapper.selectCount(points);
@@ -396,6 +399,13 @@ public class TTaskInspectionPlanController extends BaseController {
     @Log(title = "检测计划", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
+        for (Long id : ids) {
+            TTaskInspection tTaskInspection = new TTaskInspection();
+            tTaskInspection.setPlanId(id);
+            if (CollectionUtils.isNotEmpty(tTaskInspectionService.selectTTaskInspectionList(tTaskInspection))) {
+                return AjaxResult.error("不可删除已存在检测任务的计划!");
+            }
+        }
         return toAjax(tTaskInspectionPlanService.deleteTTaskInspectionPlanByIds(ids));
     }
 }

+ 1 - 1
ui/src/views/task/plan/index.vue

@@ -412,7 +412,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除数据项?').then(function () {
+      this.$modal.confirm('是否确认删除数据项?已创建检测任务的计划将不会删除!').then(function () {
         return delPlan(ids);
       }).then(() => {
         this.getList();