From 91f9f222edfdb313f638dbf9bb99fa942f7ce13f Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期三, 08 五月 2024 14:01:16 +0800 Subject: [PATCH] 接口类型参数修改 --- hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java | 88 +++++++++++++++----------------------------- 1 files changed, 30 insertions(+), 58 deletions(-) diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java index 4251046..bc6f9a4 100644 --- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java +++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java @@ -45,13 +45,13 @@ private void initialize(){ - mapParameter.put("A06_request_word","DB11.0"); - mapParameter.put("A05_scanning_ID","DB11.2"); - mapParameter.put("MES_confirmation_word","DB11.40"); - mapParameter.put("A09_glass_status","DB11.70"); - mapParameter.put("A10_glass_status","DB11.72"); - mapParameter.put("A09_prohibit_film_production","DB11.74"); - mapParameter.put("A10_prohibit_film_production","DB11.76"); + mapParameter.put("A06_request_word","DB11.0");//璇锋眰瀛� + mapParameter.put("A05_scanning_ID","DB11.2");//璇锋眰ID + mapParameter.put("MES_confirmation_word","DB11.40");//MES鍙戦�佸瓧 + mapParameter.put("A09_glass_status","DB11.70");//A09鐜荤拑鐘舵�� + mapParameter.put("A10_glass_status","DB11.72");//A10鐜荤拑鐘舵�� + mapParameter.put("A09_prohibit_film_production","DB11.74");//A9绂佹鍑虹墖 + mapParameter.put("A10_prohibit_film_production","DB11.76");//A10绂佹鍑虹墖 mapSettings.put("territoryPoor",3); // mapValue.put("A06_request_word","1");//璇锋眰瀛� @@ -66,7 +66,7 @@ mapValue.put(key,value); } } - private void inTo(){ + private boolean inTo(){ List<GlassInfo> glassInfos=glassInfoService.selectId(mapValue.get("A05_scanning_ID")); if(glassInfos.size()<1){ log.info("姝ょ幓鐠冪紪鍙蜂笉瀛樺湪"); @@ -90,30 +90,32 @@ taskCache.setCreateTime(new DateTime()); edgStorageCageDetailsMapper.updateById(edgStorageCageDetails); taskCacheService.insertTaskCache(taskCache); + return true; }else{ log.info("涓嶅瓨鍦ㄧ┖鏍�"); } }else{ log.info("姝ょ幓鐠冪紪鍙峰瓨鍦ㄥ涓�"); } + return false; } - private void outTo(int line){ + private boolean outTo(int line){ int endcell=0; EdgStorageCageDetails outEdgStorageCageDetails=new EdgStorageCageDetails(); - TaskCache taskCacheA09=taskCacheService.selectLastOutCacheInfo(""); - TaskCache taskCacheA10=taskCacheService.selectLastOutCacheInfo(""); + TaskCache taskCacheA09=taskCacheService.selectLastOutCacheInfo(2001); + TaskCache taskCacheA10=taskCacheService.selectLastOutCacheInfo(2002); //涓ょ嚎鍚勮嚜瑕佸嚭鐨勭幓鐠� EdgStorageCageDetails glassInfo09=edgStorageCageDetailsService.selectConformGlass(taskCacheA09.getGlassId(),(int)mapSettings.get("territoryPoor")); EdgStorageCageDetails glassInfo10=edgStorageCageDetailsService.selectConformGlass(taskCacheA10.getGlassId(),(int)mapSettings.get("territoryPoor")); //鍐冲畾绾胯矾 if(line==1){ - endcell=9000; + endcell=2001; outEdgStorageCageDetails=glassInfo09; }else if(line==2){ - endcell=1000; + endcell=2002; outEdgStorageCageDetails=glassInfo10; }else if(line==3){ - endcell=9000;//榛樿璧颁竴鍙风嚎 浼樺寲鏂瑰悜鍙牴鎹� 瀵规瘮涓ょ嚎閫熷害/涓ょ嚎褰撳墠浠诲姟鎯呭喌鍋� + endcell=2001;//榛樿璧颁竴鍙风嚎 浼樺寲鏂瑰悜鍙牴鎹� 瀵规瘮涓ょ嚎閫熷害/涓ょ嚎褰撳墠浠诲姟鎯呭喌鍋� outEdgStorageCageDetails=glassInfo09; } if(outEdgStorageCageDetails!=null&&endcell>0){ @@ -125,15 +127,17 @@ taskCache.setTaskType(2); taskCache.setCreateTime(new DateTime()); taskCacheService.insertTaskCache(taskCache); + return true; } - + return false; } @Override public void run() { - boolean start=true; + boolean start=false; + boolean isSend=false; while (this != null&&start) { JSONObject jsonObject = new JSONObject(); try { @@ -150,8 +154,8 @@ }else if("1".equals(mapValue.get("A06_request_word"))&& "0".equals(mapValue.get("MES_confirmation_word"))) { - - inTo(); + //杩涚墖浠诲姟 鏌ユ壘鏄惁瀛樺湪姝ょ墖鐜荤拑 瀛樺湪鍒欑敓鎴愪换鍔� + isSend=inTo(); }else if("2".equals(mapValue.get("A06_request_word"))&& "0".equals(mapValue.get("MES_confirmation_word"))&& ( @@ -159,52 +163,20 @@ "0".equals(mapValue.get("A10_glass_status")) ) ){ - - outTo(3); + //鍑虹墖浠诲姟 鏌ユ壘涓ゆ潯绾夸笂涓�娆′换鍔$殑灏哄 + isSend=outTo(3); }else if("3".equals(mapValue.get("A06_request_word"))&& "0".equals(mapValue.get("MES_confirmation_word"))){ - + //鍏堝嚭鍚庤繘 if("0".equals(mapValue.get("A09_glass_status"))||"0".equals(mapValue.get("A10_glass_status"))){ - outTo(3); + isSend=outTo(3); }else{ - inTo(); + isSend=inTo(); } } - - -// List<String> address2=new ArrayList<String>(); -// address.add(""); -// List<String> list2= S7object.getinstance().plccontrol.readStrings(address); -// PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; -// log.info("plcmes:{}",plcmes); -// S7object.getinstance().plccontrol.WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1); - -// taskCacheMapper = WebSocketServer.applicationContext.getBean(TaskCacheMapper.class); -// List<TaskCache> list=taskCacheMapper.selectList(null); -// log.info("鏁版嵁{}",list); - // 娉ㄥ叆mapper -// HomeService = WebSocketServer.applicationContext.getBean(HomeService.class); -// QueueMapper = WebSocketServer.applicationContext.getBean(QueueMapper.class); - - -// //璇诲彇DB105鍖烘枃浠� -// PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; -// -// String PlcRequest=plcmes.getPlcParameter("GaToMES").getValue();//璇锋眰 -// String MesSend=plcmes.getPlcParameter("MESToGaStatus").getValue();//鍙戦�� -// double width=Double.valueOf(plcmes.getPlcParameter("width").getValue());//瀹� -// double height=Double.valueOf(plcmes.getPlcParameter("Height").getValue());//楂� - - //鑾峰彇娴嬮噺鐨勯暱锛屽 - boolean istest = true; - // String PlcRequest = "1"; - // String MesSend = "0"; - // double width = 516; - // double height = 507; - //System.out.println(111); - // //鏌ヨ褰撳墠璁㈠崟浠诲姟 - //List<FlowCard> OrderTask = storageCageService.SelectOrderTask(); - //jsonObject.append("OrderTask", OrderTask); + if(isSend){ + S7object.getinstance().plccontrol.WriteWord(mapParameter.get("MES_confirmation_word"),(short)1); + } } catch (InterruptedException e) { e.printStackTrace(); -- Gitblit v1.8.0