Bladeren bron

Merge remote-tracking branch 'origin/dev_v1.0.0' into dev_v1.0.0

qinguocai 1 jaar geleden
bovenliggende
commit
5ae7e7f720

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SaveDataServiceImpl.java

@@ -253,6 +253,14 @@ public class SaveDataServiceImpl implements SaveDataService {
             taskNotice.setCreateTime(new Date());
             taskNotice.setSiteId(siteInfo.getSiteId());
             taskNoticeMapper.insert(taskNotice);
+            //任务完成更新状态
+            TaskResult taskResult = taskResultMapper.queryByTaskid(taskNotice.getTaskid());
+            if (taskResult == null){
+                log.error("查询站点失败入库失败 无法查询任务结果 站码:{}", taskNotice.getId());
+                return;
+            }
+            taskResult.setStatus(2);
+            taskResultMapper.update(taskResult);
         } catch (Exception e) {
             log.error("小车任务完成 入库错误:", e);
         }

+ 8 - 4
ruoyi-ui/src/views/analysis/task/index.vue

@@ -52,13 +52,17 @@
               <span class="status-circle"></span>
               <span class="status-text">已完成</span>
             </span>
+            <span class="status status-running" v-else-if="scope.row.status === 3">
+              <span class="status-circle"></span>
+              <span class="status-text">已暂停</span>
+            </span>
           </template>
         </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
-            <template v-if="scope.row.status === 0">
+            <template v-if="scope.row.status === 0 || scope.row.status === 3">
               <el-button size="mini" type="text" icon="el-icon-edit" @click="goRealTime(scope.row)">实时动态</el-button>
-              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleStop(scope.row)">止</el-button>
+              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleStop(scope.row)">止</el-button>
             </template>
             <template v-else-if="scope.row.status === 2">
               <el-button size="mini" type="text" icon="el-icon-edit" @click="goRealTime(scope.row)">测流成果</el-button>
@@ -144,11 +148,11 @@ export default {
       window.open(`${process.env.VUE_APP_BASE_API}/achievement/downAchievement?resultId=${task.resultId}`, '_blank')
     },
     handleStop(task) {
-      this.$modal.confirm('是否确认止编号为"' + task.taskid + '"的测流任务?').then(function() {
+      this.$modal.confirm('是否确认止编号为"' + task.taskid + '"的测流任务?').then(function() {
         return taskAction(task.siteId, 0);
       }).then(() => {
         this.getList();
-        this.$modal.msgSuccess("止成功");
+        this.$modal.msgSuccess("止成功");
       }).catch(() => {});
     },
   }

+ 4 - 1
ruoyi-ui/src/views/analysis/task/realtime.vue

@@ -1,6 +1,6 @@
 <template>
   <div v-if="task.taskid">
-    <Realtime v-if="task.status === 0" :task="task" @refresh="loadTask" />
+    <Realtime v-if="task.status === 0 || task.status === 3" :task="task" @refresh="loadTask" />
     <Result v-if="task.status === 2" :task="task" @refresh="loadTask" />
   </div>
 </template>
@@ -34,6 +34,9 @@ export default {
         if (res.data === null) {
           this.$message.error("测流任务不存在");
         } else {
+          if (![0, 2, 3].includes(res.data.status)) {
+            this.$router.back();
+          }
           this.task = res.data;
         }
       })

+ 3 - 3
ruoyi-ui/src/views/analysis/task/realtime/simulation.vue

@@ -14,7 +14,7 @@
         </div>
         <div class="realtime-foot-action" v-if="task.status === 0 || task.status === 3">
           <svg-icon icon-class="realtime-stop" class-name="realtime-foot-action-icon" @click="stop" />
-          <div class="realtime-foot-action-label">止任务</div>
+          <div class="realtime-foot-action-label">止任务</div>
         </div>
       </div>
       <div class="realtime-foot-time">
@@ -87,11 +87,11 @@ export default {
       }).catch(() => {});
     },
     stop() {
-      this.$modal.confirm('是否确认止当前任务?').then(() => {
+      this.$modal.confirm('是否确认止当前任务?').then(() => {
         return taskAction(this.siteId, 0);
       }).then(() => {
         this.$router.back();
-        this.$modal.msgSuccess("止成功");
+        this.$modal.msgSuccess("止成功");
       }).catch(() => {});
     },
     loadCarLocation() {

+ 2 - 2
ruoyi-ui/src/views/analysis/task/result/simulation.vue

@@ -10,7 +10,7 @@
         </div>
         <div class="realtime-foot-action" v-if="isplay">
           <svg-icon icon-class="realtime-stop" class-name="realtime-foot-action-icon" @click="stop" />
-          <div class="realtime-foot-action-label">止回放</div>
+          <div class="realtime-foot-action-label">止回放</div>
         </div>
         <div class="realtime-foot-action" v-else>
           <svg-icon icon-class="realtime-play" class-name="realtime-foot-action-icon" @click="play" />
@@ -74,7 +74,7 @@ export default {
       this.$emit('play');
     },
     stop() {
-      this.$modal.confirm('是否确认止回放?').then(() => {
+      this.$modal.confirm('是否确认止回放?').then(() => {
         this.$emit('stop');
       }).catch(() => {});
     },

+ 24 - 12
ruoyi-ui/src/views/site/plain-time/add.vue

@@ -14,14 +14,17 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="起测水位" prop="wlevel">
-              <el-input-number
-                placeholder="请输入起测水位"
+              <el-select
                 v-model="form.wlevel"
-                @change="wlevel => plain.wlevel = wlevel"
-                :precision="2"
-                :step="0.1"
-                :min="plain.wlevelmin"
-                :max="plain.wlevelmax" />
+                placeholder="请选择停泊点策略"
+                @change="wlevel => plain.wlevel = wlevel">
+                <el-option
+                  v-for="item in points"
+                  :key="item.planid"
+                  :label="`停泊点策略${item.planid}(${item.wlevel})`"
+                  :value="item.wlevel">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
         </el-row>
@@ -64,7 +67,7 @@
 
 <script>
 import { getSite, getConfig } from '@/api/site/site'
-import { savePlainTime, getSiteSection, getPlainTime } from '@/api/site/berthing'
+import { savePlainTime, getSiteSection, getPlainTime, listPlainPoint } from '@/api/site/berthing'
 import SectionChart from './chart';
 
 export default {
@@ -78,11 +81,12 @@ export default {
       site: {},
       loading: false,
       times: [],
+      points: [],
       plain: {
         sections: [],
-        wlevelmax: 0,
-        wlevelmin: 0,
-        wlevel: 0,
+        wlevelmax: '',
+        wlevelmin: '',
+        wlevel: '',
       },
       form: {
         timeId: '',
@@ -91,7 +95,7 @@ export default {
         siteId: '',
         siteName: '',
         type: '',
-        wlevel: 0,
+        wlevel: '',
       },
       rules: {
         wlevel: [
@@ -106,6 +110,12 @@ export default {
     }
   },
   methods: {
+    loadPoints() {
+      listPlainPoint({ siteId: this.siteId, page: 1, size: 10000 }).then(response => {
+          this.points = response.data.records;
+        }
+      );
+    },
     loadPlainTime() {
       getPlainTime(this.timeId).then((res) => {
         const { timeId, siteId, wlevel, times } = res.data || {};
@@ -118,6 +128,7 @@ export default {
 
         this.siteId = siteId;
         this.loadSite();
+        this.loadPoints();
         this.loadSection();
         this.loadConfig();
       })
@@ -182,6 +193,7 @@ export default {
     this.siteId = this.$route.query.siteId;
     if (this.siteId) {
       this.loadSite();
+      this.loadPoints();
       this.loadSection();
       this.loadConfig();
     }