Bladeren bron

Merge remote-tracking branch 'origin/master'

lry 8 maanden geleden
bovenliggende
commit
62c090c52c
43 gewijzigde bestanden met toevoegingen van 744 en 135 verwijderingen
  1. 1 1
      industry-admin/src/components/CommonTable/index.vue
  2. 40 1
      industry-admin/src/views/device/deviceLedger/index.vue
  3. 41 2
      industry-admin/src/views/device/deviceLedger/itemList.vue
  4. 105 0
      industry-admin/src/views/device/deviceLedger/usedItemList.vue
  5. 1 1
      industry-admin/src/views/largeScreen/deviceDataItem/index.vue
  6. 1 1
      industry-admin/src/views/largeScreen/deviceRunParam/deviceRun.vue
  7. 1 1
      industry-admin/src/views/largeScreen/mainRunParam/mainRun.vue
  8. 1 1
      industry-admin/src/views/largeScreen/trafficChartParam/trafficChart.vue
  9. 17 4
      industry-admin/src/views/source/itemGroup/alarmConfig.vue
  10. 23 9
      industry-admin/src/views/source/itemGroup/item.vue
  11. 7 2
      industry-admin/src/views/source/itemGroup/updateItem.vue
  12. 2 0
      industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/entity/AlarmConfig.java
  13. 4 1
      industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/entity/ItemParent.java
  14. 2 2
      industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/util/DateUtil.java
  15. BIN
      industry-system/industry-da/security/cydcs_opc_ua_client.pfx
  16. 26 0
      industry-system/industry-da/security/cydcs_opc_ua_client_certificate.pem
  17. 3 0
      industry-system/industry-da/security/cydcs_opc_ua_client_private.pem
  18. 2 0
      industry-system/industry-da/src/main/java/com/example/opc_da/config/MyApplicationRunner.java
  19. 51 12
      industry-system/industry-da/src/main/java/com/example/opc_da/controller/ItemGroupController.java
  20. 15 12
      industry-system/industry-da/src/main/java/com/example/opc_da/controller/RootRedirectController.java
  21. 15 0
      industry-system/industry-da/src/main/java/com/example/opc_da/dao/DeviceDataItemDao.java
  22. 15 0
      industry-system/industry-da/src/main/java/com/example/opc_da/dao/DeviceRunDao.java
  23. 4 4
      industry-system/industry-da/src/main/java/com/example/opc_da/dao/MainRunDao.java
  24. 15 0
      industry-system/industry-da/src/main/java/com/example/opc_da/dao/PageAnimationDao.java
  25. 14 0
      industry-system/industry-da/src/main/java/com/example/opc_da/dao/SceneDao.java
  26. 15 0
      industry-system/industry-da/src/main/java/com/example/opc_da/dao/TrafficChartDao.java
  27. 1 1
      industry-system/industry-da/src/main/java/com/example/opc_da/exception/GlobalExceptionHandler.java
  28. 12 2
      industry-system/industry-da/src/main/java/com/example/opc_da/policy/ChangeReportDataPolicyTask.java
  29. 6 2
      industry-system/industry-da/src/main/java/com/example/opc_da/policy/EventReportDataPolicyTask.java
  30. 9 2
      industry-system/industry-da/src/main/java/com/example/opc_da/policy/FreReportDataPolicyTask.java
  31. 68 5
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/DeviceLedgerServiceImpl.java
  32. 10 10
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/DeviceRunServiceImpl.java
  33. 11 11
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/MainRunServiceImpl.java
  34. 11 11
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/TrafficChartServiceImpl.java
  35. 1 1
      industry-system/industry-da/src/main/java/com/example/opc_da/task/DataSourceStatusTimerTask.java
  36. 11 10
      industry-system/industry-da/src/main/resources/mapper/AlarmConfigDao.xml
  37. 27 0
      industry-system/industry-da/src/main/resources/mapper/DeviceDataItemDao.xml
  38. 30 0
      industry-system/industry-da/src/main/resources/mapper/DeviceRunDao.xml
  39. 19 11
      industry-system/industry-da/src/main/resources/mapper/ItemGroupDao.xml
  40. 11 15
      industry-system/industry-da/src/main/resources/mapper/MainRunDao.xml
  41. 35 0
      industry-system/industry-da/src/main/resources/mapper/PageAnimationDao.xml
  42. 32 0
      industry-system/industry-da/src/main/resources/mapper/SceneDao.xml
  43. 29 0
      industry-system/industry-da/src/main/resources/mapper/TrafficChartDao.xml

+ 1 - 1
industry-admin/src/components/CommonTable/index.vue

@@ -7,7 +7,7 @@
         </el-table-column> -->
         <!-- <el-table-column align="center" v-if="isShowCheckbox" type="selection" width="55"></el-table-column>
         <el-table-column align="center" v-if="isShowIndex" label="序号" type="index" width="60"> -->
-        <el-table-column :align="item.align" :prop="item.propName" :label="item.labelName" :width="item.width"
+        <el-table-column :align="item.align" :prop="item.propName" :label="item.labelName" v-if="item && !item.hidden" :width="item.width"
             v-for="(item, index) in tableHeaderTitle" :key="index" :formatter="item.formatter">
             <template slot-scope="scope">
                 <slot v-if="(item.type == null || item.type == '' || item.type == undefined) && !item.formatter">

+ 40 - 1
industry-admin/src/views/device/deviceLedger/index.vue

@@ -106,6 +106,9 @@
         <ItemList ref="itemList"></ItemList>
       <!-- 导出excel文件 -->
       <DownloadExcel ref="downloadExcel"></DownloadExcel>
+
+      <!-- 点位占用提醒-->
+      <UsedItemList ref="usedItemList"></UsedItemList>
     </div>
 </template>
 
@@ -118,6 +121,7 @@ import DeviceLedger from './deviceLedger.vue'
 import AdQuery from './adQuery.vue'
 import ItemList from './itemList.vue'
 import DownloadExcel from '@/components/Excel/downloadExcel'
+import UsedItemList from "@/views/device/deviceLedger/usedItemList";
 import {
     getDeviceDirectoryTree, getDeviceLedgerPage,
     getDeviceLedgerById,
@@ -133,7 +137,8 @@ export default {
         AdQuery,
         ChooseDeviceType,
         ItemList,
-        DownloadExcel
+        DownloadExcel,
+        UsedItemList
     },
     created() {
         this.getDeviceDirectoryTree()
@@ -621,6 +626,40 @@ export default {
                         })
                         return
                     }
+                  if (Array.isArray(res.data)) {
+                    if("mainRun" == res.msg){
+                      this.$refs.usedItemList.visible = true
+                      this.$refs.usedItemList.itemList = res.data
+                      this.$refs.usedItemList.onlyShowItemName = false
+                      this.$refs.usedItemList.modelName = "主要运行参数"
+                    }else if("deviceRun" == res.msg){
+                      this.$refs.usedItemList.visible = true
+                      this.$refs.usedItemList.itemList = res.data
+                      this.$refs.usedItemList.onlyShowItemName = false
+                      this.$refs.usedItemList.modelName = "设备运行参数"
+                    }else if("trafficChart" == res.msg){
+                      this.$refs.usedItemList.visible = true
+                      this.$refs.usedItemList.itemList = res.data
+                      this.$refs.usedItemList.onlyShowItemName = false
+                      this.$refs.usedItemList.modelName = "流量图表配置"
+                    }else if("scene" == res.msg){
+                      this.$refs.usedItemList.visible = true
+                      this.$refs.usedItemList.itemList = res.data
+                      this.$refs.usedItemList.onlyShowItemName = false
+                      this.$refs.usedItemList.modelName = "场景设计"
+                    }else if("deviceDataItem" == res.msg){
+                      this.$refs.usedItemList.visible = true
+                      this.$refs.usedItemList.itemList = res.data
+                      this.$refs.usedItemList.onlyShowItemName = true
+                      this.$refs.usedItemList.modelName = "数据列表设置"
+                    }else if("pageAnimation" == res.msg){
+                      this.$refs.usedItemList.visible = true
+                      this.$refs.usedItemList.itemList = res.data
+                      this.$refs.usedItemList.onlyShowItemName = true
+                      this.$refs.usedItemList.modelName = "页面动效管理"
+                    }
+                    return;
+                  }
                     this.$message({
                         message: '删除设备台账成功!',
                         type: 'success'

+ 41 - 2
industry-admin/src/views/device/deviceLedger/itemList.vue

@@ -41,6 +41,9 @@
 
         <!-- 添加点位 -->
         <AddItem ref="addItem" @getLedgerItemList="getLedgerItemList"></AddItem>
+
+      <!-- 点位占用提醒-->
+      <UsedItemList ref="usedItemList"></UsedItemList>
     </div>
 </template>
 
@@ -54,6 +57,7 @@ import {
 } from '@/api/device/deviceLedger'
 import { getDictListByType } from '@/api/system/dict';
 import {getUid} from "@/utils/auth";
+import UsedItemList from "@/views/device/deviceLedger/usedItemList";
 
 export default {
     mounted() {
@@ -68,7 +72,8 @@ export default {
     },
     components: {
         CommonTable,
-        AddItem
+        AddItem,
+      UsedItemList
     },
     data() {
         return {
@@ -94,7 +99,7 @@ export default {
                 },
                 {
                     propName: "describe",
-                    labelName: "描述",
+                    labelName: "别名",
                     align: "left",
                 },
                 {
@@ -275,6 +280,40 @@ export default {
                     })
                     return
                 }
+              if (Array.isArray(res.data)) {
+                if("mainRun" == res.msg){
+                  this.$refs.usedItemList.visible = true
+                  this.$refs.usedItemList.itemList = res.data
+                  this.$refs.usedItemList.onlyShowItemName = false
+                  this.$refs.usedItemList.modelName = "主要运行参数"
+                }else if("deviceRun" == res.msg){
+                  this.$refs.usedItemList.visible = true
+                  this.$refs.usedItemList.itemList = res.data
+                  this.$refs.usedItemList.onlyShowItemName = false
+                  this.$refs.usedItemList.modelName = "设备运行参数"
+                }else if("trafficChart" == res.msg){
+                  this.$refs.usedItemList.visible = true
+                  this.$refs.usedItemList.itemList = res.data
+                  this.$refs.usedItemList.onlyShowItemName = false
+                  this.$refs.usedItemList.modelName = "流量图表配置"
+                }else if("scene" == res.msg){
+                  this.$refs.usedItemList.visible = true
+                  this.$refs.usedItemList.itemList = res.data
+                  this.$refs.usedItemList.onlyShowItemName = false
+                  this.$refs.usedItemList.modelName = "场景设计"
+                }else if("deviceDataItem" == res.msg){
+                  this.$refs.usedItemList.visible = true
+                  this.$refs.usedItemList.itemList = res.data
+                  this.$refs.usedItemList.onlyShowItemName = true
+                  this.$refs.usedItemList.modelName = "数据列表设置"
+                }else if("pageAnimation" == res.msg){
+                  this.$refs.usedItemList.visible = true
+                  this.$refs.usedItemList.itemList = res.data
+                  this.$refs.usedItemList.onlyShowItemName = true
+                  this.$refs.usedItemList.modelName = "页面动效管理"
+                }
+                return;
+              }
                 this.$message({
                     message: '删除成功!',
                     type: 'success'

+ 105 - 0
industry-admin/src/views/device/deviceLedger/usedItemList.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <el-dialog title="提示" width="800px" top="10vh" class="cy-tj-config" center :before-close="dialogClose"
+               :visible.sync="visible" @open="dialogOpen">
+      <el-row>
+        <el-col :span="24">
+          点位已被{{modelName}}引用,禁止移除!具体引用如下:
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col>
+          <!-- 数据组表格信息 -->
+          <CommonTable ref="usedItemTable" :tableHeaderTitle="tableHeaderTitle" :tableData="tableData"
+                       :isShowCheckbox="isShowCheckbox" :isShowIndex="isShowIndex" :tableHight="tableHight"
+                       :tableOperate="tableOperate">
+          </CommonTable>
+          <!-- 分页信息 -->
+          <pagination v-show="tableTotal > 0" small :total="tableTotal" :page.sync="queryParams.page"
+                      :limit.sync="queryParams.limit" align="right" @pagination="pageUsedItemList"/>
+        </el-col>
+      </el-row>
+      <div style="width: 100%; text-align: right;margin-top: 10px;">
+        <el-button type="primary" @click="dialogClose" size="small">关闭</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+import CommonTable from '@/components/CommonTable/index.vue'
+
+export default {
+  components: {
+    CommonTable
+  },
+  data() {
+    return {
+      visible: false,
+      modelName: null,
+      onlyShowItemName: true,
+      itemList: [],
+      //表格参数
+      isShowCheckbox: false,
+      isShowIndex: true,
+      tableHight: '60vh',
+      tableHeaderTitle: [
+        {
+          propName: "itemReadName",
+          labelName: "点位",
+          align: "left"
+        },
+        {
+          propName: "dataName",
+          labelName: this.modelName,
+          align: "left",
+          hidden: row => this.onlyShowItemName
+        }
+      ],
+      tableData: [],
+      tableOperate: [],
+      queryParams: {
+        page: 1,
+        limit: 10
+      },
+      tableTotal: 0,
+    }
+  },
+  methods: {
+    /** 弹出层打开事件 */
+    dialogOpen() {
+      this.tableTotal = this.itemList.length
+      this.tableHeaderTitle =  [
+        {
+          propName: "itemReadName",
+          labelName: "点位",
+          align: "left"
+        },
+        {
+          propName: "dataName",
+          labelName: this.modelName + "名称",
+          align: "left",
+          hidden: this.onlyShowItemName
+        }
+      ]
+      this.pageUsedItemList()
+    },
+    /** 弹出层关闭事件 */
+    dialogClose() {
+      this.visible = false
+    },
+    pageUsedItemList() {
+      if (this.itemList.length === 0) {
+        return
+      }
+      let startIndex = (this.queryParams.page - 1) * this.queryParams.limit
+      let endLen = this.queryParams.page * this.queryParams.limit
+      if (endLen > this.itemList.length) {
+        endLen = this.itemList.length
+      }
+      this.tableData = this.itemList.slice(startIndex, endLen)
+    }
+  }
+}
+</script>

+ 1 - 1
industry-admin/src/views/largeScreen/deviceDataItem/index.vue

@@ -91,7 +91,7 @@ export default {
         },
         {
           propName: "describe",
-          labelName: "描述",
+          labelName: "别名",
           align: "left",
         },
         {

+ 1 - 1
industry-admin/src/views/largeScreen/deviceRunParam/deviceRun.vue

@@ -34,7 +34,7 @@
                     <!-- 表格数据信息 -->
                     <el-table ref="table" :data="deviceRunForm.deviceRunItemList" height="30vh" row-key="id" border>
                         <el-table-column align="left" label="点位" prop="itemReadName" />
-                        <el-table-column align="left" label="描述" prop="describe" />
+                        <el-table-column align="left" label="别名" prop="describe" />
                         <el-table-column align="left" label="数据组" prop="itemGroupName" />
                         <el-table-column align="left" label="单位" prop="unit" />
                         <el-table-column align="left" label="序号" prop="sortNum" width="80">

+ 1 - 1
industry-admin/src/views/largeScreen/mainRunParam/mainRun.vue

@@ -35,7 +35,7 @@
                     <!-- 表格数据信息 -->
                     <el-table ref="table" :data="mainRunForm.mainRunItemList" height="40vh" row-key="id" border>
                         <el-table-column align="left" label="点位" prop="itemReadName" />
-                        <el-table-column align="left" label="描述" prop="describe" width="120"/>
+                        <el-table-column align="left" label="别名" prop="describe" width="120"/>
                         <el-table-column align="left" label="数据组" prop="itemGroupName" width="120"/>
                         <el-table-column align="left" label="单位" prop="unit" width="120"/>
                         <el-table-column label="图标" show-overflow-tooltip>

+ 1 - 1
industry-admin/src/views/largeScreen/trafficChartParam/trafficChart.vue

@@ -46,7 +46,7 @@
                     <!-- 表格数据信息 -->
                     <el-table ref="table" :data="trafficChartForm.trafficChartItemList" height="30vh" row-key="id" border>
                         <el-table-column align="left" label="点位" prop="itemReadName" />
-                        <el-table-column align="left" label="描述" prop="describe" />
+                        <el-table-column align="left" label="别名" prop="describe" />
                         <el-table-column align="left" label="数据组" prop="itemGroupName" />
                         <el-table-column align="left" label="单位" prop="unit" />
                         <el-table-column align="left" label="排序号" prop="sortNum" width="80">

+ 17 - 4
industry-admin/src/views/source/itemGroup/alarmConfig.vue

@@ -2,16 +2,16 @@
     <!-- 报警配置 -->
     <el-dialog :title="title" width="40%" custom-class="dialog-max" top="10vh" :before-close="dialogClose"
         :visible.sync="visible" @open="dialogOpen" @close="dialogClose">
-        <el-form ref="alarmConfigForm" :model="alarmConfigForm" :rules="alarmConfigRules" label-width="90px"
+        <el-form ref="alarmConfigForm" :model="alarmConfigForm" :rules="alarmConfigRules" label-width="120px"
             label-position="right">
             <el-row>
                 <el-col :span="12">
-                    <el-form-item label="点位名称:" prop="itemName">
+                    <el-form-item label="点位名称:" prop="itemName">
                         {{ alarmConfigForm.itemName }}
                     </el-form-item>
                 </el-col>
                 <el-col :span="12">
-                    <el-form-item label="描述:" prop="describe">
+                    <el-form-item label="别名:" prop="describe">
                         {{ alarmConfigForm.describe }}
                     </el-form-item>
                 </el-col>
@@ -44,8 +44,18 @@
                 </el-col>
             </el-row>
             <el-row>
+              <el-col :span="12">
+                <el-form-item label="报警值类型:" prop="alarmValueType">
+                  <el-radio-group v-model="alarmConfigForm.alarmValueType">
+                    <el-radio :label="0">原始值报警</el-radio>
+                    <el-radio :label="1">计算值报警</el-radio>
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
                 <el-col :span="12">
-                    <el-form-item prop="alarmType">
+                    <el-form-item label="报警类型:" prop="alarmType">
                         <el-radio-group v-model="alarmConfigForm.alarmType">
                             <el-radio :label="0">范围报警</el-radio>
                             <el-radio :label="1">开关报警</el-radio>
@@ -228,6 +238,7 @@ export default {
                 lowerLimit: null,
                 alarmLevelId: null,
                 alarmType: 0,
+                alarmValueType: 1,
                 lowLowAlarm: null,
                 lowLowText: null,
                 lowAlarm: null,
@@ -250,6 +261,7 @@ export default {
             alarmConfigRules: {
                 alarmLevelId: [{ required: true, message: '报警级别不能为空', trigger: 'blur' }],
                 alarmType: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }],
+                alarmValueType: [{ required: true, message: '报警值类型不能为空', trigger: 'blur' }],
                 isStart: [{ required: true, message: '是否启动不能为空', trigger: 'blur' }],
                 lowLowAlarm: [
                     { type: 'number', message: '低低报警值为数字值' },
@@ -447,6 +459,7 @@ export default {
                     this.alarmConfigForm.maxValue = data.maxValue
                     this.alarmConfigForm.alarmLevelId = data.alarmLevelId
                     this.alarmConfigForm.alarmType = data.alarmType
+                    this.alarmConfigForm.alarmValueType = data.alarmValueType
                     if (data.lowLowAlarm || data.lowLowText) {
                         this.lowLowChecked = true
                     } else {

+ 23 - 9
industry-admin/src/views/source/itemGroup/item.vue

@@ -4,7 +4,7 @@
     <el-dialog :title="title" width="80%" custom-class="dialog-max" top="10vh" :before-close="dialogClose"
                :visible.sync="visible" @open="dialogOpen">
       <div style="margin-bottom: 10px;">
-        <el-input placeholder="请输入点位名称" v-model="queryParams.itemReadName" size="mini" style="width: 200px;"
+        <el-input placeholder="请输入点位名称" v-model="queryParams.itemReadName" size="mini" style="width: 200px;"
                   @blur="itemChangeEvent" prefix-icon="el-icon-search">
         </el-input>
         <el-checkbox size="mini" style="margin-left: 20px;" v-model="runCheckbox" @change="groupRunCheckboxEvent"
@@ -24,7 +24,7 @@
         </el-button>
         <el-upload
           ref="upload"
-          action=""
+          action="#"
           :before-upload="uploadExcelModel"
           :show-file-list="false"
           :limit="1"
@@ -151,8 +151,8 @@ export default {
       //点位名称,点位类型,表达式,质量,数据值,数据源名称,取值时间
       tableHeaderTitle: [
         {
-          propName: "名称",
-          labelName: "名称",
+          propName: "源点位名称",
+          labelName: "源点位名称",
           align: "left",
           formatter: (row, column, cellValue, index) => {
             return row.modbusConfig ? row.itemName : row.itemReadName
@@ -161,6 +161,12 @@ export default {
         },
         {
           propName: "describe",
+          labelName: "别名",
+          align: "left",
+          width: '120'
+        },
+        {
+          propName: "remark",
           labelName: "描述",
           align: "left",
           width: '120'
@@ -388,11 +394,11 @@ export default {
         this.stopTimer()
         this.tableHeaderTitle = [
           {
-            propName: "名称",
+            propName: "源点位名称",
             formatter: (row, column, cellValue, index) => {
               return row.modbusConfig ? row.itemName : row.itemReadName
             },
-            labelName: "名称",
+            labelName: "源点位名称",
           },
           {
             propName: "operationRuleName",
@@ -466,11 +472,11 @@ export default {
     tableHeaderTitleByDataBaseType(){
       let tableHeaderTitle0 = [
         {
-          propName: "名称",
+          propName: "源点位名称",
           formatter: (row, column, cellValue, index) => {
             return row.modbusConfig ? row.itemName : row.itemReadName
           },
-          labelName: "名称",
+          labelName: "源点位名称",
           align: "left"
         }
       ]
@@ -539,10 +545,16 @@ export default {
       var tableHeaderTitle2 = [
         {
           propName: "describe",
-          labelName: "描述",
+          labelName: "别名",
           align: "left"
         },
         {
+          propName: "remark",
+          labelName: "描述",
+          align: "left",
+          width: '120'
+        },
+        {
           propName: "unit",
           labelName: "单位",
           align: "left"
@@ -828,6 +840,7 @@ export default {
         })
         return false
       });
+      return false
     },
     getClientNameByItemGroupId() {
       this.clientStatusType = -1
@@ -926,6 +939,7 @@ export default {
       this.$refs.updateItem.itemForm.lowerLimit = row.lowerLimit
       this.$refs.updateItem.itemForm.dataModelId = row.dataModelId
       this.$refs.updateItem.itemForm.describe = row.describe
+      this.$refs.updateItem.itemForm.remark = row.remark
       this.$refs.updateItem.itemForm.unit = row.unit
       this.$refs.updateItem.itemForm.scale = row.scale
       this.$refs.updateItem.scaleList = this.scaleList

+ 7 - 2
industry-admin/src/views/source/itemGroup/updateItem.vue

@@ -6,10 +6,14 @@
             <el-form-item label="ID" prop="id" style="display: none;">
                 <el-input v-model='itemForm.id' type="text" auto-complete="off"></el-input>
             </el-form-item>
-            <el-form-item label="描述:" prop="describe">
+            <el-form-item label="别名:" prop="describe">
                 <el-input v-model.trim='itemForm.describe' type="text" auto-complete="off" show-word-limit maxlength="20"
-                    placeholder="请输入描述"></el-input>
+                    placeholder="请输入别名"></el-input>
             </el-form-item>
+          <el-form-item label="描述:" prop="remark">
+            <el-input v-model.trim='itemForm.remark' type="text" auto-complete="off" show-word-limit maxlength="20"
+                      placeholder="请输入描述"></el-input>
+          </el-form-item>
             <el-form-item label="数据计算模型:" prop="dataModelId">
                 <el-select v-model="itemForm.dataModelId" filterable clearable placeholder="请选择数据计算模型" style="width: 100%;">
                     <el-option v-for="(item, index) in this.dataModelList" :key="index" :label="item.title"
@@ -66,6 +70,7 @@ export default {
                 describe: null,
                 unit: null,
                 scale:null,
+                remark: null,
             },
             scaleList:[]
         }

+ 2 - 0
industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/entity/AlarmConfig.java

@@ -32,6 +32,8 @@ public class AlarmConfig implements Serializable {
     private String alarmLevelName;
     //报警类型(0范围报警,1开关报警)
     private Integer alarmType = 0;
+    //报警值类型(0原始值报警,1计算值报警),默认1
+    private Integer alarmValueType = 1;
     //低低报警值
     private Double lowLowAlarm;
     //低低文本

+ 4 - 1
industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/entity/ItemParent.java

@@ -24,8 +24,10 @@ public class ItemParent implements Serializable {
     private Double upperLimit;
     //下限
     private Double lowerLimit;
-    //描述
+    //别名
     private String describe;
+    //描述
+    private String remark;
     //单位
     private String unit;
     //小数位数
@@ -77,6 +79,7 @@ public class ItemParent implements Serializable {
                     itemParent.setUpperLimit(commonItem.getUpperLimit());
                     itemParent.setLowerLimit(commonItem.getLowerLimit());
                     itemParent.setDescribe(commonItem.getDescribe());
+                    itemParent.setRemark(commonItem.getRemark());
                     itemParent.setUnit(commonItem.getUnit());
                     itemParent.setScale(commonItem.getScale());
                     itemParent.setDataSourceId(commonItem.getDataSourceId());

+ 2 - 2
industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/util/DateUtil.java

@@ -27,7 +27,7 @@ public class DateUtil {
     }
 
     public static Date strYmdhmssChangeDate(String dateStr) {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
         Date date = null;
         try {
             date = sdf.parse(dateStr);
@@ -44,7 +44,7 @@ public class DateUtil {
      * @return
      */
     public static String dateChangeStrYmdhmss(Date date) {
-        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(date);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(date);
     }
 
     /**

BIN
industry-system/industry-da/security/cydcs_opc_ua_client.pfx


+ 26 - 0
industry-system/industry-da/security/cydcs_opc_ua_client_certificate.pem

@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIETzCCAzegAwIBAgIGAZF5DzCPMA0GCSqGSIb3DQEBCwUAMGgxHjAcBgNVBAMM
+FU9QQ19VQV9DTElFTlRAQ1FDWURDUzENMAsGA1UECgwEQ1FDWTEQMA4GA1UECwwH
+Q1FDWURDUzELMAkGA1UEBwwCQ1ExCzAJBgNVBAgMAkNRMQswCQYDVQQGEwJDTjAe
+Fw0yNDA4MjExNjAwMDBaFw0yNzA4MjExNjAwMDBaMGgxHjAcBgNVBAMMFU9QQ19V
+QV9DTElFTlRAQ1FDWURDUzENMAsGA1UECgwEQ1FDWTEQMA4GA1UECwwHQ1FDWURD
+UzELMAkGA1UEBwwCQ1ExCzAJBgNVBAgMAkNRMQswCQYDVQQGEwJDTjCCASIwDQYJ
+KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJZLQ4GEpiIn5FYRtXlWTVsp6UBbo003
+Tx+Cp2mzSK/cNAmEjW69DBxa3Xl6pY+fMMh2Qg++JcxEJpxeonJ6j6PSqHTh9+uG
+odGw/FAXkSmiIfJmfGHe7tv7nCbRsP2/TYuHhlwS1iQA/TjY6orNM7xEEauZsgcr
+yOo0iB4akrbpTNJrjz2IJR9ioZ6OIPu6RAQSalTrujfznbMoEmxn5R59eyr6CYgZ
+Yaq9BW9ucauhTkK6ReWQ7lXFS3Zh3vZrPPun0mxEfcqSPFTEl85qtzUlB+jMvr/J
+H757u/jQ+0AXJuxdV7qO/uyBhJbJ744BsSo7xHQvdH0ZE2qpYMMWAB0CAwEAAaOB
+/jCB+zAfBgNVHSMEGDAWgBQ6/SUkYl427EVZ+x9jw+GXWSWq+TAPBgNVHRMECDAG
+AQH/AgEAMAsGA1UdDwQEAwIC/DAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH
+AwEwfAYDVR0RBHUwc4YqdXJuOmN5ZGNzOlVuaWZpZWRBdXRvbWF0aW9uOlVhRXhw
+ZXJ0QGN5ZGNzggVDWURDU4IMTGVpSHVhbmdZdWFughhsb2NhbGhvc3Quc2FuZ2Zv
+ci5jb20uY26HBH8AAAGHBKn+5vSHBAIAAAGHBMCoAd4wHQYDVR0OBBYEFDr9JSRi
+XjbsRVn7H2PD4ZdZJar5MA0GCSqGSIb3DQEBCwUAA4IBAQBXIi7RrMQjW1ij4Gs1
+xfz7wGl1uaNWuBkvDnym9Ju3rjTa5D6ILzbsGTB7na/RB6bDy6zX2B0ntDNNv0/P
+1a+kYHSBXMZaRD9Rg83CQdMuPm4EQH/hnrPadFWlBPQs55J9w1RHbxpr+vJ+6Pcn
+LVrv8WOXmzDb7wIYU2vqntX06anzk4Z9jplPjGlR3f9JjYppNvMI6l//mmIdJtbY
+2noCSr2reot0y7JYR/8cyKSelK2IMMngJ8sIYq5NhPmD/cIh4wsSN1g61Dxa8ABD
+rbcqh471siD4N+1I/KvP1HGarAwQgRq0GxSLUUVBZXMjBVHO6lWwgoehocvrOoyb
+54gR
+-----END CERTIFICATE-----

+ 3 - 0
industry-system/industry-da/security/cydcs_opc_ua_client_private.pem

@@ -0,0 +1,3 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWS0OBhKYiJ+RWEbV5Vk1bKelAW6NNN08fgqdps0iv3DQJhI1uvQwcWt15eqWPnzDIdkIPviXMRCacXqJyeo+j0qh04ffrhqHRsPxQF5EpoiHyZnxh3u7b+5wm0bD9v02Lh4ZcEtYkAP042OqKzTO8RBGrmbIHK8jqNIgeGpK26UzSa489iCUfYqGejiD7ukQEEmpU67o3852zKBJsZ+UefXsq+gmIGWGqvQVvbnGroU5CukXlkO5VxUt2Yd72azz7p9JsRH3KkjxUxJfOarc1JQfozL6/yR++e7v40PtAFybsXVe6jv7sgYSWye+OAbEqO8R0L3R9GRNqqWDDFgAdAgMBAAECggEAG8DOOG6MVyZSreobPsrHAhydK/tADpQ2EjWIQKaQt5jMKy3FCDv0ro/A8hvJ0tmsonfj/xA33p5/GsUG7mjfeXr/DIZlx6JW42fxT8DqV2vPJPnz4gbOyOSPk0OJkXHwGeHu17XKwV9FY2f696Ko+Q0AzlVVYKmfMlB9CkIR8aCexRfx7DVpG5nH4AubVbJXtvaEH19MJFqnvey83b1kQKTBxNw8TnpWIJ8S3eIvsW/J8YAYGC4MNy6qPj3fMJBR7qUmMXMdl3y7GrqU69w+FF5YZxpDHGc25LkbqQndqT87Cx7yYhUUxlJic1+3EF/pwnuJzUEPlfjPrR7kmhXjAQKBgQDMDFWH7462IfoEylEtjZivVS4fglIID40dTpxlwCjHNmlMQyG8gYy5wnNFusvSjpDquPdZ6SiwlHYYVckTrw8QEeyH4UTX8nNdPZqT1z/H7EhF6Ig8h9gTSnXsf9iBXCkZcfdI9tvz2wFaS13bTd7PKrJcVm4o8JjwXeKNZ8zlvQKBgQC8j0iFi6wRgx9ZDoxVAUgtYk+lBg7avNbITW+Q3fOu+gm5gvwcOv8gQC0+phoFYK6A3ziLRCguE1L6KbDAezJSweXVl/WOhTEitWYu+4AvSELUE+0j3BYKNlbHLWC/i+mP3GygMcBaEXnjLnsL6gVOrTjZGgOHutxU2MTte0054QKBgChqhQKA476VqkUKodupAUYxVApvsLniAqx8ZqQM1MbosyCk52jELFCbAGQeZMLW9ENZ0bygXyvirCWT0FkywoQHWNdtOkqfvlQIoLaJ2xtJZONb9KgwrA7eH89xXzv4OjfNCBMOunBpv7HX3cZTfT+BkISTpgw7478wiXBC0CXtAoGAf1/PHp9mYgIQeAly1K1kA3xoztJT0IFGGdLtbY/xYB752L5Z7fwQgcm4hpyP8VgJKXcg7DrjZZSaNfFZu/y81tiymGHpeBgTRB4D4/Ly+X233ymCxPmUTdu9LRlDRMGPyiWdn21cQbuSedvZNQgmA6rSPx3qipK46fvws3faiCECgYEAgmK9SHBLq1ZHoD7bHePjmTRIxclCKBAfatjUppp60YzgYIYyhuYuoaDCDIMFErmAtwD9bC4Dz942X88LUyM5KzmXlrlzpEgVdLkSL2/CzctBsUuvFoOls4mDEEI5hxliMknjlwfjKUOFhhZRbzjNKiY3Bxf2OTaDUcrZdAtiiw4=
+-----END PRIVATE KEY-----

+ 2 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/config/MyApplicationRunner.java

@@ -95,6 +95,8 @@ public class MyApplicationRunner implements ApplicationRunner {
                     Map<String, Object> reportDataPolicyMap = new HashMap<>();
                     reportDataPolicyMap.put("reportDataPolicy", reportDataPolicy);
                     reportDataPolicyMap.put("cronId", cronId);
+                    // 0 0 0 ? * MON,TUE,WED,THU,FRI,SAT,SUN 表示每天0点执行
+                    // 0 0 0 ? * MON,TUE 表示星期一、星期二每天0点执行
                     QuartzTimerFactory.creteTimer().addTask(cronId, ReportDataPolicyQuartzJob.class, cron, reportDataPolicyMap);
                 });
             }

+ 51 - 12
industry-system/industry-da/src/main/java/com/example/opc_da/controller/ItemGroupController.java

@@ -518,15 +518,15 @@ public class ItemGroupController {
                 String itemName = null;
                 Boolean pass = true;
                 if(col > maxIndex){
-                    errorList.add("第" + (i + 1) + "行名称为空");
+                    errorList.add("第" + (i + 1) + "行源点位名称为空");
                     pass = false;
                 }else {
                     itemName = Convert.toStr(row.get(col), "");
                     if (Blank.isEmpty(itemName)) {
-                        errorList.add("第" + (i + 1) + "行名称为空");
+                        errorList.add("第" + (i + 1) + "行源点位名称为空");
                         pass = false;
                     }else if (itemName.length() > 100) {
-                        errorList.add("第" + (i + 1) + "行名称长度大于100字符");
+                        errorList.add("第" + (i + 1) + "行源点位名称长度大于100字符");
                         pass = false;
                     }else{
                         /*List<Item> dbItemList = itemGroupService.getItemListByGroupId(itemGroupId, null);
@@ -790,14 +790,14 @@ public class ItemGroupController {
                     }
                 }
 
-                // 描述
+                // 别名
                 col++;
                 if(col <= maxIndex) {
                     String describe = Convert.toStr(row.get(col), "");
                     if (Blank.isNotEmpty(describe)){
                         pass = true;
                         if (describe.length() > 20) {
-                            errorList.add("第" + (i + 1) + "行描述长度大于20字符");
+                            errorList.add("第" + (i + 1) + "行别名长度大于20字符");
                             pass = false;
                         }
                         if(pass){
@@ -806,6 +806,22 @@ public class ItemGroupController {
                     }
                 }
 
+                // 描述
+                col++;
+                if(col <= maxIndex) {
+                    String remark = Convert.toStr(row.get(col), "");
+                    if (Blank.isNotEmpty(remark)){
+                        pass = true;
+                        if (remark.length() > 20) {
+                            errorList.add("第" + (i + 1) + "行描述长度大于20字符");
+                            pass = false;
+                        }
+                        if(pass){
+                            item.setRemark(remark);
+                        }
+                    }
+                }
+
                 // 单位
                 col++;
                 if(col <= maxIndex) {
@@ -916,12 +932,35 @@ public class ItemGroupController {
                     String startName = Convert.toStr(row.get(col), "");
                     if (Blank.isNotEmpty(startName)) {
                         pass = true;
-                        if(startName.length() > 20) {
-                            errorList.add("第" + (i + 1) + "行是否启动长度大于20字符");
+                        if(!Arrays.asList("是", "否").contains(startName)) {
+                            errorList.add("第" + (i + 1) + "行是否启动格式错误");
                             pass = false;
                         }
                         if (pass) {
-                            alarmConfig.setIsStart(0);//默认0,不启动
+                            if(startName.equals("否")){
+                                alarmConfig.setIsStart(0);//默认0,不启动
+                            }else{
+                                alarmConfig.setIsStart(1);//启动
+                            }
+                        }
+                    }
+                }
+                //报警值类型
+                col++;
+                if(col <= maxIndex) {
+                    String alarmValueType = Convert.toStr(row.get(col), "");
+                    if (Blank.isNotEmpty(alarmValueType)) {
+                        pass = true;
+                        if(!Arrays.asList("原始值报警", "计算值报警").contains(alarmValueType)) {
+                            errorList.add("第" + (i + 1) + "行报警值类型格式错误");
+                            pass = false;
+                        }
+                        if (pass) {
+                            if(alarmValueType.equals("原始值报警")){
+                                alarmConfig.setAlarmValueType(0);//原始值报警
+                            }else{
+                                alarmConfig.setAlarmValueType(1);//计算值报警
+                            }
                         }
                     }
                 }
@@ -931,8 +970,8 @@ public class ItemGroupController {
                     String alarmType = Convert.toStr(row.get(col), "");
                     if (Blank.isNotEmpty(alarmType)) {
                         pass = true;
-                        if(alarmType.length() > 20) {
-                            errorList.add("第" + (i + 1) + "行是否启动长度大于20字符");
+                        if(!Arrays.asList("范围", "开关").contains(alarmType)) {
+                            errorList.add("第" + (i + 1) + "行报警类型格式错误");
                             pass = false;
                         }
                         if (pass) {
@@ -1074,8 +1113,8 @@ public class ItemGroupController {
                     String switchTypeStr = Convert.toStr(row.get(col), "");
                     if (Blank.isNotEmpty(switchTypeStr)) {
                         pass = true;
-                        if(switchTypeStr.length() > 20) {
-                            errorList.add("第" + (i + 1) + "行开关报警文本长度大于20字符");
+                        if(!Arrays.asList("关断", "开通", "值改变").contains(switchTypeStr)) {
+                            errorList.add("第" + (i + 1) + "行开关报警格式错误");
                             pass = false;
                         }
                         if (pass) {

+ 15 - 12
industry-system/industry-da/src/main/java/com/example/opc_da/controller/RootRedirectController.java

@@ -1,5 +1,6 @@
 package com.example.opc_da.controller;
 
+import cn.hutool.core.util.StrUtil;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -13,19 +14,21 @@ public class RootRedirectController {
     @GetMapping("/")
     public void redirect(HttpServletRequest request, HttpServletResponse response) throws IOException {
         String userAgent = request.getHeader("user-agent");
-        String s = userAgent.toLowerCase();
-        if (s.contains("phone")
-                ||
-                s.contains("android")
-                ||
-                s.contains("iphone")
-                ||
-                s.contains("ipad") //暂且把ipad也归为苹果设备
-        ) {
-            response.sendRedirect("/app/index.html");
-        } else {
-            response.sendRedirect("/page/index.html");
+        if(StrUtil.isNotEmpty(userAgent)){
+            String s = userAgent.toLowerCase();
+            if (s.contains("phone")
+                    ||
+                    s.contains("android")
+                    ||
+                    s.contains("iphone")
+                    ||
+                    s.contains("ipad") //暂且把ipad也归为苹果设备
+            ) {
+                response.sendRedirect("/app/index.html");
+                return;
+            }
         }
+        response.sendRedirect("/page/index.html");
 //        response.sendRedirect("/index.html");
     }
 }

+ 15 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/dao/DeviceDataItemDao.java

@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 @Repository
 public interface DeviceDataItemDao {
@@ -33,4 +34,18 @@ public interface DeviceDataItemDao {
                                            @Param("itemReadName") String itemReadName);
 
     Integer getDeviceDataItemCount(String itemReadName);
+
+    /**
+     * 根据设备点位查询设备点位被数据列表设置占用数据
+     * @param idList 设备点位id集合
+     * @return
+     */
+    List<Map<String, Object>> getDeviceDataItemNameByItemIds(List<Integer> idList);
+
+    /**
+     * 根据设备Id查询设备下点位被数据列表设置占用数据
+     * @param id 设备Id
+     * @return
+     */
+    List<Map<String, Object>> getDeviceDataItemNameByDeviceLedgerId(Integer id);
 }

+ 15 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/dao/DeviceRunDao.java

@@ -5,6 +5,7 @@ import com.example.opc_common.entity.DeviceRunItem;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 @Repository
 public interface DeviceRunDao {
@@ -35,4 +36,18 @@ public interface DeviceRunDao {
     List<DeviceRunItem> getDeviceRunItemShowByDeviceId(Integer deviceRunId, Integer isShow);
 
     List<Integer> getAssignedItemList();
+
+    /**
+     * 根据设备点位查询设备点位被设备运行参数占用数据
+     * @param idList 设备点位id集合
+     * @return
+     */
+    List<Map<String, Object>> getDeviceRunNameByItemIds(List<Integer> idList);
+
+    /**
+     * 根据设备Id查询设备下点位被设备运行参数占用数据
+     * @param id 设备Id
+     * @return
+     */
+    List<Map<String, Object>> getDeviceRunNameByDeviceLedgerId(Integer id);
 }

+ 4 - 4
industry-system/industry-da/src/main/java/com/example/opc_da/dao/MainRunDao.java

@@ -42,12 +42,12 @@ public interface MainRunDao {
      * @param idList 设备点位id集合
      * @return
      */
-    List<Map<String, Object>> getDataGroupNameByItemIds(List<Integer> idList);
+    List<Map<String, Object>> getMainRunNameByItemIds(List<Integer> idList);
 
     /**
-     * 根据设备Id集合查询设备下点位被主要运行参数占用数据
-     * @param idList 设备Id集合
+     * 根据设备Id查询设备下点位被主要运行参数占用数据
+     * @param id 设备Id
      * @return
      */
-    List<Map<String, Object>> getDataGroupNameByDeviceLedgerIds(List<Integer> idList);
+    List<Map<String, Object>> getMainRunNameByDeviceLedgerId(Integer id);
 }

+ 15 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/dao/PageAnimationDao.java

@@ -4,6 +4,7 @@ import com.example.opc_common.entity.PageAnimation;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 @Repository
 public interface PageAnimationDao {
@@ -14,4 +15,18 @@ public interface PageAnimationDao {
     List<PageAnimation> getAllPageAnimation();
 
     PageAnimation getPageAnimationByType(String Type);
+
+    /**
+     * 根据设备点位查询设备点位被页面动效管理占用数据
+     * @param idList 设备点位id集合
+     * @return
+     */
+    List<Map<String, Object>> getPageAnimationNameByItemIds(List<Integer> idList);
+
+    /**
+     * 根据设备Id查询设备下点位被页面动效管理占用数据
+     * @param id 设备Id
+     * @return
+     */
+    List<Map<String, Object>> getPageAnimationNameByDeviceLedgerId(Integer id);
 }

+ 14 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/dao/SceneDao.java

@@ -75,4 +75,18 @@ public interface SceneDao {
     List<Map<String, Object>> getAllSceneSourceImg();
 
     Boolean delSceneImg(@Param("id") Integer id);
+
+    /**
+     * 根据设备点位查询设备点位被场景设计占用数据
+     * @param idList 设备点位id集合
+     * @return
+     */
+    List<Map<String, Object>> getSceneNameByItemIds(List<Integer> idList);
+
+    /**
+     * 根据设备Id查询设备下点位被场景设计占用数据
+     * @param id 设备Id
+     * @return
+     */
+    List<Map<String, Object>> getSceneNameByDeviceLedgerId(Integer id);
 }

+ 15 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/dao/TrafficChartDao.java

@@ -5,6 +5,7 @@ import com.example.opc_common.entity.TrafficChartItem;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 @Repository
 public interface TrafficChartDao {
@@ -35,4 +36,18 @@ public interface TrafficChartDao {
     List<TrafficChartItem> getTcItemShowByTrafficChartId(Integer trafficChartId, Integer isShow);
 
     List<Integer> getAssignedItemList();
+
+    /**
+     * 根据设备点位查询设备点位被流量图表配置占用数据
+     * @param idList 设备点位id集合
+     * @return
+     */
+    List<Map<String, Object>> getTrafficChartNameByItemIds(List<Integer> idList);
+
+    /**
+     * 根据设备Id查询设备下点位被流量图表配置占用数据
+     * @param id 设备Id
+     * @return
+     */
+    List<Map<String, Object>> getTrafficChartNameByDeviceLedgerId(Integer id);
 }

+ 1 - 1
industry-system/industry-da/src/main/java/com/example/opc_da/exception/GlobalExceptionHandler.java

@@ -39,7 +39,7 @@ public class GlobalExceptionHandler {
     @ExceptionHandler(value = CustomException.class)
     public Result handle(CustomException e) {
         //e.printStackTrace();
-        log.error(e.getMessage());
+        log.warn(e.getMessage());
         return Result.no(e.getCode(), e.getMessage());
     }
 }

+ 12 - 2
industry-system/industry-da/src/main/java/com/example/opc_da/policy/ChangeReportDataPolicyTask.java

@@ -7,6 +7,7 @@ import cn.hutool.core.collection.CollUtil;
 import com.cqcy.ei.influxdb.entity.Item;
 import com.example.opc_common.entity.ReportDataPolicy;
 import com.example.opc_common.entity.ReportDataPolicyItem;
+import com.example.opc_common.util.DateUtil;
 import com.example.opc_common.util.MathUtil;
 import com.example.opc_da.config.SpringContextUtils;
 import com.example.opc_da.task.AsyncTask;
@@ -53,7 +54,8 @@ public class ChangeReportDataPolicyTask extends ReportDataPolicyTask {
             @Override
             public void run() {
                 //判断数据组是否到达了,今天的结束时间
-                if (System.currentTimeMillis()<=startTime || System.currentTimeMillis() >= endTime){
+                Long currentTime = System.currentTimeMillis();
+                if (currentTime >= endTime){
                     stop();
                     return;
                 }
@@ -64,9 +66,17 @@ public class ChangeReportDataPolicyTask extends ReportDataPolicyTask {
                 //过滤已经存在的数据
                 List<Item> validItemDataList = itemDataByLast.stream().filter(i ->
                         lastItemDataByLast.stream().noneMatch(l ->
-                                l.getName().equals(i.getName()) && l.getTime().equals(i.getTime()))
+                                l.getName().equals(i.getName()) && l.getTime().equals(i.getTime())
+                        )
+                        && DateUtil.strYmdhmssChangeDate(i.getTime()).getTime() >= startTime
                 ).collect(Collectors.toList());
 
+                if (CollUtil.isEmpty(validItemDataList)) {
+                    // 无新增数据
+                    return;
+                }
+
+
                 //将得到的数据转换为Map<点位名称,Item实体类>
                 Map<String, Item> map = validItemDataList.stream().collect(Collectors.toMap(Item::getName, i -> i));
                 //将报表采集策略的点位,赋值相应的值

+ 6 - 2
industry-system/industry-da/src/main/java/com/example/opc_da/policy/EventReportDataPolicyTask.java

@@ -12,6 +12,7 @@ import com.example.opc_common.enums.ModelEnum;
 import com.example.opc_common.enums.OperationEnum;
 import com.example.opc_common.enums.ResultEnum;
 import com.example.opc_common.util.ConstantStr;
+import com.example.opc_common.util.DateUtil;
 import com.example.opc_da.config.SpringContextUtils;
 import com.example.opc_da.dao.OperationLogDao;
 import com.example.opc_da.dao.ReportTableDao;
@@ -125,7 +126,7 @@ public class EventReportDataPolicyTask extends ReportDataPolicyTask {
             public void run() {
                 //判断数据组是否到达了,今天的结束时间
                 Long currentTime = System.currentTimeMillis();
-                if (currentTime<=startTime || currentTime>= endTime) {
+                if (currentTime >= endTime){
                     stop();
                     return;
                 }
@@ -137,8 +138,11 @@ public class EventReportDataPolicyTask extends ReportDataPolicyTask {
                     lastItemDataByLast.stream().noneMatch(l ->
                             l.getName().equals(i.getName()) && l.getTime().equals(i.getTime())
                     )
+                    && DateUtil.strYmdhmssChangeDate(i.getTime()).getTime() >= startTime
                 ).collect(Collectors.toList());
-                if(validItemDataList.size() == 0){
+
+
+                if (CollUtil.isEmpty(validItemDataList)) {
                     // 无新增数据
                     return;
                 }

+ 9 - 2
industry-system/industry-da/src/main/java/com/example/opc_da/policy/FreReportDataPolicyTask.java

@@ -8,6 +8,7 @@ import cn.hutool.core.collection.CollUtil;
 import com.cqcy.ei.influxdb.entity.Item;
 import com.example.opc_common.entity.ReportDataPolicy;
 import com.example.opc_common.entity.ReportDataPolicyItem;
+import com.example.opc_common.util.DateUtil;
 import com.example.opc_da.config.SpringContextUtils;
 //import com.example.opc_da.service.CollectorService;
 import com.example.opc_da.task.AsyncTask;
@@ -45,7 +46,7 @@ public class FreReportDataPolicyTask extends ReportDataPolicyTask {
             public void run() {
                 //判断数据组是否到达了,今天的结束时间
                 Long currentTime = System.currentTimeMillis();
-                if (currentTime<=startTime || currentTime >= endTime){
+                if (currentTime >= endTime){
                     stop();
                     return;
                 }
@@ -58,9 +59,15 @@ public class FreReportDataPolicyTask extends ReportDataPolicyTask {
                 //过滤已经存在的数据
                 List<Item> validItemDataList = itemDataByLast.stream().filter(i ->
                         lastItemDataByLast.stream().noneMatch(l ->
-                                l.getName().equals(i.getName()) && l.getTime().equals(i.getTime()))
+                                l.getName().equals(i.getName()) && l.getTime().equals(i.getTime())
+                        )
+                        && DateUtil.strYmdhmssChangeDate(i.getTime()).getTime() >= startTime
                 ).collect(Collectors.toList());
 
+                if (CollUtil.isEmpty(validItemDataList)) {
+                    // 无新增数据
+                    return;
+                }
                 //将得到的数据转换为Map<点位名称,Item实体类>
                 Map<String, Item> map = validItemDataList.stream().collect(Collectors.toMap(Item::getName, i -> i));
                 //将报表采集策略的点位,赋值相应的值

+ 68 - 5
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/DeviceLedgerServiceImpl.java

@@ -8,7 +8,7 @@ import com.example.opc_common.util.Blank;
 import com.example.opc_common.util.DateUtil;
 import com.example.opc_common.util.Result;
 import com.example.opc_da.config.FilePathConfig;
-import com.example.opc_da.dao.DeviceLedgerDao;
+import com.example.opc_da.dao.*;
 import com.example.opc_da.service.DeviceLedgerService;
 import com.example.opc_da.util.FileUtil;
 import com.example.opc_da.util.QueryServiceUtil;
@@ -18,10 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -37,6 +34,24 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
     @Autowired
     private QueryServiceUtil queryServiceUtil;
 
+    @Resource
+    private MainRunDao mainRunDao;
+
+    @Resource
+    private DeviceRunDao deviceRunDao;
+
+    @Resource
+    private TrafficChartDao trafficChartDao;
+
+    @Resource
+    private SceneDao sceneDao;
+
+    @Resource
+    private DeviceDataItemDao deviceDataItemDao;
+
+    @Resource
+    private PageAnimationDao pageAnimationDao;
+
     @Override
     public Result addDeviceDirectory(DeviceDirectory deviceDirectory) {
         DeviceDirectory oldDeviceDirectory = deviceLedgerDao.getDeviceDirectoryByName(deviceDirectory.getDirectoryName());
@@ -339,6 +354,30 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
 
     @Override
     public Result delDeviceLedgerById(Integer id) {
+        List<Map<String, Object>> mainRunNameList = mainRunDao.getMainRunNameByDeviceLedgerId(id);
+        if (Blank.isNotEmpty(mainRunNameList)) {
+            return Result.ok(mainRunNameList,"mainRun");
+        }
+        List<Map<String, Object>> deviceRunNameList = deviceRunDao.getDeviceRunNameByDeviceLedgerId(id);
+        if (Blank.isNotEmpty(deviceRunNameList)) {
+            return Result.ok(deviceRunNameList,"deviceRun");
+        }
+        List<Map<String, Object>> trafficChartNameList = trafficChartDao.getTrafficChartNameByDeviceLedgerId(id);
+        if (Blank.isNotEmpty(trafficChartNameList)) {
+            return Result.ok(trafficChartNameList,"trafficChart");
+        }
+        List<Map<String, Object>> sceneNameList = sceneDao.getSceneNameByDeviceLedgerId(id);
+        if (Blank.isNotEmpty(sceneNameList)) {
+            return Result.ok(sceneNameList,"scene");
+        }
+        List<Map<String, Object>> deviceDataItemNameList = deviceDataItemDao.getDeviceDataItemNameByDeviceLedgerId(id);
+        if (Blank.isNotEmpty(deviceDataItemNameList)) {
+            return Result.ok(deviceDataItemNameList,"deviceDataItem");
+        }
+        List<Map<String, Object>> pageAnimationNameList = pageAnimationDao.getPageAnimationNameByDeviceLedgerId(id);
+        if (Blank.isNotEmpty(pageAnimationNameList)) {
+            return Result.ok(pageAnimationNameList,"pageAnimation");
+        }
         if (deviceLedgerDao.delDeviceLedgerById(id) <= 0) {
             return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除设备台账失败");
         }
@@ -429,6 +468,30 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
 
     @Override
     public synchronized Result delLedgerItemList(Integer deviceLedgerId, List<Integer> itemIdList) {
+        List<Map<String, Object>> mainRunNameList = mainRunDao.getMainRunNameByItemIds(itemIdList);
+        if (Blank.isNotEmpty(mainRunNameList)) {
+            return Result.ok(mainRunNameList,"mainRun");
+        }
+        List<Map<String, Object>> deviceRunNameList = deviceRunDao.getDeviceRunNameByItemIds(itemIdList);
+        if (Blank.isNotEmpty(deviceRunNameList)) {
+            return Result.ok(deviceRunNameList,"deviceRun");
+        }
+        List<Map<String, Object>> trafficChartNameList = trafficChartDao.getTrafficChartNameByItemIds(itemIdList);
+        if (Blank.isNotEmpty(trafficChartNameList)) {
+            return Result.ok(trafficChartNameList,"trafficChart");
+        }
+        List<Map<String, Object>> sceneNameList = sceneDao.getSceneNameByItemIds(itemIdList);
+        if (Blank.isNotEmpty(sceneNameList)) {
+            return Result.ok(sceneNameList,"scene");
+        }
+        List<Map<String, Object>> deviceDataItemNameList = deviceDataItemDao.getDeviceDataItemNameByItemIds(itemIdList);
+        if (Blank.isNotEmpty(deviceDataItemNameList)) {
+            return Result.ok(deviceDataItemNameList,"deviceDataItem");
+        }
+        List<Map<String, Object>> pageAnimationNameList = pageAnimationDao.getPageAnimationNameByItemIds(itemIdList);
+        if (Blank.isNotEmpty(pageAnimationNameList)) {
+            return Result.ok(pageAnimationNameList,"pageAnimation");
+        }
         if (deviceLedgerDao.delLedgerItemList(deviceLedgerId, itemIdList) <= 0) {
             return Result.no(ResultEnum.SUCCESS.getRespCode(), "删除设备台账点位失败");
         }

+ 10 - 10
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/DeviceRunServiceImpl.java

@@ -30,30 +30,30 @@ public class DeviceRunServiceImpl implements DeviceRunService {
     public synchronized Result addDeviceRun(DeviceRun deviceRun) {
         DeviceRun oldDeviceRun = deviceRunDao.getDeviceRunByName(deviceRun.getDataGroupName());
         if (Blank.isNotEmpty(oldDeviceRun)) {
-            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此数组名称了,请更改后再试");
+            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此设备运行参数组名称了,请更改后再试");
         }
         if (deviceRunDao.addDeviceRun(deviceRun) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "添加设备运行参数失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "添加设备运行参数失败");
         }
         List<DeviceRunItem> deviceRunItemList = deviceRun.getDeviceRunItemList();
         if (Blank.isNotEmpty(deviceRunItemList)) {
             List<DeviceRunItem> deviceRunItems = deviceRunDao.getDeviceRunItemByItemIdList(deviceRunItemList);
             if (Blank.isNotEmpty(deviceRunItems)) {
-                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他数组中使用,请修改");
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他设备运行参数组中使用,请修改");
             }
             deviceRunDao.addDeviceRunItem(deviceRun.getId(), deviceRunItemList);
         }
-        return Result.ok("添加设备运行参数成功");
+        return Result.ok("添加设备运行参数成功");
     }
 
     @Override
     public synchronized Result updateDeviceRun(DeviceRun deviceRun) {
         DeviceRun oldDeviceRun = deviceRunDao.getDeviceRunByNameNoId(deviceRun.getId(), deviceRun.getDataGroupName());
         if (Blank.isNotEmpty(oldDeviceRun)) {
-            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此数组名称了,请更改后再试");
+            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此设备运行参数组名称了,请更改后再试");
         }
         if (deviceRunDao.updateDeviceRun(deviceRun) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "修改设备运行参数失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "修改设备运行参数失败");
         }
         Integer id = deviceRun.getId();
         deviceRunDao.delDeviceRunItemByDeviceId(id);
@@ -61,11 +61,11 @@ public class DeviceRunServiceImpl implements DeviceRunService {
         if (Blank.isNotEmpty(deviceRunItemList)) {
             List<DeviceRunItem> deviceRunItems = deviceRunDao.getDeviceRunItemByItemIdList(deviceRunItemList);
             if (Blank.isNotEmpty(deviceRunItems)) {
-                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他数组中使用,请修改");
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他设备运行参数组中使用,请修改");
             }
             deviceRunDao.addDeviceRunItem(id, deviceRunItemList);
         }
-        return Result.ok("修改设备运行参数成功");
+        return Result.ok("修改设备运行参数成功");
     }
 
     @Override
@@ -81,10 +81,10 @@ public class DeviceRunServiceImpl implements DeviceRunService {
     @Override
     public synchronized Result delDeviceRunById(Integer id) {
         if (deviceRunDao.delDeviceRunById(id) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除设备运行参数失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除设备运行参数失败");
         }
         deviceRunDao.delDeviceRunItemByDeviceId(id);
-        return Result.ok("删除设备运行参数成功");
+        return Result.ok("删除设备运行参数成功");
     }
 
     @Override

+ 11 - 11
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/MainRunServiceImpl.java

@@ -35,30 +35,30 @@ public class MainRunServiceImpl implements MainRunService {
     public synchronized Result addMainRun(MainRun mainRun) {
         MainRun oldMainRun = mainRunDao.getMainRunByName(mainRun.getDataGroupName());
         if (Blank.isNotEmpty(oldMainRun)) {
-            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此数组名称了,请更改后再试");
+            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此主要运行参数组名称了,请更改后再试");
         }
         if (mainRunDao.addMainRun(mainRun) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "添加主要运行参数失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "添加主要运行参数失败");
         }
         List<MainRunItem> mainRunItemList = mainRun.getMainRunItemList();
         if (Blank.isNotEmpty(mainRunItemList)) {
             List<MainRunItem> mainRunItems = mainRunDao.getMainRunItemByItemIdList(mainRunItemList);
             if (Blank.isNotEmpty(mainRunItems)) {
-                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他数组中使用,请修改");
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他主要运行参数组中使用,请修改");
             }
             mainRunDao.addMainRunItem(mainRun.getId(), mainRunItemList);
         }
-        return Result.ok("添加主要运行参数成功");
+        return Result.ok("添加主要运行参数成功");
     }
 
     @Override
     public synchronized Result updateMainRun(MainRun mainRun) {
         MainRun oldMainRun = mainRunDao.getMainRunByNameNoId(mainRun.getId(), mainRun.getDataGroupName());
         if (Blank.isNotEmpty(oldMainRun)) {
-            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此数组名称了,请更改后再试");
+            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此主要运行参数组名称了,请更改后再试");
         }
         if (mainRunDao.updateMainRun(mainRun) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "修改主要运行参数失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "修改主要运行参数失败");
         }
         Integer id = mainRun.getId();
         mainRunDao.delMainRunItemByMainId(id);
@@ -66,11 +66,11 @@ public class MainRunServiceImpl implements MainRunService {
         if (Blank.isNotEmpty(mainRunItemList)) {
             List<MainRunItem> mainRunItems = mainRunDao.getMainRunItemByItemIdList(mainRunItemList);
             if (Blank.isNotEmpty(mainRunItems)) {
-                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他数组中使用,请修改");
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他主要运行参数组中使用,请修改");
             }
             mainRunDao.addMainRunItem(id, mainRunItemList);
         }
-        return Result.ok("修改主要运行参数成功");
+        return Result.ok("修改主要运行参数成功");
     }
 
     @Override
@@ -87,7 +87,7 @@ public class MainRunServiceImpl implements MainRunService {
     @Override
     public synchronized Result delMainRunById(Integer id) {
         if (mainRunDao.delMainRunById(id) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除数组失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除主要运行参数组失败");
         }
         List<MainRunItem> mainRunItemList = mainRunDao.getMainRunItemByMainId(id);
         mainRunDao.delMainRunItemByMainId(id);
@@ -98,7 +98,7 @@ public class MainRunServiceImpl implements MainRunService {
             });
             fileService.deleleFiles(fileIdList);
         }
-        return Result.ok("删除主要运行参数成功");
+        return Result.ok("删除主要运行参数成功");
     }
 
     @Override
@@ -119,7 +119,7 @@ public class MainRunServiceImpl implements MainRunService {
         List<MainRunItem> mainRunItemList = mainRunDao.getMainRunItemShowByMainId(id, 1);
         for (MainRunItem m : mainRunItemList) {
             if (Blank.isEmpty(m.getDataSourceId(), m.getItemReadName())) {
-                return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "表格中没有名称的点位在数组中已被删除,请调整后调用");
+                return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "表格中没有名称的点位在主要运行参数组中已被删除,请调整后调用");
             }
         }
         //从工具类中组装对应点位的数据到集合中

+ 11 - 11
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/TrafficChartServiceImpl.java

@@ -31,30 +31,30 @@ public class TrafficChartServiceImpl implements TrafficChartService {
     public synchronized Result addTrafficChart(TrafficChart trafficChart) {
         TrafficChart oldTrafficChart = trafficChartDao.getTrafficChartByName(trafficChart.getTrafficType(), trafficChart.getDataGroupName());
         if (Blank.isNotEmpty(oldTrafficChart)) {
-            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此类型的数据组名称了,请更改后再试");
+            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此类型的流量图表配置组名称了,请更改后再试");
         }
         if (trafficChartDao.addTrafficChart(trafficChart) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "添加数据组失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "添加流量图表配置组失败");
         }
         List<TrafficChartItem> trafficChartItemList = trafficChart.getTrafficChartItemList();
         if (Blank.isNotEmpty(trafficChartItemList)) {
             List<TrafficChartItem> trafficChartItems = trafficChartDao.getTrafficChartItemByItemIdList(trafficChartItemList);
             if (Blank.isNotEmpty(trafficChartItems)) {
-                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他数据组中使用,请修改");
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他流量图表配置组中使用,请修改");
             }
             trafficChartDao.addTrafficChartItem(trafficChart.getId(), trafficChartItemList);
         }
-        return Result.ok("添加数据组成功");
+        return Result.ok("添加流量图表配置组成功");
     }
 
     @Override
     public synchronized Result updateTrafficChart(TrafficChart trafficChart) {
         TrafficChart oldTrafficChart = trafficChartDao.getTrafficChartByNameNoId(trafficChart.getId(), trafficChart.getTrafficType(), trafficChart.getDataGroupName());
         if (Blank.isNotEmpty(oldTrafficChart)) {
-            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此类型的数据组名称了,请更改后再试");
+            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "已经存在此类型的流量图表配置组名称了,请更改后再试");
         }
         if (trafficChartDao.updateTrafficChart(trafficChart) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "修改数据组失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "修改流量图表配置组失败");
         }
         Integer id = trafficChart.getId();
         trafficChartDao.delTcItemByTrafficChartId(id);
@@ -62,11 +62,11 @@ public class TrafficChartServiceImpl implements TrafficChartService {
         if (Blank.isNotEmpty(trafficChartItemList)) {
             List<TrafficChartItem> trafficChartItems = trafficChartDao.getTrafficChartItemByItemIdList(trafficChartItemList);
             if (Blank.isNotEmpty(trafficChartItems)) {
-                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他数据组中使用,请修改");
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "点位已在其他流量图表配置组中使用,请修改");
             }
             trafficChartDao.addTrafficChartItem(id, trafficChartItemList);
         }
-        return Result.ok("修改数据组成功");
+        return Result.ok("修改流量图表配置组成功");
     }
 
     @Override
@@ -81,10 +81,10 @@ public class TrafficChartServiceImpl implements TrafficChartService {
     @Override
     public synchronized Result delTrafficChartById(Integer id) {
         if (trafficChartDao.delTrafficChartById(id) <= 0) {
-            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除数据组失败");
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除流量图表配置组失败");
         }
         trafficChartDao.delTcItemByTrafficChartId(id);
-        return Result.ok("删除数据组成功");
+        return Result.ok("删除流量图表配置组成功");
     }
 
     @Override
@@ -120,7 +120,7 @@ public class TrafficChartServiceImpl implements TrafficChartService {
         List<TrafficChartItem> trafficChartItemList = trafficChartDao.getTcItemShowByTrafficChartId(id, 1);
         for (TrafficChartItem m : trafficChartItemList) {
             if (Blank.isEmpty(m.getDataSourceId(), m.getItemReadName())) {
-                return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "表格中没有名称的点位在数据组中已被删除,请调整后调用");
+                return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "表格中没有名称的点位在流量图表配置组中已被删除,请调整后调用");
             }
         }
         //从工具类赋值相应的点位基本信息和历史数据到集合中

+ 1 - 1
industry-system/industry-da/src/main/java/com/example/opc_da/task/DataSourceStatusTimerTask.java

@@ -54,7 +54,7 @@ public class DataSourceStatusTimerTask extends PeriodTimerTask {
                 try {
                     result = dataSourceService.testConnect(dataSource);
                 } catch (Exception e) {
-                    log.error("定时任务获取数据源连接失败。id:{}。连接信息:{}。具体错误:{}", dataSource.getId(), key, e.getMessage());
+                    log.warn("定时任务获取数据源连接失败。id:{}。连接信息:{}。具体错误:{}", dataSource.getId(), key, e.getMessage());
                 }
                 if (result == null) {
                     testStatus = false;

+ 11 - 10
industry-system/industry-da/src/main/resources/mapper/AlarmConfigDao.xml

@@ -4,18 +4,17 @@
 
     <sql id="alarmConfig">
         item_id
-        ,alarm_level_id,alarm_type,low_low_alarm,low_low_text,
+        ,alarm_level_id,alarm_type,alarm_value_type,low_low_alarm,low_low_text,
             low_alarm,low_text,high_alarm,high_text,high_high_alarm,high_high_text,switch_type,open_text,close_text,is_start,create_time
     </sql>
 
     <insert id="addAlarmConfig">
-insert into t_alarm_config (item_id, alarm_level_id, alarm_type, low_low_alarm, low_low_text,
-                                    low_alarm, low_text, high_alarm, high_text, high_high_alarm, high_high_text,
-                                    switch_type, open_text, close_text,
-                                    is_start, create_time)
-            VALUE (#{itemId}, #{alarmLevelId},#{alarmType},#{lowLowAlarm}, #{lowLowText},
-            #{lowAlarm}, #{lowText},#{highAlarm}, #{highText}, #{highHighAlarm}, #{highHighText},
-            #{switchType},#{openText},#{closeText},#{isStart},now())
+        insert into t_alarm_config (item_id, alarm_level_id, alarm_type, alarm_value_type, low_low_alarm, low_low_text,
+        low_alarm, low_text, high_alarm, high_text, high_high_alarm, high_high_text,
+        switch_type, open_text, close_text, is_start, create_time)
+        VALUE (#{itemId}, #{alarmLevelId},#{alarmType},#{alarmValueType},#{lowLowAlarm}, #{lowLowText},
+        #{lowAlarm}, #{lowText},#{highAlarm}, #{highText}, #{highHighAlarm}, #{highHighText},
+        #{switchType},#{openText},#{closeText},#{isStart},now())
     </insert>
 
     <insert id="addAlarmLogList">
@@ -31,6 +30,7 @@ insert into t_alarm_config (item_id, alarm_level_id, alarm_type, low_low_alarm,
         update t_alarm_config
         set alarm_level_id=#{alarmLevelId},
             alarm_type=#{alarmType},
+            alarm_value_type=#{alarmValueType},
             low_low_alarm=#{lowLowAlarm},
             low_low_text=#{lowLowText},
             low_alarm=#{lowAlarm},
@@ -274,14 +274,15 @@ insert into t_alarm_config (item_id, alarm_level_id, alarm_type, low_low_alarm,
 
     <insert id="addAlarmConfigForExcel">
         <foreach collection="itemList" item="item" index="index" separator=";">
-            insert into t_alarm_config (item_id, alarm_level_id, alarm_type, low_low_alarm, low_low_text,
+            insert into t_alarm_config (item_id, alarm_level_id, alarm_type, alarm_value_type, low_low_alarm, low_low_text,
             low_alarm, low_text, high_alarm, high_text, high_high_alarm, high_high_text,
             switch_type, open_text, close_text,is_start, create_time)
-            VALUE (#{item.itemId}, #{item.alarmLevelId},#{item.alarmType},#{item.lowLowAlarm}, #{item.lowLowText},
+            VALUE (#{item.itemId}, #{item.alarmLevelId},#{item.alarmType},#{item.alarmValueType},#{item.lowLowAlarm}, #{item.lowLowText},
             #{item.lowAlarm}, #{item.lowText},#{item.highAlarm}, #{item.highText}, #{item.highHighAlarm}, #{item.highHighText},
             #{item.switchType},#{item.openText},#{item.closeText},#{item.isStart},now())
             ON DUPLICATE KEY UPDATE alarm_level_id=#{item.alarmLevelId},
             alarm_type=#{item.alarmType},
+            alarm_value_type=#{item.alarmValueType},
             low_low_alarm=#{item.lowLowAlarm},
             low_low_text=#{item.lowLowText},
             low_alarm=#{item.lowAlarm},

+ 27 - 0
industry-system/industry-da/src/main/resources/mapper/DeviceDataItemDao.xml

@@ -125,4 +125,31 @@
         </where>
     </select>
 
+    <!--根据设备点位查询设备点位被数据列表设置占用数据-->
+    <select id="getDeviceDataItemNameByItemIds" resultType="map">
+        select ti.itemReadName
+        from (
+            select DISTINCT tddi.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from t_device_data_item tddi
+            inner join t_item ti on ti.id = tddi.item_id
+            where tddi.item_id in
+            <foreach collection="idList" item="id" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        ) ti
+        ORDER BY ti.itemReadName
+    </select>
+
+    <!--根据设备Id查询设备下点位被数据列表设置占用数据-->
+    <select id="getDeviceDataItemNameByDeviceLedgerId" resultType="map">
+        select ti.itemReadName
+        from (
+            select DISTINCT tddi.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from t_device_data_item tddi
+            inner join t_item ti on ti.id = tddi.item_id
+            inner join t_device_ledger_item tdli on tdli.device_ledger_id =#{id} and tdli.item_id = tddi.item_id
+        ) ti
+        ORDER BY ti.itemReadName
+    </select>
+
 </mapper>

+ 30 - 0
industry-system/industry-da/src/main/resources/mapper/DeviceRunDao.xml

@@ -118,5 +118,35 @@
         from t_device_run_item
     </select>
 
+    <!--根据设备点位查询设备点位被设备运行参数占用数据-->
+    <select id="getDeviceRunNameByItemIds" resultType="map">
+        select ti.itemReadName,GROUP_CONCAT(ti.data_group_name order by ti.data_group_name SEPARATOR '、') dataName
+        from (
+            select DISTINCT tdr.id,tdr.data_group_name,tdri.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from t_device_run tdr
+            inner join t_device_run_item tdri on tdr.id = tdri.device_run_id
+            inner join t_item ti on ti.id = tdri.item_id
+            where tdri.item_id in
+            <foreach collection="idList" item="id" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        ) ti
+        GROUP BY ti.itemReadName
+        ORDER BY ti.itemReadName
+    </select>
 
+
+    <!--根据设备Id查询设备下点位被设备运行参数占用数据-->
+    <select id="getDeviceRunNameByDeviceLedgerId" resultType="map">
+        select ti.itemReadName,ti.data_group_name dataName
+        from (
+            select DISTINCT tdr.id,tdr.data_group_name,tdri.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from t_device_run tdr
+            inner join t_device_run_item tdri on tdr.id = tdri.device_run_id
+            inner join t_item ti on ti.id = tdri.item_id
+            inner join t_device_ledger_item tdli on tdli.device_ledger_id =#{id} and tdli.item_id = tdri.item_id
+        ) ti
+        GROUP BY ti.itemReadName
+        ORDER BY ti.itemReadName
+    </select>
 </mapper>

+ 19 - 11
industry-system/industry-da/src/main/resources/mapper/ItemGroupDao.xml

@@ -10,7 +10,7 @@
     <sql id="item">
         ti.id
         , ti.item_group_id, ti.item_name, ti.item_read_name, ti.item_type, ti.node_index , ti.data_type, ti.upper_limit, ti.lower_limit
-        , ti.`describe`, ti.unit,ti.scale ,ti.data_model_id, ti.modbus_config,ti.identifier
+        , ti.`describe`, ti.unit,ti.scale ,ti.data_model_id, ti.modbus_config,ti.identifier,ti.remark
     </sql>
 
     <insert id="addItemGroup" parameterType="com.example.opc_common.entity.ItemGroup" useGeneratedKeys="true"
@@ -21,12 +21,14 @@
 
     <insert id="addItem">
         insert into t_item (item_group_id, item_name,
-        item_read_name, item_type, node_index ,data_type,`describe`, unit,data_model_id, modbus_config,identifier)
+        item_read_name, item_type, node_index ,data_type,`describe`, unit,data_model_id, modbus_config,identifier
+        ,remark)
         VALUES
         <foreach collection="itemList" item="item" index="index" separator=",">
             (#{itemGroupId},#{item.itemName},#{item.itemReadName},if(#{item.itemType} is null, 1,
             #{item.itemType}),#{item.nodeIndex},#{item.dataType},
-            #{item.describe},#{item.unit},#{item.dataModelId}, #{item.modbusConfig},#{item.identifier})
+            #{item.describe},#{item.unit},#{item.dataModelId}, #{item.modbusConfig},#{item.identifier}
+            ,#{item.remark})
         </foreach>
     </insert>
 
@@ -58,7 +60,8 @@
             data_model_id=#{dataModelId},
             `describe`=#{describe},
             unit=#{unit},
-            scale=#{scale}
+            scale=#{scale},
+            remark = #{remark}
         where id = #{id}
     </update>
 
@@ -240,7 +243,8 @@
         tdm.operation_rule,
         tdm.remark as operation_rule_name,
         tds.data_source_name,
-        tac.is_start
+        tac.is_start,
+        ti.remark
         FROM
         t_item ti
         LEFT JOIN t_item_group tig ON ti.item_group_id = tig.id
@@ -399,7 +403,8 @@
             a.describe,
             a.unit,
             b.data_source_id,
-            b.group_name as item_group_name
+            b.group_name as item_group_name,
+            a.remark
             from t_item a
             left join t_item_group b on a.item_group_id = b.id
             where a.id in
@@ -431,7 +436,8 @@
             c.operation_rule,
             c.replacing_value,
             c.operation_rule_two,
-            c.replacing_value_two
+            c.replacing_value_two,
+            a.remark
             from t_item a
             left join t_item_group b on a.item_group_id = b.id
             left join t_data_model c on a.data_model_id = c.id
@@ -466,7 +472,8 @@
         tdm.operation_rule,
         tdm.remark as operation_rule_name,
         tds.data_source_name,
-        tac.is_start
+        tac.is_start,
+        ti.remark
         FROM
         t_item ti
         LEFT JOIN t_item_group tig ON ti.item_group_id = tig.id
@@ -486,13 +493,13 @@
         insert into t_item (item_group_id, item_name, item_read_name,
         item_type, upper_limit,lower_limit,
         node_index ,data_type,`describe`, unit,data_model_id,
-        modbus_config,scale,identifier)
+        modbus_config,scale,identifier,remark)
         VALUES
         <foreach collection="itemList" item="item" index="index" separator=",">
             (#{itemGroupId},#{item.itemName},#{item.itemReadName},
              if(#{item.itemType} is null, 1,#{item.itemType}),#{item.upperLimit},#{item.lowerLimit},
              #{item.nodeIndex},#{item.dataType},#{item.describe},#{item.unit},#{item.dataModelId},
-             #{item.modbusConfig}, #{item.scale},#{item.identifier})
+             #{item.modbusConfig}, #{item.scale},#{item.identifier},#{item.remark})
         </foreach>
     </insert>
 
@@ -512,7 +519,8 @@
                 data_model_id = #{item.dataModelId},
                 modbus_config = #{item.modbusConfig},
                 scale = #{item.scale},
-                identifier = #{item.identifier}
+                identifier = #{item.identifier},
+                remark = #{item.remark}
             WHERE
                 id = #{item.itemId}
         </foreach>

+ 11 - 15
industry-system/industry-da/src/main/resources/mapper/MainRunDao.xml

@@ -145,36 +145,32 @@
     </select>
 
     <!--根据设备点位查询设备点位被主要运行参数占用数据-->
-    <select id="getDataGroupNameByItemIds" resultType="map">
+    <select id="getMainRunNameByItemIds" resultType="map">
         select ti.itemReadName,GROUP_CONCAT(ti.data_group_name order by ti.data_group_name SEPARATOR '、') dataName
         from (
-                 select DISTINCT tmr.id,tmr.data_group_name,tmri.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
-                 from t_main_run tmr
-                          inner join t_main_run_item tmri on tmr.id = tmri.main_run_id
-                          inner join t_item ti on ti.id = tmri.item_id
-                 where tmri.item_id in
+                select DISTINCT tmr.id,tmr.data_group_name,tmri.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+                from t_main_run tmr
+                inner join t_main_run_item tmri on tmr.id = tmri.main_run_id
+                inner join t_item ti on ti.id = tmri.item_id
+                where tmri.item_id in
                 <foreach collection="idList" item="id" open="(" close=")" separator=",">
                     #{id}
                 </foreach>
-             ) ti
+        ) ti
         GROUP BY ti.itemReadName
         ORDER BY ti.itemReadName
     </select>
 
 
-    <!--根据设备Id集合查询设备下点位被主要运行参数占用数据-->
-    <select id="getDataGroupNameByDeviceLedgerIds" resultType="String">
-        select ti.itemReadName,ti.data_group_name dataGroupName
+    <!--根据设备Id查询设备下点位被主要运行参数占用数据-->
+    <select id="getMainRunNameByDeviceLedgerId" resultType="map">
+        select ti.itemReadName,ti.data_group_name dataName
         from (
             select DISTINCT tmr.id,tmr.data_group_name,tmri.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
             from t_main_run tmr
             inner join t_main_run_item tmri on tmr.id = tmri.main_run_id
             inner join t_item ti on ti.id = tmri.item_id
-            inner join t_device_ledger_item tdli on tdli.device_ledger_id in
-            <foreach collection="idList" item="id" open="(" close=")" separator=",">
-                #{id}
-            </foreach>
-            and tdli.item_id = tmri.item_id
+            inner join t_device_ledger_item tdli on tdli.device_ledger_id =#{id} and tdli.item_id = tmri.item_id
         ) ti
         GROUP BY ti.itemReadName
         ORDER BY ti.itemReadName

+ 35 - 0
industry-system/industry-da/src/main/resources/mapper/PageAnimationDao.xml

@@ -30,4 +30,39 @@
         where tpa.type = #{type}
         limit 1
     </select>
+
+    <!--根据设备点位查询设备点位被页面动效管理占用数据-->
+    <select id="getPageAnimationNameByItemIds" resultType="map">
+        select ti.itemReadName
+        from (
+        select DISTINCT tpa.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+        from t_page_animation tpa
+        inner join t_item ti on ti.id = tpa.item_id
+        where tpa.item_id in
+        <foreach collection="idList" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+        ) ti
+        ORDER BY ti.itemReadName
+    </select>
+
+    <!--根据设备Id查询设备下点位被页面动效管理占用数据-->
+    <select id="getPageAnimationNameByDeviceLedgerId" resultType="map">
+        select ti.itemReadName
+        from (
+                 select DISTINCT tddi.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+                 from t_device_data_item tddi
+                          inner join t_item ti on ti.id = tddi.item_id
+                          inner join t_device_ledger_item tdli on tdli.device_ledger_id =#{id} and tdli.item_id = tddi.item_id
+             ) ti
+        ORDER BY ti.itemReadName
+        select ti.itemReadName
+        from (
+            select DISTINCT tpa.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from t_page_animation tpa
+            inner join t_item ti on ti.id = tpa.item_id
+            inner join t_device_ledger_item tdli on tdli.device_ledger_id =#{id} and tdli.item_id = tpa.item_id
+        ) ti
+        ORDER BY ti.itemReadName
+    </select>
 </mapper>

+ 32 - 0
industry-system/industry-da/src/main/resources/mapper/SceneDao.xml

@@ -101,4 +101,36 @@
     <delete id="delSceneImg">
         delete from f_scene_source where id = #{id}
     </delete>
+
+
+    <!--根据设备点位查询设备点位被场景设计占用数据-->
+    <select id="getSceneNameByItemIds" resultType="map">
+        select ti.itemReadName,GROUP_CONCAT(ti.scene_name order by ti.scene_name SEPARATOR '、') dataName
+        from (
+            select DISTINCT fs.id,fs.scene_name,ti.id item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from f_scene fs
+            inner join f_scene_img fsi on fs.id = fsi.scene_id
+            inner join t_item ti on fsi.config_json like concat('%"itemId":"',ti.id,'"%')
+            where ti.id in
+            <foreach collection="idList" item="id" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        ) ti
+        GROUP BY ti.itemReadName
+        ORDER BY ti.itemReadName
+    </select>
+
+    <!--根据设备Id查询设备下点位被场景设计占用数据-->
+    <select id="getSceneNameByDeviceLedgerId" resultType="map">
+        select ti.itemReadName,GROUP_CONCAT(ti.scene_name order by ti.scene_name SEPARATOR '、') dataName
+        from (
+            select DISTINCT fs.id,fs.scene_name,ti.id item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from f_scene fs
+            inner join f_scene_img fsi on fs.id = fsi.scene_id
+            inner join t_item ti on fsi.config_json like concat('%"itemId":"',ti.id,'"%')
+            inner join t_device_ledger_item tdli on tdli.device_ledger_id =#{id} and tdli.item_id = ti.id
+        ) ti
+        GROUP BY ti.itemReadName
+        ORDER BY ti.itemReadName
+    </select>
 </mapper>

+ 29 - 0
industry-system/industry-da/src/main/resources/mapper/TrafficChartDao.xml

@@ -132,5 +132,34 @@
         from t_traffic_chart_item
     </select>
 
+    <!--根据设备点位查询设备点位被流量图表配置占用数据-->
+    <select id="getTrafficChartNameByItemIds" resultType="map">
+        select ti.itemReadName,GROUP_CONCAT(ti.data_group_name order by ti.data_group_name SEPARATOR '、') dataName
+        from (
+            select DISTINCT ttc.id,ttc.data_group_name,ttci.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from t_traffic_chart ttc
+            inner join t_traffic_chart_item ttci on ttc.id = ttci.traffic_chart_id
+            inner join t_item ti on ti.id = ttci.item_id
+            where ttci.item_id in
+            <foreach collection="idList" item="id" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        ) ti
+        GROUP BY ti.itemReadName
+        ORDER BY ti.itemReadName
+    </select>
 
+    <!--根据设备Id查询设备下点位被流量图表配置占用数据-->
+    <select id="getTrafficChartNameByDeviceLedgerId" resultType="map">
+        select ti.itemReadName,ti.data_group_name dataName
+        from (
+            select DISTINCT ttc.id,ttc.data_group_name,ttci.item_id,IF(IFNULL(ti.modbus_config,'') = '', ti.item_read_name, ti.item_name) itemReadName
+            from t_traffic_chart ttc
+            inner join t_traffic_chart_item ttci on ttc.id = ttci.traffic_chart_id
+            inner join t_item ti on ti.id = ttci.item_id
+            inner join t_device_ledger_item tdli on tdli.device_ledger_id =#{id} and tdli.item_id = ttci.item_id
+         ) ti
+        GROUP BY ti.itemReadName
+        ORDER BY ti.itemReadName
+    </select>
 </mapper>