From 65c3895042187119fa797076f797791b02944a0e Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期二, 16 四月 2024 10:47:16 +0800 Subject: [PATCH] 更新查询语句 --- hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java | 76 +++++++++++++++++++------------------ 1 files changed, 39 insertions(+), 37 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 e839f95..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 @@ -4,12 +4,14 @@ 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.DownStorageCageDetailsMapper; import com.mes.downworkstation.mapper.DownWorkstationMapper; import com.mes.tools.WebSocketServer; -import com.mes.uppattenusage.entity.GlassInfo; -import com.mes.uppattenusage.service.GlassInfoService; +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; @@ -23,6 +25,7 @@ private DownStorageCageDetailsMapper selectInfo; private GlassInfoService GlassInfoService; private DownStorageCageDetailsService downStorageCageDetailsService; + private DownGlassTaskService downGlassTaskService; /** * @param Number @@ -99,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; } @@ -110,57 +114,55 @@ 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().equals(item.getWidth()) && glassInfo06.getHeight().equals(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){ // -- Gitblit v1.8.0