| | |
| | | transform: translateX(-150%);
|
| | | }
|
| | | }
|
| | |
|
| | | .el-dialog{
|
| | | width: 80%;
|
| | | }
|
| | | </style>
|
| | | <template>
|
| | | <el-container>
|
| | |
| | | <el-main>
|
| | | <div class="box" @click="dialogFormVisible2 = true">
|
| | | <div class="text">
|
| | | Alarm:
|
| | | <!-- Alarm: -->
|
| | | <label v-for="item in this.alarm" :key="item['id']">
|
| | | {{ item['content'] }}
|
| | | </label>
|
| | |
| | | <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, index) in cagelist1" :key="item['date']"
|
| | | :style="{ height: 35 * item['glassWidth'] + 'px', left: 3.07 * index+(item['cage']-1)*6.8 + 'px' }"
|
| | | :style="{ height: 35 * item['glassWidth'] + 'px', left: 3.07 * index + Math.abs(item['cage'] - 10) * 6.8 + '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, index) in cagelist2" :key="item['date']"
|
| | | :style="{ height: 35 * item['glassWidth'] + 'px', left: 3.07 * index+(item['cage']-6)*6.8 + 'px' }"
|
| | | :style="{ height: 35 * item['glassWidth'] + 'px', left: 3.07 * index + Math.abs(item['cage'] - 5) * 6.8 + 'px' }"
|
| | | @click="showcageinfo(item['cage'])"></div>
|
| | | </div>
|
| | | <div style="display:flex;position: absolute;float:left;z-index: 999;top:139px;left:237px;">
|
| | | <div :class="getStatusClass(item.state)" v-for="(item, index) in cagelist3" :key="item['date']"
|
| | | :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px', left: 3.07 * index+(item['cage']-1)*6.8 + 'px' }"
|
| | | :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px', left: 3.07 * index + Math.abs(item['cage'] - 10) * 6.8 + 'px' }"
|
| | | @click="showcageinfo(item['cage'])">
|
| | | </div>
|
| | | </div>
|
| | | <div style="display:flex;position: absolute;float:left;z-index: 999;top:139px;left:640px;">
|
| | | <div :class="getStatusClass(item.state)" v-for="(item, index) in cagelist4" :key="item['date']"
|
| | | :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px', left: 3.07 * index+(item['cage']-6)*6.8 + 'px' }"
|
| | | :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px', left: 3.07 * index + Math.abs(item['cage'] - 5) * 6.8 + 'px' }"
|
| | | @click="showcageinfo(item['cage'])"></div>
|
| | | </div>
|
| | | <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
|
| | |
| | | </el-dialog>
|
| | | <el-dialog :visible.sync="dialogFormVisible3" :title="$t('Cage Details')">
|
| | | <el-table :data="this.cageinfo" :height="700" border style="width: 100%;overflow: auto;">
|
| | | <el-table-column :width="150" prop="cage" :label="$t('The Cage number')"></el-table-column>
|
| | | <el-table-column prop="cage" :label="$t('The Cage number')"></el-table-column>
|
| | | <el-table-column prop="cell" :label="$t('cell')"></el-table-column>
|
| | | <el-table-column prop="tier" :label="$t('tier')"></el-table-column>
|
| | | <el-table-column prop="glassId" :label="$t('glassid')"></el-table-column>
|
| | | <el-table-column :width="130" prop="orderId" :label="$t('order number')"></el-table-column>
|
| | | <el-table-column :width="150" prop="lengthWidth" :label="$t('Length and width')"></el-table-column>
|
| | | <el-table-column prop="orderId" :label="$t('order number')"></el-table-column>
|
| | | <el-table-column prop="lengthWidth" :label="$t('Length and width')"></el-table-column>
|
| | | <el-table-column prop="coating" :label="$t('coating')"></el-table-column>
|
| | | <el-table-column :width="140" :label="$t('Operate')">
|
| | | <el-table-column :label="$t('Operate')">
|
| | | <template slot-scope='scope'>
|
| | | <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
|
| | | @click="deleteglass(scope.row.glassId, scope.row.state)">{{ $t('delete') }}</el-button>
|
| | |
| | | //console.log("收到数据====" + msg.data);
|
| | | let obj = JSON.parse(msg.data);
|
| | | if (obj.params != null) {
|
| | | this.car1 = 145 + 8.15 * (obj.params[0][0] - this.carlist[0]['start']) / (this.carlist[0]['end'] - this.carlist[0]['start']) * 100;
|
| | | this.car2 = 210 + 8.15 * (obj.params[0][1] - this.carlist[1]['start']) / (this.carlist[1]['end'] - this.carlist[1]['start']) * 100;
|
| | | this.car1 = 145 + 8.1 * Math.abs(obj.params[0][0] - this.carlist[0]['start']) / Math.abs(this.carlist[0]['end'] - this.carlist[0]['start']) * 100;
|
| | | this.car2 = 210 + 8.25 * Math.abs(obj.params[0][1] - this.carlist[1]['start']) / Math.abs(this.carlist[1]['end'] - this.carlist[1]['start']) * 100;
|
| | | // this.car1 = 210 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
|
| | | // this.car2 = 300 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
|
| | | console.log(obj.params[0][1], this.carlist[1]['start']);
|
| | | }
|
| | | this.tableData = obj.tableData[0];
|
| | | this.cagelist1 = obj.cagelist1[0];
|
| | |
| | | while (this != null) { |
| | | try { |
| | | |
| | | Thread.sleep(500); |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | // \\ 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); |
| | | |
| | | List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 获取prc进片请求数据 |
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 获取进片车状态 |
| | | List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.12", 1);// 获取进片车任务是否启动 |
| | | |
| | | |
| | | if (datas1List != null && datas1ListState != null) { |
| | | // 获取prc进片请求数据 |
| | | boolean exist = datas1List.contains((short) 1); |
| | | // 获取进片车状态 |
| | | boolean exist1 = datas1ListState.contains((short) 0); |
| | | //判断进片车任务是否启动 |
| | | boolean exist2 = datas1ListState2.contains((short) 1); |
| | | |
| | | String glassid=""; |
| | | StringBuilder strId=new StringBuilder(); |
| | | |
| | |
| | | // 当进片车空闲时 |
| | | if (exist1 == true) { |
| | | // 获取进片id |
| | | byte[] datas1ListID = S7control.getinstance().ReadByte("DB106.26", 4); |
| | | byte[] datas1ListID = S7control.getinstance().ReadByte("DB106.26", 1); |
| | | if (datas1ListID != null) { |
| | | // 获取玻璃id |
| | | for (byte list1 : datas1ListID) { |
| | |
| | | } |
| | | spianService.selectAll(strId.toString()); |
| | | //spianService.selectAll(Short.parseShort(strId.toString())); |
| | | S7control.getinstance().WriteByte("DB105.16",datas1ListID); |
| | | S7control.getinstance().WriteByte("DB105.16",datas1ListID);//派发进片id |
| | | } |
| | | |
| | | } |
| | | // System.out.println(exist); |
| | | } |
| | | |
| | | if(exist1==false){//下发任务后将任务启动改为0 |
| | | if(exist2==true) { |
| | | S7control.getinstance().WriteWord("DB105.12",(short)0);//进片任务启动改为0 |
| | | } |
| | | } |
| | | } |
| | | |
| | | //spianService.selectAll((short) 111); |
| | | |
| | | List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态 |
| | | List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.14", 1); // 出片任务是否启动 |
| | | boolean outstate=false;//出片车空闲判断 |
| | | if (outlist != null) { |
| | | boolean outstate1=false;//出片车任务是否启动 |
| | | if (outlist != null&&outlist1!=null) { |
| | | // 判断按订单出片 |
| | | outstate = outlist.contains((short) 0); |
| | | outstate = outlist.contains((short) 0);//出片车空闲判断 |
| | | outstate1 = outlist1.contains((short) 1);//出片车任务是否启动 |
| | | |
| | | Glass glass=spianMapper.SelectDBOut();//判断是否有调拨后的出片任务未完成 |
| | | |
| | | if(outstate== true ){ |
| | | if(glass.getId()==2){ |
| | | if(glass.getId()==2){ |
| | | spianService.selectout2(glass.getGlassId().toString()); |
| | | } |
| | | } |
| | | } |
| | | if(outstate==false){//下发任务后将任务启动改为0//出片车空闲判断 |
| | | if(outstate1==true){ |
| | | S7control.getinstance().WriteWord("DB105.14",(short)0);//出片任务启动改为0 |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | public void run() {
|
| | | while (this != null) {
|
| | | try {
|
| | | Thread.sleep(500);
|
| | | Thread.sleep(1000);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(500); |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(500); |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | map.put("message2", "500"); |
| | | } else { |
| | | // 调用伍上片函数 |
| | | short results = spianService.selectAll(glassid); |
| | | short results = spianService.selectAll(Short.toString(glassid)); |
| | | if (results == 200) { |
| | | map.put("message2", "200"); |
| | | } else if (results == 300) { |
| | |
| | | //按订单优先进片 |
| | | public void selectAll(Short glassid){ |
| | | SpianService service=new SpianService(); |
| | | service.selectAll(glassid); |
| | | service.selectAll(Short.toString(glassid)); |
| | | |
| | | } |
| | | |
| | |
| | | @Mapper |
| | | public interface HomeMapper { |
| | | //查询每个笼子的使用情况 |
| | | @Select("select cage,round((21-sum(state))/21*100) as cell,21-sum(state) as state from (select cage,cell,max(state) as state from storage_cage group by cage,cell) as cages group by cage") |
| | | @Select("select cage,round(100-(21-sum(state))/21*100) as cell,21-sum(state) as state from (select cage,cell,max(state) as state from storage_cage group by cage,cell) as cages group by cage") |
| | | List<StorageCage> selectAll(); |
| | | |
| | | // 查询1-5笼内层格子状态 |
| | | @Select("SELECT cage,state,glasswidth/2750*2 as glasswidth from storage_cage where cage<=5 and tier=2") |
| | | @Select("SELECT cage,state,glasswidth/2750*2 as glasswidth from storage_cage where cage>5 and tier=2 order by cage desc,cell desc") |
| | | List<StorageCage> selectRack1(); |
| | | |
| | | // 查询6-10笼内层格子状态 |
| | | @Select("SELECT cage,state,glasswidth/2750*2 as glasswidth from storage_cage where cage>5 and tier=2") |
| | | @Select("SELECT cage,state,glasswidth/2750*2 as glasswidth from storage_cage where cage<=5 and tier=2 order by cage desc,cell desc") |
| | | List<StorageCage> selectRack2(); |
| | | |
| | | // 查询1-5笼外层格子状态 |
| | | @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/2750*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/2750*2 else 0 end) as width from storage_cage where cage<=5 group by cage,cell") |
| | | @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/2750*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/2750*2 else 0 end) as width from storage_cage where cage>5 group by cage,cell order by cage desc,cell desc") |
| | | List<StorageCage> selectRack3(); |
| | | |
| | | // 查询6-10笼外层格子状态 |
| | | @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/2750*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/2750*2 else 0 end) as width from storage_cage where cage>5 group by cage,cell") |
| | | @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/2750*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/2750*2 else 0 end) as width from storage_cage where cage<=5 group by cage,cell order by cage desc,cell desc") |
| | | List<StorageCage> selectRack4(); |
| | | |
| | | // 根据任务类型查询当前正在出片,进片的玻璃信息 |
| | |
| | | @Update("update storage_cage set width=width+#{width} where cage=#{cage} and cell=#{cell};") |
| | | void UpdataOutCage1(double width,int cage,int cell); |
| | | //调拨更换笼子信息 |
| | | @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=2)as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1 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=2)as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1,a.glasswidth=b.glasswidth where a.id=#{id1}") |
| | | void UpdateDBCage(int id1,int cage,int cell); |
| | | // @Insert("insert into user(name, date, address, user_no) values (#{name}, #{date}, #{address}, #{userNo})") |
| | | // void insert (Spian spian); |
| | |
| | | @Select("select glass_id from storage_cage where cage=#{cage} and cell=#{cell} and tier=2;") |
| | | String SelectGlassid(int cage,int cell); |
| | | } |
| | | |
| | |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | // 更换玻璃的笼子 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);//减少新格子宽度 |
| | | String glassids=spianMapper.SelectGlassid(cage, cell); //获取被调拨的玻璃id |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);//减少新格子宽度 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除被调拨格子数据 |
| | | spianMapper.Inserttask(2, 0,cageout.getId(),ids,orderid);//新增调度任务 |
| | | // 传输mes数据,坐标,数据 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | String glassids=spianMapper.SelectGlassid(cage, cell); //获取被调拨的玻璃id |
| | | System.out.println(datas); |
| | | outmesid(glassids);//派发调拨玻璃ID |
| | | return Result.success(cagecell); //结束 |
| | | |
| | |
| | | datas.add((short) prcid2); |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | String glassids=spianMapper.SelectGlassid(cage, cell); //获取被调拨的玻璃id |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.Inserttask(2, 0,cageout.getId(),ids,orderid);//新增调度任务 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);//减少新格子宽度 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除被调拨格子数据 |
| | | // 传输mes数据,坐标,数据 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | String glassids=spianMapper.SelectGlassid(cage, cell); //获取被调拨的玻璃id |
| | | |
| | | outmesid(glassids);//派发调拨玻璃ID |
| | | return Result.success(cagecell); //结束 |
| | | |
| | |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | // 更换玻璃的笼子 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);//减少新格子宽度 |
| | | String glassids=spianMapper.SelectGlassid(cage, cell); //获取被调拨的玻璃id |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);//减少新格子宽度 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除被调拨格子数据 |
| | | spianMapper.Inserttask(2, 0,cageout.getId(),ids,glassid);//新增调度任务 |
| | | spianMapper.Inserttask(1, 0,cageout.getId(),1000,glassid);//新增出片任务 |
| | | // 传输mes数据,坐标,数据 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | String glassids=spianMapper.SelectGlassid(cage, cell); //获取被调拨的玻璃id |
| | | |
| | | outmesid(glassids);//派发调拨玻璃ID |
| | | return (200); //结束 |
| | | |
| | |
| | | datas.add((short) prcid2); |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | String glassids=spianMapper.SelectGlassid(cage, cell); //获取被调拨的玻璃id |
| | | spianMapper.Inserttask(2, 0,cageout.getId()+1,ids,glassid);//新增调度任务 |
| | | spianMapper.Inserttask(1, 0,cageout.getId(),1000,glassid);//新增出片任务 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);//减少新格子宽度 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除被调拨格子数据 |
| | | // 传输mes数据,坐标,数据 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | String glassids=spianMapper.SelectGlassid(cage, cell); //获取被调拨的玻璃id |
| | | |
| | | outmesid(glassids);//派发调拨玻璃ID |
| | | return (200);//结束 |
| | | |
| | |
| | | } |
| | | |
| | | public void outmesid(String glassid) { |
| | | System.out.println("outmesid:"+glassid); |
| | | List<Byte> glassidlist=new ArrayList(); |
| | | for (char iditem : glassid.toCharArray()) { |
| | | glassidlist.add(Byte.valueOf(String.valueOf(iditem))); |
| | | } |
| | | byte[] bytes= Bytes.toArray(glassidlist); |
| | | System.out.println("outmesidbytes:"+bytes.length); |
| | | S7control.getinstance().WriteByte("DB105.30", bytes);//派发出片id |
| | | } |
| | | |