wuyouming666
2023-12-25 c49dc2f40279bcc360948cea68dec69cf213b85f
Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

# Conflicts:
# CanadaMes-ui/src/views/home/index.vue
# springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
12个文件已修改
1个文件已添加
967 ■■■■ 已修改文件
Alarm.json 507 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/api/home.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/layout/index.vue 251 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/North_Glass_Buffer1Service.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Alarm.json
New file
@@ -0,0 +1,507 @@
{
  "content": [
    {
      "name": "D01 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D02 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D03 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D04 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D05 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D06 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 servo turn error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 servo turn error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 servo travel error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 servo travel error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 servo travel error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 servo travel error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D01 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D01 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D02 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D02 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D03 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D03 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D04 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D04 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D05 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D05 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D06 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D06 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 IN DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 IN pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 OUT DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 OUT pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 IN DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 IN pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 OUT DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 OUT pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D01 Scan glass exceeding limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "emergency stop alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "More glass than known",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "less glass than known",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D01 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D02 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D03 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D04 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D05 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D06 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 conveyor Left safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 conveyor right safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 conveyor Left safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 conveyor right safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "1# buffer safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "2# buffer safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "3# buffer safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "4# buffer safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01.SR right in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02.SR left in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01.SR left in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01.SR left dec error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01.SR right dec error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01.SR right in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02.SR left in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02.SR left dec error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02.SR right dec error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    }
  ],
  "address": [
    {
      "name": "DB104.0.0",
      "count": 71
    }
  ]
}
CanadaMes-ui/src/api/home.js
@@ -198,11 +198,11 @@
    })
}
export function AddOutSliceS(data) {
export function AddOutSliceS(FrameNo) {
    return request({
        url: '/home/AddOutSliceS',
        url: '/home/AddOutSliceS?FrameNo='+FrameNo,
        method: 'post',
        data
        data:""
    })
}
@@ -214,6 +214,14 @@
    })
}
export function isAllowReorderings(isAllowReordering,data) {
    return request({
        url: '/home/isAllowReorderings?isAllowReordering=' + isAllowReordering,
        method: 'post',
        data
    })
}
export function isConfirmStates(isConfirmStates) {
    return request({
        url: '/home/isConfirmStates?isConfirmStates=' + isConfirmStates,
CanadaMes-ui/src/lang/locales/en-US.json
@@ -329,6 +329,7 @@
  "You do not have this permission":"You do not have this permission",
  "This glass is already in the Queue":"This glass is already in the Queue",
  "Complete":"Complete",
  "Allow":"Allow",
  "Not Allow":"Not Allow",
  "Completed":"Completed",
  "Waiting":"Waiting",
@@ -339,6 +340,7 @@
  "EXTERIQR OUT AND BYPASS TO THE LEFT":"EXTERIQR OUT AND BYPASS TO THE LEFT",
  "EXTERIQR OUT AND BYPASS TO THE RIGHT":"EXTERIQR OUT AND BYPASS TO THE RIGHT",
  "Complete Task":"Complete Task",
  "Outed":"Outed",
    "ServoManualone": {
      "A01 所在格子": "A01 Current Grid",
      "数量": "Quantity",
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -319,6 +319,7 @@
  "This glass is already in the Queue":"此玻璃已在出片队列中",
  "Complete":"完成",
  "Not Allow":"不允许",
  "Allow":"允许",
  "Completed":"已完成",
  "Waiting":"等待中",
  "Deleted":"已删除",
@@ -328,6 +329,7 @@
  "EXTERIQR OUT AND BYPASS TO THE LEFT":"EXTERIQR OUT AND BYPASS TO THE LEFT",
  "EXTERIQR OUT AND BYPASS TO THE RIGHT":"EXTERIQR OUT AND BYPASS TO THE RIGHT",
  "Complete Task":"完成任务",
  "Outed":"已出笼",
  "langparameter": {
    "conveyor Velocity(Auto FAST)": "D01-D06 皮带输送自动快速",
    "conveyor Velocity(Auto SLOW)": "D01-D06 皮带输送自动慢速",
CanadaMes-ui/src/layout/index.vue
@@ -1,7 +1,7 @@
<template>
  <el-container style="flex: 1;height:100%;">
    <div style="width: 200px;background-color: #222f3e" :style="{width: isCollapse?'70px':'250px'}">
      <el-aside :width="isCollapse?'70px':'250px'">
    <div style="width: 200px;background-color: #222f3e" :style="{ width: isCollapse ? '70px' : '250px' }">
      <el-aside :width="isCollapse ? '70px' : '250px'">
        <el-col :gutter="20">
          <el-row :span="4">
            <div class="logo" @click="goToHome">
@@ -9,11 +9,10 @@
            </div>
          </el-row>
          <el-row :span="20">
            <el-menu :default-active="activePath" class="el-menu-vertical-demo"
                      background-color="#222f3e" text-color="#fff" active-text-color="#ffd04b"
                      :collapse="isCollapse" :unique-opened="true"
                      :collapse-transition="false" :router="true">
             <!-- <el-menu-item index="/" @click="youhua">
            <el-menu :default-active="activePath" class="el-menu-vertical-demo" background-color="#222f3e"
              text-color="#fff" active-text-color="#ffd04b" :collapse="isCollapse" :unique-opened="true"
              :collapse-transition="false" :router="true">
              <!-- <el-menu-item index="/" @click="youhua">
                <template slot="title">
               
                  <i class="el-icon-menu"></i>
@@ -31,10 +30,8 @@
                  <span>{{ item.name }}</span>
                </template>
                <!--二级菜单-->
                <el-menu-item :index="'/'+menu.router"
                              v-for="menu in item.menuLists" :key="menu.id"
                             >
                <el-menu-item :index="'/' + menu.router" v-for="menu in item.menuLists" :key="menu.id">
                  <template slot="title">
                    <!--图标-->
                    <i :class="menu.icon"></i>
@@ -50,19 +47,21 @@
    </div>
    <el-container>
      <el-header class="header-container">
        <el-menu :default-active="activePath1" class="el-menu-demo" mode="horizontal"
                 background-color="#576574" text-color="#fff" active-text-color="#ffd04b">
        <el-menu :default-active="activePath1" class="el-menu-demo" mode="horizontal" background-color="#576574"
          text-color="#fff" active-text-color="#ffd04b">
          <div class="header-left">
            <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse" style="height:30px;"></el-button>
            <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse"
              style="height:30px;"></el-button>
          </div>
          <!-- <div class="tagContainer" style="display: flex;">
  <tag v-for="(tag, index) in tags" :key="index" :tag="tag" @removeTag="removeTag(index)" @switchTag="switchTag(index)"></tag>
</div> -->
          <template>
            <el-submenu index="1" class="custom-submenu"  >
            <el-submenu index="1" class="custom-submenu">
              <template slot="title">
                <el-avatar src="../assets/emi.png"   style="width:20px;height:20px;margin-top:30px;background-color: white;"></el-avatar>
                <el-avatar src="../assets/emi.png"
                  style="width:20px;height:20px;margin-top:30px;background-color: white;"></el-avatar>
              </template>
              <el-menu-item index="1-1" @click="logout">{{ $t('exit') }}</el-menu-item>
              <el-menu-item index="1-2" @click="showChangePasswordDialog">{{ $t('changePassword') }}</el-menu-item>
@@ -92,10 +91,24 @@
      </el-header>
      <el-main>
        <keep-alive>
          <router-view/>
          <router-view />
        </keep-alive>
      </el-main>
    </el-container>
    <el-dialog :visible.sync="dialogFormVisible2" :title="$t('Alarm Information')">
      <el-table :data="this.alarm" border style="width: 100%;font-size: 25px;">
        <el-table-column prop="id" :label="$t('id')"></el-table-column>
        <el-table-column prop="content" :label="$t('content')"></el-table-column>
        <el-table-column prop="timeons" :label="$t('timeon')"></el-table-column>
      </el-table>
    </el-dialog>
    <el-dialog :visible.sync="dialogFormVisible3" >
      <el-button :class="{ 'blue-button': receivedData === 1 }" @click="toggleButtonValue(1)">{{ $t('A01Abort/ResumeTasks') }}</el-button>
    <el-button :class="{ 'blue-button': receivedData2 === 1 }" @click="toggleButtonValue(2)">{{ $t('A02Abort/ResumeTasks') }}</el-button>
    </el-dialog>
  </el-container>
</template>
@@ -107,6 +120,7 @@
// import { mapState, mapMutations } from 'vuex';
// import Tag from '../layout/tag.vue';
// import store from '../store';
let socket;
export default {
  name: "Layout",
@@ -116,6 +130,8 @@
    return {
      activeTag: '', // 当前激活的标签
      dialogVisible: false,
      receivedData:0,
      receivedData2:0,
      formData: {
        oldPassword: '',
        newPassword: '',
@@ -128,7 +144,11 @@
      menuListForm: {
        pageSize: 1,
        pageNum: -1
      }
      },
      dialogFormVisible2: false,
      dialogFormVisible3: true,
      alarm: [],
      alarm2: []
    }
  },
  // components: {
@@ -148,12 +168,104 @@
      // 记录上一次激活的菜单
      // this.activePath = window.sessionStorage.getItem('activePath')
    });
    this.init();
  },
  computed: {
    // ...mapState('tags', ['tags'])
  },
  methods: {
    toggleButtonValue(buttonNumber) {
      if (buttonNumber === 1) {
        this.receivedData = this.receivedData === 0 ? 1 : 0;
      } else if (buttonNumber === 2) {
        this.receivedData2 = this.receivedData2 === 0 ? 1 : 0;
      }
console.log(this.receivedData,this.receivedData2)
        const data3 = [];
        const resetButtonValues3 = [this.receivedData,this.receivedData2];
        // 将得到的值添加到 data 数组中
        data3.push(resetButtonValues3.flat());
        // 在 data3 数组前面添加两个空数组
        // 创建 jsonObject3 对象,并添加 data3 属性
        const jsonObject3 = { data: data3 };
        // 提交数据到后端
        const jsonString3 = JSON.stringify(jsonObject3);
        console.log("急停后中止/继续选择:", jsonString3);
        socket?.send(jsonString3);
        // setTimeout(()=>
        //   window.location.reload(),2000
        // )
    },
    init() {
      let viewname = "Home";
      if (typeof (WebSocket) == "undefined") {
        console.log("您的浏览器不支持WebSocket");
      } else {
        //console.log("您的浏览器支持WebSocket");
        let socketUrl = "ws://" + this.$t('ip') + ":8888" + "/springboot-vue3/api/talk/" + viewname;
        if (socket != null) {
          socket.close();
          socket = null;
        }
        // 开启一个websocket服务
        socket = new WebSocket(socketUrl);
        //打开事件
        socket.onopen = function () {
          console.log("websocket已打开");
        };
        //  浏览器端收消息,获得从服务端发送过来的文本消息
        socket.onmessage = function (msg) {
          //console.log("收到数据====" + msg.data);
          let obj = JSON.parse(msg.data);
          if (obj.alarmmg[0].length > 0) {
            if (this.alarm.length > 0) {
              if (this.alarm[this.alarm.length - 1].id != obj.alarmmg[0][obj.alarmmg[0].length-1].id) {
                this.alarm = obj.alarmmg[0];
                this.dialogFormVisible2 = true;
              }
            } else {
              this.alarm = obj.alarmmg[0];
              this.dialogFormVisible2 = true;
            }
          }
          this.$forceUpdate();
          if (obj.Abort[0].length > 0) {
            this.receivedData=obj.Abort[0][0];
            this.receivedData2=obj.Abort[0][1];
            this.dialogFormVisible3 = true;
          }
        }.bind(this);
        //关闭事件
        socket.onclose = function () {
          console.log("websocket已关闭");
        };
        //发生了错误事件
        socket.onerror = function () {
          console.log("websocket发生了错误");
        }
      }
    },
    logout: function () {
      removeToken()
      this.$router.push('/login')
@@ -161,19 +273,19 @@
    goToHome() {
      this.$router.push('/home');
    },
    // ...mapMutations('tags', ['addTag', 'removeTag', 'switchTag']),
    addTag() {
  // let submenuItem;
  // const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === router));
  // if (menuItem) {
  //   submenuItem = menuItem.menuLists.find(menu => menu.router === router);
  // }
  // if (submenuItem) {
  //   const tag = submenuItem.router;
  //   this.$store.commit('tags/addTag', tag);
  // }
},
      // let submenuItem;
      // const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === router));
      // if (menuItem) {
      //   submenuItem = menuItem.menuLists.find(menu => menu.router === router);
      // }
      // if (submenuItem) {
      //   const tag = submenuItem.router;
      //   this.$store.commit('tags/addTag', tag);
      // }
    },
    removeTag() {
      // this.$store.commit('tags/removeTag', index); // 从 Vuex Store 中移除标签
@@ -188,13 +300,13 @@
        this.$message.error('新密码与确认密码不一致');
        return;
      }
      changePassword({oldPassword, newPassword}).then(res => {
      changePassword({ oldPassword, newPassword }).then(res => {
        console.log(res.data);
        this.$message.success('密码修改成功');
        removeToken()
        this.$router.push('/login')
      }).catch(() => {
      });
      this.dialogVisible = false;
@@ -217,7 +329,7 @@
        '角色管理': 'RoleManagement',
        '角色列表': 'RoleList',
        '电气管理': 'Electrical management',
        '设备状态':'State',
        '设备状态': 'State',
        '主页': 'Home'
        // 根据实际需求继续添加对照关系
@@ -244,69 +356,74 @@
</script>
<style scoped lang="less">
.el-menu--horizontal > .el-submenu .el-submenu__title {
.el-menu--horizontal>.el-submenu .el-submenu__title {
  height: 45px !important;
}
.custom-submenu  {
 height: 90px   !important;
.custom-submenu {
  height: 90px !important;
}
.header-container {
 height: 30px   !important; /* 设置较小的高度 */
  height: 30px !important;
  /* 设置较小的高度 */
}
.header-left {
 margin-right: auto;
width:30px;
  margin-right: auto;
  width: 30px;
}
.el-aside {
 height: 100vh;
 background-color: #222f3e;
 line-height: 200px;
  height: 100vh;
  background-color: #222f3e;
  line-height: 200px;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
 width: 200px;
 min-height: 400px;
  width: 200px;
  min-height: 400px;
}
.el-menu-demo {
 display: flex;
 width: 100%;
 height: 100%;
 justify-content: flex-end;
 align-items: center;
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: flex-end;
  align-items: center;
}
.el-menu-vertical-demo {
 border: 0;
  border: 0;
}
.logo {
 background-color: #222f3e;
 display: flex;
 justify-content: center;
 align-items: center;
 height: 60px;
  background-color: #222f3e;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60px;
 .sys-name {
   font-size: 20px;
   color: #ffffff;
   margin-left: 10px;
 }
  .sys-name {
    font-size: 20px;
    color: #ffffff;
    margin-left: 10px;
  }
}
.blue-button {
  background-color: green;
  color: white;
}
.el-header {
 background-color: #576574;
  background-color: #576574;
}
</style>
CanadaMes-ui/src/views/home/index.vue
@@ -46,8 +46,8 @@
    background-color: blue;
}
.red {
    background-color: red;
.black {
    background-color: black;
}
.yellow {
@@ -155,7 +155,7 @@
.box {
    width: 90%;
    margin-left: 5%;
    color: red;
    color: black;
    font-size: 12px;
    overflow: hidden;
    height: 20px;
@@ -643,13 +643,15 @@
            <el-button type="primary" @click="isAllowQueueState()" :disabled="!this.isAllowReordering">{{ this.isAllowQueue
                == true ? $t('Start') : $t('Stop')
            }}</el-button>
            <el-button type="primary" @click="isAllowReorderingState()" :disabled="this.isAllowQueue">{{
            <el-button type="primary" @click="isAllowReorderings()" :disabled="this.isAllowQueue">{{
                this.isAllowReordering == true ? $t('Not Allow') : $t('Allow')
            }}</el-button>
            <el-input style="width:15%;" :placeholder="$t('Enter the Frame No')" v-model="framebarcode"></el-input>
            <el-button type="primary" @click="AddOutSliceS()">{{ $t('Add') }}</el-button>
            <el-table :data="this.OutSlice" :height="700" :span-method="objectSpanMethod" border :cell-style="cellStyle"
                style="width: 100%;overflow: auto;font-size: 18px;">
                <el-table-column :min-width="175" prop="glassId" :label="$t('Barcode')"></el-table-column>
                <el-table-column :min-width="90" prop="orderId" :label="$t('Order No')"></el-table-column>
                <el-table-column :min-width="100" prop="orderId" :label="$t('Order No')"></el-table-column>
                <el-table-column :min-width="70" prop="listId" :label="$t('List No')"></el-table-column>
                <el-table-column :min-width="70" prop="boxId" :label="$t('Box No')"></el-table-column>
                <el-table-column :min-width="100" prop="glasswidthmm" :label="$t('Length')"></el-table-column>
@@ -657,14 +659,14 @@
                <el-table-column :min-width="90" prop="state" :label="$t('Glass State')">
                    <template slot-scope='scope'>
                        {{ scope.row.state == 0 ? $t('Waiting') : scope.row.state == 1 ? $t('Outing') : scope.row.state == 2
                            ? $t('Completed') : scope.row.state == 3 ? $t('Absent') : $t('Deleted') }}
                            ? $t('Outed') : scope.row.state == 3 ? $t('Absent') : $t('Completed') }}
                    </template>
                </el-table-column>
                <el-table-column prop="sequence" :label="$t('Sequence')"></el-table-column>
                <el-table-column :min-width="90" prop="barcode" :label="$t('Complete')">
                    <template slot-scope='scope' style="height:100px;height:100px;">
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            :disabled="!(!isAllowQueue && scope.row.state != 2&&scope.row.state != 4)"
                            :disabled="!(!isAllowQueue && scope.row.state != 2 && scope.row.state != 4)"
                            @click="CompleteQueue(scope.row.id, scope.row.barcode, scope.row.glassId)">{{ $t('Complete')
                            }}</el-button>
                    </template>
@@ -688,7 +690,7 @@
                <el-table-column prop="barcode" :label="$t('Frame No')"></el-table-column>
                <el-table-column :width="280" :label="$t('Operate')">
                <el-table-column :width="200" :label="$t('Operate')">
                    <template slot-scope='scope'>
                        <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)"
                            style="font-size: 15px;"
@@ -749,7 +751,6 @@
                </el-table-column>
            </el-table>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormCountDown" :title="$t('Approximately resettable time')" top="5vh">
            <div :style="'font-size: ' + PromptSize + 'px;text-align: center;'">
                <!-- {{ this.CountDowns }} -->
@@ -763,7 +764,8 @@
import {
    home, home2, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist,
    SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState, DeleteQueueGlass, SelectGlassNo,
    SelectAluminumFrameInfoById, DeleteProductionQueueGlass, AddOutSliceS, isAllowQueues, isConfirmStates, SelectPermissionByUserName, currentUsername, CompleteQueue
    SelectAluminumFrameInfoById, DeleteProductionQueueGlass, AddOutSliceS, isAllowQueues, isConfirmStates, SelectPermissionByUserName, currentUsername, CompleteQueue,
    isAllowReorderings
} from "../../api/home";
@@ -897,12 +899,16 @@
                    this.cagelist4 = obj.cagelist4[0];
                    this.tasklist1 = obj.tasklist1[0];
                    this.tasklist2 = obj.tasklist2[0];
                    this.alarm = obj.alarmmg[0];
                    if (this.alarm.length > 0&&this.alarm!=obj.alarmmg[0]) {
                        this.dialogFormVisible2 = true;
                    }
                    //  else {
                    //     this.dialogFormVisible2 = false;
                    // if (obj.alarmmg[0].length > 0) {
                    //     if (this.alarm.length > 0) {
                    //         if (this.alarm[this.alarm.length - 1].id != obj.alarmmg[0][obj.alarmmg[0].length - 1].id) {
                    //             this.alarm = obj.alarmmg[0];
                    //             this.dialogFormVisible2 = true;
                    //         }
                    //     } else {
                    //         this.alarm = obj.alarmmg[0];
                    //         this.dialogFormVisible2 = true;
                    //     }
                    // }
                    //是否急停
                    if (obj.emergencystop != null) {
@@ -929,6 +935,8 @@
                    //是否允许出片
                    this.isAllowQueue = obj.isAllowQueue[0];
                    //是否允许出片队列调序
                    this.isAllowReordering = obj.isAllowReordering[0];
                    //出片队列
                    if (this.isAllowReordering == true) {
                        this.OutSlice = obj.listoutslice[0];
@@ -1061,7 +1069,7 @@
            } else if (state == 2) {
                return "yellow gezi";
            } else if (state == 3) {
                return "red gezi";
                return "black gezi";
            } else {
                return "black gezi";
            }
@@ -1079,7 +1087,6 @@
                    this.load();
                });
            }
        },
        //手动上片
        sbumitglassid() {
@@ -1504,19 +1511,24 @@
            this.AluminumFrame.forEach(item => { item.barcode = glassid; item.isCheck = isChecked })
        },
        //添加到出片队列
        addoutslice() {
            var dats_ = new Array();
            this.AluminumFrame.forEach(item => {
                var dats2_ = new Array();
                dats2_[0] = item.barcode;
                dats2_[1] = item.isCheck;
                dats2_[2] = item.Flip;
                dats2_[3] = item.FrameNo;
                dats2_[4] = item.glasslengthmm;
                dats2_[5] = item.glassheightmm;
                dats_[dats_.length] = dats2_;
            });
            AddOutSliceS(dats_).then(res => {
        AddOutSliceS() {
            // var dats_ = new Array();
            // this.AluminumFrame.forEach(item => {
            //     var dats2_ = new Array();
            //     dats2_[0] = item.barcode;
            //     dats2_[1] = item.isCheck;
            //     dats2_[2] = item.Flip;
            //     dats2_[3] = item.FrameNo;
            //     dats2_[4] = item.glasslengthmm;
            //     dats2_[5] = item.glassheightmm;
            //     dats_[dats_.length] = dats2_;
            // });
            // AddOutSliceS(dats_).then(res => {
            //     if (res.data.message == 200) {
            //         this.$message.success(this.$t('Operation successful'));
            //     }
            // });
            AddOutSliceS(this.framebarcode).then(res => {
                if (res.data.message == 200) {
                    this.$message.success(this.$t('Operation successful'));
                }
@@ -1641,9 +1653,13 @@
                }
            })
        },
        //
        isAllowReorderingState() {
            this.isAllowReordering = !this.isAllowReordering;
        //是否允许出片队列排序
        isAllowReorderings() {
            isAllowReorderings(!this.isAllowReordering, this.OutSlice).then(res => {
                if (res.data.message == 200) {
                    this.$message.success(this.$t('Operation successful'));
                }
            })
        },
        //切换上片是否需要确认玻璃信息
        isConfirmState() {
@@ -1654,8 +1670,8 @@
            });
        }
        ,
        cellStyle({  column, rowIndex, columnIndex }) {
            // console.log(row, column, "ss");
        //表格样式
        cellStyle({ column, rowIndex, columnIndex }) {
            column = rowIndex;
            rowIndex = column;
            let style = "";
@@ -1753,8 +1769,8 @@
                }
            });
        },
        //45秒复位倒数计时
        CountDown() {
            //50秒倒数计时
            let count = 45;
            let timer = setInterval(
                () => {
@@ -1767,6 +1783,7 @@
                            this.PromptSize = 500;
                            this.CountDowns = count;
                            count--;
                            this.dialogFormCountDown = true;
                        }
                        else {
                            this.PromptSize = 200;
@@ -1780,7 +1797,7 @@
                },
                1000
            );
            this.dialogFormCountDown = true;
        }
    }
}
springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
@@ -28,7 +28,7 @@
    FileInputStream fileInputStream;
    try {
      // 从文件中读取字节数据存入 fileInputStream
      fileInputStream = new FileInputStream("D:/canadames/Alarm.json");
      fileInputStream = new FileInputStream("D:/Code/canadames/Alarm.json");
      // 读取 fileInputStream 中字节并将其解码为字符
      InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
      // 提高读取效率,在 BufferedReader 内包装 InputStreamReader
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -2,8 +2,10 @@
import cn.hutool.json.JSONObject;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,10 +32,20 @@
    private JdbcConnections dbserve;
    // 出片队列是否允许出片
    public static Boolean isAllowQueue = true;
    public static Boolean isAllowReordering = true;
    // 铝框id
    public static String FrameNo="";
    // 是否需要手动确认玻璃
    public static Boolean isConfirm = false;
    private Configuration config;
    public Plchome() throws IOException {
        config = new Configuration("config.properties");
    }
    // public static Map b=new HashMap<>();
    // b.put()
@@ -92,8 +104,10 @@
            // 获取出片队列信息
            List<Out_slice> listoutslice = outSliceServive.SelectProductionqueue();
            jsonObject.append("listoutslice", listoutslice);
            // 获取当前出片队列状态
            // 获取当前出片队列出片状态
            jsonObject.append("isAllowQueue", Plchome.isAllowQueue);
            // 获取当前出片队列调序状态
            jsonObject.append("isAllowReordering", Plchome.isAllowReordering);
            // 是否需要人工确认上片玻璃
            jsonObject.append("isConfirm", isConfirm);
@@ -155,6 +169,16 @@
                 jsonObject.append("emergencystop", emergencystop);
             }
             //终止继续按钮
            List<String> niuanaddressList3 = Arrays.asList(config.getProperty("Parameter2.stop").split(","));
            List<Boolean> anniuread = S7control.getinstance().readBits(niuanaddressList3);
            short[] anniuparams = new short[anniuread.size()];
            for (int i = 0; i < anniuread.size(); i++) {
                boolean value = anniuread.get(i);
                anniuparams[i] = value ? (short) 1 : (short) 0;
            }
            jsonObject.append("Abort", anniuparams);
            // 铝框线交互
            // //铝框id请求字
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -5,44 +5,30 @@
import java.util.List;
import java.util.Map;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import com.example.springboot.mapper.HomeMapper;
import com.example.springboot.mapper.SpianMapper;
import com.example.springboot.security.constant.SystemConstant;
import com.example.springboot.security.util.JwtUtil;
import com.example.springboot.security.util.SecurityUtil;
import com.example.springboot.service.HomeService;
import com.example.springboot.service.JdbcConnections;
import com.example.springboot.service.North_Glass_Buffer1Service;
import com.example.springboot.service.OutSliceServive;
import com.example.springboot.service.PermissionService;
import com.example.springboot.service.SpianService;
import com.example.springboot.service.StorageCageService;
import cn.hutool.core.util.StrUtil;
import com.example.springboot.common.Result;
import com.example.springboot.component.Plchome;
import com.example.springboot.component.S7control;
import com.example.springboot.entity.CarPosition;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.StorageTask;
import com.example.springboot.entity.User;
import com.example.springboot.entity.alarmmg;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.entity.Out_slice;
import com.example.springboot.entity.Permission;
import com.example.springboot.entity.Queue;
import com.example.springboot.entity.RolePermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@RestController
@RequestMapping("/home")
@@ -95,7 +81,6 @@
  // 查询理片笼玻璃情况
  @GetMapping("/loads")
  public Result selectRack() {
    List<StorageCage> storageCagelist1 = homeMapper.selectRack1();
    List<StorageCage> storageCagelist2 = homeMapper.selectRack2();
    List<StorageCage> storageCagelist3 = homeMapper.selectRack3();
@@ -193,7 +178,6 @@
  // 根据玻璃id手动出片
  @GetMapping("/OutByGlassID")
  public Result OutByGlassID(String glassid) throws SQLException {
    Map<String, Object> map = new HashMap<>();
    Out_slice result = homeMapper.SelectQueueByglassid(glassid);
    if (result == null) {
@@ -208,7 +192,6 @@
              sequence, position, (short) 0, north_glass_buffer1.getordernumber(), north_glass_buffer1.getlistnumber(),
              north_glass_buffer1.getboxnumber(), north_glass_buffer1.getglasslength().toString(),
              north_glass_buffer1.getglassheight().toString());
          map.put("message2", "200");
        } else {
          map.put("message2", "300");
@@ -357,18 +340,33 @@
  // 添加铝框id对应玻璃到出片队列
  @PostMapping("/AddOutSliceS")
  public Result AddOutSliceS(@RequestBody String[][] AluminumFrames) throws SQLException {
    outSliceServive.AddOutSliceS(AluminumFrames);
  public Result AddOutSliceS(String FrameNo) throws SQLException {
    //public Result AddOutSliceS(@RequestBody String[][] AluminumFrames) throws SQLException {
    north_Glass_Buffer1Service.AddOutSliceS(FrameNo);
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
    return Result.success(map);
  }
  // 修改出片队列状态与出片队列调序
  // 修改出片队列出片状态
  @PostMapping("/isAllowQueues")
  public Result isAllowQueues(Boolean isAllowQueue, @RequestBody List<Out_slice> out_slice) {
    Plchome.isAllowQueue = isAllowQueue;
    if (isAllowQueue == true) {
    // if (isAllowQueue == true) {
    //   for (Out_slice out_slice2 : out_slice) {
    //     homeMapper.UpdateOutSliceSequence(out_slice2.getGlassId(), out_slice2.getSequence());
    //   }
    // }
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
    return Result.success(map);
  }
  // 修改出片队列调序状态与出片队列调序
  @PostMapping("/isAllowReorderings")
  public Result isAllowReorderings(Boolean isAllowReordering, @RequestBody List<Out_slice> out_slice) {
    Plchome.isAllowReordering = isAllowReordering;
    if (isAllowReordering == true) {
      for (Out_slice out_slice2 : out_slice) {
        homeMapper.UpdateOutSliceSequence(out_slice2.getGlassId(), out_slice2.getSequence());
      }
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -155,7 +155,7 @@
  //查询玻璃是否已存在于出片队列
  @Select("select * from out_slice where glassid=#{getbarcode} and (state=0 or state=1 or state=2 or state=3)")
  @Select("select * from out_slice where glassid=#{getbarcode}")
  Out_slice SelectQueueByglassid(String getbarcode);
  //添加出片队列
@@ -173,23 +173,26 @@
  @Select("select rp.* from role_permission rp inner join user r on rp.role_id=r.role_id and r.username=#{username} and (permission_id=32 or permission_id=33 or permission_id=34 or permission_id=35)")
  List<RolePermission> SelectPermissionByUserName(String username);
  //完成出片任务
  @Update("update out_slice set state=2 where id=#{id}")
  @Update("update out_slice set state=4 where id=#{id}")
  void CompleteQueue(String id);
  //查询铝框id对应玻璃完成数量
  @Select("select count(*) from out_slice where barcode=#{frameid} and (state=0 or state=1 or state=3)")
  @Select("select count(*) from out_slice where barcode=#{frameid} and state!=4")
  Short SelectCountByFrameNo(String frameid);
  //删除已完成的任务
  @Update("delete from out_slice where Barcode=#{frameid}")
  @Delete("delete from out_slice where Barcode=#{frameid}")
  void CompleteQueueByFrameNo(String frameid);
  //查询笼内格子剩余宽度
  @Select("Select width from storage_cage where cage=#{cage} and cell=#{cell} limit 1")
  Double SelectCageWidth(short cage, short cell);
  @Select("update out_slice set state=3 where glassId=#{glassid} and state<3")
  //修改出片队列玻璃状态为缺失
  @Update("update out_slice set state=3 where glassId=#{glassid} and state<3")
  void UpdateOutSliceGlass(String glassid);
  //查询未完成的任务
  @Select("select * from storage_task where task_state=0 and task_type=#{task_type}")
  List<StorageTask> SelectTaskByState(int task_type);
springboot-vue3/src/main/java/com/example/springboot/service/North_Glass_Buffer1Service.java
@@ -34,7 +34,6 @@
        String flip = jdbcConnections.SelectFlipByFrameBarcode(FrameBarcode);
        String position = jdbcConnections.SelectPositionByFrameBarcode(FrameBarcode);
        int sequence = homeMapper.SelectMaxSquence();
        for (north_glass_buffer1 north_glass_buffer1 : north_glass_buffer1s) {
            Short state = 0;
            if (north_glass_buffer1.getOut_slice() == null) {
springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
@@ -6,11 +6,9 @@
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoProperties.Storage;
import org.springframework.stereotype.Service;
import com.example.springboot.common.Result;
import com.example.springboot.component.S7control;
import com.example.springboot.entity.Out_slice;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.mapper.HomeMapper;
@@ -26,8 +24,6 @@
  @Autowired
  SpianService spianService;
  @Autowired
  private JdbcConnections jdbcConnections;
  public void AddOutSliceS(String[][] AluminumFrames) throws SQLException {
    // int sequence = homeMapper.SelectMaxSquence();
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -313,12 +313,12 @@
        spianMapper.UpdateCageadd(glassid, 1);// 更改笼子表进片状态
        String barcode = spianMapper.SelectBarcode(glassid);// 获取该玻璃的铝框id
        spianMapper.UpdateAddQueue(glassid);// 把进片的玻璃更新到出片队列中
//        if (barcode != null) {
//            int barcodeState = spianMapper.SelectOverState(barcode);// 获取该铝框的状态
//            if (barcodeState == 0) {// 当该铝框所有的玻璃都是完成状态时删除在出片队列的数据
//                spianMapper.DeleteQueue(barcode);
//            }
//        }
        // if (barcode != null) {
        //     int barcodeState = spianMapper.SelectOverState(barcode);// 获取该铝框的状态
        //     if (barcodeState == 0) {// 当该铝框所有的玻璃都是完成状态时删除在出片队列的数据
        //         spianMapper.DeleteQueue(barcode);
        //     }
        // }
    }
}