wuyouming666
2024-01-22 2883c25a71cb080258f5e17430ff5ee37c0061c2
Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

# Conflicts:
# springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
14个文件已修改
1个文件已添加
939 ■■■■ 已修改文件
.vscode/launch.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plclog.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/Alarm.json 628 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/launch.json
@@ -6,6 +6,13 @@
    "configurations": [
      {
        "type": "java",
        "name": "MyGenerator",
        "request": "launch",
        "mainClass": "MyGenerator",
        "projectName": "canadames"
      },
      {
        "type": "java",
        "name": "AuthorityApplication",
        "request": "launch",
        "mainClass": "com.example.springboot.AuthorityApplication",
CanadaMes-ui/src/lang/locales/en-US.json
@@ -1,4 +1,5 @@
{
  "Clear":"Clear",
  "ip":"localhost",
  "systemTitle": "Login System",
  "usernamePlaceholder": "Please enter username",
@@ -359,6 +360,7 @@
  "Hand Movement":"Hand Movement",
  "Please enter the correct glassID":"Please enter the correct glassID",
  "Switch":"Switch",
  "This frame has glass that is currently outing":"This frame has glass that is currently outing",
    "ServoManualone": {
      "A01 所在格子": "A01 Current Grid",
      "数量": "Quantity",
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -1,4 +1,5 @@
{
  "Clear":"清除",
  "ip":"localhost",
  "systemTitle": "登录系统",
  "usernamePlaceholder": "请输入用户名",
@@ -35,6 +36,9 @@
  "northglassMESsystem": "北玻MES系统",
  "exit": "退出",
  "changePassword": "修改密码",
  "Old password":"旧密码",
  "New password":"新密码",
  "Confirm password":"提交密码",
  "resetPassword": "重置密码",
  "home": "主页",
  "role": "角色",
@@ -349,6 +353,7 @@
  "Hand Movement":"手动",
  "Please enter the correct glassID":"请输入正确的玻璃ID",
  "Switch":"切换",
  "This frame has glass that is currently outing":"此铝框有正在出片的玻璃",
  "langparameter": {
    "conveyor Velocity(Auto FAST)": "D01-D06 皮带输送自动快速",
    "conveyor Velocity(Auto SLOW)": "D01-D06 皮带输送自动慢速",
CanadaMes-ui/src/views/home/index.vue
@@ -375,37 +375,70 @@
                <div class="device" :style="'top: 262px;left: 150px;background-color: ' + ShowDeviceList(8) + ';'">D05</div>
                <div class="device" :style="'top: 339px;left: 150px;background-color: ' + ShowDeviceList(9) + ';'">D06</div>
                <div class="glass D01" style="top: 54px;left: 1055px;position: absolute;"
                    @click="ClearGlassId('DB101.9.2', 0)">{{ ShowGlassIdList(0) }}</div>
                <div class="glass D02" style="top: 132px;left: 1055px;position: absolute;"
                    @click="ClearGlassId('DB101.9.2', 1)">{{ ShowGlassIdList(1) }}</div>
                <div class="glass B01" style="top: 270px;left: 640px;position: absolute;"
                    @click="ClearGlassId('DB101.10.2', 2)">
                    B01:{{ ShowGlassIdList(2) }}</div>
                <div class="glass B02" style="top: 290px;left: 640px;position: absolute;"
                    @click="ClearGlassId('DB101.10.3', 3)">B02:{{ ShowGlassIdList(3) }}</div>
                <div class="glass A01" style="top: 270px;left: 289px;position: absolute;"
                    @click="ClearGlassId('DB101.10.0', 4)">
                    A01.1:{{ ShowGlassIdList(4) }}</div>
                <div class="glass D01" style="top: 39px;left: 1055px;position: absolute;">{{ ShowGlassIdList(0) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 0)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass D02" style="top: 117px;left: 1055px;position: absolute;">{{ ShowGlassIdList(1) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 1)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass B01" style="top: 270px;left: 640px;position: absolute;">
                    B01:{{ ShowGlassIdList(2) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2', 2)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass B02" style="top: 315px;left: 640px;position: absolute;">B02:{{ ShowGlassIdList(3) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.3', 3)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass A01" style="top: 270px;left: 289px;position: absolute;">
                    A01.1:{{ ShowGlassIdList(4) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.0', 4)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass A01" style="top: 290px;left: 289px;position: absolute;"
                    @click="ClearGlassId('DB101.10.1,5',5)">A01.2:{{ ShowGlassIdList(5) }}</div>
                <div class="glass A01" style="top: 315px;left: 289px;position: absolute;">A01.2:{{ ShowGlassIdList(5) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1,5', 5)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass A02" style="top: 310px;left: 289px;position: absolute;"
                    @click="ClearGlassId('DB101.10.2,6',6)">A02:{{ ShowGlassIdList(6) }}</div>
                <div class="glass A02" style="top: 360px;left: 289px;position: absolute;">A02:{{ ShowGlassIdList(6) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2,6', 6)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass D03" style="top: 137px;left: 42px;position: absolute;"
                    @click="ClearGlassId('DB101.9.4', 7)">
                    {{ ShowGlassIdList(7) }}</div>
                <div class="glass D04" style="top: 213px;left: 42px;position: absolute;"
                    @click="ClearGlassId('DB101.9.5', 8)">
                    {{ ShowGlassIdList(8) }}</div>
                <div class="glass D05" style="top: 290px;left: 42px;position: absolute;"
                    @click="ClearGlassId('DB101.9.6', 9)">
                    {{ ShowGlassIdList(9) }}</div>
                <div class="glass D06" style="top: 367px;left: 42px;position: absolute;"
                    @click="ClearGlassId('DB101.9.5', 10)">
                    {{ ShowGlassIdList(10) }}</div>
                <div class="glass D03" style="top: 122px;left: 42px;position: absolute;">
                    {{ ShowGlassIdList(7) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.4', 7)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass D04" style="top: 198px;left: 42px;position: absolute;">
                    {{ ShowGlassIdList(8) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.5', 8)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass D05" style="top: 275px;left: 42px;position: absolute;">
                    {{ ShowGlassIdList(9) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.6', 9)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass D06" style="top: 352px;left: 42px;position: absolute;">
                    {{ ShowGlassIdList(10) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.5', 10)">
                        {{ $t('Clear') }}</el-button>
                </div>
            </div>
@@ -573,12 +606,12 @@
                        }}</el-button>
                    </el-form-item> -->
                    <el-form-item>
                        {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Not Allow') : $t('Allow') }}
                        {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}
                        <el-button type="primary" @click="isConfirmState()">
                            {{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}</el-button>
                            {{ this.isConfirm == true ? $t('Not Allow') : $t('Allow') }}</el-button>
                    </el-form-item>
                    <el-form-item>
                        {{ $t('Current State') }}:{{ this.Scanningmethod==true?$t('Automatic'):$t('Hand Movement')}}
                        {{ $t('Current State') }}:{{ this.Scanningmethod == false ? $t('Automatic') : $t('Hand Movement') }}
                        <el-button type="primary" @click="SwitchScanMethod()">{{ $t('Switch')
                        }}</el-button>
                    </el-form-item>
@@ -754,7 +787,7 @@
                        <el-table-column :min-width="90" prop="barcode" :label="$t('Complete')">
                            <template slot-scope='scope' style="height:100px;height:100px;">
                                <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                                    :disabled="!(!isAllowQueue && scope.row.state != 2 && scope.row.state != 4)"
                                    :disabled="!(!isAllowQueue && scope.row.state != 1 && scope.row.state != 2)"
                                    @click="CompleteQueue(scope.row.id, scope.row.barcode, scope.row.glassId)">{{
                                        $t('Complete')
                                    }}</el-button>
@@ -986,7 +1019,6 @@
    },
    created() {
        this.load();
        this.init();
    }
    ,
@@ -1261,6 +1293,7 @@
        },
        //手动上片
        sbumitglassid() {
            console.log(1111111);
            if (this.form.order != "") {
                if (this.form.height < 380 || this.form.width < 390 || this.form.height > 1810 || this.form.width > 2760) {
                    this.$message.error(this.$t('The glass size is not within the range'));
@@ -1596,6 +1629,8 @@
                    DeleteProductionQueueGlass(id).then(res => {
                        if (res.data.message == 200) {
                            this.$message.success(this.$t('Operation successful'));
                        }else{
                            this.$message.error(this.$t('This frame has glass that is currently outing'));
                        }
                    });
                }
@@ -1634,6 +1669,9 @@
                        if (res.data.message == 200) {
                            this.form5 = {};
                            this.$message.success(this.$t('Operation successful'));
                        }
                        else if (res.data.message == 400) {
                            this.$message.error(this.$t('The glass size is not within the range'));
                        } else {
                            this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
                        }
@@ -2046,7 +2084,7 @@
            if (this.ClearGlassID == false) {
                console.log(this.DeviceList,num);
                if (this.DeviceList[num] == 0) {
                    if (this.GlassIdList[num].length < 14) {
                    if (this.GlassIdList[num].length <= 14) {
                        this.$confirm(this.$t('Are you sure to clear this barcode ?'), this.$t('confirm'), {
                            confirmButtonText: this.$t('Yes'),
                            cancelButtonText: this.$t('No'),
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -1,5 +1,6 @@
package com.example.springboot.component;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.service.JdbcConnections;
@@ -29,6 +30,7 @@
        // \\ TODO Auto-generated catch block
        e.printStackTrace();
      }
      // if (S7control.getinstance().CheckConnected() == false) {
        spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
        spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
@@ -82,6 +84,8 @@
          if (outstate == true) {// 当出片车空闲时,且出片启动为1时,任务启动改为0
            if (outstate1 == true) {
              S7control.getinstance().WriteWord("DB105.18", (short) 0);// 出片任务启动改为0
            System.out.println("关闭启动" + LocalDateTime.now());
            }
          }
        }
@@ -99,23 +103,37 @@
        // 当进片小车完成任务时
        if (B01backs == true) {
        // 判断是否汇报正确的id
        int HB = spianMapper.SelectHB(B01glassid.toString());
        if (HB > 0) {
          // 当B01小车汇报完成时更改玻璃状态 为1
          spianService.overtask(B01glassid.toString());// 完成任务
          S7control.getinstance().WriteWord("DB106.60", (short) 0);// 恢复B01小车应答改为0
          boolean yingda = spianService.listbool("DB106.60");// b01汇报
          if(yingda==false){
            spianService.overtask(B01glassid.toString());// 完成任务
          }
          System.out.println("汇报时B01|第" + aaa + "次" + B01glassid + "应答" + yingda);
          aaa += 1;
        }
      }
        // 当出片小车完成任务时
        if (B02backs == true) {
        // 判断是否汇报正确的id
        int HB = spianMapper.SelectHB(B02glassid.toString());
        if (HB > 0) {
          // 当B02小车汇报完成时更改玻璃状态为0
          spianService.overtask(B02glassid.toString());// 完成任务
          S7control.getinstance().WriteWord("DB106.62", (short) 0);// 恢复B02小车应答改为0
          System.out.println("汇报时B02|" + B02glassid);
          boolean yingda = spianService.listbool("DB106.62");// b02汇报
          if (yingda == false) {
            spianService.overtask(B02glassid.toString());// 完成任务
          }
          System.out.println("汇报时B02|第" + aaa + "次" + B02glassid + "应答" + yingda);
        }
      }
        // 获取DO1数据
        StringBuilder queueid1 = spianService.queGlassid("DB106.26", 14);// 获取请求的id跟DO1同时清
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -153,7 +153,7 @@
            // // TODO: handle exception
            // }
            // if (S7control.getinstance().CheckConnected() == true) {
            if (S7control.getinstance().CheckConnected() == true) {
            // 获取当前扫码方式
            List<Boolean> Scanningmethods = S7control.getinstance().ReadBits("DB101.11.4", 1);
@@ -163,7 +163,6 @@
                }
            }
            
            String CurrrentGlassId = spianService.queGlassid("DB103.256", 14).toString();
            jsonObject.append("CurrrentGlassId", CurrrentGlassId);
@@ -172,7 +171,7 @@
            jsonObject.append("DeviceList", DeviceList);
            // 获取D01-D06,A01,A02,B01,B02玻璃id
            List<String> GlassIdList = new ArrayList<String>();
            GlassIdList.add(spianService.queGlassid("DB103.40", 14).toString());
                GlassIdList.add(spianService.queGlassid("DB103.44", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.58", 14).toString());
            GlassIdList.add(spianService.queGlassid("DB103.184", 14).toString());
@@ -265,37 +264,7 @@
            for (Boolean emergencystop : emergencystops) {
                jsonObject.append("emergencystop", emergencystop);
            }
            // // 终止继续按钮
            // List<String> niuanaddressList3 =
            // Arrays.asList(config.getProperty("Parameter2.stop").split(","));
            // List<Boolean> anniuread =
            // S7control.getinstance().readBits(niuanaddressList3);
            // // Boolean[] value4 = { false, false};
            // // List<Boolean> anniuread = new ArrayList<>(Arrays.asList(value4));
            // Boolean[] value5 = { true };
            // List<Boolean> resets = new ArrayList<>(Arrays.asList(value5));
            // short[] anniuparams = new short[anniuread.size()];
            // for (int i = 0; i < anniuread.size(); i++) {
            // boolean value = anniuread.get(i);
            // anniuparams[i] = value ? (short) 1 : (short) 0;
            // }
            // short[] resets2 = new short[resets.size()];
            // for (int i = 0; i < resets.size(); i++) {
            // boolean value = resets.get(i);
            // resets2[i] = value ? (short) 1 : (short) 0;
            // }
            // for (short number : resets2) {
            // if (number == 1) {
            // jsonObject.append("Abort", anniuparams);
            // }
            // }
            // }
            }
            storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
            dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
springboot-vue3/src/main/java/com/example/springboot/component/Plclog.java
@@ -21,23 +21,24 @@
            }
            spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
            spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
            StringBuilder B01glassid = spianService.queGlassid("DB103.184", 14);// BO1的玻璃id
            StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02的玻璃id
            boolean B01backs = spianService.listbool("DB106.60");// b01汇报
            boolean B02backs = spianService.listbool("DB106.62");// b01汇报
            if (b01 != B01backs) {
                if (B01backs == true) {
                    spianMapper.insertlog("BO1:1");
                    spianMapper.insertlog("BO1:1"+B01glassid);
                } else {
                    spianMapper.insertlog("BO1:0");
                    spianMapper.insertlog("BO1:0"+B01glassid);
                }
                 b01 = B01backs;
            }
           
             if (b02 != B02backs) {
                if (B02backs == true) {
                    spianMapper.insertlog("BO2:1");
                    spianMapper.insertlog("BO2:1"+B02glassid);
                } else {
                    spianMapper.insertlog("BO2:0");
                    spianMapper.insertlog("BO2:0"+B02glassid);
                }
                b02 = B02backs;
            }
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -20,25 +20,25 @@
      //  new PlcHold().start();
        new Plchome().start();
        // new PlcLayout().start();
        // new Plcalarm().start();
        new Plcalarm().start();
        // new Plcsign().start();
        new Plcsign().start();
        // new Plcstate().start();
        // new PlcPositioning1().start();
        new Plcstate().start();
        new PlcPositioning1().start();
        // new PlcParameter2().start();
        new PlcParameter2().start();
        // new PLCAutomaticParameterSetting().start();
        new PLCAutomaticParameterSetting().start();
        // new PlcManualonePosition().start();
        // new PlcManualonePosition2().start();
        // new PlcServoManualone().start();
        // new PLCManualJog().start();
        // new Plclog().start();
        new PlcManualonePosition().start();
        new PlcManualonePosition2().start();
        new PlcServoManualone().start();
        new PLCManualJog().start();
        new Plclog().start();
        new PlcInteractionState().start();
        // new PlcInteractionState().start();
//new PlcParameter1Review().start();
       // new PLCAutomaticParameterSettingReview().start();
    }
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -275,16 +275,21 @@
  @PostMapping("/InsertQueueGlassId")
  public Result InsertQueueGlassId(Short id, @RequestBody Queue queue) {
    Map<String, Object> map = new HashMap<>();
    Short zhi=200;
    short result = homeMapper.SelectStorageByGlassId(queue.getglassId());
    if (result > 0) {
      map.put("message", "300");
    } else {
      homeMapper.InsertQueueGlassId(queue, id);
      if (id == 1) {
        // 调用伍存储过程
        spianService.selectAll(queue.getglassId());
        zhi=spianService.selectAll(queue.getglassId());
        if(zhi==200){
          homeMapper.InsertQueueGlassId(queue, id);
      }
      map.put("message", "200");
      }
      map.put("message",zhi);
    }
    return Result.success(map);
  }
@@ -330,11 +335,7 @@
  // 根据铝框id删除出片队列玻璃
  @PostMapping("/DeleteProductionQueueGlass")
  public Result DeleteProductionQueueGlass(String FrameNo) {
    homeMapper.CompleteQueueByFrameNo(FrameNo);
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
    return Result.success(map);
    return outSliceServive.CompleteQueueByFrameNo(FrameNo);
  }
  // 添加铝框id对应玻璃到出片队列
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -165,7 +165,7 @@
  Out_slice SelectQueueByglassid(String getbarcode);
  //添加出片队列
  @Insert("INSERT INTO out_slice( `glassId`, `barcode`, `glasswidth`, `glassheight`, `state`, `flip`, `sequence`, `time` ,`position` ,`orderid` ,`listid` ,`boxid` ,`glasswidthmm` ,`glassheightmm` ,`framewidthmm` ,`frameheightmm` ) VALUES ( #{glassid}, #{FrameNo}, #{glasslengthMm}, #{glassheightMm}, #{state}, #{flip}, #{sequence}, now(), #{position}, #{orderid}, #{listid}, #{boxid}, #{glasswidth}, #{glassheight}, #{framewidthmm}, #{frameheightmm});")
  @Insert("INSERT INTO out_slice( `glassId`, `barcode`, `glasswidth`, `glassheight`, `state`, `flip`, `sequence`, `time` ,`position` ,`orderid` ,`listid` ,`boxid` ,`glasswidthmm` ,`glassheightmm` ,`framewidthmm` ,`frameheightmm` ,`framestate` ) VALUES ( #{glassid}, #{FrameNo}, #{glasslengthMm}, #{glassheightMm}, #{state}, #{flip}, #{sequence}, now(), #{position}, #{orderid}, #{listid}, #{boxid}, #{glasswidth}, #{glassheight}, #{framewidthmm}, #{frameheightmm}, 0);")
  void AddOutSliceS(String glassid, String flip, String FrameNo, String glasslengthMm, String glassheightMm, int sequence, String position, Short state,String orderid, String listid, String boxid, String glasswidth, String glassheight,String framewidthmm,String frameheightmm);
  //出片队列调序
@@ -179,12 +179,12 @@
  @Select("select rp.* from role_permission rp inner join user r on rp.role_id=r.role_id and r.username=#{username} and (permission_id=32 or permission_id=33 or permission_id=34 or permission_id=35 or permission_id=36 or permission_id=37 or permission_id=38 or permission_id=39)")
  List<RolePermission> SelectPermissionByUserName(String username);
  //根据玻璃完成出片任务
  @Update("update out_slice set state=3 where id=#{id}")
  void CompleteQueue(String id);
  // //根据玻璃完成出片任务
  // @Update("update out_slice set state=2 where id=#{id}")
  // void CompleteQueue(String id);
  //根据玻璃完成出片任务
  @Update("update out_slice set state=3 where id=#{id}")
  @Update("update out_slice set state=2 where glassid=#{glassid}")
  void CompleteQueueByGlassId(String glassid);
  //查询铝框id对应玻璃完成数量
@@ -223,4 +223,9 @@
  @Update("update storage_cage set width=width+#{width} where   cage=#{cage} and cell=#{cell};")
  void UpdataCageWidth(double width, int cage, int cell);
  //获取铝框有没有正在出片的玻璃
  @Select("select count(*) from out_slice where barcode=#{frameNo} and state=1")
  Short SelectOutingQueueCount(String frameNo);
}
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -18,8 +18,8 @@
    @Select("select a.cage,FrameBarcode,COUNT(if(a.order_id=#{orderids},a.order_id,null))as orderid,b.shu,c.shu2,a.cell,min(a.state)as state1,max(a.state)as state2,disabled,FrameBarcode 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 (FrameBarcode=#{Fbarcode} or ''='') desc,shu desc,shu2,state2 asc,cage asc;")
    List<StorageCage> selectAll(String orderids,String Fbarcode);
    //优先判断一次是否有同铝框的空位
    @Select("select *,min(state) state1 from storage_cage  GROUP BY cage,cell HAVING state1=0 and  FrameBarcode=#{FrameBarcode} LIMIT 1;")
    List<StorageCage> selectAllFbarcode(String Fbarcode);
    @Select("select *,min(state) state1 from storage_cage where width>=(#{width}+#{width2})  GROUP BY cage,cell HAVING state1=0 and  FrameBarcode=#{Fbarcode} ORDER BY width desc LIMIT 1;")
    List<StorageCage> selectAllFbarcode(String Fbarcode,double width,double width2);
    // 获取判断该格子是否需要把外片推入内片位置
    @Select("select state from storage_cage where  cage=#{cage} and cell=#{cell} and tier=1;")
    int selectcell(int cage, int cell);
@@ -232,4 +232,7 @@
    //判断玻璃是否禁用
    @Select(" select disabled from storage_cage where glass_id=#{glassid} limit 1;")
    int SelectCageGlassState(String glassid);
    //判断汇报的id是否正确
    @Select("SELECT count(*) FROM `storage_cage` where state!=0 and state!=1 and glass_id=#{glassid}")
    int SelectHB(String glassid);
}
springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
@@ -52,16 +52,7 @@
  // 完成出片任务
  public Result CompleteQueue(String id, String frameid, String glassid) {
    homeMapper.CompleteQueue(id);
    Short num = homeMapper.SelectCountByFrameNo(frameid);
    if (num == 0) {
      homeMapper.CompleteQueueByFrameNo(frameid);
    }
    StorageCage storageCage = homeMapper.SelectGlassInfo(glassid);
    if (storageCage != null && storageCage.getState().equals("3")) {
      spianMapper.UpdataOutCage1(storageCage.getGlassWidth(), storageCage.getCage(), storageCage.getCell());
      homeMapper.DeleteByGlassID(glassid);
    }
    homeMapper.CompleteQueueByGlassId(glassid);
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
    return Result.success(map);
@@ -122,4 +113,16 @@
    return homeMapper.SelectCurrentFrame();
  }
public Result CompleteQueueByFrameNo(String frameNo) {
  Map<String, Object> map = new HashMap<>();
  Short num= homeMapper.SelectOutingQueueCount(frameNo);
  if(num==0){
    homeMapper.CompleteQueueByFrameNo(frameNo);
    map.put("message", "200");
  }else{
    map.put("message", "300");
  }
  return Result.success(map);
}
}
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -19,7 +19,7 @@
    // @GetMapping("/all")
    public Short selectAll(String glassid) {
        int cage1;
        int cage1=0;
        int cells;
        int ids;
        int prcid;
@@ -33,12 +33,7 @@
        if (glasslist == null) {
            return (300);
        }
        //判断是否还有进片任务未完成的
        int cagestate=spianMapper.SelectCageState(2);
        //有进片任务未完成时返回不进片
        if(cagestate>0){
            return (300);
        }
        double widths = glasslist.getglasslengthmm();
        String orderids = glasslist.getordernumber();
        String FrameBarcode = glasslist.getFrameBarcode();
@@ -54,7 +49,10 @@
        // String orderid="A001";
        // 获取订单相关度最高的笼子排序
        List<StorageCage> storageCage = spianMapper.selectAllFbarcode(FrameBarcode);
        List<StorageCage> storageCage = spianMapper.selectAllFbarcode(FrameBarcode,widths,400);
        //判断铝框指定空格是否需要间隔空间
        if (storageCage.size() == 0) {
            storageCage = spianMapper.selectAll(orderids, FrameBarcode);
        }
@@ -171,10 +169,10 @@
            spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, state);// 新增任务
            // int state = spianMapper.selectGlassState(cage, cell);//获取格子数量
            if (state == 2) {
                spianMapper.UpdateDBCage1(cage, cell);// 将内片数据更新到外片里
                spianMapper.UpdateDBCage2(cage, cell);// 清除内片数据
            }
            // if (state == 2) {
            //     spianMapper.UpdateDBCage1(cage, cell);// 将内片数据更新到外片里
            //     spianMapper.UpdateDBCage2(cage, cell);// 清除内片数据
            // }
            System.out.println("出片任务|" + datas);
            S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务
            outmesid(glassid, "DB105.34");// 派发出片ID
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -30,19 +30,21 @@
        String A01glassid2 = spianService.queGlassid("DB103.142", 14).toString();
        String A02glassid1 = spianService.queGlassid("DB103.156", 14).toString();
        String B01glassid = spianService.queGlassid("DB103.184", 14).toString();
        String B02glassid = spianService.queGlassid("DB103.198", 14).toString();
        String B02glassid = spianService.queGlassid("DB103.212", 14).toString();
        List<Short> DeviceList = S7control.getinstance().ReadWord("DB103.0", 10);
        if (types == 0) {// 终止进片任务
            List<StorageTask> cageList = homeMapper.SelectTaskByState(types);
            for (StorageTask storageTask : cageList) {
                // 判断出片任务位置并清除对应玻璃id
                if ((storageTask.getGlassId() == A01glassid1 || storageTask.getGlassId() == A01glassid2)&&DeviceList.get(4)==0) {
                if ((storageTask.getGlassId().equals(A01glassid1)|| storageTask.getGlassId().equals(A01glassid2))&&DeviceList.get(4)==0) {
                    outSliceServive.StopTask(storageTask.getGlassId(), types);
                    ClearGlassId("DB101.10.0");
                } else if (storageTask.getGlassId() == B01glassid&&DeviceList.get(2)==0) {
                }
                if (storageTask.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0) {
                    outSliceServive.StopTask(storageTask.getGlassId(), types);
                    ClearGlassId("DB101.10.2");
                } else if (storageTask.getGlassId() == B02glassid&&DeviceList.get(3)==0) {
                }
                if (storageTask.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0) {
                    ClearGlassId("DB101.10.3");
                    outSliceServive.StopTask(storageTask.getGlassId(), types);
                }
@@ -56,7 +58,6 @@
            }
            for (StorageTask cageList : cageLists) {
                if (cageList.getTaskType().equals("1")) {
                    System.out.println(DeviceList.get(5));
                    if(cageList.getGlassId().equals(A02glassid1)&&DeviceList.get(5)==0){
                        outSliceServive.StopTask(cageList.getGlassId(), types);
springboot-vue3/src/main/resources/Alarm.json
New file
@@ -0,0 +1,628 @@
{
  "content": [
    {
      "name": "D01 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D02 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D03 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D04 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D05 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D06 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 VFD error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 servo turn error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 servo turn error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 servo travel error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 servo travel error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 servo travel error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 servo travel error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D01 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D01 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D02 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D02 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D03 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D03 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D04 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D04 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D05 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D05 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D06 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D06 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 IN DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 IN pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 OUT DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 OUT pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 IN DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 IN pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 OUT DEC error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 OUT pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D01 Scan glass exceeding limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "emergency stop alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "More glass than known",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "less glass than known",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D01 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D02 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D03 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D04 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D05 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "D06 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02 conveyor timeout alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 conveyor Left safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01 conveyor right safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 conveyor Left safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02 conveyor right safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "1# buffer safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "2# buffer safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "3# buffer safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "4# buffer safety alarm",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A01.SR right in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "A02.SR left in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01.SR left in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01.SR left dec error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01.SR right dec error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B01.SR right in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02.SR left in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02.SR left dec error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },
    {
      "name": "B02.SR right dec error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    }
    ,{
      "name": "B02.SR right in pos error",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A01 servo turn  homed",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A02 servo turn  homed",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A01 servo travel  homed",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A02 servo travel  homed",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "B01 servo travel  homed",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "B02 servo travel  homed",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "resetDelay",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A01 travel Negative limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A01 travel Positive limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A01 turn up limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A01 turn down limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A02 travel Negative limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A02 travel Positive limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A02 turn up limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    } ,{
      "name": "A02 turn down limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },{
      "name": "B01 travel Negative limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },{
      "name": "B01 travel Positive limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },{
      "name": "B02 travel Negative limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    },{
      "name": "B02 travel Positive limit",
      "value": "1",
      "state": "1",
      "type": "3",
      "page": "1"
    }
  ],
  "address": [
    {
      "name": "DB104.0.0",
      "count": 91
    }
  ]
}