| | |
| | | @Select("select method from flowcard where state=1 and line=#{line} ORDER BY starttime LIMIT 1;") |
| | | GlassInfo SelectMethod(int line); |
| | | //直出模式任务查询 |
| | | @Select("select b.flowcard,b.glasstype,b.mateid,a.totaltier as id,IFNULL(c.number,0)as number,b.glassid from flowcard a left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=#{line} and c.number>0") |
| | | @Select("select b.flowcard,b.glassid,b.glasstype,b.mateid,b.width,b.tier,a.totaltier as id,IFNULL(c.number,0)as number,b.glassid from flowcard a left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=#{line} and c.number>0 limit 1") |
| | | GlassInfo SelectOutGlass2(int line); |
| | | //查询直通模式下最后一块 |
| | | @Select("select b.tier from flowcard a left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=2 and c.number>0 ORDER BY b.tier desc LIMIT 1") |
| | | int SelectOutGlassend(int line); |
| | | //增加笼子表宽高 |
| | | @Select("update storage_cage a set a.glasswidth=#{width},a.glassheight=#{height} where id=#{id} ") |
| | | void UpdateStorage(double width,double height,int id); |
| | | //更改队列表状态 |
| | | @Update("update queue set state=2 where glassid=#{glassid};") |
| | | void UpdateQueueState(String glassid); |
| | | |
| | |
| | | albaniaMapper.AddCage(cage.getId(), glassid,width, height, 1, glasstype, 0); |
| | | Mestast(glassid,1001,cage.getId(),1,"MESID1",1); |
| | | albaniaMapper.UpdateStorage(width,height,cage.getId()); |
| | | albaniaMapper.UpdateQueueState(glassid); |
| | | |
| | | }else{ |
| | | return(400); |
| | | } |
| | | } |
| | | //增加任务记录 |
| | | albaniaMapper.Inserttask(0, 0, 1001, cage.getId(), glassid,glasstype, flowcard,0,0); |
| | | albaniaMapper.UpdateQueueState(glassid); |
| | | return(200); |
| | | |
| | | } |
| | |
| | | GlassInfo glassmate=new GlassInfo(); |
| | | GlassInfo method=new GlassInfo(); |
| | | StorageCage glass=new StorageCage(); |
| | | int glassend=0; |
| | | method=albaniaMapper.SelectMethod(line); |
| | | double width=0; |
| | | for(int i=1;i<=7;i++){ |
| | |
| | | }else{ |
| | | //直通模式时按顺序直出 |
| | | glassmate= albaniaMapper.SelectOutGlass2(line); |
| | | //获取直通模式最后一块 |
| | | glassend=albaniaMapper.SelectOutGlassend(line); |
| | | } |
| | | |
| | | if(glassmate==null){ |
| | |
| | | Mestast(glass.getGlassId(), glass.getId(),40, 0,"MESID"+i,i); |
| | | albaniaMapper.AddFinishNumber(glassmate.getFlowcard(), glassmate.getMateid(), glassmate.getTier()); |
| | | albaniaMapper.Inserttask(1, 0, glass.getId(), 2002, glassmate.getGlassid(), glassmate.getGlasstype(),glass.getFlowcard(),glassmate.getMateid(),glassmate.getTier()); |
| | | if(glassmate.getTier()==glassmate.getId()){//当配片数量等于成品小片总片数时 |
| | | if(glassmate.getTier()==glassmate.getId()||glassmate.getTier()==glassend){//当配片数量等于成品小片总片数时 |
| | | //本次配片完成发送启动命令 |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short)1);//出片任务启动 |
| | | return (200);//结束 |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | return (400);//结束 |