| | |
| | | homeMapper.FinishTask(storageTask.getId(), 2);// 完成任务 |
| | | homeMapper.DeletequeueByGlassid(storageTask.getGlasstype().toString()); |
| | | glassInfoMapper.updateGlassNumber(storageTask.getGlasstype());// 减少扫描次数 |
| | | StorageCage storageCage = homeMapper.SelectStorageByCell(storageTask.getLoadrack()); |
| | | if (storageCage.getNumber() == null || storageCage.getNumber() == 0) { |
| | | UpdateStroageCageByCell(Integer.parseInt(storageTask.getShelfRack()), 0);// 清除格内信息 |
| | | } |
| | | } else { |
| | | System.out.println("结束出片任务:" + storageTask.getId()); |
| | | homeMapper.FinishTask(storageTask.getId(), 2);// 完成任务 |
| | |
| | | } |
| | | |
| | | // 查询玻璃信息 |
| | | public Result SelectGlassInfo(String width, String height, String thickness, String films) { |
| | | List<GlassInfo> glassInfoList = homeMapper.SelectGlassInfo(width, height, thickness, films); |
| | | public Result SelectGlassInfo(String width, String height, String thickness, String films,String tier) { |
| | | List<GlassInfo> glassInfoList = homeMapper.SelectGlassInfo(width, height, thickness, films,tier); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("StorageCageAddInfo", glassInfoList); |
| | | return Result.success(map); |
| | |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | //扫码匹配成功 |
| | | public int ScanMatch(String Order, Integer Mateid,Integer tier) { |
| | | |
| | | GlassInfo glass=homeMapper.SelectCodeGlass(Order,Mateid,tier); |
| | | System.out.println("glass:"+glass); |
| | | System.out.println("order"+Order+"mateid"+Mateid+"tier"+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()); |
| | | glassInfoMapper.updatemeasurenumber(glass.getId()); |
| | | return cont; |
| | | } |
| | | } |
| | | |
| | | // 人工匹配修改测量信息 |
| | | public Result UpdateQueue(GlassInfo glassInfo) { |
| | | // 删除数据 |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | QueueMapper.DeleteQueue(); |
| | | System.out.println("人工匹配ID:" + glassInfo.getMateid() + "膜系:" + glassInfo.getFilms()); |
| | | String mestoplc=plcmes.getPlcParameter("MESToGaStatus").getValue(); |
| | | String A02Plc=plcmes.getPlcParameter("GaToMES").getValue(); |
| | | System.out.println("人工匹配mestoplc:"+mestoplc); |
| | | // int count = homeMapper.SelectQueue(); |
| | | // if (count > 0) { |
| | | 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.AddQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(), |
| | | glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier(), glassInfo.getMateid()); |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | glassInfoMapper.updatemeasurenumber(glassInfo.getId()); |
| | | if("0".equals(mestoplc)){ |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToA01").getAddress(), (short) 1); |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1); |
| | | System.out.println("提前匹配"); |
| | | }else{ |
| | | System.out.println("测量匹配"); |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1); |
| | | } |
| | | map.put("message", "200"); |
| | | // } else { |
| | | // map.put("message", "300"); |
| | | // } |
| | | } else { |
| | | map.put("message", "300"); |
| | | } |
| | | return Result.success(map); |
| | | } |
| | | |
| | |
| | | |
| | | // 删除出片队列 |
| | | public Result DeleteOutTask(Integer id) { |
| | | |
| | | int cell=homeMapper.SelectOutTaskId(id); |
| | | UpdateStroageCageByCell(cell, 1);// 玻璃数量+1 |
| | | homeMapper.DeleteOutTask(id); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | |
| | | // 读取DB105区文件 |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | // 重新测量 |
| | | String PlcRequest = plcmes.getPlcParameter("GaToMES").getValue();// plc请求字 |
| | | if("1".equals(PlcRequest)){ |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 2); |
| | | } |
| | | // 删除数据 |
| | | QueueMapper.DeleteErrorQueue(); |
| | | // plcmes.getPlcParameter("GaToMES").setValue("2"); |
| | |
| | | for (Map map : RemoveErrorData) { |
| | | String key = map.get("base").toString() + "_" + map.get("height").toString() + "_" |
| | | + map.get("thickness").toString() + "_" + map.get("films").toString() + "_" |
| | | + map.get("order").toString() + "_" + map.get("matching").toString(); |
| | | |
| | | + map.get("order").toString() + "_" + map.get("matching").toString()+ map.get("tier").toString(); |
| | | String tierkey = map.get("order").toString() + "_" + map.get("matching").toString(); |
| | | |
| | | String value = TypeData.get(key); |