From 3dc8dcf5854bb90b9d5fb07ab449053ed6a361ae Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期一, 06 五月 2024 15:32:10 +0800 Subject: [PATCH] 更新逻辑 --- hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java | 43 +++++++++++++++++++++++++++---------------- 1 files changed, 27 insertions(+), 16 deletions(-) diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java index a723b66..d1a6673 100644 --- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java +++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java @@ -1,5 +1,6 @@ package com.mes.downstorage.service.impl; +import com.github.yulichang.toolkit.JoinWrappers; import com.mes.common.PLCAutoMes; import com.mes.common.S7control; import com.mes.device.PlcParameterObject; @@ -19,6 +20,7 @@ import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; /** * <p> @@ -65,11 +67,11 @@ - public DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell,String taskType ) { DownGlassTask downGlassTask = new DownGlassTask(); - BeanUtils.copyProperties(downGlassTask,glassInfo); + BeanUtils.copyProperties(glassInfo,downGlassTask); + downGlassTask.setStartCell(startCell); downGlassTask.setTaskType(taskType); downGlassTask.setEndCell(endCell); @@ -80,7 +82,7 @@ public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell,String taskType ) { DownGlassTask downGlassTask = new DownGlassTask(); - BeanUtils.copyProperties(downGlassTask,glassInfo); + BeanUtils.copyProperties(glassInfo,downGlassTask); downGlassTask.setStartCell(startCell); downGlassTask.setTaskType(taskType); downGlassTask.setEndCell(endCell); @@ -97,13 +99,13 @@ //瀛樺湪姝ょ幓鐠冪紪鍙� if (GlassInfo != null) { //鍚屾壘鍒板悓娴佺▼鍗¢檮杩戠┖鏍� - List<DownStorageCageDetails> list = downStorageCageDetailsService.getIsExistIntoCacheByflowcardid(GlassInfo.getFlowcardId(), GlassInfo.getWidth()); + List<DownStorageCageDetails> list = selectCacheEmpty(); - List<DownStorageCageDetails> selectCacheEmpty=downStorageCageDetailsService.selectCacheEmpty2(); + // list<Map> list=selectCacheEmpty(); // list<Map> = downStorageCageService.selectCacheEmpty(); - if (selectCacheEmpty.size() > 0) { + if (list.size() > 0) { //瀛樺湪绌烘牸 //1.鐢熸垚浠诲姟锛� 璧峰浣嶇疆0 缁撴潫浣嶇疆this.slot 浠诲姟绫诲瀷 1 锛堣繘鐗囦换鍔★級 //2.鍥炲 1杩涚墖 @@ -115,7 +117,7 @@ downGlassTaskService.insertCacheTask(downGlassTask); - S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1); + //S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1); //瀹屾垚鍚庢彃鍏ュ皬鐗囨暟鎹埌缂撳瓨琛� @@ -159,13 +161,13 @@ String endcell = "13"; String SendEndcell = "1"; -// selectInfo.insertCacheTask(item3.getGlassId() + "", "0", endcell, "2", item3.getWidth(), item3.getHeight(), item3.getFilmsid(), item3.getThickness(), item3.getFlowCardId()); + DownGlassTask downGlassTask =createDownGlassTask(item3,"0",endcell,"2"); downGlassTaskService.insertCacheTask(downGlassTask); - S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); - S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); + // S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); + // S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); return true; } } @@ -177,7 +179,7 @@ DownStorageCageDetails item3 = list2.get(0); String endcell = "11"; String SendEndcell = "1"; - // selectInfo.insertCacheTask(item3.getGlassId() + "", "0", endcell, "2", item3.getWidth(), item3.getHeight(), item3.getFilmsid(), item3.getThickness(), item3.getFlowCardId()); + DownGlassTask downGlassTask =createDownGlassTask(item3,"0",endcell,"2"); downGlassTaskService.insertCacheTask(downGlassTask); @@ -191,7 +193,7 @@ DownStorageCageDetails item = list.get(0); // 鍑哄埌 G06 - //selectInfo.insertCacheTask(item.getGlassId() + "", "0", "06", "2", item.getWidth(), item.getHeight(), item.getFilmsid(), item.getThickness(), item.getFlowCardId()); + DownGlassTask downGlassTask =createDownGlassTask(item,"0","06","2"); downGlassTaskService.insertCacheTask(downGlassTask); @@ -204,7 +206,7 @@ DownStorageCageDetails item2 = list2.get(0); // 鍑哄埌 G11 - // selectInfo.insertCacheTask(item2.getGlassId() + "", "0", "11", "2", item2.getWidth(), item2.getHeight(), item2.getFilmsid(), item2.getThickness(), item2.getFlowCardId()); + DownGlassTask downGlassTask =createDownGlassTask(item2,"0","11","2"); downGlassTaskService.insertCacheTask(downGlassTask); @@ -222,8 +224,17 @@ } - - - + @Override + public List<DownStorageCageDetails> selectCacheEmpty() { + return baseMapper.selectJoinList(DownStorageCageDetails.class, + JoinWrappers.lambda(DownStorageCage.class) + .selectAll(DownStorageCage.class) + .select(DownStorageCageDetails::getWidth, DownStorageCageDetails::getHeight, DownStorageCageDetails::getGlassId) + .leftJoin(DownStorageCageDetails.class, on -> on + .eq(DownStorageCageDetails::getDeviceId, DownStorageCage::getDeviceId) + .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot)) + .isNull(DownStorageCageDetails::getSlot) + ); + } } -- Gitblit v1.8.0