clll
2023-11-27 1de312a18d164c2fa3718a1a975b8c5804723bcf
Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

# Conflicts:
# .vscode/launch.json
# .vscode/settings.json
# CanadaMes-ui/src/configuration/Positioning1.json
# CanadaMes-ui/src/configuration/parameter2.json
# CanadaMes-ui/src/views/Electrical/Parameter2.vue
# CanadaMes-ui/src/views/Electrical/ServoManualone.vue
# springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter1.java
# springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
29个文件已修改
4个文件已添加
3400 ■■■■■ 已修改文件
.vscode/launch.json 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/settings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/api/home.js 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/configuration/Positioning1.json 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/configuration/parameter2.json 192 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter2.vue 300 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/ServoManualone.vue 358 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Sign.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/State.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/alarm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 564 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 238 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter1.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcPositioning1.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcPositioning2.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcServoManualone.java 238 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/S7control.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/Out_slice.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/StorageCage.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/north_glass_buffer1.java 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/out_slice.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java 294 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/security/config/ShiroConfig.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/OutSlice.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/launch.json
@@ -1,28 +1,28 @@
{
  // 使用 IntelliSense 了解相关属性。
  // 悬停以查看现有属性的描述。
  // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "java",
      "name": "Current File",
      "request": "launch",
      "mainClass": "${file}"
    },
    {
      "type": "java",
      "name": "MyGenerator",
      "request": "launch",
      "mainClass": "MyGenerator",
      "projectName": "canadames"
    },
    {
      "type": "java",
      "name": "AuthorityApplication",
      "request": "launch",
      "mainClass": "com.example.springboot.AuthorityApplication",
      "projectName": "canadames"
    }
  ]
    // 使用 IntelliSense 了解相关属性。
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Current File",
            "request": "launch",
            "mainClass": "${file}"
        },
        {
            "type": "java",
            "name": "MyGenerator",
            "request": "launch",
            "mainClass": "MyGenerator",
            "projectName": "springboot-vue3"
        },
        {
            "type": "java",
            "name": "AuthorityApplication",
            "request": "launch",
            "mainClass": "com.example.springboot.AuthorityApplication",
            "projectName": "springboot-vue3"
        }
    ]
}
.vscode/settings.json
@@ -1,3 +1,3 @@
{
  "java.configuration.updateBuildConfiguration": "interactive"
    "java.configuration.updateBuildConfiguration": "interactive"
}
CanadaMes-ui/src/api/home.js
@@ -154,4 +154,44 @@
        method: 'post',
        data: ""
    })
}
}
export function SelectGlassNo(orderid) {
    return request({
        url: '/home/SelectGlassNo?orderid=' + orderid,
        method: 'post',
        data: ""
    })
}
export function SelectAluminumFrameInfoById(FrameBarcode) {
    return request({
        url: '/home/SelectAluminumFrameInfoById?FrameBarcode=' + FrameBarcode,
        method: 'post',
        data: ""
    })
}
export function SelectProductionqueue() {
    return request({
        url: '/home/SelectProductionqueue',
        method: 'post',
        data: ""
    })
}
export function DeleteProductionQueueGlass(id) {
    return request({
        url: '/home/DeleteProductionQueueGlass?id='+id,
        method: 'post',
        data: ""
    })
}
export function AddOutSliceS(data) {
    return request({
        url: '/home/AddOutSliceS',
        method: 'post',
        data
    })
}
CanadaMes-ui/src/configuration/Positioning1.json
@@ -1,4 +1,12 @@
[
  [{
    "name": "格子间距",
    "read": 33,
    "sending": 0,
    "type": "0",
    "value":"0"
  }],
    [{
      "name": "存片接片地址",
      "read": 33,
@@ -15,14 +23,7 @@
      "value":"0"
      
    }],
    [{
      "name": "格子间距",
      "read": 33,
      "sending": 0,
      "type": "0",
      "value":"0"
    }],
    [
        {
CanadaMes-ui/src/configuration/parameter2.json
@@ -3,7 +3,7 @@
    [
      {
        "button": {
          "name": "D03手动状态",
          "name": "D01手动状态",
          "value":0,
      "address":"DB10.0"
      },"type": "4"
@@ -26,7 +26,7 @@
      ,[
      {
        "button": {
          "name": "D04手动状态",
          "name": "D02手动状态",
          "value":0,
      "address":"DB10.0"
      },"type": "4"
@@ -50,6 +50,57 @@
    ,[
      {
        "button": {
          "name": "D03手动状态",
          "value":0,
      "address":"DB10.0"
      },"type": "4"
      },
      {
        "button": {
          "name": "清除ID",
          "value":0,
      "address":"DB10.0"
        },"type": "3"
      },
      {
        "name": "ID",
        "read": 33,
        "sending": 0,
        "type": "0",
        "value":0
      }
    ]
    ,[
      {
        "button": {
          "name": "D04手动状态",
          "value":0,
      "address":"DB10.0"
      },"type": "4"
      },
      {
        "button": {
          "name": "清除ID",
          "value":0,
      "address":"DB10.0"
        },"type": "3"
      },
      {
        "name": "ID",
        "read": 33,
        "sending": 0,
        "type": "0",
        "value":0
      }
    ]
     ,[
      {
        "button": {
          "name": "D05手动状态",
          "value":0,
      "address":"DB10.0"
@@ -70,6 +121,8 @@
        "value":0
   
      }
    ]
    ,[
      {
@@ -96,9 +149,41 @@
      }
      
     
    ] ,[
      {
        "button": {
          "name": "A01手动状态",
          "value":0,
      "address":"DB10.0"
      },"type": "4"
      },
      {
        "button": {
          "name": "清除ID",
          "value":0,
      "address":"DB10.0"
        },"type": "3"
      },
      {
        "name": "ID1",
        "read": 33,
        "sending": 0,
        "type": "0",
        "value":0
      },{
        "name": "ID2",
        "read": 33,
        "sending": 0,
        "type": "0",
        "value":0
      }
    ]
     ,[
    ,[
      {
        "button": {
          "name": "A02手动状态",
@@ -130,7 +215,7 @@
          "name": "B01手动状态",
          "value":0,
      "address":"DB10.0"
      },"type": "4"
        },"type": "4"
      },
      {
        "button": {
@@ -149,7 +234,7 @@
      }
      
     
    ] ,[
    ],[
      {
        "button": {
          "name": "B02手动状态",
@@ -173,91 +258,6 @@
   
      }
      
    ]
    ,[
      {
        "button": {
          "name": "D01手动状态",
          "value":0,
      "address":"DB10.0"
      },"type": "4"
      },
      {
        "button": {
          "name": "清除ID",
          "value":0,
      "address":"DB10.0"
        },"type": "3"
      },
      {
        "name": "ID",
        "read": 33,
        "sending": 0,
        "type": "0",
        "value":0
      }
    ]
    ,[
      {
        "button": {
          "name": "D02手动状态",
          "value":0,
      "address":"DB10.0"
        },"type": "4"
      },
      {
        "button": {
          "name": "清除ID",
          "value":0,
      "address":"DB10.0"
        },"type": "3"
      },
      {
        "name": "ID",
        "read": 33,
        "sending": 0,
        "type": "0",
        "value":0
      }
    ],[
      {
        "button": {
          "name": "A01手动状态",
          "value":0,
      "address":"DB10.0"
      },"type": "4"
      },
      {
        "button": {
          "name": "清除ID",
          "value":0,
      "address":"DB10.0"
        },"type": "3"
      },
      {
        "name": "ID1",
        "read": 33,
        "sending": 0,
        "type": "0",
        "value":0
      },
      {
        "name": "ID2",
        "read": 33,
        "sending": 0,
        "type": "0",
        "value":0
      }
      
     
    ]
@@ -265,7 +265,7 @@
    ,[
      {
        "name": "扫描枪扫码的ID",
        "read": 33,
        "read": 66,
        "sending": 0,
        "type": "0",
        "value":0
@@ -277,7 +277,7 @@
    ,[
      {
        "name": "A01当前格子",
        "read": 33,
        "read": 333,
        "sending": 0,
        "type": "0",
        "value":0
@@ -285,7 +285,7 @@
      },
      {
        "name": "A02所在格子",
        "read": 33,
        "read": 333,
        "sending": 0,
        "type": "0",
        "value":0
@@ -293,7 +293,7 @@
      },
      {
        "name": "B01所在格子",
        "read": 33,
        "read": 333,
        "sending": 0,
        "type": "0",
        "value":0
@@ -301,7 +301,7 @@
      },
      {
        "name": "B02所在格子",
        "read": 33,
        "read": 333,
        "sending": 0,
        "type": "0",
        "value":0
CanadaMes-ui/src/lang/locales/en-US.json
@@ -227,8 +227,8 @@
"deleteCancelledMessage": "Deletion cancelled",
  "Enter the glass lD":"Enter the glass lD",
  "Infeed barcodid":"Infeed barcodid",
  "Enter the glass barcode":"Enter the glass barcode",
  "Manually Infeed Glass":"Manually Infeed Glass",
  "Enter the order number":"Enter the order number",
  "Exit the glass by order number":"Exit the glass by order number",
  "Please confirm the glass information":"Please confirm the glass information",
@@ -236,33 +236,30 @@
  "Alarm Information":"Alarm Information",
  "Cage Details":"Cage Details",
  "order":"order",
  "length":"length",
  "width":"width",
  "Length":"Length",
  "Width":"Width",
  "Operate":"Operate",
  "end task":"end task",
  "Terminate Task":"Terminate Task",
  "cancel":"cancel",
  "confirm":"confirm",
  "number":"number",
  "Outfeed Barcodid":"Outfeed Barcodid",
  "Infeed Barcodid":"Infeed Barcodid",
  "The Cage number being used":"The Cage Number being used",
  "The Slot number being used":"The Slot Number being used",
  "Order Nmuber":"Order Nmuber",
  "Length and Width":"Length and Width",
  "Number":"Number",
  "Outfeed glass barcode":"Outfeed glass barcode",
  "Infeed glass barcode":"Infeed glass barcode",
  "Cage No":"Cage No",
  "Slot No":"Slot No",
  "Dim":"Dim",
  "id":"id",
  "content":"content",
  "timeon":"timeon",
  "endTime":"endTime",
  "The Cage number":"The Cage number",
  "The Side":"The Side",
  "The Slot Number":"The Slot Number",
  "Barcodid":"Barcodid",
  "Order Number":"Order Number",
  "List Number":"List Number",
  "Box Number":"Box Number",
  "delete":"delete",
  "out":"out",
  "barcode":"barcode",
  "Order No":"Order No",
  "List No":"List No",
  "Box No":"Box No",
  "Delete":"Delete",
  "Out":"Out",
  "Operation successful":"Operation successful",
  "Operation canceled":"Operation canceled",
@@ -273,7 +270,6 @@
  "No delete allowed":"No delete allowed",
  "No out allowed":"No out allowed",
  "Are you sure to perform this operation ?":"Are you sure to perform this operation ?",
  "prompt":"prompt",
  "Yes":"Yes",
  
@@ -283,13 +279,13 @@
  "DataBase Connection failed":"DataBase Connection failed",
  "Distribute parameters":"Distribute parameters",
  "The glass size is not within the range":"The glass size is not within the range",
  "increase":"increase",
  "Increase":"Increase",
  "Enable":"Enable",
  "Disable":"Disable",
  "Usage":"Usage",
  "Space (Pieces)":"Space (Pieces)",
  "This glass is already in the cage":"This glass is already in the cage",
  "Enter the Order lD":"Enter the Order lD",
  "Enter the Order No":"Enter the Order No",
  "OrderInfo":"OrderInfo",
  "Query":"Query",
  "permission update":"permission update",
@@ -302,6 +298,13 @@
  "Clear Current":"Clear Current",
  "Confirm Modification":"Confirm modification",
  "The glass ID already exists in the loading queue":"The glass ID already exists in the loading queue",
  "This glass ID already exists in the sorting cage":"This glass ID already exists in the sorting cage"
  "This glass ID already exists in the sorting cage":"This glass ID already exists in the sorting cage",
  "Production queue":"Production queue",
  "Enter the Frame No":"Enter the Frame No",
  "Frame No":"Frame No",
  "Glass information corresponding to aluminum frame":"Glass information corresponding to aluminum frame",
  "In the cage":"In the cage",
  "Flip":"Flip",
  "In the queue":"In the queue"
}
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -215,8 +215,8 @@
  "cancelButtonText": "取消",
  "deleteSuccessMessage": "删除成功",
  "deleteCancelledMessage": "已取消删除操作",
  "Enter the glass lD": "输入玻璃id",
  "Infeed barcodid": "手动上片",
  "Enter the glass barcode": "输入玻璃id",
  "Infeed Barcodeid": "手动上片",
  "Enter the order number": "输入订单号",
  "Exit the glass by order number": "按订单出片",
  "Please confirm the glass information": "请确认玻璃信息",
@@ -224,32 +224,28 @@
  "Alarm Information": "报警信息",
  "Cage Details": "理片笼详情",
  "order": "订单",
  "length": "长",
  "width": "宽",
  "Length": "长",
  "Width": "宽",
  "Operate": "操作",
  "Terminate Task":"结束任务",
  "end task": "完成任务",
  "cancel": "取消",
  "confirm": "确认",
  "number": "数量",
  "Outfeed Barcodid": "出片玻璃id",
  "Infeed Barcodid": "进片玻璃id",
  "The Cage number being used": "笼子",
  "The Slot number being used": "格子",
  "Order Nmuber": "订单编号",
  "List Number": "列表编号",
  "Box Number": "箱子编号",
  "Length and Width": "尺寸",
  "Number": "数量",
  "Outfeed glass barcode": "出片玻璃id",
  "Infeed glass barcode": "进片玻璃id",
  "Order No": "订单编号",
  "List No": "列表编号",
  "Box No": "箱子编号",
  "Dim": "尺寸",
  "id": "id",
  "content": "内容",
  "timeon": "报警时间",
  "endTime": "结束时间",
  "The Cage number": "笼子",
  "Cage No": "笼子",
  "The Side": "内外侧",
  "The Slot Number": "格子",
  "Barcodid": "玻璃id",
  "Order Number": "订单",
  "delete": "删除",
  "out": "出片",
  "Slot No": "格子",
  "Barcode": "玻璃id",
  "Delete": "删除",
  "Out": "出片",
  "Operation successful": "操作成功",
  "Operation canceled": "操作取消",
  "There is no such order": "没有此订单的玻璃",
@@ -276,13 +272,13 @@
  "DataBase Connection failed": "数据库连接失败",
  "Distribute parameters": "下发参数",
  "The glass size is not within the range": "玻璃尺寸不在范围内",
  "increase": "添加",
  "Increase": "添加",
  "Enable": "启用",
  "Disable": "禁用",
  "Usage": "使用率",
  "Space (Pieces)": "空间(片数)",
  "This glass is already in the cage": "笼子里已有此玻璃",
  "Enter the Order lD": "请输入订单id",
  "Enter the Order No": "请输入订单id",
  "OrderInfo": "订单信息",
  "Query": "查询",
  "permission update": "权限编辑",
@@ -296,6 +292,15 @@
  "Confirm Modification": "确认修改",
  "The glass ID already exists in the loading queue": "上片队列已存在此玻璃id",
  "This glass ID already exists in the sorting cage": "理片笼内已存在此玻璃id",
  "Production queue":"上片队列",
  "Enter the Aluminum Frame No":"请输入铝框id",
  "Frame No":"铝框id",
  "Glass information corresponding to aluminum frame":"铝框对应的玻璃信息",
  "In the cage":"在笼内",
  "Flip":"翻转",
  "In the queue":"在队列",
  "Enter the Frame No":"请输入铝框id",
  "Manually Infeed Glass":"手动进片",
  "langparameter": {
    "conveyor Velocity(Auto FAST)": "D01-D06 皮带输送自动快速",
    "conveyor Velocity(Auto SLOW)": "D01-D06 皮带输送自动慢速",
CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -12,6 +12,8 @@
      }}</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
      }}</router-link>
       <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual')
        }}</router-link>
    </el-breadcrumb>
    <div>Parameter</div>
@@ -57,18 +59,18 @@
      record: {
        params: [100, 200, 10, 10, 10, 10],
        xyData: [
          { name: "conveyor Velocity(Auto FAST)", value: 0, value2: 1, unit: "m/min" },
          { name: "conveyor Velocity(Auto SLOW)", value: 0, value2: 1, unit: "m/min" },
          { name: "conveyor Velocity(Manual)", value: 0, value2: 1, unit: "m/min" },
          { name: "A01 A02 TURN JOG Velocity", value: 0, value2: 1, unit: "mm/S" },
          { name: "A01 A02 TRAVEL JOG Velocity", value: 0, value2: 1, unit: "mm/S" },
          { name: "B01 B02 TRAVEL JOG Velocity", value: 0, value2: 1, unit: "mm/S" },
          { name: "A01 A02 TURN POS Velocity AUTO", value: 0, value2: 1, unit: "mm/S" },
          { name: "A01 A02 TURN POS Velocity manual", value: 0, value2: 1, unit: "mm/S" },
          { name: "A01 A02 TRAVEL POS Velocity AUTO", value: 0, value2: 1, unit: "mm/S" },
          { name: "A01 A02 TRAVEL POS Velocity manual", value: 0, value2: 1, unit: "mm/S" },
          { name: "B01 B02 TRAVEL POS Velocity AUTO", value: 0, value2: 1, unit: "mm/S" },
          { name: "B01 B02 TRAVEL POS Velocity manual", value: 0, value2: 1, unit: "mm/S" }
          { name: "conveyor Velocity(Auto FAST)", value: 0, value2: 0, unit: "m/min" },
          { name: "conveyor Velocity(Auto SLOW)", value: 0, value2: 0, unit: "m/min" },
          { name: "conveyor Velocity(Manual)", value: 0, value2: 0, unit: "m/min" },
          { name: "A01 A02 TURN JOG Velocity", value: 0, value2: 0, unit: "mm/S" },
          { name: "A01 A02 TRAVEL JOG Velocity", value: 0, value2: 0, unit: "mm/S" },
          { name: "B01 B02 TRAVEL JOG Velocity", value: 0, value2: 0, unit: "mm/S" },
          { name: "A01 A02 TURN POS Velocity AUTO", value: 0, value2: 0, unit: "mm/S" },
          { name: "A01 A02 TURN POS Velocity manual", value: 0, value2: 0, unit: "mm/S" },
          { name: "A01 A02 TRAVEL POS Velocity AUTO", value: 0, value2: 0, unit: "mm/S" },
          { name: "A01 A02 TRAVEL POS Velocity manual", value: 0, value2: 0, unit: "mm/S" },
          { name: "B01 B02 TRAVEL POS Velocity AUTO", value: 0, value2: 0, unit: "mm/S" },
          { name: "B01 B02 TRAVEL POS Velocity manual", value: 0, value2: 0, unit: "mm/S" }
        ],
        canshu: []
      },
@@ -218,6 +220,10 @@
  border: 1px solid black;
  border: none;
}
.special-class{
}
.in_mc {
CanadaMes-ui/src/views/Electrical/Parameter2.vue
@@ -1,92 +1,74 @@
<template>
  <div class="app">
    <div class="app">
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/Electrical/alarm" tag="el-button" type="text" active-class="blue-button">{{ $t('Alarm')
      }}</router-link>
      <router-link to="/Electrical/State" tag="el-button" type="text" active-class="blue-button">{{ $t('State')
      }}</router-link>
      <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action')
      }}</router-link>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
      }}</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
      }}</router-link>
      <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{
        $t('ServoManual')
      }}</router-link>
        <router-link to="/Electrical/alarm" tag="el-button" type="text" active-class="blue-button">{{ $t('Alarm')
        }}</router-link>
        <router-link to="/Electrical/State" tag="el-button" type="text" active-class="blue-button">{{ $t('State')
        }}</router-link>
        <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action')
        }}</router-link>
        <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
        }}</router-link>
        <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
        }}</router-link>
         <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual')
        }}</router-link>
      </el-breadcrumb>
      <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
        <router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{ $t('Servomanualone')
        }}</router-link>
          <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
          }}</router-link>
         <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter2')
          }}</router-link>
            <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning1')
          }}</router-link>
            <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning2')
          }}</router-link>
    </el-breadcrumb>
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{
        $t('Servomanualone')
      }}</router-link>
      <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
      }}</router-link>
      <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter2')
      }}</router-link>
      <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
        $t('Positioning1')
      }}</router-link>
      <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{
        $t('Positioning2')
      }}</router-link>
      <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualonePosition')
      }}</router-link>
      <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualonePosition2')
      }}</router-link>
      <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
        $t('AutomaticParameterSetting')
      }}</router-link>
      <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualJog')
      }}</router-link>
    </el-breadcrumb>
    <el-row :gutter="20">
    <el-row :gutter="40">
      <el-col :span="6" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex">
        <el-card class="json-block" style="width:260px;">
        <el-card class="json-block"  style="width:260px;">
          <div class="button-row" style="display: flex; justify-content: space-between;">
            <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
              <span v-if="item.title" :name="item.title.name" class="action-button">{{ item.title.name }}</span>
              <span v-if="item.title" :name="item.title.name" class="action-button" >{{ item.title.name }}</span>
            </div>
          </div>
          <div class="button-row" style="display: flex; justify-content: space-between;">
            <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
              <el-button v-if="item.button" :name="item.button.name" v-model="item.button.value" class="action-button"
                @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name)"
                :class="{ 'green-button': item.button.value === 0 && item.button.name !== '清除ID', 'red-button': item.button.value === 1 && item.button.name !== '清除ID' }">{{
                  item.button.name }}</el-button>
  @click="updateButtonValue(dataGroup, itemIndex);submitDataToBackend(item.button.name)"
  :class="{ 'green-button': item.button.value === 0  && item.button.name !== '清除ID','red-button': item.button.value === 1 && item.button.name !== '清除ID' }">{{ item.button.name }}</el-button>
            </div>
          </div>
          <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" class="item-container">
            <div class="item-row">
              <span class="name" style="width:150px;">{{ item.name }}</span>
              <el-input v-if="item.type === '0'" v-model="item.value" readonly="readonly" style="width:150px;"
                class="input-box"></el-input>
              <el-input v-if="item.type === '0'" v-model="item.value" readonly="readonly"    style="width:150px;" class="input-box"></el-input>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <!-- <el-button @click="submitDataToBackend">提交数据到后端</el-button> -->
  </div>
</template>
  </template>
  
<script>
import LanguageMixin from '../../lang/LanguageMixin'
import data from '../../configuration/parameter2'
let socket;
export default {
  <script>
  import LanguageMixin from '../../lang/LanguageMixin'
  import data from '../../configuration/parameter2'
  let socket;
  export default {
  name: "Parameter2",
  mixins: [LanguageMixin],
  data () {
  data() {
    return {
      jsonData: data,
      jsonData: data ,
      // 加载整个data.json文件作为jsonData
    }
@@ -97,38 +79,38 @@
  },
  methods: {
    updateButtonValue (dataGroup, itemIndex) {
      // 将当前按钮的值设为1
    updateButtonValue(dataGroup, itemIndex) {
  // 将当前按钮的值设为1
      this.$set(dataGroup[itemIndex].button, 'value', 1);
    this.$set(dataGroup[itemIndex].button, 'value', 1);
  // 将其他按钮的值全部设为0
      // 将其他按钮的值全部设为0
},
    submitDataToBackend(currentButtonName) {
  if (currentButtonName === '清除ID') {
    const inputData = this.jsonData.map(dataGroup => {
      return dataGroup.map(item => {
        if (item.type === '3') {
          return { value: item.button.value };
        }
        return null;
      });
    });
    },
    submitDataToBackend (currentButtonName) {
      if (currentButtonName === '清除ID') {
        const inputData = this.jsonData.map(dataGroup => {
          return dataGroup.map(item => {
            if (item.type === '3') {
              return { value: item.button.value };
            }
            return null;
          });
        });
    const values = inputData.flat().filter(item => item !== null).map(item => item.value);
        const values = inputData.flat().filter(item => item !== null).map(item => item.value);
        const jsonObject = { data: values };
        // 提交数据到后端
        const jsonString = JSON.stringify(jsonObject);
        console.log('Type为3的value:', jsonString);
        socket?.send(jsonString);
      }
    },
    const jsonObject = { data: values };
 // 提交数据到后端
 const jsonString = JSON.stringify(jsonObject);
   console.log('Type为3的value:', jsonString);
     socket?.send(jsonString);
  }
},
    initWebSocket () {
      let viewname = "Parameter2";
      if (typeof WebSocket === "undefined") {
@@ -151,59 +133,90 @@
        // 收到消息
        socket.onmessage = (msg) => {
          if (!msg.data) {
            return; // 如果收到空数据,则直接返回,不执行后续逻辑
          }
  if (!msg.data) {
    return; // 如果收到空数据,则直接返回,不执行后续逻辑
  }
          let obj = JSON.parse(msg.data);
  let obj = JSON.parse(msg.data);
  const jsonData2 = this.jsonData;
      // 如果鼠标不在输入框内,更新输入框的值
      // this.submitDataToBackend()
      const parms = obj.params;
      // const xiaoche = obj.params[3];
     console.log(parms);
          const jsonData2 = this.jsonData;
      for (let i = 0; i < jsonData2.length; i++) {
  let arr = jsonData2[i];
  for (let j = 0; j < arr.length; j++) {
    let obj = arr[j];
    if (obj.type === '3') {
      obj.button.value = parms[0][i];
    }
  }
          // 如果鼠标不在输入框内,更新输入框的值
          // this.submitDataToBackend()
          const parms = obj.params;
          // console.log(parms);
}
          for (let i = 0; i < jsonData2.length; i++) {
            let arr = jsonData2[i];
            for (let j = 0; j < arr.length; j++) {
              let obj = arr[j];
              if (obj.type === '0') {
                obj.value = parms[1][i];
              }
      for (let i = 0; i < jsonData2.length; i++) {
  let arr = jsonData2[i];
  for (let j = 0; j < arr.length; j++) {
    let obj = arr[j];
    if (obj.type === '0') {
      obj.value = parms[1][i];
    }
  }
}
for (let i = 0; i < jsonData2.length; i++) {
  let arr = jsonData2[i];
  for (let j = 0; j < arr.length; j++) {
    let obj = arr[j];
    if (obj.type === '4') {
      obj.button.value = parms[2][i];
    }
  }
}
jsonData2.forEach((item) => {
  item.forEach((subItem) => {
    if (subItem.read === 66) {
      subItem.value = parms[3][0];
    }
  });
});
let lastParmsArray = parms[parms.length - 1];
let lastParmsIndex = 0;
for (let i = 0; i < jsonData2.length; i++) {
    for (let j = 0; j < jsonData2[i].length; j++) {
        if (jsonData2[i][j].read === 333) {
            jsonData2[i][j].value = lastParmsArray[lastParmsIndex];
            lastParmsIndex++;
            if (lastParmsIndex === lastParmsArray.length) {
                lastParmsIndex = 0;
            }
        }
    }
}
          }
          for (let i = 0; i < jsonData2.length; i++) {
            let arr = jsonData2[i];
            for (let j = 0; j < arr.length; j++) {
              let obj = arr[j];
              if (obj.type === '4') {
                obj.button.value = parms[2][i];
              }
            }
          }
          for (let i = 0; i < jsonData2.length; i++) {
            let arr = jsonData2[i];
            for (let j = 0; j < arr.length; j++) {
              let obj = arr[j];
              if (obj.type === '3') {
                obj.button.value = parms[0][i];
              }
            }
//  console.log(jsonData2);
          }
          //  console.log(jsonData2);
        };
};
@@ -221,30 +234,28 @@
      }
    },
    send () {
      socket?.send(JSON.stringify(this.messagepack));
    }
  }
}
</script>
  }
  </script>
  
<style scoped>
.item-row {
  <style scoped>
  .item-row {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  /* 调整每个项目之间的间距 */
}
.action-button {
  margin-bottom: 5px; /* 调整每个项目之间的间距 */
  }
  .action-button {
  margin-right: 30px;
  background: #66b1ff;
  color: #FFF;
}
.blue-button {
  }
  .blue-button {
  background-color: skyblue;
}
@@ -252,7 +263,8 @@
  background-color: green;
}
.red-button {
.red-button{
  background-color: red;
}
</style>
  </style>
CanadaMes-ui/src/views/Electrical/ServoManualone.vue
@@ -1,90 +1,56 @@
<template>
  <div class="app">
    <div class="app">
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/Electrical/alarm" tag="el-button" type="text" active-class="blue-button">{{ $t('Alarm')
      }}</router-link>
      <router-link to="/Electrical/State" tag="el-button" type="text" active-class="blue-button">{{ $t('State')
      }}</router-link>
      <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action')
      }}</router-link>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
      }}</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
      }}</router-link>
      <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{
        $t('ServoManual')
      }}</router-link>
    </el-breadcrumb>
        <router-link to="/Electrical/alarm" tag="el-button" type="text" active-class="blue-button">{{ $t('Alarm')
        }}</router-link>
        <router-link to="/Electrical/State" tag="el-button" type="text" active-class="blue-button">{{ $t('State')
        }}</router-link>
        <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action')
        }}</router-link>
        <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
        }}</router-link>
        <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
        }}</router-link>
         <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual')
        }}</router-link>
      </el-breadcrumb>
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{
        $t('Servomanualone')
      <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
        <router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{ $t('Servomanualone')
      }}</router-link>
      <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
      }}</router-link>
      <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter2')
      }}</router-link>
      <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
        $t('Positioning1')
      }}</router-link>
      <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{
        $t('Positioning2')
      }}</router-link>
      <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualonePosition')
      }}</router-link>
      <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualonePosition2')
      }}</router-link>
      <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
        $t('AutomaticParameterSetting')
      }}</router-link>
      <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualJog')
      }}</router-link>
      <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualonePosition')
      }}</router-link>
      <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualonePosition2')
      }}</router-link>
      <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
        $t('AutomaticParameterSetting')
      }}</router-link>
      <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
        $t('ManualJog')
      }}</router-link>
        <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
        }}</router-link>
           <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter2')
        }}</router-link>
          <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning1')
          }}</router-link>
            <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning2')
          }}</router-link>
    </el-breadcrumb>
    <el-row :gutter="26">
      <el-col :span="12" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex">
        <el-card class="json-block" style="width:auto;">
          <el-row>
            <el-col v-for="(item, itemIndex) in dataGroup" :key="itemIndex" :span="12">
              <div class="item-container">
                <div class="item-row">
                  <span class="name" style='width:230px;'>{{ item.name }}</span>
                  <el-input v-if="item.type === '0'" v-model="item.value" class='input-box'
                    :class="{ 'special-class': groupIndex === 0, 'special-class2': groupIndex === 1 }"
                    v-show="groupIndex !== 0 && groupIndex !== 1"></el-input>
                </div>
              </div>
            </el-col>
          </el-row>
          <div class="button-row" style="display: flex; justify-content: space-between;">
            <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
              <el-button v-if="item.button" :name="item.button.name" v-model="item.button.value"
                :class="{ 'action-button': true, 'error-button': item.button.name === '故障' && item.button.value === 1 }"
                @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{
                  item.button.name }}</el-button>
  <el-col :span="12" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex">
    <el-card class="json-block"  style="width:auto;">
      <el-row >
        <el-col v-for="(item, itemIndex) in dataGroup" :key="itemIndex" :span="12">
          <div class="item-container">
            <div class="item-row">
              <span class="name" style='width:230px;'>{{ item.name }}</span>
              <el-input v-if="item.type === '0'" v-model="item.value"   class='input-box' :class="{ 'special-class': groupIndex === 0,'special-class2': groupIndex === 1 }" v-show="groupIndex !== 0 && groupIndex !== 1"  ></el-input>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
        </el-col>
      </el-row>
      <div class="button-row" style="display: flex; justify-content: space-between;">
        <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
          <el-button v-if="item.button" :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '故障' && item.button.value === 1}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button>
        </div>
      </div>
    </el-card>
  </el-col>
</el-row>
    <!-- <el-button @click="submitDataToBackend">提交数据到后端</el-button> -->
  </div>
@@ -95,12 +61,12 @@
import data from '../../configuration/ServoManualone'
import { throttle } from 'lodash';
let socket;
export default {
  export default {
  name: "ServoManualone",
  mixins: [LanguageMixin],
  data () {
  data() {
    return {
      jsonData: data,
      jsonData: data ,
      // 加载整个data.json文件作为jsonData
    }
@@ -111,84 +77,84 @@
  },
  methods: {
    updateButtonValue (dataGroup, itemIndex) {
      // 将当前按钮的值设为1
    updateButtonValue(dataGroup, itemIndex) {
  // 将当前按钮的值设为1
      this.$set(dataGroup[itemIndex].button, 'value', 1);
    this.$set(dataGroup[itemIndex].button, 'value', 1);
},
submitDataToBackend(currentButtonName) {
  if (currentButtonName === '半自动启动') {
    const data = [];
for (let i = 0; i < 2; i++) {
  const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
    return { value: item.value };
  });
  const values = inputData.map(item => item.value);
  data.push(values);
}
    },
    submitDataToBackend (currentButtonName) {
      if (currentButtonName === '半自动启动') {
        const data = [];
const jsonObject = { data };
        for (let i = 0; i < 2; i++) {
          const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
            return { value: item.value };
          });
// 提交数据到后端
const jsonString = JSON.stringify(jsonObject);
console.log('所有Type为0的value:', jsonString);
socket?.send(jsonString);
          const values = inputData.map(item => item.value);
  }
          data.push(values);
        }
  if (currentButtonName === '复位') {
    const data2 = [];
    const resetButtonValues = this.jsonData.map(item => {
  const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '复位');
  return buttonItem ? buttonItem.button.value : null;
}).filter(value => value !== null);
// 将得到的值添加到 data 数组中
data2.push(...resetButtonValues);
const jsonObject2 = { data2 };
// 提交数据到后端
const jsonString2 = JSON.stringify(jsonObject2);
console.log('所有Type为0的value:', jsonString2);
socket?.send(jsonString2);
}
  if (currentButtonName === 'A01半自动') {
    const elements = document.getElementsByClassName('special-class');
    for (let i = 0; i < elements.length; i++) {
      if (elements[i].style.display === 'none') {
        elements[i].style.display = ''; // 显示元素
      }
    }
  }
        const jsonObject = { data };
  if (currentButtonName === 'A02半自动') {
    const elements = document.getElementsByClassName('special-class2');
    for (let i = 0; i < elements.length; i++) {
      if (elements[i].style.display === 'none') {
        elements[i].style.display = ''; // 显示元素
      }
    }
  }
        // 提交数据到后端
        const jsonString = JSON.stringify(jsonObject);
        console.log('所有Type为0的value:', jsonString);
        socket?.send(jsonString);
      }
      if (currentButtonName === '复位') {
        const data2 = [];
        const resetButtonValues = this.jsonData.map(item => {
          const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '复位');
          return buttonItem ? buttonItem.button.value : null;
        }).filter(value => value !== null);
        // 将得到的值添加到 data 数组中
        data2.push(...resetButtonValues);
        const jsonObject2 = { data2 };
        // 提交数据到后端
        const jsonString2 = JSON.stringify(jsonObject2);
        console.log('所有Type为0的value:', jsonString2);
        socket?.send(jsonString2);
      }
      if (currentButtonName === 'A01半自动') {
        const elements = document.getElementsByClassName('special-class');
        for (let i = 0; i < elements.length; i++) {
          if (elements[i].style.display === 'none') {
            elements[i].style.display = ''; // 显示元素
          }
        }
      }
      if (currentButtonName === 'A02半自动') {
        const elements = document.getElementsByClassName('special-class2');
        for (let i = 0; i < elements.length; i++) {
          if (elements[i].style.display === 'none') {
            elements[i].style.display = ''; // 显示元素
          }
        }
      }
    },
},
    initWebSocket () {
      let viewname = "ServoManualone";
      if (typeof WebSocket === "undefined") {
@@ -211,60 +177,57 @@
        // 收到消息
        socket.onmessage = (msg) => {
          if (!msg.data) {
            return; // 如果收到空数据,则直接返回,不执行后续逻辑
          }
  if (!msg.data) {
    return; // 如果收到空数据,则直接返回,不执行后续逻辑
  }
          let obj = JSON.parse(msg.data);
          // console.log(obj)
          const jsonData2 = this.jsonData;
  let obj = JSON.parse(msg.data);
  // console.log(obj)
  const jsonData2 = this.jsonData;
          const handleMouseMove = throttle(function (event) {
            const inputBox = document.querySelectorAll('.el-card__body');
            const target = event.target;
            if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
              // 执行更新逻辑
              for (let i = 0; i < 6; i++) {
                jsonData2[i].forEach((item, index) => {
                  if (typeof item.value !== 'undefined' && typeof obj[`zuhe${i + 1}`][0][index] !== 'undefined') {
                    item.value = obj[`zuhe${i + 1}`][0][index];
                  }
                });
              }
  const handleMouseMove = throttle(function(event) {
  const inputBox = document.querySelectorAll('.el-card__body');
  const target = event.target;
  if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
    // 执行更新逻辑
    for (let i = 0; i < 6; i++) {
  jsonData2[i].forEach((item, index) => {
    if (typeof item.value !== 'undefined' && typeof obj[`zuhe${i+1}`][0][index] !== 'undefined') {
      item.value = obj[`zuhe${i+1}`][0][index];
    }
  });
}
              // 遍历guzhang数组
              for (let i = 0; i < obj.guzhang[0].length; i++) {
                const guzhangValue = obj.guzhang[0][i];
                // 查找jsonData2中带有"button"的对象,并且name等于"故障"
                for (let j = 0; j < jsonData2.length; j++) {
                  const section = jsonData2[j];
                  for (let k = 0; k < section.length; k++) {
                    const item = section[k];
                    if (item.button && item.button.name === "故障") {
                      // 更新value属性
                      item.button.value = guzhangValue;
                      break;
                    }
                  }
                }
              }
// 遍历guzhang数组
for (let i = 0; i < obj.guzhang[0].length; i++) {
  const guzhangValue = obj.guzhang[0][i];
  // 查找jsonData2中带有"button"的对象,并且name等于"故障"
  for (let j = 0; j < jsonData2.length; j++) {
    const section = jsonData2[j];
    for (let k = 0; k < section.length; k++) {
      const item = section[k];
      if (item.button && item.button.name === "故障") {
        // 更新value属性
        item.button.value = guzhangValue;
        break;
      }
    }
  }
}
  }
}, 200);
            }
          }, 200);
          document.addEventListener('mouseover', handleMouseMove);
        };
  document.addEventListener('mouseover', handleMouseMove);
};
@@ -282,21 +245,22 @@
      }
    },
    send () {
      socket?.send(JSON.stringify(this.messagepack));
    }
  }
}
  }
</script>
<style scoped>
.item-row {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
  /* 调整每个项目之间的间距 */
  margin-bottom: 2px; /* 调整每个项目之间的间距 */
}
.action-button {
@@ -304,12 +268,12 @@
  background: #66b1ff;
  color: #FFF;
}
.blue-button {
  background-color: skyblue;
}
.error-button {
  background-color: red;
}
</style>
CanadaMes-ui/src/views/Electrical/Sign.vue
@@ -13,7 +13,8 @@
      }}</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
      }}</router-link>
 <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual')
        }}</router-link>
    </el-breadcrumb>
    <div>{{ $t('Sign') }}</div>
CanadaMes-ui/src/views/Electrical/State.vue
@@ -13,7 +13,8 @@
      }}</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
      }}</router-link>
 <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual')
        }}</router-link>
    </el-breadcrumb>
    <div>{{ $t('State') }}</div>
    <el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="messagepack.data">
CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -8,7 +8,8 @@
      <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action') }}</router-link>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter') }}</router-link>
    <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign') }}</router-link>
    <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual')
        }}</router-link>
    </el-breadcrumb>
    <div>{{ $t('Alarm') }}</div>
    <div class="block">
CanadaMes-ui/src/views/home/index.vue
@@ -111,9 +111,15 @@
    top: 366px; */
}
.orderbutton {
.orderbutton1 {
    position: absolute;
    left: 1070px;
    top: 70px;
}
.orderbutton2 {
    position: absolute;
    left: 1170px;
    top: 70px;
}
@@ -194,39 +200,46 @@
                </div>
            </div>
            <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
                <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid1"></el-input>
                <el-button type="primary" @click="SelectGlassByGlassIDs(2)">{{ $t('Infeed barcodid') }}</el-button>
                <el-input style="width:15%;" :placeholder="$t('Enter the order number')" v-model="order"></el-input>
                <el-input style="width:15%;" :placeholder="$t('Enter the glass barcode')" v-model="glassid1"></el-input>
                <el-button type="primary" @click="SelectGlassByGlassIDs(2)">{{ $t('Manually Infeed Glass') }}</el-button>
                <el-input style="width:15%;" :placeholder="$t('Enter the Order No')" v-model="order"></el-input>
                <el-button type="warning" @click="showform1();">{{ $t('Exit the glass by order number') }}</el-button>
            </div>
            <div>
                <el-table :data="this.tasklist1" border style="width: 100%">
                    <el-table-column :width="130" prop="cage" :label="$t('The Cage number being used')"></el-table-column>
                    <el-table-column :width="130" prop="cell" :label="$t('The Slot number being used')"></el-table-column>
                    <el-table-column :width="150" prop="glassId" :label="$t('Outfeed Barcodid')"></el-table-column>
                    <el-table-column :width="130" prop="orderId" :label="$t('Order Nmuber')"></el-table-column>
                    <el-table-column prop="list" :label="$t('List Number')"></el-table-column>
                    <el-table-column prop="box" :label="$t('Box Number')"></el-table-column>
                    <el-table-column :width="230" prop="lengthWidth" :label="$t('Length(inch) and Width(inch)')"></el-table-column>
                    <el-table-column :label="$t('Operate')">
                    <el-table-column :width="130" prop="cage" :label="$t('Cage No')"></el-table-column>
                    <el-table-column :width="130" prop="cell" :label="$t('Slot No')"></el-table-column>
                    <el-table-column :width="150" prop="glassId" :label="$t('Outfeed glass barcode')"></el-table-column>
                    <el-table-column :width="130" prop="north_glass_buffer1s.ordernumber" :label="$t('Order No')"></el-table-column>
                    <el-table-column prop="north_glass_buffer1s.listnumber" :label="$t('List No')"></el-table-column>
                    <el-table-column prop="north_glass_buffer1s.boxnumber" :label="$t('Box No')"></el-table-column>
                    <el-table-column prop="lengthWidth" :label="$t('Dim')"></el-table-column>
                    <el-table-column :label="$t('Terminate Task')">
                        <template slot-scope='scope'>
                            <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                                @click="endtask(1, scope.row.glassId, scope.row.cell)">{{ $t('end task') }}</el-button>
                                @click="endtask(1, scope.row.glassId, scope.row.cell)">{{ $t('Terminate Task')
                                }}</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <el-table :data="this.tasklist2" border style="width: 100%">
                    <el-table-column :width="130" prop="cage" :label="$t('The Cage number being used')"></el-table-column>
                    <el-table-column :width="130" prop="cell" :label="$t('The Slot number being used')"></el-table-column>
                    <el-table-column :width="150" prop="glassId" :label="$t('Infeed Barcodid')"></el-table-column>
                    <el-table-column :width="130" prop="orderId" :label="$t('Order Nmuber')"></el-table-column>
                    <el-table-column prop="list" :label="$t('List Number')"></el-table-column>
                    <el-table-column prop="box" :label="$t('Box Number')"></el-table-column>
                    <el-table-column :width="230"  prop="lengthWidth" :label="$t('Length(inch) and Width(inch)')"></el-table-column>
                    <el-table-column :label="$t('Operate')">
                    <el-table-column :width="130" prop="cage" :label="$t('Cage No')"></el-table-column>
                    <el-table-column :width="130" prop="cell" :label="$t('Slot No')"></el-table-column>
                    <el-table-column :width="150" prop="glassId" :labelf="$t('Infeed glass barcode')"></el-table-column>
                    <el-table-column :width="130" prop="north_glass_buffer1s.ordernumber" :label="$t('Order No')"></el-table-column>
                    <el-table-column prop="north_glass_buffer1s.listnumber" :label="$t('List No')"></el-table-column>
                    <el-table-column prop="north_glass_buffer1s.boxnumber" :label="$t('Box No')"></el-table-column>
                    <el-table-column prop="lengthWidth" :label="$t('Dim')">
                        <template slot-scope='scope'>
                            {{ scope.row.north_glass_buffer1s.glasslength }}*{{ scope.row.north_glass_buffer1s.glassheight }}
                        </template>
                    </el-table-column>
                    <el-table-column :label="$t('Terminate Task')">
                        <template slot-scope='scope'>
                            <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                                @click="endtask(0, scope.row.glassId, scope.row.cell)">{{ $t('end task') }}</el-button>
                                @click="endtask(0, scope.row.glassId, scope.row.cell)">{{ $t('Terminate Task')
                                }}</el-button>
                        </template>
                    </el-table-column>
                </el-table>
@@ -274,7 +287,8 @@
                <div class="blocks-img" :style="{ left: car2 + 'px', top: '175px' }"></div>
                <div class="blocks-img2"></div>
                <div class="blocks-img3"></div>
                <el-button class="orderbutton" type="primary" @click="showform2()">{{ $t('OrderInfo') }}</el-button>
                <el-button class="orderbutton1" type="primary" @click="showform2()">{{ $t('OrderInfo') }}</el-button>
                <el-button class="orderbutton2" type="primary" @click="showform6()">{{ $t('Production queue') }}</el-button>
                <!-- <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:328px;">
                    <div :class="getStatusClass(item.state)" v-for="(item,index) in cagelist1" :key="item['date']"
@@ -304,22 +318,35 @@
        </el-footer>
        <el-dialog :visible.sync="dialogFormVisible" :title="$t('Please confirm the glass information')">
            <el-form :model="form" label-width="100px" style="padding-right: 30px">
                <el-form-item :label="$t('Barcodid')">
                    <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid"></el-input>
                <el-form-item :label="$t('Barcode')">
                    <el-input style="width:15%;" :placeholder="$t('Enter the glass barcode')" v-model="glassid"></el-input>
                    <el-button type="primary" @click="showform(3)">{{ $t('Query') }}</el-button>
                </el-form-item>
                <el-form-item :label="$t('order')">
                    <el-input v-model="form.orderId" readonly autocomplete="off" />
                <el-form-item :label="$t('Barcode')">
                    <el-input v-model="form.barcode" readonly autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('length(inch)')">
                    <el-input v-model="form.height" readonly autocomplete="off" />
                <el-form-item :label="$t('Order No')">
                    <el-input v-model="form.ordernumber" readonly autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('width(inch)')">
                    <el-input v-model="form.width" readonly autocomplete="off" />
                <el-form-item :label="$t('List No')">
                    <el-input v-model="form.listnumber" readonly autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('Barcodid')">
                    <el-input v-model="form.glassId" readonly autocomplete="off" />
                <el-form-item :label="$t('Box No')">
                    <el-input v-model="form.boxnumber" readonly autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('Length')">
                    <el-input v-model="form.glasslength" readonly autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('Width')">
                    <el-input v-model="form.glassheight" readonly autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('Length')">
                    <el-input v-model="form.glasslengthMm" readonly autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('Width')">
                    <el-input v-model="form.glassheightMm" readonly autocomplete="off" />
                </el-form-item>
            </el-form>
            <template #footer>
                <span class="dialog-footer">
@@ -334,6 +361,79 @@
            </template>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible1" :title="$t('Please confirm the Ordering Information')">
            <el-form :model="form1" label-width="100px" style="padding-right: 30px">
                <el-form-item :label="$t('Order No')">
                    <el-input v-model="form1.order" autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('Number')">
                    <el-input v-model="form1.number" autocomplete="off" />
                </el-form-item>
            </el-form>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="getOrder();" type="primary">{{ $t('confirm') }}</el-button>
                    <el-button @click="cancel1()">{{ $t('cancel') }}</el-button>
                </span>
            </template>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible2" :title="$t('Alarm Information')">
            <el-table :data="this.alarm" border style="width: 100%;">
                <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-column prop="endTime" :label="$t('endTime')"></el-table-column>
            </el-table>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible3" :title="$t('Cage Details')" top="5vh">
            <el-table :data="this.cageinfo" :height="700" border style="width: 100%;overflow: auto;">
                <el-table-column :width="90" prop="cage" :label="$t('Cage No')"></el-table-column>
                <el-table-column :width="90" prop="cell" :label="$t('Slot No')"></el-table-column>
                <el-table-column :width="55" prop="tier" :label="$t('The Side')"></el-table-column>
                <el-table-column :width="100" prop="glassId" :label="$t('Barcode')"></el-table-column>
                <el-table-column :width="100" prop="orderId" :label="$t('Order No')"></el-table-column>
                <el-table-column :width="100" prop="north_glass_buffer1s.listnumber"
                    :label="$t('List No')"></el-table-column>
                <el-table-column :width="100" prop="north_glass_buffer1s.boxnumber" :label="$t('Box No')"></el-table-column>
                <el-table-column :width="170" prop="lengthWidth" :label="$t('Dim')"></el-table-column>
                <el-table-column :width="280" :label="$t('Operate')">
                    <template slot-scope='scope'>
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="deleteglass(scope.row.glassId, scope.row.state)">{{ $t('Delete') }}</el-button>
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="outglass(scope.row.glassId, scope.row.state)">{{ $t('Out') }}</el-button>
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="UpdateDisabled(scope.row.cage, scope.row.cell, scope.row.disabled == 0 ? 1 : 0)">
                            {{ scope.row.disabled == 0 ? $t('Enable') : $t('Disable') }}</el-button>
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="insertglass(scope.row.cage, scope.row.cell, scope.row.tier)">{{ $t('Increase')
                            }}</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible4" :title="$t('OrderInfo')" top="5vh">
            <el-input style="width:15%;" :placeholder="$t('Enter the Order No')" v-model="orderid"></el-input>
            <el-button type="primary" @click="selectglassinfo()">{{ $t('Query') }}</el-button>
            <el-table :data="GlassInfo.slice((currentPage - 1) * pagesize, currentPage * pagesize)
                " :height="700" border style="width: 100%;overflow: auto;">
                <el-table-column prop="barcode" :label="$t('Barcode')"></el-table-column>
                <el-table-column prop="ordernumber" :label="$t('Order No')"></el-table-column>
                <el-table-column prop="listnumber" :label="$t('List No')"></el-table-column>
                <el-table-column prop="boxnumber" :label="$t('Box No')"></el-table-column>
                <el-table-column prop="glasslength" :label="$t('Length')"></el-table-column>
                <el-table-column prop="glassheight" :label="$t('Width')"></el-table-column>
            </el-table>
            <el-pagination :style="'margin-top:-2px'" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :pager-count="7" :current-page="currentPage" :page-sizes="[5, 10, 15, 20]" :page-size="pagesize"
                layout="total, sizes, prev, pager, next, jumper" :total="GlassInfo.length > 0 ? GlassInfo.length : null"
                background style="float: right; margin-top: 20px">
            </el-pagination>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible5" :title="$t('Please confirm the glass information')">
            <el-form :model="form" label-width="100px" style="padding-right: 30px">
                <div style="display: flex;justify-content: space-around;">
@@ -350,72 +450,100 @@
                </div>
                <div style="display: flex;justify-content: space-around;">
                    <el-form-item>
                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass lD')"
                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass barcode')"
                            v-model="glassid2"></el-input>
                        <el-button type="primary" @click="SelectGlassByGlassIDs(1)" :disabled="disabled">{{ $t('Query')
                        }}</el-button>
                    </el-form-item>
                    <el-form-item>
                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass lD')"
                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass barcode')"
                            v-model="glassid1"></el-input>
                        <el-button type="primary" @click="SelectGlassByGlassIDs(2)" :disabled="disabled">{{ $t('Query')
                        }}</el-button>
                    </el-form-item>
                </div>
                <div style="display: flex;justify-content: space-around;">
                    <el-form-item :label="$t('Barcodid')">
                        <el-input v-model="form2.glassId" readonly autocomplete="off" />
                    <el-form-item :label="$t('Barcode')">
                        <el-input v-model="form2.barcode" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Barcodid')">
                        <el-input v-model="form4.glassId" readonly autocomplete="off" />
                    <el-form-item :label="$t('Barcode')">
                        <el-input v-model="form4.barcode" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Barcodid')">
                        <el-input v-model="form3.glassId" readonly autocomplete="off" />
                    <el-form-item :label="$t('Barcode')">
                        <el-input v-model="form3.barcode" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Barcodid')">
                        <el-input v-model="form5.glassId" readonly autocomplete="off" />
                    <el-form-item :label="$t('Barcode')">
                        <el-input v-model="form5.barcode" readonly autocomplete="off" />
                    </el-form-item>
                </div>
                <div style="display: flex;justify-content: space-around;">
                    <el-form-item :label="$t('order')">
                        <el-input v-model="form2.orderId" readonly autocomplete="off" />
                    <el-form-item :label="$t('Order No')">
                        <el-input v-model="form2.ordernumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('order')">
                        <el-input v-model="form4.orderId" readonly autocomplete="off" />
                    <el-form-item :label="$t('Order No')">
                        <el-input v-model="form4.ordernumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('order')">
                        <el-input v-model="form3.orderId" readonly autocomplete="off" />
                    <el-form-item :label="$t('Order No')">
                        <el-input v-model="form3.ordernumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('order')">
                        <el-input v-model="form5.orderId" readonly autocomplete="off" />
                    <el-form-item :label="$t('Order No')">
                        <el-input v-model="form5.ordernumber" readonly autocomplete="off" />
                    </el-form-item>
                </div>
                <div style="display: flex;justify-content: space-around;">
                    <el-form-item :label="$t('length')">
                        <el-input v-model="form2.height" readonly autocomplete="off" />
                    <el-form-item :label="$t('List No')">
                        <el-input v-model="form2.listnumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('length')">
                        <el-input v-model="form4.height" readonly autocomplete="off" />
                    <el-form-item :label="$t('List No')">
                        <el-input v-model="form4.listnumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('length')">
                        <el-input v-model="form3.height" readonly autocomplete="off" />
                    <el-form-item :label="$t('List No')">
                        <el-input v-model="form3.listnumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('length')">
                        <el-input v-model="form5.height" readonly autocomplete="off" />
                    <el-form-item :label="$t('List No')">
                        <el-input v-model="form5.listnumber" readonly autocomplete="off" />
                    </el-form-item>
                </div>
                <div style="display: flex;justify-content: space-around;">
                    <el-form-item :label="$t('width')">
                        <el-input v-model="form2.width" readonly autocomplete="off" />
                    <el-form-item :label="$t('Box No')">
                        <el-input v-model="form2.boxnumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('width')">
                        <el-input v-model="form4.width" readonly autocomplete="off" />
                    <el-form-item :label="$t('Box No')">
                        <el-input v-model="form4.boxnumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('width')">
                        <el-input v-model="form3.width" readonly autocomplete="off" />
                    <el-form-item :label="$t('Box No')">
                        <el-input v-model="form3.boxnumber" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('width')">
                        <el-input v-model="form5.width" readonly autocomplete="off" />
                    <el-form-item :label="$t('Box No')">
                        <el-input v-model="form5.boxnumber" readonly autocomplete="off" />
                    </el-form-item>
                </div>
                <div style="display: flex;justify-content: space-around;">
                    <el-form-item :label="$t('Length')">
                        <el-input v-model="form2.glasslength" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Length')">
                        <el-input v-model="form4.glasslength" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Length')">
                        <el-input v-model="form3.glasslength" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Length')">
                        <el-input v-model="form5.glasslength" readonly autocomplete="off" />
                    </el-form-item>
                </div>
                <div style="display: flex;justify-content: space-around;">
                    <el-form-item :label="$t('Width')">
                        <el-input v-model="form2.glassheight" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Width')">
                        <el-input v-model="form4.glassheight" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Width')">
                        <el-input v-model="form3.glassheight" readonly autocomplete="off" />
                    </el-form-item>
                    <el-form-item :label="$t('Width')">
                        <el-input v-model="form5.glassheight" readonly autocomplete="off" />
                    </el-form-item>
                </div>
                <div style="display: flex;justify-content: space-around;">
@@ -431,105 +559,76 @@
            </el-form>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
                </span>
            </template>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible1" :title="$t('Please confirm the Ordering Information')">
            <el-form :model="form1" label-width="100px" style="padding-right: 30px">
                <el-form-item :label="$t('order')">
                    <el-input v-model="form1.order" autocomplete="off" />
                </el-form-item>
                <el-form-item :label="$t('number')">
                    <el-input v-model="form1.number" autocomplete="off" />
                </el-form-item>
            </el-form>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="getOrder();" type="primary">{{ $t('confirm') }}</el-button>
                    <el-button @click="cancel1()">{{ $t('cancel') }}</el-button>
                </span>
            </template>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible2" :title="$t('Alarm Information')">
            <el-table :data="this.alarm" border style="width: 100%;">
                <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-column prop="endTime" :label="$t('endTime')"></el-table-column>
            </el-table>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible3" :title="$t('Cage Details')" top="5vh">
            <el-table :data="this.cageinfo" :height="700" border style="width: 100%;overflow: auto;">
                <el-table-column :width="90" prop="cage" :label="$t('The Cage number')"></el-table-column>
                <el-table-column :width="90" prop="cell" :label="$t('The Slot Number')"></el-table-column>
                <el-table-column :width="55" prop="tier" :label="$t('The Side')"></el-table-column>
                <el-table-column :width="100" prop="glassId" :label="$t('Barcodid')"></el-table-column>
                <el-table-column :width="100" prop="orderId" :label="$t('Order Number')"></el-table-column>
                <el-table-column :width="100" prop="list" :label="$t('List Number')"></el-table-column>
                <el-table-column :width="100" prop="box" :label="$t('Box Number')"></el-table-column>
                <el-table-column :width="170" prop="lengthWidth" :label="$t('Length(inch) and Width(inch)')"></el-table-column>
        <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Production queue')" top="5vh">
            <el-button type="primary" @click="showform7()">{{ $t('Increase') }}</el-button>
            <el-table :data="this.OutSlice" :height="700" border style="width: 100%;overflow: auto;">
                <el-table-column prop="glassId" :label="$t('Barcode')"></el-table-column>
                <el-table-column prop="north_glass_buffer1s.ordernumber" :label="$t('Order No')"></el-table-column>
                <el-table-column prop="north_glass_buffer1s.listnumber" :label="$t('List No')"></el-table-column>
                <el-table-column prop="north_glass_buffer1s.boxnumber" :label="$t('Box No')"></el-table-column>
                <el-table-column prop="barCode" :label="$t('Frame No')"></el-table-column>
                <el-table-column prop="north_glass_buffer1s.glasslength" :label="$t('Length')"></el-table-column>
                <el-table-column prop="north_glass_buffer1s.glassheight" :label="$t('Width')"></el-table-column>
                <el-table-column :width="280" :label="$t('Operate')">
                    <template slot-scope='scope'>
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="deleteglass(scope.row.glassId, scope.row.state)">{{ $t('delete') }}</el-button>
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="outglass(scope.row.glassId, scope.row.state)">{{ $t('out') }}</el-button>
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="UpdateDisabled(scope.row.cage, scope.row.cell, scope.row.disabled == 0 ? 1 : 0)">
                            {{ scope.row.disabled == 0 ? $t('Enable') : $t('Disable') }}</el-button>
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="insertglass(scope.row.cage, scope.row.cell, scope.row.tier)">{{ $t('increase')
                            }}</el-button>
                            @click="deleteproductionqueueglass(scope.row.id)">{{ $t('Delete') }}</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible4" :title="$t('OrderInfo')" top="5vh">
            <el-input style="width:15%;" :placeholder="$t('Enter the Order lD')" v-model="orderid"></el-input>
            <el-button type="primary" @click="selectglassinfo()">{{ $t('Query') }}</el-button>
            <el-table :data="GlassInfo.slice((currentPage - 1) * pagesize, currentPage * pagesize)
                " :height="700" border style="width: 100%;overflow: auto;">
                <el-table-column prop="glassId" :label="$t('Barcodid')"></el-table-column>
                <el-table-column prop="orderId" :label="$t('Order Number')"></el-table-column>
                <el-table-column prop="width" :label="$t('length')"></el-table-column>
                <el-table-column prop="height" :label="$t('width')"></el-table-column>
            </el-table>
        <el-dialog :visible.sync="dialogFormVisible7" :title="$t('Glass information corresponding to aluminum frame')"
            top="5vh">
            <el-input style="width:15%;" :placeholder="$t('Enter the Frame No')" v-model="framebarcode"></el-input>
            <el-button type="primary" @click="showform7()">{{ $t('Query') }}</el-button>
            <el-button type="primary" @click="addoutslice()">{{ $t('Increase') }}</el-button>
            <el-table :data="this.AluminumFrame" :height="700" border style="width: 100%;overflow: auto;">
            <!-- <el-table :data="tableDatas.slice((currentPage - 1) * pagesize, currentPage * pagesize)
                " style="width: 100%">
                <el-table-column label="Date" prop="date"> </el-table-column>
                <el-table-column label="Name" prop="name"> </el-table-column>
                <el-table-column label="操作">
                    <template slot-scope="scope">
                        <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">Edit</el-button>
                        <el-button size="mini" type="danger"
                            @click="handleDelete(scope.$index, scope.row)">Delete</el-button>
                <el-table-column prop="barcode" :label="$t('Barcode')"></el-table-column>
                <el-table-column prop="ordernumber" :label="$t('Order No')"></el-table-column>
                <el-table-column prop="listnumber" :label="$t('List No')"></el-table-column>
                <el-table-column prop="boxnumber" :label="$t('Box No')"></el-table-column>
                <el-table-column prop="glasslength" :label="$t('Length')"></el-table-column>
                <el-table-column prop="glassheight" :label="$t('Width')"></el-table-column>
                <el-table-column prop="storageCage.cage" :label="$t('Cage No')"></el-table-column>
                <el-table-column prop="storageCage.cell" :label="$t('Slot No')"></el-table-column>
                <el-table-column prop="storageCage.tier" :label="$t('The Side')"></el-table-column>
                <el-table-column prop="FrameNo" :label="$t('Frame No')"></el-table-column>
                <el-table-column prop="Flip" :label="$t('Flip')"></el-table-column>
                <el-table-column prop="out_slice.state" :label="$t('In the queue')">
                    <template slot-scope='scope'>
                        {{ scope.row.out_slice != null ? $t('Yes') : $t('No') }}
                    </template>
                </el-table-column>
            </el-table> -->
            <!-- 表格分页 -->
            <!-- pager-count pager-count属性可以设置最大页码按钮数,超出折叠,默认为7-->
            <!-- 注意:若数据是后端接口返回的则此时:total="pageCount"-->
            <el-pagination :style="'margin-top:-2px'" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :pager-count="7" :current-page="currentPage" :page-sizes="[5, 10, 15, 20]" :page-size="pagesize"
                layout="total, sizes, prev, pager, next, jumper" :total="GlassInfo.length > 0 ? GlassInfo.length : null"
                background style="float: right; margin-top: 20px">
            </el-pagination>
                <el-table-column prop="storageCage.tier" :label="$t('In the cage')">
                    <template slot-scope='scope'>
                        {{ scope.row.storageCage != null ? $t('Yes') : $t('No') }}
                    </template>
                </el-table-column>
                <el-table-column :width="80" :label="$t('Operate')">
                    <template slot-scope='scope'>
                        <el-checkbox label="" :disabled="!(scope.row.storageCage != null&&scope.row.out_slice == null)" :checked="scope.row.isCheck"  @change="CheckBoxchange(scope.row.barcode,$event)"></el-checkbox>
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>
    </el-container>
</template>
<script>
//:disabled="scope.row.glassId > 0 || scope.row.disabled == 1 ? true : false"
import {
    home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist,
    SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState, DeleteQueueGlass
    SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState, DeleteQueueGlass, SelectGlassNo,
    SelectAluminumFrameInfoById, SelectProductionqueue, DeleteProductionQueueGlass, AddOutSliceS
} from "../../api/home";
@@ -552,40 +651,19 @@
            dialogFormVisible3: false,
            dialogFormVisible4: false,
            dialogFormVisible5: false,
            dialogFormVisible6: false,
            dialogFormVisible7: false,
            form: {
                orderId: "",
                glassId: "",
                height: "",
                width: ""
            },
            form1: {
                order: "NG2210210",
                number: 800,
            },
            form2: {
                orderId: "",
                glassId: "",
                height: "",
                width: ""
            },
            form3: {
                orderId: "",
                glassId: "",
                height: "",
                width: ""
            },
            form4: {
                orderId: "",
                glassId: "",
                height: "",
                width: ""
            },
            form5: {
                orderId: "",
                glassId: "",
                height: "",
                width: ""
            },
            form1: {},
            form2: {},
            form3: {},
            form4: {},
            form5: {},
            alarm: [],
            tableData: [],
            cagelist1: [],
@@ -618,7 +696,10 @@
            disabled1: false,
            currentPage: 1,  //默认初始页
            pagesize: 15,    //每页默认显示的数据
            pageCount: 0
            pageCount: 0,
            OutSlice: [],
            AluminumFrame: [],
            framebarcode: ""
        };
    },
    created() {
@@ -666,7 +747,9 @@
                    if (obj.zhuangtai != null) {
                        this.zhuangtai = obj.zhuangtai[0];
                    }
                    if(this.dialogFormVisible7==true){
                        this.showform7();
                    }
                    // this.glassid1 = obj.queid[0];
                    // if (obj.queid[0] != "" && obj.queid[0] != null && obj.state[0] == 0) {
                    //     this.state = false;
@@ -686,23 +769,14 @@
                    if (obj.form2 != null && obj.form2 != "") {
                        this.form2 = obj.form2[0];
                    } else {
                        this.form2 = {
                            orderId: "",
                            glassId: "",
                            height: "",
                            width: ""
                        };
                        this.form2 = {};
                    }
                    if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 1) {
                        this.form3 = obj.form3[0];
                    } else {
                        this.form3 = {
                            orderId: "",
                            glassId: "",
                            height: "",
                            width: ""
                        };
                        this.form3 = {};
                    }
                    if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) {
                        this.form5 = obj.form3[0];
@@ -844,11 +918,10 @@
        //显示订单信息页面
        showform1() {
            if (this.order != "") {
                this.form1 =
                {
                    order: "NG2210210",
                    number: 800,
                };
                SelectGlassNo(this.order).then(res => {
                    this.form1.order = this.order;
                    this.form1.number = res.data.count;
                });
                this.dialogFormVisible1 = true;
            }
        },
@@ -898,6 +971,7 @@
        },
        selectglassinfo() {
            SelectGlass(this.orderid).then(res => {
                this.currentPage = 1;
                this.GlassInfo = res.data.glass;
            });
        },
@@ -906,6 +980,27 @@
                this.GlassInfo = res.data.glass;
            });
            this.dialogFormVisible4 = true;
        },
        showform6() {
            SelectProductionqueue().then(res => {
                this.OutSlice = res.data.listoutslice;
            });
            this.dialogFormVisible6 = true;
        },
        showform7() {
            SelectAluminumFrameInfoById(this.framebarcode).then(res => {
                this.AluminumFrame = res.data.listAluminumFrame;
                this.AluminumFrame.forEach(item => {
                    if(item.storageCage!=null&&item.out_slice==null){
                        item.isCheck = true;
                    }else{
                        item.isCheck = false;
                    }
                    item.Flip=res.data.flip;
                    item.FrameNo=this.framebarcode;
                });
            });
            this.dialogFormVisible7 = true;
        },
        //取消操作时关闭页面
        cancel() {
@@ -956,6 +1051,7 @@
            this.cage = cage;
            SelectCageInfo(cage).then(res => {
                this.cageinfo = res.data.cageinfo;
                console.log(this.cageinfo)
                this.dialogFormVisible3 = true;
            });
        },
@@ -1051,7 +1147,7 @@
        //手动上片
        FeedInglassid() {
            Inglassid(this.insertcage, this.insertcell, this.inserttier, this.form).then(res => {
                if (this.form.glassId != "") {
                if (this.form.barcode != "") {
                    if (res.data.message == 200) {
                        this.$message.success(this.$t('Operation successful'));
                        this.dialogFormVisible = false;
@@ -1072,7 +1168,29 @@
                }
            });
        },
        handleEdit(index, row) {
        //删除出片队列玻璃
        deleteproductionqueueglass(id) {
            this.$prompt(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
                inputType: 'password',
                inputPlaceholder: this.$t('Please enter the password'),
                confirmButtonText: this.$t('Yes'),
                cancelButtonText: this.$t('No'),
                type: 'warning'
            }).then(({ value }) => {
                if (this.password == value) {
                    DeleteProductionQueueGlass(id).then(res => {
                        if (res.data.message == 200) {
                            this.$message.success(this.$t('Operation successful'));
                        }
                    });
                }
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: this.$t('Operation canceled')
                });
            });
        }, handleEdit(index, row) {
            console.log(index, row);
        },
        //表格删除
@@ -1089,36 +1207,26 @@
        },
        //手动添加扫码位玻璃
        InsertQueueGlass(parameter) {
            if (parameter == 1 && this.form5.glassId != "") {
                if (this.form5.glassId != this.form2.glassId) {
                    InsertQueueGlassId(this.form5.glassId, 1).then(res => {
            if (parameter == 1 && this.form5.barcode != "") {
                if (this.form5.barcode != this.form2.barcode) {
                    InsertQueueGlassId(this.form5.barcode, 1).then(res => {
                        if (res.data.message == 200) {
                            this.form5 = {
                                orderId: "",
                                glassId: "",
                                height: "",
                                width: ""
                            };
                            this.form5 = {};
                            this.$message.success(this.$t('Operation successful'));
                        }else{
                        } else {
                            this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
                        }
                    });
                } else {
                    this.$message.error(this.$t('The glass ID already exists in the loading queue'));
                }
            } else if (parameter == 2 && this.form4.glassId != "") {
                if (this.form4.glassId != this.form3.glassId) {
                    InsertQueueGlassId(this.form4.glassId, 2).then(res => {
            } else if (parameter == 2 && this.form4.barcode != "") {
                if (this.form4.barcode != this.form3.barcode) {
                    InsertQueueGlassId(this.form4.barcode, 2).then(res => {
                        if (res.data.message == 200) {
                            this.form4 = {
                                orderId: "",
                                glassId: "",
                                height: "",
                                width: ""
                            };
                            this.form4 = {};
                            this.$message.success(this.$t('Operation successful'));
                        }else{
                        } else {
                            this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
                        }
                    });
@@ -1152,6 +1260,36 @@
                    this.$message.success(this.$t('Operation successful'));
                }
            });
        },
        CheckBoxchange(glassid,isChecked){
            this.AluminumFrame.forEach(item=>{item.barcode=glassid;item.isCheck=isChecked})
            console.log(this.AluminumFrame);
        },
        addoutslice(){
            // var AluminumFrames1=this.AluminumFrame.map(item=>{return item.barcode});
            // var AluminumFrames2=this.AluminumFrame.map(item=>{return item.isCheck});
            // var AluminumFrames3=this.AluminumFrame.map(item=>{return item.Flip});
            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_;
            });
            console.log(dats_);
            //var AluminumFrames=this.AluminumFrame.map((item)=>({barcode,isCheck,Flip}) );
            // console.log(AluminumFrames1);
            // console.log(AluminumFrames2);
            // console.log(AluminumFrames3);
            AddOutSliceS(dats_).then(res=>{
                if (res.data.message == 200) {
                    this.$message.success(this.$t('Operation successful'));
                }
            });
        }
    }
}
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -10,6 +10,7 @@
import com.example.springboot.service.JdbcConnections;
import com.example.springboot.service.SpianService;
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.mapper.AlarmMapper;
import com.example.springboot.mapper.SpianMapper;
@@ -24,8 +25,8 @@
  @Override
  public void run() {
    boolean inglassbegin=false;
    boolean outglassbegin=false;
    boolean inglassbegin = false;
    boolean outglassbegin = false;
    while (this != null) {
      try {
@@ -38,35 +39,33 @@
      spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
      jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
      spianService.selectout("1145");
      //spianService.selectAll2();
      //增加队列表数据
      //spianMapper.insertqueue("1",1,1500);
      String str = "Hello";
      char[] charArray = new char[str.length()];
      for (int i = 0; i < str.length(); i++) {
        charArray[i] = str.charAt(i);
      }
      System.out.println(charArray);
      // spianService.selectout("1145");
      // spianService.selectAll("11");
      // spianService.selectAll2();
      // 增加队列表数据
      // spianMapper.insertqueue("1",1,1500);
      // 根据玻璃id获取订单号,单独数据源
      // try {
      //   Glass glass = jdbcConnections.selectGlass(112);
      // north_glass_buffer1 glass = jdbcConnections.selectGlass(112);
      //   // System.out.println(glass.getOrderId());
      // // System.out.println(glass.getOrderId());
      // } catch (SQLException e) {
      //   // TODO Auto-generated catch block
      //   e.printStackTrace();
      // // TODO Auto-generated catch block
      // e.printStackTrace();
      // }
      //判断进片请求
      // 判断进片请求
      List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 获取prc进片请求数据
      List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 获取进片车状态
      List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.12", 1);// 获取进片车任务是否启动
      //测试启动自定义prc值
      // List<Short> datas1List=new ArrayList<>();
      // datas1List.add((short)1);
      // List<Short> datas1ListState=new ArrayList<>();
      // datas1List.add((short)0);
      // List<Short> datas1ListState2=new ArrayList<>();
      // datas1List.add((short)0);
      if (datas1List != null && datas1ListState != null) {
@@ -74,127 +73,144 @@
        boolean exist = datas1List.contains((short) 1);
        // 获取进片车状态
        boolean exist1 = datas1ListState.contains((short) 0);
        //判断进片车任务是否启动
        // 判断进片车任务是否启动
        boolean exist2 = datas1ListState2.contains((short) 1);
        String glassid="";
        StringBuilder strId=new StringBuilder();
         StringBuilder writedstrId=new StringBuilder();
       if(!inglassbegin&!exist1)//当进片车不空闲时
       {
         inglassbegin=true;
       }
       if(inglassbegin&exist1)//当进片车空闲时
       {
        inglassbegin=false;
        spianMapper.Updatetask(1, 0);//立即结束数据库表中的上片任务
        spianMapper.UpdataAddCageState(1,2);
       }
        String glassid = "";
        StringBuilder strId = new StringBuilder();
        StringBuilder writedstrId = new StringBuilder();
        if (!inglassbegin & !exist1)// 当进片车不空闲时
        {
          inglassbegin = true;
        }
        if (inglassbegin & exist1)// 当进片车空闲时
        {
          inglassbegin = false;
          spianMapper.Updatetask(1, 0);// 立即结束数据库表中的上片任务
          spianMapper.UpdataAddCageState(1, 2);
        }
        // 进片请求为1时
        if (exist == true) {
          // 当进片车空闲时
          if (exist1 == true) {
            //获取已下发的进片id 与plc请求的id作比较
              byte[] writedglassidbytes = S7control.getinstance().ReadByte("DB105.16", 1);
            // 获取已下发的进片id 与plc请求的id作比较
            byte[] writedglassidbytes = S7control.getinstance().ReadByte("DB105.16", 13);
            if (writedglassidbytes != null) { //
              // 获取玻璃id
              for (byte iditem : writedglassidbytes) {
              for (byte iditem : writedglassidbytes) {
                writedstrId.append(iditem);
              }
            }
            // 获取进片id
            byte[] datas1ListID = S7control.getinstance().ReadByte("DB106.26", 1);
            byte[] datas1ListID = S7control.getinstance().ReadByte("DB106.26", 13);
            if (datas1ListID != null) {
              // 获取玻璃id
              for (byte list1 : datas1ListID) {
              for (byte list1 : datas1ListID) {
                strId.append(list1);
              }
              if(!writedstrId.toString().equals(strId.toString())) //已经下发的id与plc请求的id不一样时,认为不是重复的任务,才执行下发任务指令
              if (!writedstrId.toString().equals(strId.toString())) // 已经下发的id与plc请求的id不一样时,认为不是重复的任务,才执行下发任务指令
              {
                 int glasslimit=1;//判断是否是多片上片
                 if(glasslimit==1){
                int glasslimit = 1;// 判断是否是多片上片
                if (glasslimit == 1) {
                  spianService.selectAll(strId.toString());
                 }else{
                } else {
                  spianService.selectAll(strId.toString());
                 }
                  S7control.getinstance().WriteByte("DB105.16",datas1ListID);//派发进片id
                }
                S7control.getinstance().WriteByte("DB105.16", datas1ListID);// 派发进片id
              }
              //spianService.selectAll(Short.parseShort(strId.toString()));
              // spianService.selectAll(Short.parseShort(strId.toString()));
            }
          }
          // System.out.println(exist);
        }
//下发任务后将任务启动改为0
           if(exist1==false){  //进片车忙碌时
          if(exist2==true) {   //任务已启动时
          S7control.getinstance().WriteWord("DB105.12",(short)0);//进片任务启动改为0
          }
        // 下发任务后将任务启动改为0
        if (exist1 == false) { // 进片车忙碌时
          if (exist2 == true) { // 任务已启动时
            S7control.getinstance().WriteWord("DB105.12", (short) 0);// 进片任务启动改为0
          }
        }
      }
      //spianService.selectAll((short) 111);
      List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态
      List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.14", 1); // 出片任务是否启动
      StringBuilder writedstrIdOut=new StringBuilder();
       //获取已下发的出片id
              byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 1);
            if (writedglassidbytesOut != null) {
              // 获取玻璃id
              for (byte iditem : writedglassidbytesOut) {
                writedstrIdOut.append(iditem);
              }
            }
      boolean outstate=false;//出片车空闲判断
      boolean outstate1=false;//出片车任务是否启动
       if (outlist != null&&outlist1!=null) {
        // 判断按订单出片
         outstate = outlist.contains((short) 0);//出片车空闲判断
         outstate1 = outlist1.contains((short) 1);//出片车任务是否启动
          Glass glass=spianMapper.SelectDBOut();//判断是否有调拨后的出片任务未完成
          if(!outglassbegin&!outstate)//当任务还未开始,且出片车不空闲时,任务状态改为开始
       {
         outglassbegin=true;
       }
       if(outglassbegin&outstate)//当任务开始且出片车空闲时
       {
        outglassbegin=false;
        spianMapper.UpdatetaskOut(); //完成上一次出片或者调度任务
        spianMapper.UpdataAddCageState(0,3);
       }
         if(outstate== true &glass.getGlassId()!=null){ //当出片车空闲且有出片任务待完成时
          if(glass.getId()==2&!writedstrIdOut.toString().equals(glass.getGlassId().toString())){
           spianService.selectout2(glass.getGlassId().toString());
            }
        }
        if(outstate==false){//下发任务后将任务启动改为0//出片车空闲判断
          if(outstate1==true){
            S7control.getinstance().WriteWord("DB105.14",(short)0);//出片任务启动改为0
          }
         }
      StringBuilder writedstrIdOut = new StringBuilder();
      // 获取已下发的出片id
      byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 13);
      if (writedglassidbytesOut != null) {
        // 获取玻璃id
        for (byte iditem : writedglassidbytesOut) {
          writedstrIdOut.append((char) iditem);
        }
      }
        if (outstate == true) { // 出片车状态空闲时
            Integer state=spianMapper.Selectoutstate();
            String orderid = spianMapper.SelectOrderout();
            if (orderid != null &&state==0) {
              spianService.selectout(orderid);
            }
      // 获取BO1数据
      StringBuilder queueid1 = spianService.queGlassid("DB103.DBB32");
      // 获取BO2数据
      StringBuilder queueid2 = spianService.queGlassid("DB103.DBB46");
      if (queueid1 != null) {
        // 写入B01的数据到上片队列表
        spianMapper.insertqueue(queueid1.toString(), 1, 0);
      }
      if (queueid2 != null) {
        // 写入B02的数据到上片队列表
        spianMapper.insertqueue(queueid2.toString(), 2, 0);
      }
      // 出片任务////////////////////////////////
      boolean outstate = false;// 出片车空闲判断
      boolean outstate1 = false;// 出片车任务是否启动
      if (outlist != null && outlist1 != null) {
        // 判断按订单出片
        outstate = outlist.contains((short) 0);// 出片车空闲判断
        outstate1 = outlist1.contains((short) 1);// 出片车任务是否启动
        north_glass_buffer1 glass = spianMapper.SelectDBOut();// 判断是否有调拨后的出片任务未完成
        if (!outglassbegin & !outstate)// 当任务还未开始,且出片车不空闲时,任务状态改为开始
        {
          outglassbegin = true;
        }
        if (outglassbegin & outstate)// 当任务开始且出片车空闲时
        {
          outglassbegin = false;
          spianMapper.UpdatetaskOut(); // 完成上一次出片或者调度任务
          spianMapper.UpdataAddCageState(0, 3);// 将出片中的格子状态改成0
        }
        if (outstate == true & glass.getbarcode() != null) { // 当出片车空闲且有出片任务待完成时
          // 判断有两个出片或调拨任务时并且出片id和未完成的出片任务id不一样时执行出片
          if (glass.getId() == 2 & !writedstrIdOut.toString().equals(glass.getbarcode().toString())) {
            spianService.selectout2(glass.getbarcode().toString());
          }
        }
        // 判断当前是否有未执行的任务
        int outnum = spianMapper.SelectOutSliceshu();
        if (outnum == 0) {
          // 判断铝框出片队列表是否有待出片的玻璃
          String outglassid = spianMapper.SelectOutSlice();
          if (outglassid != null) {
            spianService.selectout2(outglassid);
          }
        }
        if (outstate == false) {// 下发任务后将任务启动改为0//出片车空闲判断
          if (outstate1 == true) {
            S7control.getinstance().WriteWord("DB105.14", (short) 0);// 出片任务启动改为0
          }
        }
      }
      if (outstate == true) { // 出片车状态空闲时
        Integer state = spianMapper.Selectoutstate();
        String orderid = spianMapper.SelectOrderout();
        if (orderid != null && state == 0) {
          spianService.selectout(orderid);
        }
      }
      // 查询数据库
      // 推送到前端
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter1.java
@@ -66,20 +66,22 @@
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      // this.readValue();
      // String PlcAddress = this.name;
      // Integer Plccount = this.count;
//      this.readValue();
//      String PlcAddress = this.name;
//      Integer Plccount = this.count;
      // System.out.println(stt);
      // List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12);
      // List<Short> fanzhuan1 = S7control.getinstance().ReadWord("DB100.8", 1);
      // List<Short> xiaoche1 = S7control.getinstance().ReadWord("DB100.12", 1);
      Short[] values1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
      List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
      Short[] fanzhuan = { 4 };
      List<Short> fanzhuan1 = new ArrayList<>(Arrays.asList(fanzhuan));
      Short[] xiaoche = { 5 };
      List<Short> xiaoche1 = new ArrayList<>(Arrays.asList(xiaoche));
       List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12);
       List<Short> fanzhuan1 = S7control.getinstance().ReadWord("DB100.8", 1);
       List<Short> xiaoche1 = S7control.getinstance().ReadWord("DB100.12", 1);
//      Short[] values1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
//      List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
//      Short[] fanzhuan = { 4 };
//      List<Short> fanzhuan1 = new ArrayList<>(Arrays.asList(fanzhuan));
//      Short[] xiaoche = {5};
//      List<Short> xiaoche1 = new ArrayList<>(Arrays.asList(xiaoche));
      JSONObject jsonObject = new JSONObject();
      // new short[]{1,1, 1, 1, 1, 1, 2, 33, 2,3, 4, 5}
@@ -90,16 +92,13 @@
      jsonObject.append("xiaoche", xiaoche1);
      WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter1");
      // System.out.println(sendwServer);
      if (sendwServer != null) {
        sendwServer.sendMessage(jsonObject.toString());
      }
      WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("Parameter1");
      if (webSocketServer != null) {
        List<String> messages = webSocketServer.getMessages();
        // System.out.println(messages);
        String addressList1 = "DB100.0";
        String addressList2 = "DB100.8";
        String addressList3 = "DB100.12";
@@ -107,9 +106,9 @@
        if (!messages.isEmpty()) {
          // 将最后一个消息转换为 short 类型的列表
          String lastMessage = messages.get(messages.size() - 1);
          // System.out.println("lastMessage:" + lastMessage);
//        System.out.println("lastMessage:" + lastMessage);
          JSONArray messageArray = new JSONArray(lastMessage);
          // System.out.println(messageArray);
          // 整合第 1 到 3 个数组并去掉 null 元素
          List<Short> mergedList = new ArrayList<>();
          for (int i = 0; i < 3; i++) {
@@ -136,9 +135,8 @@
              try {
                String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
                short sValue = Short.parseShort(cleanedValue.trim());
                // S7control.getinstance().WriteWord(addressList1, Arrays.asList(sValue));
                System.out
                    .println("messageValue:" + Arrays.asList(sValue) + " written to PLC at address " + addressList1);
               S7control.getinstance().WriteWord(addressList1, Arrays.asList(sValue));
                System.out.println("messageValue:" + Arrays.asList(sValue) + " written to PLC at address " + addressList1);
              } catch (NumberFormatException e) {
                // 如果无法解析为 short 类型,则忽略该部分
                System.err.println("Could not parse value: " + value);
@@ -153,9 +151,8 @@
              try {
                String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
                short sValue = Short.parseShort(cleanedValue.trim());
                // S7control.getinstance().WriteWord(addressList2, Arrays.asList(sValue));
                System.out
                    .println("messageValue:" + Arrays.asList(sValue) + " written to PLC at address " + addressList2);
               S7control.getinstance().WriteWord(addressList2, Arrays.asList(sValue));
                System.out.println("messageValue:" + Arrays.asList(sValue) + " written to PLC at address " + addressList2);
              } catch (NumberFormatException e) {
                // 如果无法解析为 short 类型,则忽略该部分
                System.err.println("Could not parse value: " + value);
@@ -165,15 +162,16 @@
          // 写入第三个地址
          if (!mergedList.isEmpty()) {
            // S7control.getinstance().WriteWord(addressList3, mergedList);
          S7control.getinstance().WriteWord(addressList3, mergedList);
            System.out.println("messageValue:" + mergedList + " written to PLC at address " + addressList3);
          }
          // 清空消息列表
          webSocketServer.clearMessages();
        }
      }
    }
    }
  }
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java
@@ -66,22 +66,64 @@
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
//      this.readValue();
//      String PlcAddress = this.name;
//      Integer Plccount = this.count;
      // System.out.println(stt);
      // List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12);
      // List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10);
      Boolean[] values = { false, true, true, true, true, true, true, true, true,
              true};
      List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values));
      Short[] values1 = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
      List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
      List<String> addressList1 = new ArrayList<>();
      addressList1.add("DB103.32~45");
      addressList1.add("DB103.46~59");
      addressList1.add("DB103.60~73");
      addressList1.add("DB103.74~101");
      addressList1.add("DB103.102~115");
      addressList1.add("DB103.116~143");
      addressList1.add("DB103.144~157");
      addressList1.add("DB103.158~171");
      addressList1.add("DB103.172~185");
      addressList1.add("DB103.200~213");
      addressList1.add("DB103.228~241");
      List<Boolean> paramlist = S7control.getinstance().readBits(addressList1);
      Short[] values2 = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
      List<Short> state = new ArrayList<>(Arrays.asList(values2));
      List<String> addresses = new ArrayList<>();
      addresses.add("DB103.0");
      addresses.add("DB103.2");
      addresses.add("DB103.12");
      addresses.add("DB103.14");
      addresses.add("DB103.16");
      addresses.add("DB103.18");
      addresses.add("DB103.8");
      addresses.add("DB103.10");
      addresses.add("DB103.4");
      addresses.add("DB103.6");
      List<Short> data = S7control.getinstance().readWords(addresses);
      List<Boolean> data2 = S7control.getinstance().ReadBits("DB101.9.2", 10);
      List<String> addressList3 = new ArrayList<>();
      addressList3.add("DB106.64-DB106.77");
      List<Boolean> data3 = S7control.getinstance().readBits(addressList3);
      List<String> addresses4 = new ArrayList<>();
      addresses.add("DB106.0");
      addresses.add("DB106.12");
      addresses.add("DB106.40");
      addresses.add("DB106.50");
      List<Short> data4 = S7control.getinstance().readWords(addresses4);
//     Boolean[] values = { false, true, true, true, true, true, true, true, true,
//            true};
//      List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values));
//      Short[] values1 = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
//     List<Short> data = new ArrayList<>(Arrays.asList(values1));
//      Short[] values2 = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
//     List<Short> data2 = new ArrayList<>(Arrays.asList(values2));
//      Short[] values3 = { 11};
//     List<Short> data3 = new ArrayList<>(Arrays.asList(values3));
//      Short[] values4 = { 2,2,3,4};
//      List<Short> data4 = new ArrayList<>(Arrays.asList(values4));
      JSONObject jsonObject = new JSONObject();
      short[] params = new short[paramlist.size()];
@@ -89,11 +131,13 @@
        boolean value = paramlist.get(i);
        params[i] = value ? (short) 1 : (short) 0;
      }
      // new short[]{1,1, 1, 1, 1, 1, 2, 33, 2,3, 4, 5}
      // new short[]{0,0, 0, 0, 0, 0, 0, 0, 0, 0}
      jsonObject.append("params", params);
      jsonObject.append("params", arraylist);
      jsonObject.append("params", state);
      jsonObject.append("params", data2);
      jsonObject.append("params", data);
      jsonObject.append("params", data3);
      jsonObject.append("params", data4);
      WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter2");
      if (sendwServer != null) {
@@ -105,7 +149,7 @@
        List<String> messages = webSocketServer.getMessages();
        String addressList = "DB2.0.0";
        String addressList = "DB101.9.2";
        if (!messages.isEmpty()) {
          // 将最后一个消息转换为整数类型的列表
@@ -132,7 +176,7 @@
          }
          // 将布尔列表写入 PLC
//          S7control.getinstance().WriteBit(addressList, messageBooleans);
         S7control.getinstance().WriteBit(addressList, messageBooleans);
          System.out.println("messageValues:" + messageBooleans);
          System.out.println("addressList:" + addressList);
          // 清空消息列表
springboot-vue3/src/main/java/com/example/springboot/component/PlcPositioning1.java
@@ -79,16 +79,16 @@
//            Integer Plccount = this.count;
            // System.out.println(stt);
            // List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12);
            // List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10);
  List<Short> arraylist = S7control.getinstance().ReadWord("DB100.42", 20);
//            Short[] 存片 = { 1 };
//            List<Short> 存片1 = new ArrayList<>(Arrays.asList(存片));
//            Short[] 接片 = { 1 };
//            List<Short> 接片1 = new ArrayList<>(Arrays.asList(接片));
//            Short[] 间距 = { 1 };
//            List<Short> 间距1 = new ArrayList<>(Arrays.asList(间距));
            Short[] values1 = {1,1,1, 1,2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12,13,14,15,16,17,18,19,20 };
            List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
//            Short[] values1 = {1,1,1, 1,2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12,13,14,15,16,17,18,19,20 };
//            List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
            JSONObject jsonObject = new JSONObject();
springboot-vue3/src/main/java/com/example/springboot/component/PlcPositioning2.java
@@ -72,10 +72,10 @@
//            Integer Plccount = this.count;
            // System.out.println(stt);
            // List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12);
            // List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10);
            Short[] values1 = { 1,2, 3, 4, 5 , 11, 12,13,14,15};
            List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
            List<Short> arraylist = S7control.getinstance().ReadWord("DB100.88", 10);
//            Short[] values1 = { 1,2, 3, 4, 5 , 11, 12,13,14,15};
//            List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
            JSONObject jsonObject = new JSONObject();
@@ -94,7 +94,7 @@
            if (webSocketServer != null) {
                List<String> messages = webSocketServer.getMessages();
                String addressList3 = "DB100.12";
                String addressList3 = "DB100.88";
                if (!messages.isEmpty()) {
                    // 将最后一个消息转换为 short 类型的列表
springboot-vue3/src/main/java/com/example/springboot/component/PlcServoManualone.java
New file
@@ -0,0 +1,238 @@
package com.example.springboot.component;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import org.apache.commons.io.FileUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class PlcServoManualone extends Thread {
  String name = "";
  Integer count = 0;
  public static String readFileToString(String filePath) throws IOException {
    File file = new File(filePath);
    return FileUtils.readFileToString(file, "UTF-8");
  }
  public void readValue() {
    String str = "";
    BufferedReader bufferedReader = null;
    FileInputStream fileInputStream;
    try {
      // 从文件中读取字节数据存入 fileInputStream
      fileInputStream = new FileInputStream("CanadaMes-ui/src/configuration/address.json");
      // 读取 fileInputStream 中字节并将其解码为字符
      InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
      // 提高读取效率,在 BufferedReader 内包装 InputStreamReader
      bufferedReader = new BufferedReader(inputStreamReader);
      String line = null;
      // 将 bufferedReader 内容一行一行赋值给str
      while ((line = bufferedReader.readLine()) != null) {
        str += line;
      }
      // 将str字符串格式转为json
      JSONObject jsonObject = new JSONObject(str);
      // 获取json中的值
      JSONArray address = jsonObject.getJSONArray("ServoManualone");
      for (int i = 0; i < address.size(); i++) {
        JSONObject ress = (JSONObject) address.get(i);
        this.name = ress.getStr("name");
        this.count = ress.getInt("count");
      }
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
  @Override
  public void run() {
    while (this != null) {
      try {
        Thread.sleep(500);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
//      this.readValue();
//      String PlcAddress = this.name;
//      Integer Plccount = this.count;
      List<String> addresses = new ArrayList<>();
      addresses.add("DB103.25");
      addresses.add("DB100.144");
      addresses.add("DB100.148-161");
      addresses.add("DB100.184");
      addresses.add("DB100.186");
      addresses.add("DB100.180");
      addresses.add("DB100.182");
      List<Short> arraylist = S7control.getinstance().readWords(addresses);
      List<String> addresses2 = new ArrayList<>();
      addresses2.add("DB103.26");
      addresses2.add("DB100.188");
      addresses2.add("DB100.190");
      addresses2.add("DB100.146");
      addresses2.add("DB100.162-175");
      List<Short> arraylist2 = S7control.getinstance().readWords(addresses2);
      List<String> addresses3 = new ArrayList<>();
      addresses3.add("DB103.42");
      List<Short> arraylist3 = S7control.getinstance().readWords(addresses3);
      List<String> addresses4 = new ArrayList<>();
      addresses4.add("DB103.46");
      List<Short> arraylist4 = S7control.getinstance().readWords(addresses4);
      List<Short> arraylist5 = S7control.getinstance().ReadWord("DB103.27", 2);
      List<Short> arraylist6 = S7control.getinstance().ReadWord("DB103.29", 2);
      List<String> addresses7 = new ArrayList<>();
      addresses7.add("DB104.24");
      addresses7.add("DB104.26");
      addresses7.add("DB104.20");
      addresses7.add("DB104.22");
      addresses7.add("DB104.28");
      addresses7.add("DB104.30");
      List<Short> arraylist7 = S7control.getinstance().readWords(addresses7);
//      List<String> addresses8 = new ArrayList<>();
//      addresses8.add("DB103.26");
//      addresses8.add("DB103.26");
//      addresses8.add("DB103.26");
//      addresses8.add("DB103.26");
//      List<Short> arraylist8 = S7control.getinstance().readWords(addresses8);
//      Short[] values1 = { 1, 2, 3, 4, 5, 6, 7};
//      List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
//      Short[] values2 = { 1, 2, 3, 4, 5};
//      List<Short> arraylist2 = new ArrayList<>(Arrays.asList(values2));
//      Short[] values3 = {1};
//      List<Short> arraylist3 = new ArrayList<>(Arrays.asList(values3));
//      Short[] values4 = {2};
//      List<Short> arraylist4 = new ArrayList<>(Arrays.asList(values4));
//      Short[] values5 = {3,3};
//      List<Short> arraylist5 = new ArrayList<>(Arrays.asList(values5));
//      Short[] values6 = { 4,4};
//      List<Short> arraylist6 = new ArrayList<>(Arrays.asList(values6));
//      Short[] values7 = { 1,1,1,1,1,1};
//      List<Short> arraylist7 = new ArrayList<>(Arrays.asList(values7));
//      Short[] values8 = { 1,1,1,1,1,1};
//      List<Short> arraylist8 = new ArrayList<>(Arrays.asList(values8));
      JSONObject jsonObject = new JSONObject();
      jsonObject.append("zuhe1", arraylist);
      jsonObject.append("zuhe2", arraylist2);
      jsonObject.append("zuhe3", arraylist3);
      jsonObject.append("zuhe4", arraylist4);
      jsonObject.append("zuhe5", arraylist5);
      jsonObject.append("zuhe6", arraylist6);
      jsonObject.append("guzhang", arraylist7);
//      jsonObject.append("weihuiling", arraylist8);
      WebSocketServer sendwServer = WebSocketServer.sessionMap.get("ServoManualone");
      if (sendwServer != null) {
        sendwServer.sendMessage(jsonObject.toString());
      }
      WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("ServoManualone");
      if (webSocketServer != null) {
        List<String> messages = webSocketServer.getMessages();
        List<String> waddresses1 = new ArrayList<>();
        waddresses1.add("DB103.25");
        waddresses1.add("DB100.144");
        waddresses1.add("DB100.148-161");
        waddresses1.add("DB100.184");
        waddresses1.add("DB100.186");
        waddresses1.add("DB100.180");
        waddresses1.add("DB100.182");
        List<String> waddresses2 = new ArrayList<>();
        waddresses2.add("DB103.26");
        waddresses2.add("DB100.188");
        waddresses2.add("DB100.190");
        waddresses2.add("DB100.146");
        waddresses2.add("DB100.162-175");
        if (!messages.isEmpty()) {
          // 将最后一个消息转换为 short 类型的列表
          String lastMessage = messages.get(messages.size() - 1);
//        System.out.println("lastMessage:" + lastMessage);
          JSONArray messageArray = new JSONArray(lastMessage);
          // 写入第一个地址
          if (messageArray.getJSONArray(0).size() > 0) {
            JSONArray jsonArray = messageArray.getJSONArray(0);
            List<Short> sValue = new ArrayList<>();
            for (int i = 0; i < jsonArray.size(); i++) {
              Object value = jsonArray.get(i);
              if (value != null && !value.toString().equals("null")) {
                try {
                  String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
                  short val = Short.parseShort(cleanedValue.trim());
                  sValue.add(val);
                  System.out.println("messageValue:" + Arrays.asList(val) + " added to the list");
                } catch (NumberFormatException e) {
                  // 如果无法解析为 short 类型,则忽略该部分
                  System.err.println("Could not parse value: " + value);
                }
              }
            }
            if (!sValue.isEmpty()) {
              S7control.getinstance().WriteWord(waddresses1, sValue);
              System.out.println("Values " + sValue + " written to PLC at address " + waddresses1);
            }
          }
          if (messageArray.getJSONArray(1).size() > 0) {
            JSONArray jsonArray = messageArray.getJSONArray(1);
            List<Short> sValue2 = new ArrayList<>();
            for (int i = 0; i < jsonArray.size(); i++) {
              Object value = jsonArray.get(i);
              if (value != null && !value.toString().equals("null")) {
                try {
                  String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
                  short val = Short.parseShort(cleanedValue.trim());
                  sValue2.add(val);
                  System.out.println("messageValue:" + Arrays.asList(val) + " added to the list");
                } catch (NumberFormatException e) {
                  // 如果无法解析为 short 类型,则忽略该部分
                  System.err.println("Could not parse value: " + value);
                }
              }
            }
            if (!sValue2.isEmpty()) {
              S7control.getinstance().WriteWord(waddresses2, sValue2);
              System.out.println("Values " + sValue2 + " written to PLC at address " + waddresses2);
            }
          }
          // 清空消息列表
          webSocketServer.clearMessages();
        }
      }
    }
  }
}
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -1,18 +1,10 @@
package com.example.springboot.component;
import cn.hutool.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.PostMapping;
import com.example.springboot.common.Result;
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.alarmmg;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.mapper.HomeMapper;
import com.example.springboot.mapper.SpianMapper;
import com.example.springboot.service.JdbcConnections;
@@ -45,12 +37,18 @@
            List<StorageCage> cagelist3 = homeMapper.selectRack3();
            List<StorageCage> cagelist4 = homeMapper.selectRack4();
            jsonObject.append("cagelist1", cagelist1);
            jsonObject.append("cagelist2", (Object) cagelist2);
            jsonObject.append("cagelist2", cagelist2);
            jsonObject.append("cagelist3", cagelist3);
            jsonObject.append("cagelist4", cagelist4);
            // 进出片任务
            List<StorageCage> tasklist1 = homeMapper.selectinout(3);
            List<StorageCage> tasklist2 = homeMapper.selectinout(2);
            for (StorageCage storageCage : tasklist1) {
                storageCage.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(storageCage.getGlassId()));
            }
            for (StorageCage storageCage : tasklist2) {
                storageCage.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(storageCage.getGlassId()));
              }
            jsonObject.append("tasklist1", tasklist1);
            jsonObject.append("tasklist2", tasklist2);
            // 查询报警信息
@@ -62,17 +60,18 @@
            // addressList.add("DB106.0");
            // List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
            // if (paramlist != null) {
            //     jsonObject.append("params", paramlist);
            // jsonObject.append("params", paramlist);
            // }
            // // 获取进片车状态
            // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 获取进片车状态
            // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
            // 1);// 获取进片车状态
            // boolean exist1 = datas1ListState.contains((short) 0);
            // jsonObject.append("zhuangtai", exist1);
            //获取进片玻璃信息
            // 获取进片玻璃信息
            // List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
            // if (inglassInfo != null) {
            //     if (inglassInfo.size() > 0)
            //         jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
            // if (inglassInfo.size() > 0)
            // jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
            // }
            // 伍 获取进是否有待确认的玻璃id
            String queid = spianMapper.Selectqueueid();
@@ -80,8 +79,10 @@
            jsonObject.append("queid", queid);
            jsonObject.append("state", state);
            // 获取扫码位与上片位玻璃信息
            Glass form2 = homeMapper.GetQueueInfo(2);
            Glass form3 = homeMapper.GetQueueInfo(1);
            String queueglassid2 = homeMapper.GetQueueInfo(2);
            String queueglassid1 = homeMapper.GetQueueInfo(1);
            north_glass_buffer1 form2 = homeMapper.SelectGlassByGlassID(queueglassid2);
            north_glass_buffer1 form3 = homeMapper.SelectGlassByGlassID(queueglassid1);
            jsonObject.append("form2", form2);
            jsonObject.append("form3", form3);
            // List<Short> paramlists = new ArrayList<Short>();
@@ -91,7 +92,6 @@
            // paramlists.add(para2);
            // System.out.println(paramlists);
            dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
            boolean dbconnected = false;
            try {
springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
@@ -79,16 +79,36 @@
     * @param datas   word的值
     */
    public void WriteWord(List<String> address, List<Short> datas) {
        if (s7PLC==null)
        if (s7PLC == null)
            return;
        // s7PLC.write(address, data);
        MultiAddressWrite addressWrite = new MultiAddressWrite();
        for (int i = 0; i < address.size(); i++) {
            addressWrite.addInt16(address.get(i), datas.get(i));
            String addr = address.get(i);
            short data = datas.get(i);
            if (addr.contains("-")) {
                // 处理范围地址
                String[] range = addr.split("-");
                if (range.length == 2) {
                    String startAddr = range[0].trim();
                    String endAddr = range[1].trim();
                    int startIndex = Integer.parseInt(startAddr.substring(startAddr.indexOf('.') + 1));
                    int endIndex = Integer.parseInt(endAddr.substring(endAddr.indexOf('.') + 1));
                    for (int j = startIndex; j <= endIndex; j++) {
                        String currentAddress = startAddr.substring(0, startAddr.indexOf('.') + 1) + j;
                        s7PLC.writeInt16(currentAddress, data); // 将数据写入当前地址
                    }
                }
            } else {
                // 处理单个地址
                s7PLC.writeInt16(addr, data); // 将数据写入单个地址
            }
        }
        s7PLC.writeMultiData(addressWrite);
    }
@@ -255,6 +275,42 @@
        return s7PLC.readBoolean(addresslist);
    }
    public List<Boolean> readBits(List<String> addressList) {
        if (s7PLC == null)
            return null;
        List<Boolean> result = new ArrayList<>();
        for (String address : addressList) {
            if (address.contains("~")) {
                String[] range = address.split("~");
                String startAddress = range[0];
                String endAddress = range[1];
                int startIndex = extractAddressNumber(startAddress);
                int endIndex = extractAddressNumber(endAddress);
                String prefix = startAddress.substring(0, startAddress.indexOf(".") + 1);
                for (int i = startIndex; i <= endIndex; i++) {
                    String newAddress = prefix + i;
                    result.add(s7PLC.readBoolean(newAddress));
                }
            } else {
                result.add(s7PLC.readBoolean(address));
            }
        }
        return result;
    }
    private int extractAddressNumber(String address) {
        String numberStr = address.replaceAll("\\D+", ""); // 使用正则表达式提取数字部分
        return Integer.parseInt(numberStr);
    }
    /**
     * 从指定的地址开始 连续按bit位读取
     *
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -1,23 +1,30 @@
package com.example.springboot.controller;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.util.PropertySource.Comparator;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.mapper.HomeMapper;
import com.example.springboot.mapper.SpianMapper;
import com.example.springboot.service.HomeService;
import com.example.springboot.service.MultiFieldComparator;
import com.example.springboot.service.SpianService;
import com.example.springboot.common.Result;
import com.example.springboot.component.S7control;
import com.example.springboot.entity.CarPosition;
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.alarmmg;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.entity.Out_slice;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/home")
@@ -62,6 +69,9 @@
  @GetMapping("/loadinout")
  public Result selectinout(Integer types) {
    List<StorageCage> storageCageinout = homeMapper.selectinout(types);
    for (StorageCage storageCage : storageCageinout) {
      storageCage.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(storageCage.getGlassId()));
    }
    Map<String, Object> map = new HashMap<>();
    map.put("list", storageCageinout);
    return Result.success(map);
@@ -110,11 +120,9 @@
    homeMapper.UpdateTask(types);
    StorageCage glass = homeMapper.SelectGlassInfo(glassid);
    if (types == 0) {
      // spianMapper.UpdataAddCage1(glass.getGlassWidth(),glass.getCage(),glass.getCell());
      homeMapper.UpdateCageTask1(glassid);
      S7control.getinstance().WriteWord("DB105.14", (short) 0);
    } else {
      spianMapper.UpdataOutCage1(glass.getGlassWidth(), glass.getCage(), glass.getCell());
      homeMapper.UpdateCageTask2(glassid);
      S7control.getinstance().WriteWord("DB105.12", (short) 0);
@@ -136,6 +144,9 @@
  @GetMapping("/SelectCageInfo")
  public Result SelectCageInfo(short cage) {
    List<StorageCage> cageinfo = homeMapper.SelectCageInfo(cage);
    for (StorageCage storageCage : cageinfo) {
      storageCage.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(storageCage.getGlassId()));
    }
    Map<String, Object> map = new HashMap<>();
    map.put("cageinfo", cageinfo);
    return Result.success(map);
@@ -193,9 +204,9 @@
  // 根据玻璃id查询玻璃信息
  @GetMapping("/SelectGlassByGlassID")
  public Result SelectGlassByGlassID(String glassid) {
    Glass Glass = homeMapper.SelectGlassByGlassID(glassid);
    north_glass_buffer1 north_glass_buffer1s = homeMapper.SelectGlassByGlassID(glassid);
    Map<String, Object> map = new HashMap<>();
    map.put("form", Glass);
    map.put("form", north_glass_buffer1s);
    return Result.success(map);
  }
@@ -210,14 +221,14 @@
  // 手动往理片笼添加玻璃
  @PostMapping("/Inglassid")
  public Result Inglassid(short cage, short cell, short tier, @RequestBody Glass glass) {
  public Result Inglassid(short cage, short cell, short tier, @RequestBody north_glass_buffer1 north_glass_buffer1s) {
    Map<String, Object> map = new HashMap<>();
    short result = homeMapper.SelectStorageByGlassId(glass.getGlassId());
    short result = homeMapper.SelectStorageByGlassId(north_glass_buffer1s.getbarcode());
    if (result > 0) {
      map.put("message", "300");
    } else {
      homeMapper.Inglassid(glass, cage, cell, tier);
      spianMapper.UpdataAddCage1(glass.getwidth(), cage, cell);
      homeMapper.Inglassid(north_glass_buffer1s, cage, cell, tier);
      spianMapper.UpdataAddCage1(north_glass_buffer1s.getglasslengthMm(), cage, cell);
    }
    return Result.success(map);
  }
@@ -226,7 +237,7 @@
  @PostMapping("/SelectGlass")
  public Result SelectGlass(String orderid) {
    Map<String, Object> map = new HashMap<>();
    List<Glass> glass = homeMapper.SelectGlass(orderid);
    List<north_glass_buffer1> glass = homeMapper.SelectGlass(orderid);
    map.put("glass", glass);
    return Result.success(map);
  }
@@ -240,6 +251,8 @@
      map.put("message", "300");
    } else {
      homeMapper.InsertQueueGlassId(glassid, id);
    //调用伍存储过程
    spianMapper.selectAll(glassid);
      map.put("message", "200");
    }
    return Result.success(map);
@@ -263,4 +276,100 @@
    return Result.success(map);
  }
  // 查询此订单在理片笼里的玻璃数
  @PostMapping("/SelectGlassNo")
  public Result SelectGlassNo(String orderid) {
    Short count = homeMapper.SelectGlassNo(orderid);
    Map<String, Object> map = new HashMap<>();
    map.put("count", count);
    return Result.success(map);
  }
  // 根据铝框id获取对应玻璃信息
  @PostMapping("/SelectAluminumFrameInfoById")
  public Result SelectAluminumFrameInfoById(String FrameBarcode) {
    List<north_glass_buffer1> listAluminumFrame = homeMapper.SelectAluminumFrameInfoById(FrameBarcode);
    String flip=homeMapper.SelectFlipByFrameBarcode(FrameBarcode);
    for (north_glass_buffer1 north_glass_buffer1 : listAluminumFrame) {
      north_glass_buffer1.setstorageCage(homeMapper.SelectStorageGlassById(north_glass_buffer1.getbarcode()));
      north_glass_buffer1.setOut_slice(homeMapper.SelectQueueByglassid(north_glass_buffer1.getbarcode()));
    }
    Map<String, Object> map = new HashMap<>();
    map.put("listAluminumFrame", listAluminumFrame);
    map.put("flip", flip);
    return Result.success(map);
  }
  // 查询出片队列数据
  @PostMapping("/SelectProductionqueue")
  public Result SelectProductionqueue() {
    List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
    for (Out_slice out_slice : listoutslice) {
      out_slice.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(out_slice.getGlassId()));
      out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
    }
    //HashMap<String,List<Out_slice>> map=new HashMap<String,List<Out_slice>>();
    // HashMap map=new HashMap<>();
    // for (Out_slice out_slice : listoutslice) {
    //   String key_=out_slice.getState()+"-";
    //   if (map.get(key_)==null) {
    //     List<Out_slice> lists=new ArrayList<Out_slice>();
    //     lists.add(out_slice);
    //     map.put(key_, lists);
    //   }else{
    //     List<Out_slice> lists=(List<Out_slice>)map.get(key_);
    //     lists.add(out_slice);
    //     map.put(key_,lists);
    //   }
    // }
    // System.out.println(map);
    // List<Out_slice> listskey=(List<Out_slice>)map.get("1-");
    // List<Out_slice> list=new ArrayList<Out_slice>();
    // for (Out_slice out_slice : listskey) {
    //   if (list.isEmpty()) {
    //     list.add(out_slice);
    //   }else{
    //     for (int i=0;i<list.size();i++) {
    //       Out_slice out_slice2=list.get(i);
    //       if(out_slice.getID()>out_slice2.getID()){
    //         continue;
    //       }else{
    //         list.add(i,out_slice2);
    //       }
    //     }
    //   }
    // }
    //Collections.sort(listoutslice,new MultiFieldComparator());
    Map<String, Object> maps = new HashMap<>();
    maps.put("listoutslice", listoutslice);
    return Result.success(maps);
  }
  // 根据玻璃id删除出片队列玻璃
  @PostMapping("/DeleteProductionQueueGlass")
  public Result DeleteProductionQueueGlass(Short id) {
    homeMapper.DeleteProductionQueueGlass(id);
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
    return Result.success(map);
  }
  //
  @PostMapping("/AddOutSliceS")
  public Result AddOutSliceS(@RequestBody String[][] AluminumFrames ) {
    for (String[] item : AluminumFrames) {
      if(item[1]=="true"){
        homeMapper.AddOutSliceS(item[0],item[2],item[3],item[4],item[5]);
      }
    }
    System.out.println(AluminumFrames);
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
    return Result.success(map);
  }
}
springboot-vue3/src/main/java/com/example/springboot/entity/Out_slice.java
New file
@@ -0,0 +1,101 @@
package com.example.springboot.entity;
public class Out_slice {
    private int id;
    private String glassId;
    private String barcode;
    private double glasswidth;
    private double glassheight;
    private int state;
    private String time;
    private north_glass_buffer1 north_glass_buffer1s;
    public void setnorth_glass_buffer1s(north_glass_buffer1 north_glass_buffer1s) {
        this.north_glass_buffer1s = north_glass_buffer1s;
    }
    public north_glass_buffer1 getnorth_glass_buffer1s() {
        return north_glass_buffer1s;
    }
    private StorageCage storageCage;
    public void setstorageCage(StorageCage storageCage) {
        this.storageCage = storageCage;
    }
    public StorageCage getstorageCage() {
        return storageCage;
    }
    public Out_slice() {
    }
    public Out_slice(int ID, String glassId, String barCode, double glasswidth, double glassheight, int state, String time) {
        this.id = ID;
        this.glassId = glassId;
        this.barcode = barCode;
        this.glasswidth = glasswidth;
        this.glassheight = glassheight;
        this.state = state;
        this.time = time;
    }
    public int getID() {
        return id;
    }
    public String getGlassId() {
        return glassId;
    }
    public String getBarCode() {
        return barcode;
    }
    public double getGlasswidth() {
        return glasswidth;
    }
    public double getGlassheight() {
        return glassheight;
    }
    public int getState() {
        return state;
    }
    public String getTime() {
        return time;
    }
    public void setID(int ID) {
        this.id = ID;
    }
    public void setGlassId(String glassId) {
        this.glassId = glassId;
    }
public void setBarCode(String barCode) {
        barcode = barCode;
    }
    public void setGlasswidth(double glasswidth) {
        this.glasswidth = glasswidth;
    }
    public void setGlassheight(double glassheight) {
        this.glassheight = glassheight;
    }
    public void setState(int state) {
        this.state = state;
    }
    public void setTime(String time) {
        this.time = time;
    }
}
springboot-vue3/src/main/java/com/example/springboot/entity/StorageCage.java
@@ -1,5 +1,7 @@
package com.example.springboot.entity;
public class StorageCage {
    private Integer id;
    private Integer prcId;
@@ -14,6 +16,28 @@
    private String orderId;
    private Integer disabled;
    private String lengthWidth;
    private String listno;
    private String boxno;
    private north_glass_buffer1 north_glass_buffer1s;
    public void setnorth_glass_buffer1s(north_glass_buffer1 north_glass_buffer1s) {
        this.north_glass_buffer1s = north_glass_buffer1s;
    }
    public north_glass_buffer1 getnorth_glass_buffer1s() {
        return north_glass_buffer1s;
    }
    private Out_slice outSlice;
    public void setout_slice(Out_slice outSlice) {
        this.outSlice = outSlice;
    }
    public Out_slice getout_slice() {
        return outSlice;
    }
    public Integer id() {
        return id;
@@ -122,4 +146,22 @@
    public void setLengthWidth(String lengthWidth) {
        this.lengthWidth = lengthWidth;
    }
    public String getListno() {
        return listno;
    }
    public void setListno(String listno) {
        this.listno = listno;
    }
    public String getBoxno() {
        return boxno;
    }
    public void setBoxno(String boxno) {
        this.boxno = boxno;
    }
}
springboot-vue3/src/main/java/com/example/springboot/entity/north_glass_buffer1.java
@@ -8,8 +8,17 @@
    private String barcode;//玻璃id
    private double glasslength;//玻璃宽
    private double glassheight;//玻璃高
    private double glasslength_mm;//玻璃宽mm
    private double glassheight_mm;//玻璃高mm
    private double glasslengthmm;//玻璃宽mm
    private double glassheightmm;//玻璃高mm
    private String glassoutside;//
    private String glassinside;//
    private String glassbetween;//
    private String itemtype;//
    private String slotnumber;//
    private String datemodified;//
    private String datecreated;//
    private String FrameBarcode;//
    public Integer id() {
        return id;
@@ -65,20 +74,50 @@
        this.glassheight = glassheight;
    }
    public Double getglasslength_mm() {
        return glasslength_mm;
    public Double getglasslengthmm() {
        return glasslengthmm;
    }
    public void setglasslength_mm(Double glasslength_mm) {
        this.glasslength_mm = glasslength_mm;
    public void setglasslengthmm(Double glasslengthmm) {
        this.glasslengthmm = glasslengthmm;
    }
    public Double glassheight_mm() {
        return glassheight_mm;
    public Double glassheightmm() {
        return glassheightmm;
    }
    public void setglassheight_mm(Double glassheight_mm) {
        this.glassheight_mm = glassheight_mm;
    public void setglassheightmm(Double glassheightmm) {
        this.glassheightmm = glassheightmm;
    }
    public String getitemtype() {
        return itemtype;
    }
    public void setitemtype(String itemtype) {
        this.itemtype = itemtype;
    }
    public String getslotnumber() {
        return slotnumber;
    }
    public void setslotnumber(String slotnumber) {
        this.slotnumber = slotnumber;
    }
    public String getdatemodified() {
        return datemodified;
    }
    public void setdatemodified(String datemodified) {
        this.datemodified = datemodified;
    }
    public String getdatecreated() {
        return datecreated;
    }
    public void setdatecreated(String datecreated) {
        this.datecreated = datecreated;
    }
    public String getFrameBarcode() {
        return FrameBarcode;
    }
    public void setFrameBarcode(String FrameBarcode) {
        this.FrameBarcode = FrameBarcode;
    }
   
}
springboot-vue3/src/main/java/com/example/springboot/entity/out_slice.java
New file
@@ -0,0 +1,101 @@
package com.example.springboot.entity;
public class Out_slice {
    private int id;
    private String glassId;
    private String barcode;
    private double glasswidth;
    private double glassheight;
    private int state;
    private String time;
    private north_glass_buffer1 north_glass_buffer1s;
    public void setnorth_glass_buffer1s(north_glass_buffer1 north_glass_buffer1s) {
        this.north_glass_buffer1s = north_glass_buffer1s;
    }
    public north_glass_buffer1 getnorth_glass_buffer1s() {
        return north_glass_buffer1s;
    }
    private StorageCage storageCage;
    public void setstorageCage(StorageCage storageCage) {
        this.storageCage = storageCage;
    }
    public StorageCage getstorageCage() {
        return storageCage;
    }
    public Out_slice() {
    }
    public Out_slice(int ID, String glassId, String barCode, double glasswidth, double glassheight, int state, String time) {
        this.id = ID;
        this.glassId = glassId;
        this.barcode = barCode;
        this.glasswidth = glasswidth;
        this.glassheight = glassheight;
        this.state = state;
        this.time = time;
    }
    public int getID() {
        return id;
    }
    public String getGlassId() {
        return glassId;
    }
    public String getBarCode() {
        return barcode;
    }
    public double getGlasswidth() {
        return glasswidth;
    }
    public double getGlassheight() {
        return glassheight;
    }
    public int getState() {
        return state;
    }
    public String getTime() {
        return time;
    }
    public void setID(int ID) {
        this.id = ID;
    }
    public void setGlassId(String glassId) {
        this.glassId = glassId;
    }
public void setBarCode(String barCode) {
        barcode = barCode;
    }
    public void setGlasswidth(double glasswidth) {
        this.glasswidth = glasswidth;
    }
    public void setGlassheight(double glassheight) {
        this.glassheight = glassheight;
    }
    public void setState(int state) {
        this.state = state;
    }
    public void setTime(String time) {
        this.time = time;
    }
}
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -6,6 +6,9 @@
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.alarmmg;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.entity.north_glass_buffer1_frames;
import com.example.springboot.entity.Out_slice;
import java.util.List;
@@ -32,7 +35,7 @@
  List<StorageCage> selectRack4();
  // 根据任务类型查询当前正在出片,进片的玻璃信息
  @Select("select a.*,concat(round(a.glasswidth*b.conversionrate,2),' x ',round(a.glassheight*b.conversionrate,2)) as lengthwidth from storage_cage as a,conver as b where a.state=#{task_type} limit 1")
  @Select("select *,concat(glasswidth,' x ',glassheight) as lengthwidth from storage_cage where state=#{task_type}")
  List<StorageCage> selectinout(@Param("task_type") Integer task_type);
  // 查询是否存在此订单
@@ -68,7 +71,7 @@
  List<alarmmg> SelectAlarmmgInfo();
  //获取理片笼内玻璃信息
  @Select("select *,concat(round(a.glasswidth*b.conversionrate,2),' x ',round(a.glassheight*b.conversionrate,2)) as lengthwidth from storage_cage  as a,conver as b  ")
  @Select("select *,concat(round(a.glasswidth),' x ',round(a.glassheight)) as lengthwidth from storage_cage as a")
  List<StorageCage> SelectCageInfo(short cage);
  @Update("update storage_cage set state=0,glass_id=null,order_id=null,glasswidth=null,glassheight=null where glass_id=#{glassid}")
@@ -87,28 +90,29 @@
  StorageCage SelectGlassInfo(String glassid);
  //查询玻璃信息
 @Select("select * from glass where glassid=#{glassid}")
  Glass SelectGlassByGlassID(String glassid);
//  @Select("select * from glass where glassid=#{glassid}")
  @Select("SELECT ordernumber,listnumber,boxnumber,barcode,glasslength,glassheight,glasslength_mm,glassheight_mm FROM north_glass_buffer1 where barcode=#{barcode}")
  north_glass_buffer1 SelectGlassByGlassID(String barcode);
  //启用/禁用理片笼格子
  @Update("update storage_cage set disabled=#{disabled} where cage=#{cage} and cell=#{cell}")
  void Disabled(short cage, short cell, short disabled);
  //理片笼新增玻璃
  @Update("update storage_cage set state=1,glass_id=#{glass.glassId},order_id=#{glass.orderId},glasswidth=#{glass.width},glassheight=#{glass.height} where cage=#{cage} and cell=#{cell} and tier=#{tier}")
  void Inglassid(Glass glass, short cage, short cell, short tier);
  @Update("update storage_cage set state=1,glass_id=#{glass.barcode},order_id=#{glass.ordernumber},glasswidth=#{glass.glasslengthMm},glassheight=#{glass.glassheightMm} where cage=#{cage} and cell=#{cell} and tier=#{tier}")
  void Inglassid(north_glass_buffer1 glass, short cage, short cell, short tier);
  //查询理片笼中是否有此玻璃
  @Select("select count(*) from storage_cage where glass_id=#{glassId}")
  short SelectStorageByGlassId(String glassId);
  //根据订单查询玻璃信息
  @Select("select * from glass where position(#{orderid} in orderid)")
  List<Glass> SelectGlass(String orderid);
  @Select("select * from north_glass_buffer1 where position(#{orderid} in ordernumber)")
  List<north_glass_buffer1> SelectGlass(String orderid);
  //获取上片队列信息
  @Select("select gl.* from queue qe inner join glass gl on qe.glassid=gl.glassid where qe.id=#{id}")
  Glass GetQueueInfo(int id);
  @Select("select glassid from queue where id=#{id}")
  String GetQueueInfo(int id);
  //手动添加扫码位玻璃
  @Select("update queue set glassid=#{glassid},state=1 where id=#{id}")
@@ -119,8 +123,48 @@
  void UpdateQueueState();
  //手动添加扫码位玻璃
  @Select("update queue set glassid='' where id=#{id}")
  @Select("update queue set glassid='',state=0 where id=#{id}")
  void DeleteQueueGlass(String id);
  //查询此订单在理片笼里的玻璃数
  @Select("select count(*) from storage_cage where order_id=#{orderid}")
  Short SelectGlassNo(String orderid);
  //根据玻璃id从客户表查询数据
  @Select("select * from north_glass_buffer1 where barcode=#{glassid}")
  north_glass_buffer1 SelectBoxNo(String glassid);
  //查询出片队列信息
  @Select("select * from out_slice where state=0 or state=1")
  List<Out_slice> SelectProductionqueue();
  //根据玻璃id查询笼内玻璃信息
  @Select("select * from storage_cage where glass_id=#{glassid}")
  StorageCage SelectStorageGlassById(String glassid);
  //根据玻璃id删除出片队列玻璃
  @Select("update out_slice set state=3 where id=#{id}")
  void DeleteProductionQueueGlass(Short id);
  //根据铝框id查询对应玻璃信息
  @Select("select * from north_glass_buffer1 where FrameBarcode=#{FrameBarcode}")
  List<north_glass_buffer1> SelectAluminumFrameInfoById(String FrameBarcode);
  //查询根据id查询
  @Select("select b.* from storage_cage a inner join out_slice b on a.glass_id=b.glassId where b.glassId=#{glassId}")
  List<Out_slice> SelectOutSliceById(String glassId);
  //查询玻璃id是否
  @Select("select Flip from north_glass_buffer1_frames where Barcode=#{frameBarcode} limit 1")
  String SelectFlipByFrameBarcode(String frameBarcode);
  //查询玻璃是否已存在于出片队列
  @Select("select * from out_slice where glassid=#{getbarcode} and (state=0 or state=1)")
  Out_slice SelectQueueByglassid(String getbarcode);
  //查询玻璃是否已存在于出片队列
  @Select("INSERT INTO out_slice( `glassId`, `barcode`, `glasswidth`, `glassheight`, `state`, `flip`) VALUES ( #{glassid}, #{FrameNo}, #{glasslengthMm}, #{glassheightMm}, 0, #{flip});")
  void AddOutSliceS(String glassid, String flip, String FrameNo, String glasslengthMm, String glassheightMm);
}
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -1,10 +1,11 @@
package com.example.springboot.mapper;
import org.apache.ibatis.annotations.*;
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.StorageTask;
import com.example.springboot.entity.north_glass_buffer1;
import java.util.List;
@@ -13,170 +14,139 @@
@Mapper
public interface SpianMapper {
  // 判断相邻笼子是否有空格
  @Select("select COUNT(if(a.state1=0,cell,null))as cell,ROUND(id/2)as id from (select *,max(state)as state1 from storage_cage a  GROUP BY cage,cell)as a where (a.cage=#{cage1}-1 or a.cage=#{cage1}+1)and if(a.cage<6,a.cage>0 and a.cage<6,a.cage>5) GROUP BY cage ORDER BY cell desc LIMIT 1")
  int selectCage(int cage1);
    //判断相邻笼子是否有空格
    @Select("select COUNT(if(a.state1=0,cell,null))as cell,ROUND(id/2)as id from (select *,max(state)as state1 from storage_cage a  GROUP BY cage,cell)as a where (a.cage=#{cage1}-1 or a.cage=#{cage1}+1)and if(a.cage<6,a.cage>0 and a.cage<6,a.cage>5) GROUP BY cage ORDER BY cell desc LIMIT 1")
     int selectCage(int  cage1);
     //@Select("(select*from storage_cage as a  where a.state=0 and cage%2=0 ORDER BY id LIMIT 1)union (select a.* from storage_cage a inner join  (select cage,if(shu2=1,shu3,shu5) as gezi from ( select  cage, count(case when state1=1 and state2=0 then cell else null end)as shu1,  count(case when state1=0 then cell else null end) as shu2, min(case when state1=1 and state2=0 then cell else null end) as shu3, min(case when state1=0 then cell else null end) as shu4, min(case when state1=0 or state2=0 then cell else null end) as shu5 from  (select *,max(state) as state1,min(state) as state2 from storage_cage group by cage,cell) as a where  cage%2!=0  GROUP BY cage HAVING shu2>1 or (shu2=1 and shu1>0)  ) as sss limit 1)as b on a.cage=b.cage and a.cell=b.gezi and a.state=0 order by tier limit 1) ORDER BY id LIMIT 1;")
    //获取订单号排序的空订单笼子
     @Select("select a.cage,COUNT(if(a.order_id=#{orderids},a.order_id,null))as orderid,b.shu,c.shu2,a.cell,min(a.state)as state1 from storage_cage a left join (select COUNT(*)shu,cage from storage_cage  where order_id=#{orderids} GROUP BY cage)as b on a.cage=b.cage left join(select cage ,COUNT(glass_id)as shu2 from storage_cage GROUP BY cage)c  on a.cage=c.cage where (order_id=#{orderids} or ''='') GROUP BY cage,cell HAVING state1=0 ORDER BY shu desc,shu2,cage asc; ")
     List<StorageCage> selectAll(String orderids);
    //获取判断该格子是否需要把外片推入内片位置
     @Select("select state from storage_cage where  cage=#{cage} and cell=#{cell} and tier=1;")
     int selectcell(int cage,int cell);
     //判断该笼子是否有合适宽度空格
     @Select("select cage,cell,tier,id,ROUND(id/2)as prcId,width from storage_cage where cage=#{cage1} and cell=#{cell} and state=0 and width>=#{width} ORDER BY cell asc,tier asc LIMIT 1")
     StorageCage selectCage1(int  cage1,int cell,double width);
     //判断笼子内玻璃数
     @Select("select COUNT(tier)as tier from storage_cage where  cage=#{cage} and cell=#{cell} and state=1;")
     int selectsum(int cage,int cell);
  // @Select("(select*from storage_cage as a where a.state=0 and cage%2=0 ORDER BY
  // id LIMIT 1)union (select a.* from storage_cage a inner join (select
  // cage,if(shu2=1,shu3,shu5) as gezi from ( select cage, count(case when
  // state1=1 and state2=0 then cell else null end)as shu1, count(case when
  // state1=0 then cell else null end) as shu2, min(case when state1=1 and
  // state2=0 then cell else null end) as shu3, min(case when state1=0 then cell
  // else null end) as shu4, min(case when state1=0 or state2=0 then cell else
  // null end) as shu5 from (select *,max(state) as state1,min(state) as state2
  // from storage_cage group by cage,cell) as a where cage%2!=0 GROUP BY cage
  // HAVING shu2>1 or (shu2=1 and shu1>0) ) as sss limit 1)as b on a.cage=b.cage
  // and a.cell=b.gezi and a.state=0 order by tier limit 1) ORDER BY id LIMIT 1;")
  // 获取订单号排序的空订单笼子
  @Select("select a.cage,COUNT(if(a.order_id=#{orderids},a.order_id,null))as orderid,b.shu,c.shu2,a.cell,min(a.state)as state1 from storage_cage a left join (select COUNT(*)shu,cage from storage_cage  where order_id=#{orderids} GROUP BY cage)as b on a.cage=b.cage left join(select cage ,COUNT(glass_id)as shu2 from storage_cage GROUP BY cage)c  on a.cage=c.cage where (order_id=#{orderids} or ''='') GROUP BY cage,cell HAVING state1=0 ORDER BY shu desc,shu2,cage asc; ")
  List<StorageCage> selectAll(String orderids);
    //@Update("update longzi set glass_id = #{glass_id}, width = #{width}, state = #{state} where cell = #{cell}")
    @Update("update longzi set glass_id =123, width =1600, state =1 where cell =24")
     void  update();
     //获取玻璃信息
     @Select("select orderid as ordernumber,width as glasslengthmm from glass where glassid=#{glassid}")
     north_glass_buffer1 selectGlass(String glassid);
    @Insert("insert into storage_task(task_type,task_state,shelf_rack,load_rack)values(#{storage_task},#{task_state},#{shelf_rack},#{load_rack})")
     void insert(StorageTask storageTask);
    //出片任务查询
    @Select("select COUNT(order_id)order_id,cage,cell,glasswidth,tier,ROUND(id/2)as prcId,glass_id from storage_cage a where a.order_id=#{orderId} GROUP BY cage,cell ORDER BY cage desc,order_id desc,cell desc,glasswidth desc limit 1")
     StorageCage selectOut(String  orderId);
    // @Select("select cage,cell,tier,glasswidth,ROUND(id/2)as prcId,id,glass_id from storage_cage as a where a.order_id=#{orderId} and state=1 order by cage desc,tier desc,cell desc LIMIT 1")
    //  StorageCage selectOut(String  orderId);
    //按玻璃ID出片任务查询
    @Select("select cage,cell,tier,glasswidth,ROUND(id/2)as prcId,id from storage_cage as a where a.glass_id=#{glassid} and state=1 order by cage desc,tier desc,cell desc LIMIT 1")
     StorageCage selectOut2(String  glassid);
  // 判断该笼子是否有合适宽度空格
  @Select("select cage,cell,tier,id,ROUND(id/2)as prcId,width from storage_cage where cage=#{cage1} and cell=#{cell} and state=0 and width>=#{width} ORDER BY cell asc,tier desc LIMIT 1")
  StorageCage selectCage1(int cage1, int cell, double width);
    //判断出片为1时,是否可直接出片
    @Select("select COUNT(state) from storage_cage where cage=#{cage} and cell=#{cell}")
     int selectGlassState(int  cage,int cell);
  // 判断笼子内玻璃数
  @Select("select COUNT(tier)as tier from storage_cage where  cage=#{cage} and cell=#{cell} and state=1;")
  int selectsum(int cage, int cell);
     //判断该调拨的笼子
     @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage) limit 1;")
     StorageCage selectGlassCage(int cage,double width,int cage1,int cage2);
  // @Update("update longzi set glass_id = #{glass_id}, width = #{width}, state =
  // #{state} where cell = #{cell}")
  @Update("update longzi set glass_id =123, width =1600, state =1 where cell =24")
  void update();
    //删除笼子信息(出片)
    @Update("update storage_cage as a set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=0 where cage=#{cage} and cell=#{cell} and tier=#{tier};")
    void UpdataGlassCage(String orderid,String glassid,double width,int cage,int cell,int tier,int state);
  // 获取玻璃信息
  @Select("select orderid,width from glass where glassid=#{glassid}")
  Glass selectGlass(String glassid);
    //修改笼子信息(进片)
    @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where id=#{id};")
    void UpdataAddCage(String orderid,String glassid,double width,int cage,int cell,int id,int state);
     //修改笼子信息(多片进片)
    @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where cage=#{cage} and cell=#{cell} and tier=#{tier};")
    void UpdataAddqueCage(String orderid,String glassid,double width,int cage,int cell,int tier,int state);
    //修改同笼子格子宽度
     @Update("update storage_cage set width=width-#{width} where   cage=#{cage} and cell=#{cell};")
    void UpdataAddCage1(double width,int cage,int cell);
    //修改同笼子格子宽度
  @Insert("insert into storage_task(task_type,task_state,shelf_rack,load_rack)values(#{storage_task},#{task_state},#{shelf_rack},#{load_rack})")
  void insert(StorageTask storageTask);
  // 出片任务查询
  @Select("select COUNT(order_id)order_id,cage,cell,glasswidth,tier,ROUND(id/2)as prcId,glass_id from storage_cage a where a.order_id=#{orderId} GROUP BY cage,cell ORDER BY cage desc,order_id desc,cell desc,glasswidth desc limit 1")
  StorageCage selectOut(String orderId);
  // @Select("select cage,cell,tier,glasswidth,ROUND(id/2)as prcId,id,glass_id
  // from storage_cage as a where a.order_id=#{orderId} and state=1 order by cage
  // desc,tier desc,cell desc LIMIT 1")
  // StorageCage selectOut(String orderId);
  // 按玻璃ID出片任务查询
  @Select("select cage,cell,tier,glasswidth,ROUND(id/2)as prcId,id from storage_cage as a where a.glass_id=#{glassid} and state=1 order by cage desc,tier desc,cell desc LIMIT 1")
  StorageCage selectOut2(String glassid);
  // 判断出片为1时,是否可直接出片
  @Select("select COUNT(state) from storage_cage where cage=#{cage} and cell=#{cell}")
  int selectGlassState(int cage, int cell);
  // 判断该调拨的笼子
  @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage) limit 1;")
  StorageCage selectGlassCage(int cage, double width, int cage1, int cage2);
  // 删除笼子信息(出片)
  @Update("update storage_cage as a set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=0 where cage=#{cage} and cell=#{cell} and tier=#{tier};")
  void UpdataGlassCage(String orderid, String glassid, double width, int cage, int cell, int tier, int state);
  // 修改笼子信息(进片)
  @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where id=#{id};")
  void UpdataAddCage(String orderid, String glassid, double width, int cage, int cell, int id, int state);
  // 修改笼子信息(多片进片)
  @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where cage=#{cage} and cell=#{cell} and tier=#{tier};")
  void UpdataAddqueCage(String orderid, String glassid, double width, int cage, int cell, int tier, int state);
  // 修改同笼子格子宽度
  @Update("update storage_cage set width=width-#{width} where   cage=#{cage} and cell=#{cell};")
  void UpdataAddCage1(double width, int cage, int cell);
  // 修改同笼子格子宽度
  @Update("update storage_cage set state=#{state} where   state=#{oldstate};")
  void UpdataAddCageState(int state, int oldstate);
  // 修改同笼子格子宽度(出片)
  @Update("update storage_cage set width=width+#{width} where   cage=#{cage} and cell=#{cell};")
  void UpdataOutCage1(double width, int cage, int cell);
  // 调拨更换笼子信息
  @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=2)as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1,a.glasswidth=b.glasswidth where a.id=#{id1}")
  void UpdateDBCage(int id1, int cage, int cell);
  // @Insert("insert into user(name, date, address, user_no) values (#{name},
  // #{date}, #{address}, #{userNo})")
  // void insert (Spian spian);
  // 新增任务表
  @Insert("INSERT INTO `canadames`.`storage_task`(`task_type`, `task_state`, `shelf_rack`, `load_rack`,start_time,glass_id) VALUES (#{tasktype},#{taskstate},#{shelfrack},#{loadrack},now(),#{glassid});")
  void Inserttask(int tasktype, int taskstate, int shelfrack, int loadrack, String glassid);
  // 修改任务表
  @Update("update storage_task set task_state=#{state} where task_type=#{type} and task_state=0;")
  void Updatetask(int state, int type);
  // 修改任务表
  @Update("update storage_task set task_state=1 where (task_type=1 or task_type=2) and task_state=0;")
  void UpdatetaskOut();
  // 查询按订单出片
  @Select("select order_id state from order_out where state=0")
  String SelectOrderout();
  // 内外片调换
  @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=2)as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1,a.glasswidth=b.glasswidth where a.cage=#{cage} and a.cell=#{cell} and a.tier=1")
  void UpdateDBCage1(int cage, int cell);
  // 清除内片数据
  @Update("update storage_cage set glass_id='',order_id='',state=0,glasswidth=0 where a.cage=#{cage} and a.cell=#{cell} and a.tier=1;")
  void UpdateDBCage2(int cage, int cell);
  // 判断是否有调拨完后出片的任务
  @Select("select COUNT(*)as id,glass_id from storage_task where (task_type=1 or task_type=2) and task_state=0;")
  Glass SelectDBOut();
  // 根据笼子格子层数获取玻璃id
  @Select("select glass_id from storage_cage where cage=#{cage} and cell=#{cell} and tier=2;")
  String SelectGlassid(int cage, int cell);
  // 根据笼子格子层数获取玻璃id
  @Select("SELECT COUNT(*) FROM `storage_cage` where state=3;")
  Integer Selectoutstate();
  // 添加任务序列
  // 获取进片队列id
  @Insert("INSERT INTO `canadames`.`queue`(`glassid`, `type`, `state`,width) VALUES (#{glassid},#{type},0,#{width});")
  void insertqueue(String glassid, int type, double width);
  // 获取任务序列
  @Select("select glassid,orderid,width,type from queue where state=#{state}")
  StorageCage SelectQueue(int state);
  // 获取序列表的玻璃宽
  @Select("select sum(width)+400 as width,orderid from queue where state=0 limit 1")
  StorageCage SelectQueueWidth();
  // 判断该笼子是否有合适完整空格
  @Select("select cage,cell,tier,id,ROUND(id/2)as prcId,width,max(state)state1 from storage_cage where cage=#{cage1} and cell=#{cell} and state=0 and width>=#{width} HAVING state1=0 ORDER BY cell asc,tier desc LIMIT 1")
  StorageCage selectqueCage1(int cage1, int cell, double width);
  // 获取序列表的玻璃
  @Select("select glassid,orderid,width from queue where state=0 and type=#{type}")
  Glass SelectQueueGlass(int type);
  // 多片出库清除一整个空格
  @Update("update storage_cage set glass_id='',order_id='',glasswidth=0,width=2750,state=0 where cage=#{cage} and cell=#{cell}")
  void UpdatequeOut(int cage, int cell);
  // 判断序列表里的玻璃是否是同一订单
  @Select("select  COUNT(distinct orderid) from queue ")
  int SelectQueOrder();
  // 寻找可以多片出片的玻璃
  @Select("select cage,cell,ROUND(id/2)as prcId,width,count(glass_id)shu from storage_cage where order_id=#{orderid} and (cage!=#{cage} or cell!=#{cell}) GROUP BY cage,cell HAVING shu=1 ORDER BY cage desc,cell desc limit 1")
  StorageCage SelectQueout(String orderid, int cage, int cell);
  // 获取进片队列id
  @Select("select glassid from queue where type=1")
  String Selectqueueid();
  // 获取进片队列id
  @Select("select state from queue where type=1")
  String Selectqueuestate();
}
     @Update("update storage_cage set state=#{state} where   state=#{oldstate};")
    void UpdataAddCageState(int state,int oldstate);
    //修改同笼子格子宽度(出片)
     @Update("update storage_cage set width=width+#{width} where   cage=#{cage} and cell=#{cell};")
    void UpdataOutCage1(double width,int cage,int cell);
    //调拨更换笼子信息
    @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=#{tier})as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1,a.glasswidth=b.glasswidth where a.id=#{id1}")
    void UpdateDBCage(int id1,int cage,int cell,int tier);
    // @Insert("insert into user(name, date, address, user_no) values (#{name}, #{date}, #{address}, #{userNo})")
    // void insert (Spian spian);
    //新增任务表
    @Insert("INSERT INTO `canadames`.`storage_task`(`task_type`, `task_state`, `shelf_rack`, `load_rack`,start_time,glass_id) VALUES (#{tasktype},#{taskstate},#{shelfrack},#{loadrack},now(),#{glassid});")
    void Inserttask(int tasktype,int taskstate,int shelfrack,int loadrack,String glassid);
    //修改任务表
    @Update("update storage_task set task_state=#{state} where task_type=#{type} and task_state=0;")
    void Updatetask(int state,int type);
    //修改任务表
    @Update("update storage_task set task_state=1 where (task_type=1 or task_type=2) and task_state=0;")
    void UpdatetaskOut();
    //查询按订单出片
    @Select("select order_id state from order_out where state=0")
    String  SelectOrderout();
    //内外片调换
    @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=2)as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1,a.glasswidth=b.glasswidth where a.cage=#{cage} and a.cell=#{cell} and a.tier=1")
    void UpdateDBCage1(int cage,int cell);
    //清除内片数据
    @Update("update storage_cage set glass_id='',order_id='',state=0,glasswidth=0 where a.cage=#{cage} and a.cell=#{cell} and a.tier=1;")
    void UpdateDBCage2(int cage,int cell);
    //判断是否有调拨完后出片的任务
    @Select("select COUNT(*)as id,glass_id as barcode from storage_task where (task_type=1 or task_type=2) and task_state=0;")
    north_glass_buffer1 SelectDBOut();
    //根据笼子格子层数获取玻璃id
     @Select("select glass_id from storage_cage where cage=#{cage} and cell=#{cell} and tier=2;")
     String SelectGlassid(int cage,int cell);
     //根据笼子格子层数获取玻璃id
     @Select("SELECT COUNT(*) FROM `storage_cage` where state=3;")
     Integer Selectoutstate();
     //添加任务序列
     //获取进片队列id
     @Insert("INSERT INTO `canadames`.`queue`(`glassid`, `type`, `state`,width) VALUES (#{glassid},#{type},0,#{width});")
     void insertqueue(String glassid,int type,double width);
     //获取任务序列
     @Select("select glassid,orderid,width,type from queue where state=#{state}")
     StorageCage SelectQueue(int state);
     //获取序列表的玻璃宽
     @Select("select sum(width)+400 as width,orderid from queue where state=0 limit 1")
     StorageCage SelectQueueWidth();
    //判断该笼子是否有合适完整空格
     @Select("select cage,cell,tier,id,ROUND(id/2)as prcId,width,max(state)state1 from storage_cage where cage=#{cage1} and cell=#{cell} and state=0 and width>=#{width} HAVING state1=0 ORDER BY cell asc,tier desc LIMIT 1")
     StorageCage selectqueCage1(int  cage1,int cell,double width);
     //获取序列表的玻璃
     @Select("select glassid as barcode,orderid as ordernumber,width as glasslengthmm from queue where state=0 and type=#{type}")
     north_glass_buffer1 SelectQueueGlass(int type);
     //多片出库清除一整个空格
     @Update("update storage_cage set glass_id='',order_id='',glasswidth=0,width=2750,state=0 where cage=#{cage} and cell=#{cell}")
     void UpdatequeOut(int cage,int cell);
     //判断序列表里的玻璃是否是同一订单
     @Select("select  COUNT(distinct orderid) from queue ")
     int SelectQueOrder();
     //寻找可以多片出片的玻璃
     @Select("select cage,cell,ROUND(id/2)as prcId,width,count(glass_id)shu from storage_cage where order_id=#{orderid} and (cage!=#{cage} or cell!=#{cell}) GROUP BY cage,cell HAVING shu=1 ORDER BY cage desc,cell desc limit 1")
     StorageCage SelectQueout(String orderid,int cage,int cell);
     //获取进片队列id
     @Select("select glassid from queue where type=1")
     String Selectqueueid();
     //获取进片队列id
     @Select("select state from queue where type=1")
     String Selectqueuestate();
     //判断铝框出片表是否有玻璃需要出
     @Select("SELECT * FROM `out_slice` where state=0 or state=0 order by id limit 1;")
     String SelectOutSlice();
     //判断铝框出片表是否有玻璃正在出片中
     @Select("SELECT count(*) FROM `out_slice` where state=1 or state=0 order by id limit 1;")
     int SelectOutSliceshu();
}
springboot-vue3/src/main/java/com/example/springboot/security/config/ShiroConfig.java
@@ -1,5 +1,5 @@
package com.example.springboot.security.config;
import com.example.springboot.security.JWTRealm;
import com.example.springboot.security.NoSessionFilter;
import com.example.springboot.security.StatelessDefaultSubjectFactory;
@@ -18,17 +18,17 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import javax.servlet.Filter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
@Configuration
public class ShiroConfig {
    /**
     * Shiro生命周期处理器
     *
@@ -38,7 +38,7 @@
    public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
        return new LifecycleBeanPostProcessor();
    }
    /**
     * 开启Shiro的注解(如@RequiresRoles,@RequiresPermissions),需借助SpringAOP扫描使用Shiro注解的类,并在必要时进行安全逻辑验证
     * DefaultAdvisorAutoProxyCreator的顺序必须在shiroFilterFactoryBean之前,不然SecurityUtils.getSubject().getPrincipal()获取不到参数
@@ -52,24 +52,24 @@
        advisorAutoProxyCreator.setProxyTargetClass(true);
        return advisorAutoProxyCreator;
    }
    @Bean
    public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor() {
        AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor();
        authorizationAttributeSourceAdvisor.setSecurityManager(defaultSecurityManager());
        return authorizationAttributeSourceAdvisor;
    }
    @Bean(name = "shiroFilterFactoryBean")
    public ShiroFilterFactoryBean shiroFilterFactoryBean() {
        ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
        shiroFilterFactoryBean.setSecurityManager(defaultSecurityManager());
        // 过滤规则
        Map<String, String> linkedHashMap = new LinkedHashMap<>();
        // 无状态登录情况下关闭了shiro中的session,导致所有需要加上authc接口请求时候都会报错,
        // 所以使用@RequiresRoles,@RequiresPermissions注解,aop方式实现接口的权限校验
        /* 添加shiro的内置过滤器,自定义url规则
         * Shiro自带拦截器配置规则
         * rest:比如/admins/user/**=rest[user],根据请求的方法,相当于/admins/user/**=perms[user:method] ,其中method为post,get,delete等
@@ -110,7 +110,7 @@
//        // 授权的权限
//        linkedHashMap.put("/api/rolePermission/saveOrUpdate", "perms[rolePermission:add]");
//        linkedHashMap.put("/api/rolePermission/removeByIds", "perms[rolePermission:delete]");
        // 自定义过滤器
        HashMap<String, Filter> filterHashMap = new HashMap<>();
        filterHashMap.put("jwt", new NoSessionFilter());
@@ -120,7 +120,7 @@
        shiroFilterFactoryBean.setFilterChainDefinitionMap(linkedHashMap);
        return shiroFilterFactoryBean;
    }
    @Bean
    public DefaultWebSecurityManager defaultSecurityManager() {
        DefaultWebSecurityManager defaultWebSecurityManager = new DefaultWebSecurityManager();
@@ -134,7 +134,7 @@
        defaultWebSecurityManager.setSubjectFactory(subjectFactory());
        return defaultWebSecurityManager;
    }
    /**
     * 登录的认证和授权
     *
@@ -146,7 +146,7 @@
        userRealm.setCredentialsMatcher(hashedCredentialsMatcher());
        return userRealm;
    }
    /**
     * token的认证和授权
     *
@@ -156,12 +156,12 @@
    public JWTRealm jwtRealm() {
        return new JWTRealm();
    }
    @Bean
    public StatelessDefaultSubjectFactory subjectFactory() {
        return new StatelessDefaultSubjectFactory();
    }
    /*
     * 凭证匹配器 由于我们的密码校验交给Shiro的SimpleAuthenticationInfo进行处理了
     */
@@ -172,7 +172,7 @@
        hashedCredentialsMatcher.setHashIterations(1024);// 散列的次数,比如散列两次,相当于MD5(MD5(""));
        return hashedCredentialsMatcher;
    }
    @Bean
    public CookieRememberMeManager cookieRememberMeManager() {
        CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager();
springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
@@ -9,6 +9,7 @@
import org.springframework.stereotype.Component;
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.north_glass_buffer1;
@Component
public class JdbcConnections {
    /**
@@ -24,15 +25,15 @@
    private static PreparedStatement ps = null;
    private static ResultSet rs = null;
    
    public  Glass selectGlass(int glassid) throws SQLException {
    public  north_glass_buffer1 selectGlass(int glassid) throws SQLException {
        conn = getConn();
        Glass glass=new Glass();
        String sql = "select orderid from glass where glassid=?";
        north_glass_buffer1 glass=new north_glass_buffer1();
        String sql = "select ordernumber from north_glass_buffer1 where glassid=?";
         ps = conn.prepareStatement(sql);
         ps.setInt(1, glassid);
         rs= ps.executeQuery();
         while (rs.next()) {
            glass.setOrderId(rs.getString("orderid"));
            glass.setordernumber(rs.getString("ordernumber"));
         }
         conn.close();
         return glass;
springboot-vue3/src/main/java/com/example/springboot/service/OutSlice.java
New file
@@ -0,0 +1,66 @@
package com.example.springboot.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.example.springboot.entity.Out_slice;
public class OutSlice {
    // public static List<Out_slice> Groupbyresult(List<Out_slice> out_slices) {
    //     // 传入一个集合 进行分组条件分组
    //     List<Out_slice> resultlist = new ArrayList<Out_slice>();
    //     HashMap map = new HashMap<>();
    //     // HashMap<String,List<Out_slice>> map=new HashMap<String,List<Out_slice>>();
    //     for (Out_slice out_slice : out_slices) {
    //         String key_ = out_slice.getState() + "-";
    //         if (map.get(key_) == null) {
    //             List<Out_slice> lists = new ArrayList<Out_slice>();
    //             lists.add(out_slice);
    //             map.put(key_, lists);
    //         } else {
    //             List<Out_slice> lists = (List<Out_slice>) map.get(key_);
    //             lists.add(out_slice);
    //             map.put(key_, lists);
    //         }
    //     }
    //     return resultlist;
    // }
    // public static List<Out_slice> Orderbyresult(List<Out_slice> out_slices, int orders) {
    //     // orders 排序模式
    //     List<Out_slice> list = new ArrayList<Out_slice>();
    //     for (Out_slice out_slice : out_slices) {
    //         if (list.isEmpty()) {
    //             list.add(out_slice);
    //         } else {
    //             for (int i = 0; i < list.size(); i++) {
    //                 Out_slice out_slice2 = list.get(i);
    //                 if (out_slice.getID() > out_slice2.getID()) {
    //                     continue;
    //                 } else {
    //                     list.add(i, out_slice2);
    //                 }
    //             }
    //         }
    //     }
    // }
    // public static void f() {
    //     HashMap map = new HashMap<>();
    //     for (Out_slice out_slice : listoutslice) {
    //         String key_ = out_slice.getState() + "-";
    //         if (map.get(key_) == null) {
    //             List<Out_slice> lists = new ArrayList<Out_slice>();
    //             lists.add(out_slice);
    //             map.put(key_, lists);
    //         } else {
    //             List<Out_slice> lists = (List<Out_slice>) map.get(key_);
    //             lists.add(out_slice);
    //             map.put(key_, lists);
    //         }
    //     }
    // }
}
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -1,6 +1,7 @@
package com.example.springboot.service;
import java.lang.reflect.Array;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
@@ -11,6 +12,7 @@
import com.example.springboot.component.S7control;
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.mapper.SpianMapper;
import com.google.common.primitives.Bytes;
@@ -33,12 +35,12 @@
        double width;
        double minwidth = 0;
        Glass glasslist = spianMapper.selectGlass(glassid); // 获取玻璃参数
        north_glass_buffer1 glasslist = spianMapper.selectGlass(glassid); // 获取玻璃参数
        if (glasslist == null) {
            return (300);
        }
        double widths = glasslist.getwidth();
        String orderids = glasslist.getOrderId();
        double widths = glasslist.getglasslengthmm();
        String orderids = glasslist.getordernumber();
        List<String> adddresslist = new ArrayList<>();
        adddresslist.add("DB105.0");// 进片车起始位置
@@ -74,20 +76,33 @@
                cells = cages1.getCell();// 格子号
                prcid = cages1.getPrcId();// 传给prc的目标地id
                width = cages1.getWidth();// 格子剩余宽度
                widths = glasslist.getwidth();
                widths = glasslist.getglasslengthmm();
                // 执行进片
                datas.add((short) 1000);
                datas.add((short) prcid);
                datas.add((short) prctier);
                datas.add((short) 1);
                // 数据库修改笼子表新增一条玻璃
                datas.add((short) 1);
                //获取该格子内是否有玻璃
                int cellint=spianMapper.selectcell(cage1,cells);
                if(cellint==1){
                    //将外片玻璃的数据更新到内片
                    spianMapper.UpdateDBCage(ids, cage1, cells,1);
                    //将新入的玻璃存入外片
                    spianMapper.UpdataAddCage(orderids.toString(), glassid, widths, cage1, cells, ids-1, 2);
                    spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度
                    spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString());// 新增任务
                    S7control.getinstance().WriteWord(adddresslist, datas);
                }else{
                 // 数据库修改笼子表新增一条玻璃
                spianMapper.UpdataAddCage(orderids.toString(), glassid, widths, cage1, cells, ids, 2);
                spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度
                spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString());// 新增任务
                S7control.getinstance().WriteWord(adddresslist, datas);
                // S7control.getinstance().WriteByte("DB105.16",glassid);
                }
                return (200);
            }
@@ -118,7 +133,6 @@
        double widths = queGlass.getWidth();
        String orderids = queGlass.getOrderId();
        int num = spianMapper.SelectQueOrder();
        if (num == 1) {
            // 获取订单相关度最高的笼子排序
@@ -142,12 +156,12 @@
                    prcid = cages1.getPrcId();// 传给prc的目标地id
                    // 数据库修改笼子表新增一条玻璃
                    for (int i = 2; i > 0; i--) {
                        Glass qglass = spianMapper.SelectQueueGlass(i);
                        width = qglass.getwidth();// 格子剩余宽度
                        spianMapper.UpdataAddqueCage(qglass.getOrderId(), qglass.getGlassId(), width, cage1, cells, i,
                        north_glass_buffer1 qglass = spianMapper.SelectQueueGlass(i);
                        width = qglass.getglasslengthmm();// 格子剩余宽度
                        spianMapper.UpdataAddqueCage(qglass.getordernumber(), qglass.getbarcode(), width, cage1, cells, i,
                                1);
                        spianMapper.UpdataAddCage1(width, cage1, cells);// 减少格子宽度
                        spianMapper.Inserttask(0, 0, 1000, ids, qglass.getGlassId().toString());// 新增任务
                        spianMapper.Inserttask(0, 0, 1000, ids, qglass.getbarcode().toString());// 新增任务
                    }
                    // 执行进片
                    datas.add((short) 1000);
@@ -163,10 +177,10 @@
        } else {
            for (int i = 2; i > 0; i--) {
                Glass qglass = spianMapper.SelectQueueGlass(i);
                String orderid = qglass.getOrderId().toString();
                String glassid = qglass.getGlassId();
                widths = qglass.getwidth();
                north_glass_buffer1 qglass = spianMapper.SelectQueueGlass(i);
                String orderid = qglass.getordernumber().toString();
                String glassid = qglass.getbarcode();
                widths = qglass.getglasslengthmm();
                List<StorageCage> storageCage = spianMapper.selectAll(orderid);
                if (storageCage == null) {
                    return (400);
@@ -192,7 +206,7 @@
                        cells = cages1.getCell();// 格子号
                        prcid = cages1.getPrcId();// 传给prc的目标地id
                        width = cages1.getWidth();// 格子剩余宽度
                        widths = qglass.getwidth();
                        widths = qglass.getglasslengthmm();
                        // 执行进片
                        datas.add((short) 1000);
@@ -327,7 +341,7 @@
                        datas.add((short) 1);
                        // 更换玻璃的笼子
                        String glassids = spianMapper.SelectGlassid(cage, cell); // 获取被调拨的玻璃id
                        spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里
                        spianMapper.UpdateDBCage(ids, cage, cell,2);// 将原格子数据更新到新格子里
                        spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度
                        spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
                        spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 3);// 清除被调拨格子数据
@@ -354,7 +368,7 @@
                        datas.add((short) 2);
                        datas.add((short) 1);
                        String glassids = spianMapper.SelectGlassid(cage, cell); // 获取被调拨的玻璃id
                        spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里
                        spianMapper.UpdateDBCage(ids, cage, cell,2);// 将原格子数据更新到新格子里
                        spianMapper.Inserttask(2, 0, cageout.getId(), ids, orderid);// 新增调度任务
                        spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度
                        spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
@@ -373,7 +387,7 @@
    }
    // @GetMapping("/all2")
    public Short selectout2(String glassid) {
        // spianMapper.UpdatetaskOut(); //完成上一次出片或者调度任务,改到plchold里,出片或调度任务完成立即改变结束任务;
        // 定义PRC数据传送数组
@@ -417,7 +431,7 @@
                spianMapper.UpdateDBCage2(cage, cell);// 清除内片数据
            }
            S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务
            //outmesid(glassid);// 派发出片ID
            outmesid(glassid);// 派发出片ID
            return (200);// 结束
        } else {
@@ -433,7 +447,7 @@
                spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 新增任务
                spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
                spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 3);// 清除格子玻璃信息
                //outmesid(glassid);// 派发出片ID
                outmesid(glassid);// 派发出片ID
                S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务
                return (200);// 结束
@@ -458,7 +472,7 @@
                    datas.add((short) 1);
                    // 更换玻璃的笼子
                    String glassids = spianMapper.SelectGlassid(cage, cell); // 获取被调拨的玻璃id
                    spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里
                    spianMapper.UpdateDBCage(ids, cage, cell,2);// 将原格子数据更新到新格子里
                    spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度
                    spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
                    spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 3);// 清除被调拨格子数据
@@ -488,7 +502,7 @@
                    String glassids = spianMapper.SelectGlassid(cage, cell); // 获取被调拨的玻璃id
                    spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassid);// 新增调度任务
                    spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 新增出片任务
                    spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里
                    spianMapper.UpdateDBCage(ids, cage, cell,2);// 将原格子数据更新到新格子里
                    spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度
                    spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
                    spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 3);// 清除被调拨格子数据
@@ -503,7 +517,7 @@
        }
    }
    //派发调拨任务玻璃id
    public void outmesid(String glassid) {
        System.out.println("outmesid:" + glassid);
        List<Byte> glassidlist = new ArrayList();
@@ -514,23 +528,26 @@
        System.out.println("outmesidbytes:" + bytes.length);
        S7control.getinstance().WriteByte("DB105.30", bytes);// 派发出片id
    }
    /*** 修改用户* @throws SQLException */
    // public static int updateUser(Glass user) throws SQLException {conn =
    // getConn();
    // String sql = "update t_user set name=?,gender=?,age=?,score=?"+ " where
    // id=?";ps = conn.prepareStatement(sql);
    // ps.setString(1, user.getName());ps.setString(2, user.getGender());
    // ps.setInt(3, user.getAge());ps.setDouble(4, user.getScore());ps.setInt(5,
    // user.getId());return ps.executeUpdate();}
    // /*** 增加用户* @throws SQLException */
    // public static int insertUser(User user) throws SQLException {
    // conn = getConn();
    // String sql = "insert into t_user(name,gender,age,score)"+ " values(?,?,?,?)";
    // ps = conn.prepareStatement(sql);ps.setString(1,
    // user.getName());ps.setString(2, user.getGender());
    // ps.setInt(3, user.getAge());ps.setDouble(4, user.getScore());return
    // ps.executeUpdate();
    // }
    //获取地址内的玻璃id转字符串
    public StringBuilder queGlassid(String address) {
        StringBuilder writedstrIdOut = new StringBuilder();
        byte[] writedglassidbytesOut = S7control.getinstance().ReadByte(address, 13);
      if (writedglassidbytesOut != null) {
        // 获取玻璃id
        for (byte iditem : writedglassidbytesOut) {
          writedstrIdOut.append((char) iditem);
        }
      }
        return writedstrIdOut;
    }
    //char数组转化成bit数组
       public static byte[] toBytes(char[] chars) {
        String s = new String(chars);
        return s.getBytes(StandardCharsets.UTF_8);
    }
    //bit数组转化成char数组
    public static char[] toChars(byte[] bytes) {
        String s = new String(bytes, StandardCharsets.UTF_8);
        return s.toCharArray();
    }
}