| | |
| | | <el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="messagepack.data">
|
| | |
|
| | | <div class="kuai_div" v-for="item in this.record.xyData" :key="item.name">
|
| | | <el-input style="width: 280px;" class="in_mc" v-model="item.name" readonly></el-input>
|
| | | <el-input style="width: 60%;" class="in_mc" v-model="item.name" readonly></el-input>
|
| | | <el-input v-model="item.value" readonly="readonly" style="width: 90px;"></el-input>
|
| | | </div>
|
| | |
|
| | |
| | | margin-bottom: 15px;
|
| | | }
|
| | |
|
| | |
|
| | | .el-input {
|
| | | border: none;
|
| | |
|
| | |
| | | // // 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进片请求数据 |
| | |
| | | // 当进片车空闲时 |
| | | 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) { |
| | |
| | | // System.out.println(exist); |
| | | } |
| | | } |
| | | |
| | | |
| | | //spianService.selectAll((short) 111); |
| | | |
| | | List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态 |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | List<StorageCage> selectAll(); |
| | | |
| | | // 查询1-5笼内层格子状态 |
| | | @Select("SELECT cage,state from storage_cage where cage<=5 and tier=1") |
| | | @Select("SELECT cage,state 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 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 cage,state from storage_cage where cage<=5 and tier=1") |
| | | List<StorageCage> selectRack3(); |
| | | |
| | | // 查询6-10笼外层格子状态 |
| | | @Select("SELECT cage,state from storage_cage where cage>5 and tier=2") |
| | | @Select("SELECT cage,state from storage_cage where cage>5 and tier=1") |
| | | List<StorageCage> selectRack4(); |
| | | |
| | | // 根据任务类型查询当前正在出片,进片的玻璃信息 |
| | |
| | | |
| | | //@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); |
| | |
| | | int prcid; |
| | | int tiers; |
| | | int prctier; |
| | | |
| | | double width; |
| | | double minwidth=0; |
| | | spianMapper.Updatetask(1, 0);//完成任务 |
| | | Glass glasslist = spianMapper.selectGlass(glassid); |
| | | if(glasslist==null){ |
| | |
| | | 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); |
| | |
| | | // 数据库修改笼子表新增一条玻璃 |
| | | 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); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | 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);// 清除内片数据 |