clll
2023-09-17 1af2e979880431228c984ee295b93604caa91b4a
Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
6个文件已修改
104 ■■■■■ 已修改文件
CanadaMes-ui/src/views/Electrical/State.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/State.vue
@@ -167,6 +167,7 @@
  margin-bottom: 15px;
}
.el-input {
  border: none;
CanadaMes-ui/src/views/home/index.vue
@@ -60,6 +60,8 @@
.gezi {
    height: 35px;
    position: absolute;
    width: 3.07px;
    /* width: 4.22px; */
}
@@ -75,19 +77,20 @@
.blocks {
    
    max-width: 94vw;
    background-image: url('../../img/xmjc.png');
    margin: 0 auto;
    background-repeat: no-repeat;
    background-attachment: local;
    width: 1660px;
    min-height: 55vh;
    max-width: 94vw;
    background-size: 1200px 510px;
    /* max-width: 100vw;
    background-size: 1660px 560px; */
}
.blocks-img {
@@ -239,18 +242,21 @@
            <div class="blocks" style="position: relative;">
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:102px;left:237px;">
                    <div :class="getStatusClass(item.state)" v-for="item in cagelist1" :key="item['date']"
                        @click="showcageinfo(item['cage'])"></div>
                        :style="{ height: 35 * item['glassWidth'] + 'px' }" @click="showcageinfo(item['cage'])"></div>
                </div>
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:102px;left:640px;">
                    <div :class="getStatusClass(item.state)" v-for="item in cagelist2" :key="item['date']"
                        @click="showcageinfo(item['cage'])"></div>
                        :style="{ height: 35 * item['glassWidth'] + 'px' }" @click="showcageinfo(item['cage'])"></div>
                </div>
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:138px;left:237px;">
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:139px;left:237px;">
                    <div :class="getStatusClass(item.state)" v-for="item in cagelist3" :key="item['date']"
                        @click="showcageinfo(item['cage'])"></div>
                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px' }"
                        @click="showcageinfo(item['cage'])">
                    </div>
                </div>
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:138px;left:640px;">
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:139px;left:640px;">
                    <div :class="getStatusClass(item.state)" v-for="item in cagelist4" :key="item['date']"
                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px' }"
                        @click="showcageinfo(item['cage'])"></div>
                </div>
                <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
@@ -259,18 +265,22 @@
                <div class="blocks-img3"></div>
                <!-- <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:328px;">
                    <div :class="getStatusClass(item.state)" v-for="item in cagelist1" :key="item['date']"
                        :style="{ height: 35 * item['glassWidth'] + 'px' }"
                        @click="showcageinfo(item['cage'])"></div>
                </div>
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:885px;">
                    <div :class="getStatusClass(item.state)" v-for="item in cagelist2" :key="item['date']"
                        :style="{ height: 35 * item['glassWidth'] + 'px' }"
                        @click="showcageinfo(item['cage'])"></div>
                </div>
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:154px;left:328px;">
                    <div :class="getStatusClass(item.state)" v-for="item in cagelist3" :key="item['date']"
                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px' }"
                        @click="showcageinfo(item['cage'])"></div>
                </div>
                <div style="display:flex;position: absolute;float:left;z-index: 999;top:154px;left:885px;">
                    <div :class="getStatusClass(item.state)" v-for="item in cagelist4" :key="item['date']"
                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px' }"
                        @click="showcageinfo(item['cage'])"></div>
                </div>
                <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
@@ -625,7 +635,7 @@
                    OutByGlassID(glassid).then(res => {
                        if (res.data.message3 == 200) {
                            this.$message.success(this.$t('Operation successful'));
                        }
                        }
                        else if (res.data.message2 == 300) {
                            this.$message.success(this.$t('There is no such grid'));
                        }
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -45,11 +45,11 @@
      //   // TODO Auto-generated catch block
      //   e.printStackTrace();
      // }
     spianService.selectAll((short)257);
      //判断进片请求
      List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);
      List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);
      
      if (datas1List != null && datas1ListState != null) {
        // 获取prc进片请求数据
@@ -62,7 +62,7 @@
          // 当进片车空闲时
          if (exist1 == true) {
            // 获取进片id
            List<Short> datas1ListID = S7control.getinstance().ReadWord("DB106.26", 13);
            List<Short> datas1ListID = S7control.getinstance().ReadWord("DB106.26", 1);
            if (datas1ListID != null) {
              // 获取玻璃id
              for (Short list1 : datas1ListID) {
@@ -76,7 +76,7 @@
          // System.out.println(exist);
        }
      }
      //spianService.selectAll((short) 111);
      
      List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态
@@ -84,14 +84,15 @@
       if (outlist != null) {
        // 判断按订单出片
         outstate = outlist.contains((short) 0);
        }
      Glass glass=spianMapper.SelectDBOut();//判断是否有调拨后的出片任务未完成
          Glass glass=spianMapper.SelectDBOut();//判断是否有调拨后的出片任务未完成
     if(outstate== true ){
       if(glass.getId()==2){
        spianService.selectout2(glass.getGlassId().toString());
         if(outstate== true ){
          if(glass.getId()==2){
           spianService.selectout2(glass.getGlassId().toString());
            }
        }
      }
     }
      
 
     
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -14,19 +14,19 @@
  List<StorageCage> selectAll();
  // 查询1-5笼内层格子状态
  @Select("SELECT cage,state from storage_cage where cage<=5 and tier=1")
  @Select("SELECT cage,state,glasswidth/width*2 as glasswidth from storage_cage where cage<=5 and tier=2")
  List<StorageCage> selectRack1();
  // 查询6-10笼内层格子状态
  @Select("SELECT cage,state from storage_cage where cage>5 and tier=1")
  @Select("SELECT cage,state,glasswidth/width*2 as glasswidth from storage_cage where cage>5 and tier=2")
  List<StorageCage> selectRack2();
  // 查询1-5笼外层格子状态
  @Select("SELECT cage,state from storage_cage where cage<=5 and tier=2")
  @Select("SELECT case when tier=1 then cage else 0 end as cage,case when tier=1 then state else 0 end as state,sum(case when tier=1 then glasswidth/width*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/width*2 else 0 end) as width  from storage_cage where cage<=5  group by cell")
  List<StorageCage> selectRack3();
  // 查询6-10笼外层格子状态
  @Select("SELECT cage,state from storage_cage where cage>5 and tier=2")
  @Select("SELECT case when tier=1 then cage else 0 end as cage,case when tier=1 then state else 0 end as state,sum(case when tier=1 then glasswidth/width*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/width*2 else 0 end) as width  from storage_cage where cage>5  group by cell")
  List<StorageCage> selectRack4();
  // 根据任务类型查询当前正在出片,进片的玻璃信息
@@ -66,7 +66,7 @@
  List<alarmmg> SelectAlarmmgInfo();
  //获取理片笼内玻璃信息
  @Select("select *,concat(glasswidth,' x ',glassheight) as lengthwidth from storage_cage where cage=#{cage} ")
  @Select("select *,concat(glasswidth,' x ',glassheight) as lengthwidth from storage_cage where cage=#{cage} and state!=0 ")
  List<StorageCage> SelectCageInfo(short cage);
  @Update("update storage_cage set state=0,glass_id=null,order_id=null,glasswidth=null,glassheight=null,coating=null where glass_id=#{glassid}")
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -18,12 +18,12 @@
     
     //@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 cage,COUNT(if(order_id=#{orderids},order_id,null))as orderid from storage_cage where (order_id=#{orderids} or ''='') GROUP BY cage ORDER BY orderid desc; ")
     @Select("select cage,COUNT(if(order_id=#{orderids},order_id,null))as orderid,cell,min(state)as state1 from storage_cage where (order_id=#{orderids} or ''='') GROUP BY cage,cell HAVING state1=0 ORDER BY orderid desc; ")
     List<StorageCage> selectAll(Short orderids);
     //判断该笼子是否有合适宽度空格
     @Select("select cage,cell,tier,id,ROUND(id/2)as prcId from storage_cage where cage=#{cage1} and state=0 and width>=#{width} ORDER BY cell asc,tier desc LIMIT 1")
     StorageCage selectCage1(int  cage1,double width);
     @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);
     //判断笼子内玻璃数
     @Select("select COUNT(tier)as tier from storage_cage where  cage=#{cage} and cell=#{cell} and state=1;")
     int selectsum(int cage,int cell);
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -150,7 +150,8 @@
        int prcid;
        int tiers;
        int prctier;
        double width;
        double minwidth=0;
        spianMapper.Updatetask(1, 0);//完成任务
            Glass glasslist = spianMapper.selectGlass(glassid);
        if(glasslist==null){
@@ -177,22 +178,24 @@
            cage1 = storageCage2.getCage();
            // 判断该笼子号相邻最大的空格数
            int cages = spianMapper.selectCage(cage1);
            StorageCage cages1 ;
            //判断是否是第二片需要加间隔物
            prctier = spianMapper.selectsum(cage1, storageCage2.getCell());// 传给prc的格子内玻璃数
                if(prctier>0){
                   cages1 = spianMapper.selectCage1(cage1,storageCage2.getCell(),widths+400);
                }else{
                    cages1 = spianMapper.selectCage1(cage1,storageCage2.getCell(),widths);
                }
            // 判断选中笼子是否有合适宽度空格
            StorageCage cages1 = spianMapper.selectCage1(cage1, widths);
            if (cages1 != null) {
             // 有合适空格时进片
            if (cages1 != null&&cages>=1) {
                ids = cages1.getId();// 数据库ID
                tiers = cages1.getTier();// 内外片
                cells = cages1.getCell();// 格子号
                prcid = cages1.getPrcId();// 传给prc的目标地id
               if (glasslist == null) {
                    return (300);
                }
                spianMapper.Inserttask(0, 0, 1000, ids,glassid.toString());//新增任务
                prctier = spianMapper.selectsum(cage1, cells);// 传给prc的格子内玻璃数
                // 有合适空格时进片
                if (cages > 1 && cages1.getTier() != null) {
                width=cages1.getWidth();//格子剩余宽度
                widths=glasslist.getWidth();
                    // 执行进片
                    datas.add((short) 1000);
                    datas.add((short) prcid);
@@ -201,10 +204,10 @@
                    // 数据库修改笼子表新增一条玻璃
                    spianMapper.UpdataAddCage(orderids, glassid, widths, cage1, cells, ids, 1);
                    spianMapper.UpdataAddCage1(widths, cage1, cells);//减少格子宽度
                    spianMapper.Inserttask(0, 0, 1000, ids,glassid.toString());//新增任务
                    S7control.getinstance().WriteWord(adddresslist, datas);
                    return (200);
                }
                   return (200);
            }
        }
@@ -242,17 +245,18 @@
        double glasswidth = cageout.getGlassWidth();
        // 判断玻璃内外片
        if (tier == 2) {
            int state = spianMapper.selectGlassState(cage, cell);//获取格子数量
            // 判断玻璃可直接出片时
            // 修改数据库笼子表(出片)
            datas.add((short) prcid);
            datas.add((short) 1000);
            datas.add((short) 1);
            datas.add((short) state);
            datas.add((short) 1);
               
            spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度
            spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0);//清除格子玻璃信息
            spianMapper.Inserttask(1, 0,cageout.getId(),1000,glassid);//新增任务
            int state = spianMapper.selectGlassState(cage, cell);//获取格子数量
            //int state = spianMapper.selectGlassState(cage, cell);//获取格子数量
            if(state==2){
                spianMapper.UpdateDBCage1(cage, cell);// 将内片数据更新到外片里
                spianMapper.UpdateDBCage2(cage, cell);// 清除内片数据