jiangbiao преди 2 години
родител
ревизия
9b4b5bec43

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

@@ -446,4 +446,32 @@ public class StatisticsController extends BaseController {
         }
         return map;
     }
+
+    @GetMapping("/countXlcd")
+    public AjaxResult countXlcd(Statistics statistics) {
+        List<Statistics> resultList = new ArrayList<>();
+        // 根据装查询
+        for (Statistics plant : statisticsService.countPlant(statistics)) {
+            Statistics result = new Statistics();
+            setStatistics(result);
+            result.setPlantName(plant.getPlantName());
+            statistics.setPlantId(plant.getPlantId());
+            for (Statistics countXlcd : statisticsService.countXlcd(statistics)) {
+                switch (countXlcd.getContent()) {
+                    case "1":
+                        result.setWxlCount(countXlcd.getCount());
+                        break;
+                    case "2":
+                        result.setYbxlCount(countXlcd.getCount());
+                        break;
+                    case "3":
+                        result.setYzxlCount(countXlcd.getCount());
+                        break;
+                }
+            }
+            resultList.add(result);
+        }
+        return AjaxResult.success(resultList);
+    }
+
 }

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

@@ -110,7 +110,7 @@ public class TTaskInspectionPlanController extends BaseController {
 
     @GetMapping("/allPlan")
     public AjaxResult selectAllPlan() {
-        return AjaxResult.success(tTaskInspectionPlanService.selectAllPlan());
+        return AjaxResult.success(tTaskInspectionPlanService.selectAllPlan(new TTaskInspectionPlan()));
     }
 
     @GetMapping("/pointList")

+ 3 - 1
master/src/main/java/com/ruoyi/project/task/mapper/TTaskInspectionPlanMapper.java

@@ -32,7 +32,9 @@ public interface TTaskInspectionPlanMapper extends BaseMapper<TTaskInspectionPla
      */
     @DataScopePlant(deptAlias = "d")
     public List<TTaskInspectionPlan> selectTTaskInspectionPlanList(TTaskInspectionPlan tTaskInspectionPlan);
-    public List<TTaskInspectionPlan> selectAllPlan();
+
+    @DataScopePlant(deptAlias = "d")
+    public List<TTaskInspectionPlan> selectAllPlan(TTaskInspectionPlan tTaskInspectionPlan);
 
     /**
      * 新增检测计划

+ 1 - 1
master/src/main/java/com/ruoyi/project/task/service/ITTaskInspectionPlanService.java

@@ -29,7 +29,7 @@ public interface ITTaskInspectionPlanService extends IService<TTaskInspectionPla
      */
     public List<TTaskInspectionPlan> selectTTaskInspectionPlanList(TTaskInspectionPlan tTaskInspectionPlan);
 
-    public List<TTaskInspectionPlan> selectAllPlan();
+    public List<TTaskInspectionPlan> selectAllPlan(TTaskInspectionPlan tTaskInspectionPlan);
 
     /**
      * 新增检测计划

+ 2 - 2
master/src/main/java/com/ruoyi/project/task/service/impl/TTaskInspectionPlanServiceImpl.java

@@ -46,9 +46,9 @@ public class TTaskInspectionPlanServiceImpl extends ServiceImpl<TTaskInspectionP
     }
 
     @Override
-    public List<TTaskInspectionPlan> selectAllPlan()
+    public List<TTaskInspectionPlan> selectAllPlan(TTaskInspectionPlan tTaskInspectionPlan)
     {
-        return tTaskInspectionPlanMapper.selectAllPlan();
+        return tTaskInspectionPlanMapper.selectAllPlan(tTaskInspectionPlan);
     }
 
     /**

+ 2 - 2
master/src/main/resources/application.yml

@@ -11,7 +11,7 @@ ruoyi:
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
   profile: D:/ruoyi/uploadPath
   # 获取ip地址开关
-  addressEnabled: false
+  addressEnabled: true
   # 验证码类型 math 数组计算 char 字符验证
   captchaType: math
 
@@ -97,7 +97,7 @@ token:
     # 令牌密钥
     secret: abcdefghijklmnopqrstuvwxyz
     # 令牌有效期(默认30分钟)
-    expireTime: 600000
+    expireTime: 600
 
 # MyBatis配置
 mybatis:

+ 4 - 1
master/src/main/resources/mybatis/task/TTaskInspectionPlanMapper.xml

@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTTaskInspectionPlanVo">
-        select `plan_quarter`, `plan_year`, `plan_code`,id, plant_id, inspection_plan_no, inspection_plan_name, detection_frequency, start_time, end_time, point_num, remarks, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_task_inspection_plan
+        select `plan_quarter`, `plan_year`, `plan_code`,id, plant_id, inspection_plan_no, inspection_plan_name, detection_frequency, start_time, end_time, point_num, remarks, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_task_inspection_plan d
     </sql>
 
     <select id="selectTTaskInspectionPlanList" parameterType="TTaskInspectionPlan" resultMap="TTaskInspectionPlanResult">
@@ -61,6 +61,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectAllPlan" resultMap="TTaskInspectionPlanResult">
         <include refid="selectTTaskInspectionPlanVo"/> where del_flag = 0
+        <!-- 数据范围过滤 -->
+        ${params.dataScopePlant}
+        order by createdate desc
     </select>
 
     <select id="selectTTaskInspectionPlanById" parameterType="Long" resultMap="TTaskInspectionPlanResult">

+ 7 - 0
ui/src/api/statistics/statistics.js

@@ -22,3 +22,10 @@ export function pflByPoint(query) {
     params: query
   })
 }
+export function countXlcd(query) {
+  return request({
+    url: '/statistics/statistics/countXlcd',
+    method: 'get',
+    params: query
+  })
+}

+ 0 - 2
ui/src/views/check/inspectionCheck/pointEnter.vue

@@ -48,7 +48,6 @@
             icon="el-icon-download"
             size="mini"
             @click="handleExport"
-            v-hasPermi="['check:checkpoints:export']"
           >导出检测点清单
           </el-button>
         </el-col>
@@ -60,7 +59,6 @@
             size="mini"
             @click="handleImport"
             v-if="isEnter"
-            v-hasPermi="['check:checkpoints:add']"
           >导入检测数据
           </el-button>
         </el-col>

+ 0 - 2
ui/src/views/check/repairCheck/repairEnter.vue

@@ -48,7 +48,6 @@
             icon="el-icon-download"
             size="mini"
             @click="handleExport"
-            v-hasPermi="['check:checkpoints:export']"
           >导出维修点清单
           </el-button>
         </el-col>
@@ -60,7 +59,6 @@
             size="mini"
             @click="handleImport"
             v-if="isEnter"
-            v-hasPermi="['check:checkpoints:add']"
           >导入维修数据
           </el-button>
         </el-col>

+ 7 - 3
ui/src/views/index.vue

@@ -8,12 +8,12 @@
         <div class="bt"><span><i class="el-icon-coin i"></i> 泄露程度统计</span></div>
         <el-col :span="12">
           <el-card style="margin:0 5px 0 0;height: 500px" shadow="hover">
-            <plant-count-chart v-if="show" :statistics="statisticsList"></plant-count-chart>
+            <plant-count-chart :statistics="xlcdList"></plant-count-chart>
           </el-card>
         </el-col>
         <el-col :span="12">
           <el-card style="margin: 0 0 0 5px;height: 500px " shadow="hover">
-            <pt-count-chart v-if="show" :queryParams="queryParams"></pt-count-chart>
+            <pt-count-chart :queryParams="queryParams"></pt-count-chart>
           </el-card>
         </el-col>
       </el-card>
@@ -47,7 +47,7 @@ import LineChart from './dashboard/LineChart'
 import RaddarChart from './dashboard/RaddarChart'
 import PieChart from './dashboard/PieChart'
 import BarChart from './dashboard/BarChart'
-import {listStatistics, pflByPoint} from "@/api/statistics/statistics";
+import {countXlcd, listStatistics, pflByPoint} from "@/api/statistics/statistics";
 import PflPieChart from "@/views/statistics/pie/pflPieChart";
 import XllPieChart from "@/views/statistics/pie/xllPieChart";
 import JplPieChart from "@/views/statistics/pie/jplPieChart";
@@ -102,6 +102,7 @@ export default {
       show: false,
       showPoint: false,
       statisticsList: [],
+      xlcdList: [],
       pointCountList: [],
     }
   },
@@ -122,6 +123,9 @@ export default {
         this.pointCountList = response.data;
         this.showPoint = true;
       })
+      countXlcd(this.queryParams).then(response => {
+        this.xlcdList = response.data;
+      })
     }
   }
 }

+ 2 - 2
ui/src/views/statistics/index.vue

@@ -86,12 +86,12 @@
         <div class="bt"><span><i class="el-icon-coin i"></i> 泄露程度统计</span></div>
         <el-col :span="12">
           <el-card style="margin-top:0; margin-left:0;margin-bottom:0;height: 500px" shadow="hover">
-            <plant-count-chart v-if="show" :statistics="statisticsList"></plant-count-chart>
+            <plant-count-chart :statistics="statisticsList"></plant-count-chart>
           </el-card>
         </el-col>
         <el-col :span="12">
           <el-card style="margin-top:0; margin-right:0;margin-bottom:0;height: 500px" shadow="hover">
-            <pt-count-chart v-if="show" :queryParams="queryParams"></pt-count-chart>
+            <pt-count-chart :queryParams="queryParams"></pt-count-chart>
           </el-card>
         </el-col>
       </el-card>

+ 22 - 8
ui/src/views/statistics/plantCountChart.vue

@@ -104,17 +104,31 @@ export default {
   },
   mounted() {
     this.$nextTick(() => {
-      this.statistics.forEach(item => {
-        if (item.plantName!='合计') {
-          this.option.series[0].data.push(item.yzxlCount);
-          this.option.series[1].data.push(item.ybxlCount);
-          this.option.series[2].data.push(item.wxlCount);
-          this.option.yAxis.data.push(item.plantName);
-        }
-      })
+      this.option.series[0].data=[0];
+      this.option.series[1].data=[0];
+      this.option.series[2].data=[0];
+      this.option.yAxis.data=[''];
       this.initChart();
     })
   },
+  watch: {
+    statistics: {
+      deep: true,
+      immediate: true, // 监听到后,立即执行 handler方法
+      handler: function (newVal, oldVal) {
+        this.statisticsList = newVal
+        this.statisticsList.forEach(item => {
+          if (item.plantName != '合计') {
+            this.option.series[0].data.push(item.yzxlCount);
+            this.option.series[1].data.push(item.ybxlCount);
+            this.option.series[2].data.push(item.wxlCount);
+            this.option.yAxis.data.push(item.plantName);
+          }
+        })
+        this.initChart();
+      },
+    }
+  },
   methods: {
     initChart() {
       // 基于准备好的dom,初始化echarts实例