wu
2023-12-20 0be2f95c0042bacfab5965bdf127046ad04ea488
Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

# Conflicts:
# springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
11个文件已修改
1个文件已添加
273 ■■■■■ 已修改文件
CanadaMes-ui/src/lang/locales/en-US.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plclog.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json
@@ -270,7 +270,7 @@
  "There is no glass for this order":"There is no glass for this order",
  "There are currently tasks":"There are currently tasks",
  "There is no such glass":"There is no such glass",
  "There is no such grid":"There is no such grid",
  "There is no such slot":"There is no such slot",
  "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 ?",
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -252,7 +252,7 @@
  "There is no such order": "没有此订单的玻璃",
  "There are currently tasks": "当前有任务",
  "There is no such glass": "没有此玻璃",
  "There is no such grid": "没有空闲格子",
  "There is no such slot": "没有空闲格子",
  "No delete allowed": "不能删除",
  "No out allowed": "不能出片",
  "Are you sure to perform this operation ?": "确定执行此操作?",
CanadaMes-ui/src/views/home/index.vue
@@ -472,7 +472,7 @@
            <el-pagination :style="'margin-top:-2px'" @size-change="handleSizeChanges"
                @current-change="handleCurrentChanges" :pager-count="7" :current-page="currentPages"
                :page-sizes="[21, 42, 84, 420]" :page-size="pagesizes" layout="total, sizes, prev, pager, next, jumper"
                :page-sizes="[42, 84, 126, 420]" :page-size="pagesizes" layout="total, sizes, prev, pager, next, jumper"
                :total="cageinfo.length > 0 ? cageinfo.length : null" background style="float: right; margin-top: 20px">
            </el-pagination>
@@ -649,9 +649,13 @@
                    </template>
                </el-table-column>
                <el-table-column prop="sequence" :label="$t('Sequence')"></el-table-column>
                <el-table-column prop="position" :label="$t('Position')" style="font-size: 20px;">
                <el-table-column :min-width="300" prop="position" :label="$t('Position')" style="font-size: 20px;">
                    <template slot-scope='scope'>
                        {{ scope.row.position == 1 ? "▄▄▄" : "▋" }}
                        <!-- {{ scope.row.position == 1 ? "<>▄▄▄" : "▋" }} -->
                        <div :style="'width:'+(scope.row.position==1?'300':'100') +'px;height:'+(scope.row.position==1?'100':'300') +'px;background-Color:gray;'">
                            <!-- <div :style="'width:100px;height:300px;background-Color:red;'"></div> -->
                        </div>
                        <!-- {{ scope.row.position == 1 ? "<div></div>" : "<div></div>" }} -->
                    </template>
                </el-table-column>
                <el-table-column prop="position" :label="$t('Flip')">
@@ -733,6 +737,7 @@
        <el-dialog :visible.sync="dialogFormCountDown" :title="$t('Approximately resettable time')" top="5vh">
            <div :style="'font-size: ' + PromptSize + 'px;text-align: center;'">
                <!-- {{ this.CountDowns }} -->
                {{ this.CountDowns }}
            </div>
        </el-dialog>
@@ -816,7 +821,7 @@
            pagesize: 15,    //每页默认显示的数据
            pageCount: 0,
            currentPages: 1,  //默认初始页
            pagesizes: 21,    //每页默认显示的数据
            pagesizes: 42,    //每页默认显示的数据
            pageCounts: 0,
            OutSlice: [],
            AluminumFrame: [],
@@ -829,15 +834,15 @@
            OutingQueue: true,
            OrderInfo: true,
            CageDetails: true,
            CountDowns: "EMERGENCY STOP",
            CountDowns: "EMERGENCY \r\n STOP",
            D01RequestState: false,
            EmergencyStop: false,
            PromptSize: 250
            PromptSize: 250,
            reset:false
        };
    },
    created() {
        this.load();
        this.init();
    }
    ,
@@ -885,13 +890,15 @@
                    }
                    //是否急停
                    this.EmergencyStop = obj.emergencystop[0];
                    console.log(this.EmergencyStop);
                    //复位倒计时
                    if ((obj.countdown[0] == true && this.CountDowns == 0) || this.EmergencyStop == true) {
                        this.CountDown();
                    }
                    //复位完成信号
                    this.reset=obj.reset[0];
                    //是否有进片请求
                    console.log(obj.D01RequestState[0]);
                    this.D01RequestState = obj.D01RequestState[0];
                    //是否允许出片
@@ -947,8 +954,6 @@
                            this.cageinfo = res.data.cageinfo;
                        });
                    }
                    this.$forceUpdate();
                }.bind(this);
@@ -983,6 +988,10 @@
                });
            });
            //加载小车位置信息
            Loadcarlist().then(res => {
                this.carlist = res.data.carlist;
            });
            //加载笼子使用情况数据
            home().then(res => {
                this.tableData = res.data.list;
@@ -1011,10 +1020,7 @@
            SelectAlarmmgInfo().then(res => {
                this.alarm = res.data.alarmmg;
            });
            //加载小车位置信息
            Loadcarlist().then(res => {
                this.carlist = res.data.carlist;
            });
            //加载确认密码
            SelectPassword().then(res => {
                this.password = res.data.password;
@@ -1067,7 +1073,7 @@
                                this.$message.error(this.$t('There is no such glass'));
                            }
                            else if (res.data.message2 == 400) {
                                this.$message.error(this.$t('There is no such grid'));
                                this.$message.error(this.$t('There is no such slot'));
                            }
                        });
                    } else {
@@ -1418,6 +1424,7 @@
                            this.form5 = {};
                            this.$message.success(this.$t('Operation successful'));
                        } else {
                            alert(1);
                            this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
                        }
                    });
@@ -1628,7 +1635,7 @@
            rowIndex = column;
            let style = "";
            if (columnIndex === 8) {
                style = "font-size:25px;text-align: center;";
                style = "font-size:200px;text-align: center;height:200px;";
            }
            if (columnIndex === 9 && row.flip == 1) {
                style = "background-Color:yellow;";
@@ -1731,7 +1738,7 @@
                    if (this.EmergencyStop == true) {
                        clearInterval(timer);
                        this.PromptSize = 250;
                        this.CountDowns = "EMERGENCY STOP";
                        this.CountDowns = "EMERGENCY \n STOP";
                    } else {
                        if (count > 0) {
                            this.PromptSize = 500;
@@ -1740,12 +1747,11 @@
                        }
                        else {
                            this.PromptSize = 250;
                            this.CountDowns = "Waiting for reset";
                            // if(复位完成==true){
                            //     clearInterval(timer);
                            //     this.dialogFormCountDown = false;
                            // }
                            this.CountDowns = "Waiting \n for \n reset";
                            if(this.reset==true){
                                clearInterval(timer);
                                this.dialogFormCountDown = false;
                            }
                        }
                    }
                },
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -16,15 +16,14 @@
  private JdbcConnections jdbcConnections;
  private SpianMapper spianMapper;
  private SpianService spianService;
  int aaa;
  @Override
  public void run() {
    boolean inglassbegin = false;
    boolean outglassbegin = false;
    while (this != null) {
      try {
        Thread.sleep(1000);
        Thread.sleep(100);
      } catch (InterruptedException e) {
        // \\ TODO Auto-generated catch block
        e.printStackTrace();
@@ -40,21 +39,58 @@
      // // TODO Auto-generated catch block
      // e.printStackTrace();
      // }
       List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 获取prc进片请求数据
       // 出片任务////////////////////////////////
      List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态
      List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动
      // StringBuilder writedstrIdOut = new StringBuilder();
      // 获取已下发的出片id
      byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14);
      String writedstrIdOut = new String(writedglassidbytesOut);
      boolean outstate = false;// 出片车空闲判断
      boolean outstate1 = false;// 出片车任务是否启动
      if (outlist != null && outlist1 != null) {
        outstate = outlist.contains((short) 0);// 出片车空闲判断 当出片车空闲时为true
        outstate1 = outlist1.contains((short) 1);// 出片车任务是否启动 当出片车任务启动时为true
        // 判断当前是否有未执行的任务
        int outnum = spianMapper.SelectOutSliceshu();
        // 当没有任务执行并且出片车空闲时
        if (outnum == 0 && outstate == true && Plchome.isAllowQueue == true) {
          // 判断铝框出片队列表是否有待出片的玻璃
          String outglassid = spianMapper.SelectOutSlice();
          if (outglassid != null) {
            spianService.selectout2(outglassid);
            outstate = false;
          }
        }
        if (outstate == true) {// 当出片车空闲时,且出片启动为1时,任务启动改为0
          if (outstate1 == true) {
            S7control.getinstance().WriteWord("DB105.18", (short) 0);// 出片任务启动改为0
          }
        }
      }
      /////////////进片任务
      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.16", 1);// 获取进片车任务是否启动
      boolean B01backs = spianService.listbool("DB106.60");// b01汇报
      boolean B02backs = spianService.listbool("DB106.62");// b02汇报
      StringBuilder B01glassid = spianService.queGlassid("DB103.184", 14);// BO1的玻璃id
      StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02的玻璃id
      int aaa=1;
      // 当进片小车完成任务时
      if (B01backs == true) {
        // 当B01小车汇报完成时更改玻璃状态 为1
        spianService.overtask(B01glassid.toString());// 完成任务
        S7control.getinstance().WriteWord("DB106.60", (short) 0);// 恢复B01小车应答改为0
        System.out.println("汇报时B01|第"+aaa+"次"+ B01glassid);
        boolean yingda = spianService.listbool("DB106.60");// b01汇报
        System.out.println("汇报时B01|第"+aaa+"次"+ B01glassid+"应答"+yingda);
        aaa+=1;
      }
@@ -64,6 +100,8 @@
        spianService.overtask(B02glassid.toString());// 完成任务
        S7control.getinstance().WriteWord("DB106.62", (short) 0);// 恢复B02小车应答改为0
        System.out.println("汇报时B02|" + B02glassid);
        boolean yingda = spianService.listbool("DB106.62");// b01汇报
        System.out.println("汇报时B01|第"+aaa+"次"+ B02glassid+"应答"+yingda);
      }
      // 获取DO1数据
@@ -102,39 +140,7 @@
      }
      // 出片任务////////////////////////////////
      List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态
      List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动
      // StringBuilder writedstrIdOut = new StringBuilder();
      // 获取已下发的出片id
      byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14);
      String writedstrIdOut = new String(writedglassidbytesOut);
      boolean outstate = false;// 出片车空闲判断
      boolean outstate1 = false;// 出片车任务是否启动
      if (outlist != null && outlist1 != null) {
        outstate = outlist.contains((short) 0);// 出片车空闲判断 当出片车空闲时为true
        outstate1 = outlist1.contains((short) 1);// 出片车任务是否启动 当出片车任务启动时为true
        // 判断当前是否有未执行的任务
        int outnum = spianMapper.SelectOutSliceshu();
        // 当没有任务执行并且出片车空闲时
        if (outnum == 0 && outstate == true && Plchome.isAllowQueue == true) {
          // 判断铝框出片队列表是否有待出片的玻璃
          String outglassid = spianMapper.SelectOutSlice();
          if (outglassid != null) {
            spianService.selectout2(outglassid);
            outstate = false;
          }
        }
        if (outstate == true) {// 当出片车空闲时,且出片启动为1时,任务启动改为0
          if (outstate1 == true) {
            S7control.getinstance().WriteWord("DB105.18", (short) 0);// 出片任务启动改为0
          }
        }
      }
      // if (outstate == true) { // 出片车状态空闲时
      // Integer state = spianMapper.Selectoutstate();
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -42,7 +42,7 @@
        while (this != null) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
@@ -127,21 +127,26 @@
            // 是否需要人工确认上片玻璃
            jsonObject.append("isConfirm", isConfirm);
            //获取进片请求状态
            // 获取进片请求状态
            List<Short> D01Request = S7control.getinstance().ReadWord("DB106.24", 1);
            boolean D01RequestState = D01Request.contains((short)1);
            boolean D01RequestState = D01Request.contains((short) 1);
            // boolean D01RequestState =true;
            jsonObject.append("D01RequestState", D01RequestState);
            //复位倒计时
            // 复位倒计时
            // 地址104.9.6
            List<Boolean> countdown = S7control.getinstance().ReadBits("DB104.9.6", 1);
            for (Boolean countdowns : countdown) {
                jsonObject.append("countdown", countdowns);
            }
            // jsonObject.append("countdown", true);
            // 复位完成信号
            List<Boolean> resets = S7control.getinstance().ReadBits("DB103.284", 1);
            for (Boolean reset : resets) {
                jsonObject.append("reset", reset);
            }
            //是否急停
            // 是否急停
            List<Boolean> emergencystops = S7control.getinstance().ReadBits("DB104.5.1", 1);
            for (Boolean emergencystop : emergencystops) {
                jsonObject.append("emergencystop", emergencystop);
springboot-vue3/src/main/java/com/example/springboot/component/Plclog.java
New file
@@ -0,0 +1,47 @@
package com.example.springboot.component;
import com.example.springboot.mapper.SpianMapper;
import com.example.springboot.service.SpianService;
public class Plclog extends Thread {
    boolean b01 = false;
    boolean b02 = false;
    private SpianService spianService;
    private SpianMapper spianMapper;
    @Override
    public void run() {
        while (this != null) {
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                // \\ TODO Auto-generated catch block
                e.printStackTrace();
            }
            spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
            spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
            boolean B01backs = spianService.listbool("DB106.60");// b01汇报
            boolean B02backs = spianService.listbool("DB106.62");// b01汇报
            if (b01 != B01backs) {
                if (B01backs == true) {
                    spianMapper.insertlog("BO1:1");
                } else {
                    spianMapper.insertlog("BO1:0");
                }
                 b01 = B01backs;
            }
             if (b02 != B02backs) {
                if (B02backs == true) {
                    spianMapper.insertlog("BO2:1");
                } else {
                    spianMapper.insertlog("BO2:0");
                }
                b02 = B02backs;
            }
        }
    }
}
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -17,10 +17,14 @@
        //
        System.out.println("启动完成");
     new PlcHold().start();
        // new Plclog().start();
        // new PlcHold().start();
        new Plchome().start();
        //  new Plcalarm().start();
        //  new Plcsign().start();
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -141,13 +141,13 @@
  public Result UpdateTask(Integer types, Integer shelfrack, String glassid) {
    Map<String, Object> map = new HashMap<>();
    homeMapper.UpdateTask(types, glassid);
    StorageCage glass = homeMapper.SelectGlassInfo(glassid);
    // StorageCage glass = homeMapper.SelectGlassInfo(glassid);
    if (types == 0) {
      homeMapper.UpdateCageTask1(glassid);
      // S7control.getinstance().WriteWord("DB105.16", (short) 0);
    } else {
      spianMapper.UpdataOutCage1(glass.getGlassWidth(), glass.getCage(), glass.getCell());
      homeMapper.UpdateCageTask2(glassid);
      // spianMapper.UpdataOutCage1(glass.getGlassWidth(), glass.getCage(), glass.getCell());
      homeMapper.DeleteByGlassID(glassid);
      // S7control.getinstance().WriteWord("DB105.18", (short) 0);
    }
    map.put("message3", "200");
@@ -203,7 +203,6 @@
        } else {
          map.put("message2", "300");
        }
      } else {
        map.put("message2", "400");
      }
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -62,10 +62,6 @@
  @Update("update storage_cage set state=1 where glass_id=#{glassid} and state=2")
  void UpdateCageTask1(@Param("glassid") String glassid);
  // 手动完成出片任务修改笼子数据
  @Update("update storage_cage set state=0,glass_id=null,order_id=null,glasswidth=null,glassheight=null where glass_id=#{glassid} and state=3")
  void UpdateCageTask2(@Param("glassid") String glassid);
  //获取报警信息
  @Select("select id,content,timeon as timeons,endTime from alarmmg where endTime is null")
  List<alarmmg> SelectAlarmmgInfo();
@@ -74,6 +70,7 @@
  @Select("select * from storage_cage where position(#{cage} in ifnull(glass_id,\"\"))")
  List<StorageCage> SelectCageInfo(String cage);
  // 手动完成出片任务修改笼子数据
  @Update("update storage_cage set state=0,glass_id=null,order_id=null,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,listid=null,boxid=null where glass_id=#{glassid}")
  void DeleteByGlassID(String glassid);
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -15,7 +15,7 @@
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) and disabled=0 GROUP BY cage ORDER BY cell desc LIMIT 1")
    @Select("select COUNT(if(a.state1=0,cell,0))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) and disabled=0 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
@@ -42,7 +42,7 @@
    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!=0;")
    @Select("select COUNT(tier)as tier from storage_cage where  cage=#{cage} and cell=#{cell} and state=1;")
    int selectsum(int cage, int cell);
    // 完成进片中的玻璃状态
@@ -73,11 +73,11 @@
    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),cell desc  limit 1;")
    StorageCage selectGlassCage(int cage, double width, int cage1, int cage2);
    @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id,abs(#{cell}-cell)as xuhao from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage),xuhao desc  limit 1;")
    StorageCage selectGlassCage(int cage, double width, int cage1, int cage2,int cell);
    // 删除笼子信息(出片)
    @Update("update storage_cage as a set state=#{state},glass_id=null,order_id=null,glasswidth=0,a.glassheight=null,a.glasswidthmm=null,a.glassheightmm=null,a.listid=null,a.boxid=null where glass_id=#{glassid} and state=3;")
    @Update("update storage_cage as a set state=#{state},glass_id=null,order_id=null,glasswidth=null,a.glassheight=null,a.glasswidthmm=null,a.glassheightmm=null,a.listid=null,a.boxid=null where glass_id=#{glassid} and state=3;")
    void UpdataGlassCage(String glassid, int state);
    // 改变玻璃状态为出片中
@@ -109,7 +109,7 @@
    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,a.glassheight=b.glassheight,a.glasswidthmm=b.glasswidthmm,a.glassheightmm=b.glassheightmm,a.listid=b.listid,a.boxid=b.boxid where a.id=#{id1}")
    @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=2,a.glasswidth=b.glasswidth,a.glassheight=b.glassheight,a.glasswidthmm=b.glasswidthmm,a.glassheightmm=b.glassheightmm,a.listid=b.listid,a.boxid=b.boxid 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},
@@ -231,4 +231,10 @@
    // 把该进片的玻璃更新到出片队列
    @Select("update out_slice set state=0 where glassId=#{glassId} and state=3")
    void UpdateAddQueue(String glassId);
}
    //新增日志表格
    @Insert("INSERT INTO `canadames`.`log`( `text`,time) VALUES (#{logtxt},now());")
    void insertlog(String logtxt);
    //获取该半区是否有执行的任务
    @Select(" select count(*) from storage_cage where state=#{state} and cage>#{cage1} and cage<#{cage2}")
    int SelectCageTask(int state,int cage1,int cage2);
}
springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
@@ -60,7 +60,7 @@
    if(storageCage!=null){
      spianMapper.UpdataOutCage1(storageCage.getGlassWidth(), storageCage.getCage(), storageCage.getCell());
    }
    homeMapper.UpdateCageTask2(glassid);
    homeMapper.DeleteByGlassID(glassid);
    S7control.getinstance().WriteWord("DB105.12", (short) 0);
    Map<String, Object> map = new HashMap<>();
    map.put("message", "200");
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -55,6 +55,11 @@
            cage1 = storageCage2.getCage();
            // 判断该笼子号相邻最大的空格数
            int cages = spianMapper.selectCage(cage1);
            // 如果相邻笼子没有空格,或者有正在执行的出片任务时返回400
            if (cages == 0) {
                return (400);
            }
            StorageCage cages1;
            // 判断是否是第二片需要加间隔物
            prctier = spianMapper.selectsum(cage1, storageCage2.getCell());// 传给prc的格子内玻璃数
@@ -138,6 +143,8 @@
        int cages;
        int cells;
        double glasswidth = cageout.getGlassWidth();
        // 判断玻璃内外片
        if (tier == 2) {
            int state = spianMapper.selectGlassState(cage, cell);// 获取格子数量
@@ -176,7 +183,7 @@
                spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, 1);// 新增任务
                spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
                spianMapper.UpdataGlassCageState(glassid, 3);// 更改笼子表的玻璃状态
                spianMapper.OverOutSlice(glassid, 2);// 完成出片队列任务
                spianMapper.OverOutSlice(glassid, 1);// 更新出片队列任务
                System.out.println("出片任务|" + datas);
                outmesid(glassid, "DB105.34");// 派发出片ID
                S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务
@@ -186,7 +193,7 @@
            } else {
                // 玻璃需要调拨时,判断属于哪个半区的笼子
                if (cage < 6) {
                    StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6);
                    StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6,cell);
                    if (cagecell == null) {
                        return (300);
                    }
@@ -203,12 +210,11 @@
                    datas.add((short) 1);
                    // 更换玻璃的笼子
                    String glassids = spianMapper.SelectGlassid(cage, cell); // 获取被调拨的玻璃id
                    spianMapper.UpdataGlassCageState(glassids, 3);// 更改笼子表的玻璃状态
                    spianMapper.UpdateDBCage(ids, cage, cell, 2);// 将原格子数据更新到新格子里
                    spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度
                    spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
                    //spianMapper.UpdataGlassCageState(glassids, 3);// 更改笼子表的玻璃状态
                    spianMapper.Inserttask(2, 0, cageout.getId(), ids, glassid, 2);// 新增调度任务
                    // spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 新增出片任务
                    spianMapper.Inserttask(2, 0, cageout.getId(), ids, glassids, 2);// 新增调度任务
                    // 传输mes数据,坐标,数据
                    System.out.println("出片任务|" + datas);
                    S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务
@@ -217,7 +223,7 @@
                    return (200); // 结束
                } else {// 笼子号大于5时
                    StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11);
                    StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11,cell);
                    if (cagecell == null) {
                        return (300);
                    }
@@ -232,12 +238,12 @@
                    datas.add((short) 2);
                    datas.add((short) 1);
                    String glassids = spianMapper.SelectGlassid(cage, cell); // 获取被调拨的玻璃id
                    spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassid, 2);// 新增调度任务
                    spianMapper.UpdataGlassCageState(glassids, 3);// 更改笼子表的玻璃状态
                    spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassids, 2);// 新增调度任务
                    // spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 新增出片任务
                    spianMapper.UpdateDBCage(ids, cage, cell, 2);// 将原格子数据更新到新格子里
                    spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度
                    spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
                    //spianMapper.UpdataGlassCageState(glassids, 3);// 更改笼子表的玻璃状态
                    // 传输mes数据,坐标,数据
                    System.out.println("出片任务|" + datas);
                    S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务
@@ -298,11 +304,12 @@
    // 根据玻璃id完成在进行中的任务
    public void overtask(String glassid) {
        spianMapper.UpdateCageOver(glassid, 0);// 更改笼子表出片状态
        spianMapper.UpdatetaskOut(glassid); // 完成上一次出片或者进片任务
        spianMapper.UpdatetaskOut(glassid);// 完成上一次 出片或者进片任务
        spianMapper.OverOutSlice(glassid, 2);// 完成出片队列任务
        spianMapper.UpdataGlassCage(glassid, 0);// 清除出片格子玻璃信息
        spianMapper.UpdateCageadd(glassid,1);
        spianMapper.UpdateCageOver(glassid, 0);// 更改笼子表出片状态
        spianMapper.UpdateCageadd(glassid, 1);// 更改笼子表进片状态
        String barcode = spianMapper.SelectBarcode(glassid);// 获取该玻璃的铝框id
        spianMapper.UpdateAddQueue(glassid);// 把进片的玻璃更新到出片队列中
        if (barcode != null) {