| | |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | //扫码匹配成功 |
| | | public int ScanMatch(String Order, Integer Mateid,Integer tier) { |
| | | |
| | |
| | | if(glass==null){ |
| | | return 0; |
| | | }else{ |
| | | int cont= QueueMapper.insertQueueCode(glass.getFlowcard(),glass.getGlassid(),glass.getMateid(),glass.getGlasstype(),glass.getWidth(),glass.getHeight(),glass.getThickness()); |
| | | int cont = QueueMapper.insertQueueCode(glass.getFlowcard(), glass.getGlassid(), glass.getMateid(), |
| | | glass.getGlasstype(), glass.getWidth(), glass.getHeight(), glass.getThickness()); |
| | | glassInfoMapper.updatemeasurenumber(glass.getId()); |
| | | return cont; |
| | | } |
| | |
| | | System.out.println("人工匹配mestoplc:"+mestoplc); |
| | | // int count = homeMapper.SelectQueue(); |
| | | if (("0".equals(mestoplc)&&"0".equals(A02Plc))||("1".equals(A02Plc)&&"4".equals(mestoplc))) { |
| | | // homeMapper.UpdateQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(), |
| | | // glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier(), glassInfo.getMateid()); |
| | | // homeMapper.UpdateQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), |
| | | // glassInfo.getHeight(), |
| | | // glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier(), |
| | | // glassInfo.getMateid()); |
| | | homeMapper.AddQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(), |
| | | glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier(), glassInfo.getMateid()); |
| | | glassInfoMapper.updatemeasurenumber(glassInfo.getId()); |
| | |
| | | public Result ManualTake(String glassInfo) { |
| | | // 读取DB105区文件 |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | // 移除 |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 3); |
| | | // 删除数据 |
| | | QueueMapper.DeleteErrorQueue(); |
| | | |
| | | // plcmes.getPlcParameter("GaToMES").setValue("3"); |
| | | String A02Plc = plcmes.getPlcParameter("GaToMES").getValue(); |
| | | String A01Plc = plcmes.getPlcParameter("A01ToMES").getValue(); |
| | | String A02Mes = plcmes.getPlcParameter("MESToGaStatus").getValue(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 移除 |
| | | if ("1".equals(A02Plc)||"2".equals(A02Plc)|"1".equals(A02Mes)) { |
| | | Queue queue = QueueMapper.selectLastQueue3(); |
| | | if (queue != null) { |
| | | // 减少匹配次数 |
| | | glassInfoMapper.updateGlassNumber(queue.getglasstype()); |
| | | } |
| | | // 删除队列 |
| | | QueueMapper.DeletefromQueue(); |
| | | if("0".equals(A02Plc)){ |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 0); |
| | | }else{ |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 3); |
| | | } |
| | | |
| | | System.out.println("人工拿走A02Plc:" + A02Plc); |
| | | map.put("message", "200"); |
| | | }else{ |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToA01").getAddress(), (short) 3); |
| | | QueueMapper.DeletefromQueue(); |
| | | map.put("message", "300"); |
| | | System.out.println("人工拿走A01Plc:" + A01Plc); |
| | | } |
| | | // plcmes.getPlcParameter("GaToMES").setValue("3"); |
| | | |
| | | return Result.success(map); |
| | | } |
| | | |