| | |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageTaskVO; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageTaskService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.hollow.entity.HollowBigStorageCageDetails; |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | import com.mes.hollow.service.HollowBigStorageCageDetailsService; |
| | | import com.mes.hollow.service.HollowBigStorageCageService; |
| | |
| | | jsonObject.append("932", listMap.get(932)); |
| | | try { |
| | | //930空闲信号 |
| | | ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree"); |
| | | ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree"); |
| | | jsonObject.append("freeOneRequestEntity", freeOneRequestEntity.getValue()); |
| | | //931空闲信号 |
| | | ReadWriteEntity freeTwoRequestEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree"); |
| | | jsonObject.append("freeTwoRequestEntity", freeTwoRequestEntity.getValue()); |
| | | }catch (Exception e){ |
| | | log.error("opc存在异常",e); |
| | | } catch (Exception e) { |
| | | log.error("opc存在异常", e); |
| | | } |
| | | |
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("HollowGlass"); |
| | |
| | | //界面展示笼子信息 |
| | | jsonObject.append("bigStorageCageInfos", hollowBigStorageCageDetailsService.queryHollowbigStorageCageDetail()); |
| | | |
| | | try{ |
| | | try { |
| | | //进片任务数据 |
| | | List<BigStorageCageTask> inTaskList = new ArrayList(); |
| | | List<BigStorageTaskVO> inTaskList = new ArrayList(); |
| | | ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.FROM1"); |
| | | for (int i = 1; i <= 6; i++) { |
| | | ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP2A.DLP2A.DI" + i); |
| | | ReadWriteEntity targetSlotWord = miloService.readFromOpcUa("DLP2A.DLP2A.TO" + i); |
| | | ReadWriteEntity stateWord = miloService.readFromOpcUa("DLP2A.DLP2A.STATE" + i); |
| | | if (null != requestWord.getValue()) { |
| | | BigStorageCageTask task = new BigStorageCageTask(); |
| | | BigStorageTaskVO task = new BigStorageTaskVO(); |
| | | task.setGlassId(requestWord.getValue() + ""); |
| | | int isExistCount = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>().in(HollowBigStorageCageDetails::getGlassId, task.getGlassId()) |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); |
| | | if (isExistCount > 0) { |
| | | task.setIsSame(1); |
| | | } else { |
| | | task.setIsSame(0); |
| | | } |
| | | task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + "")); |
| | | task.setTargetSlot(Integer.parseInt(targetSlotWord.getValue() + "")); |
| | | task.setTaskState(Integer.parseInt(stateWord.getValue() + "")); |
| | |
| | | } |
| | | } |
| | | jsonObject.append("bigStorageCageDetailsFeedTask", inTaskList); |
| | | } catch (Exception e) { |
| | | //todo:不做任务处理 |
| | | } |
| | | try { |
| | | //进片联机 |
| | | ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2A.DLP2A.mesControl"); |
| | | jsonObject.append("inkageEntity", inkageEntity.getValue()); |
| | |
| | | ReadWriteEntity outRequestEntity = miloService.readFromOpcUa("DLP2B.DLP2B.RequestMes"); |
| | | jsonObject.append("outRequestEntity", outRequestEntity.getValue()); |
| | | //930空闲信号 |
| | | ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree"); |
| | | ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree"); |
| | | jsonObject.append("freeOneRequestEntity", freeOneRequestEntity.getValue()); |
| | | //931空闲信号 |
| | | ReadWriteEntity freeTwoRequestEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree"); |
| | | jsonObject.append("freeTwoRequestEntity", freeTwoRequestEntity.getValue()); |
| | | |
| | | }catch(Exception e){ |
| | | } catch (Exception e) { |
| | | //todo:不做任务处理 |
| | | } |
| | | |
| | |
| | | //理片笼使用情况 |
| | | List<Map<String, Object>> bigStorageCageUsage = hollowBigStorageCageService.selectBigStorageCageUsage(); |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | |
| | | // |
| | | // //打印开关 |
| | | // boolean autoPrint = false; |
| | | // if (redisUtil.getCacheObject("autoPrint") == null) { |
| | | // redisUtil.setCacheObject("autoPrint", false); |
| | | // } else { |
| | | // autoPrint = redisUtil.getCacheObject("autoPrint"); |
| | | // } |
| | | // jsonObject.append("autoPrint", autoPrint); |
| | | |
| | | } |
| | | |
| | | } |