From e208aa1ef8e861dba168e8d83ab3066fc9f1e02d Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期二, 16 四月 2024 13:30:45 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes --- hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java | 99 ++++++++++++++++++++++++++++--------------------- 1 files changed, 56 insertions(+), 43 deletions(-) diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java index 67de8c9..8a505fa 100644 --- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java +++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java @@ -3,9 +3,15 @@ import com.mes.common.PLCAutoMes; import com.mes.common.S7control; import com.mes.device.PlcParameterObject; + +import com.mes.downglassinfo.entity.DownGlassTask; +import com.mes.downglassinfo.service.DownGlassTaskService; import com.mes.downstorage.entity.DownStorageCageDetails; -import com.mes.downstorage.mapper.SelectInfo; -import com.mes.uppattenusage.entity.GlassInfo; +import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; +import com.mes.downworkstation.mapper.DownWorkstationMapper; +import com.mes.tools.WebSocketServer; +import com.mes.glassinfo.entity.GlassInfo; +import com.mes.glassinfo.service.GlassInfoService; import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -16,7 +22,10 @@ @Service public class DownGlassCacheLogic { @Autowired - private SelectInfo selectInfo; + private DownStorageCageDetailsMapper selectInfo; + private GlassInfoService GlassInfoService; + private DownStorageCageDetailsService downStorageCageDetailsService; + private DownGlassTaskService downGlassTaskService; /** * @param Number @@ -71,8 +80,9 @@ */ public boolean processInto(String Number){ + GlassInfoService = WebSocketServer.applicationContext.getBean(GlassInfoService.class); //鎸塱d鏌ヨ鐜荤拑淇℃伅琛ㄩ噷鐨勭幓鐠� - GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); + GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; //瀛樺湪姝ょ幓鐠冪紪鍙� if(GlassInfo!=null){ @@ -92,6 +102,7 @@ //2.鍥炲 1杩涚墖 DownStorageCageDetails item=list.get(0); selectInfo.insertCacheTask(GlassInfo.getId()+"","0",item.getSlot()+"","1",GlassInfo.getWidth(),GlassInfo.getHeight(),GlassInfo.getFilmsid(),GlassInfo.getThickness(),GlassInfo.getFlowcardId()); + S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1); return true; } @@ -103,57 +114,59 @@ return false; } //鐞嗙墖 鍑� - public boolean processOut(){ - //鏌ヨ浠诲姟 - String G06=S7control.getinstance().ReadWord("DB14.56", 1).get(0)+""; - String G11=S7control.getinstance().ReadWord("DB14.58", 1).get(0)+""; - String G13=S7control.getinstance().ReadWord("DB14.58", 1).get(0)+""; - PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; - List<DownStorageCageDetails> list=selectInfo.SelectCacheOut(); - //鍏朵粬鎯呭喌鏉′欢 濡傦細鍚庣画璁惧鏁呴殰绂佹鐞嗙墖鍑虹墖 绛� - boolean isOut=true; - if (list.size()>0&&isOut) { - DownStorageCageDetails item=list.get(0); - // - if(G06=="0"&&G11=="1"){ - //鍑哄埌 G06 + public boolean processOut() { + // 鏌ヨ浠诲姟 + String G06 = S7control.getinstance().ReadWord("DB14.56", 1).get(0) + ""; + String G11 = S7control.getinstance().ReadWord("DB14.58", 1).get(0) + ""; + String G13 = S7control.getinstance().ReadWord("DB14.58", 1).get(0) + ""; + PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; + List<DownStorageCageDetails> list = selectInfo.SelectCacheOut(1, 5); + List<DownStorageCageDetails> list2 = selectInfo.SelectCacheOut(6, 10); + List<DownStorageCageDetails> list3 = selectInfo.SelectCacheOut(1, 10); - selectInfo.insertCacheTask(item.getGlassId()+"","0","06","2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); + // 鎸夌収椤哄簭绗﹀悎鍓嶇鍑虹墖 + if (!list.isEmpty()) { + DownStorageCageDetails item = list.get(0); + if (G06.equals("0") && G11.equals("1")) { + // 鍑哄埌 G06 + selectInfo.insertCacheTask(item.getGlassId() + "", "0", "06", "2", item.getWidth(), item.getHeight(), item.getFilmsid(), item.getThickness(), item.getFlowCardId()); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "1"); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); return true; - }else if(G06=="1"&&G11=="0"){ - //鍑哄埌 G11 - - selectInfo.insertCacheTask(item.getGlassId()+"","0","11","2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); + } + // 鎸夌収椤哄簭绗﹀悎鍚庣鍑虹墖 + } else if (!list2.isEmpty()) { + DownStorageCageDetails item2 = list2.get(0); + if (G06.equals("1") && G11.equals("0")) { + // 鍑哄埌 G11 + selectInfo.insertCacheTask(item2.getGlassId() + "", "0", "11", "2", item2.getWidth(), item2.getHeight(), item2.getFilmsid(), item2.getThickness(), item2.getFlowCardId()); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "2"); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); return true; - }else if(G06=="0"&&G11=="0"){ - //閮藉厑璁� G04/G05 涓婁竴鐗囨槸鍚﹀拰姝ょ墖鐜荤拑灏哄灏哄鐩稿悓 - String endcell="06"; - String SendEndcell="1"; - boolean If_=false; - GlassInfo glassInfo06= selectInfo.SelectLastOutCacheInfo("06"); - GlassInfo glassInfo11= selectInfo.SelectLastOutCacheInfo("11"); - GlassInfo glassInfo13= selectInfo.SelectLastOutCacheInfo("13"); - if(glassInfo06!=null&&glassInfo11.getWidth()==item.getWidth()&&glassInfo06.getHeight()==item.getHeight()){ - endcell="11"; - SendEndcell="2"; - }else if(item.getHeight()>=3440&&item.getWidth()>=1440){ - //鍏朵粬鏉′欢浜哄伐澶勭悊 + } + // 瓒呭嚭灏哄浼樺厛浜哄伐鍑虹墖 浜哄伐澶勭悊 + } else if (!list3.isEmpty()) { + DownStorageCageDetails item3 = list3.get(0); + if (item3.getHeight() >= 3440 && item3.getWidth() >= 1440) { - } + String endcell = "06"; + String SendEndcell = "1"; - selectInfo.insertCacheTask(item.getGlassId()+"","0",endcell,"2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); + selectInfo.insertCacheTask(item3.getGlassId() + "", "0", endcell, "2", item3.getWidth(), item3.getHeight(), item3.getFilmsid(), item3.getThickness(), item3.getFlowCardId()); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); return true; } } - //杩斿洖缁撴灉 + + // 杩斿洖缁撴灉 return false; } + +//鏌ヨ鏄惁缁戝畾鏋跺瓙 +// public boolean selectFlowCardId(String FlowCardId){ +// +// } /** * @param Number @@ -162,7 +175,7 @@ public void processMb(String Number){ //鎸塱d鏌ヨ鐜荤拑淇℃伅琛ㄩ噷鐨勭幓鐠� - GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); + GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; if(GlassInfo!=null){ //鍙戦�佷换鍔� ID 闀� 瀹� 鍘� 鍊掕 宸ヨ壓鍔熻兘绛� @@ -185,7 +198,7 @@ public boolean selectMessageId(String Number){ //鏌ヨ鏄惁瀛樺湪 - GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); + GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); if(GlassInfo==null){ //杩斿洖 涓嶅瓨鍦� return false; @@ -203,7 +216,7 @@ public boolean deleteMessageId(String Number){ //鏌ヨ鏄惁瀛樺湪 - GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); + GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); if(GlassInfo==null){ //杩斿洖 涓嶅瓨鍦� return false; @@ -221,7 +234,7 @@ */ public boolean isExist(String Number){ //鏌ヨ鏄惁瀛樺湪 - GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); + GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); if(GlassInfo==null){ //杩斿洖 涓嶅瓨鍦� return false; -- Gitblit v1.8.0