hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/controller/DownStorageCageDetailsController.java
@@ -34,7 +34,7 @@ @GetMapping("/selectStorageCage") @ResponseBody public Result selectEdgStorageCage () { List<Map> list=downStorageCageService.getCacheInfo(); List<Map> list=downStorageCageDetailsService.getCacheInfo(); return Result.build(200,"成功",list); } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/mapper/DownStorageCageMapper.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.github.yulichang.base.MPJBaseMapper; import com.mes.downstorage.entity.DownStorageCage; import org.apache.ibatis.annotations.Mapper; /** * <p> @@ -12,6 +13,7 @@ * @author zhoush * @since 2024-03-27 */ @Mapper public interface DownStorageCageMapper extends MPJBaseMapper<DownStorageCage> { } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java
@@ -12,6 +12,12 @@ //修改理片笼内信息 boolean updatedownStorageCageDetails(DownStorageCageDetails details); List<DownStorageCageDetails> getCacheLeisure(); List<DownStorageCageDetails> getCacheOut(int start, int end); List<Map> getCacheInfo(); List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width); List<DownStorageCageDetails> CacheOut(int start, int end); } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageService.java
@@ -20,13 +20,7 @@ public List<Map> gettask(); // List<Map<String, Object>> selectCacheLeisure(); List<DownStorageCageDetails> getCacheLeisure(); List<DownStorageCageDetails> getCacheOut(int start, int end); List<Map> getCacheInfo(); List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width); List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width); List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width); List<DownStorageCageDetails> IsExistIntoCacheByflowcardid(String flowcardid, double width); List<Map> selectCacheEmpty(); boolean processInto(String Number); boolean processOut(); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java
@@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mes.downstorage.entity.DownStorageCage; import com.mes.downstorage.entity.DownStorageCageDetails; import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; import com.mes.downstorage.mapper.DownStorageCageMapper; import com.mes.downstorage.service.DownStorageCageDetailsService; import com.mes.glassinfo.entity.GlassInfo; import lombok.extern.slf4j.Slf4j; @@ -22,7 +24,8 @@ @Service public class DownStorageCageDetailsServiceImpl extends ServiceImpl<DownStorageCageDetailsMapper, DownStorageCageDetails> implements DownStorageCageDetailsService { @Autowired private DownStorageCageMapper downStorageCageMapper; @Autowired private DownStorageCageDetailsMapper downStorageCageDetailsMapper; @Override @@ -61,5 +64,89 @@ // Other business methods can be implemented here @Override public List<DownStorageCageDetails> getCacheOut(int start, int end) { log.info("根据传入的工位查询符合按照顺序和大小出片的小片"); return downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id and gi.flowcard_id=escd.flow_card_id ") .isNotNull("escd.slot") .between("dw.workstation_id", start, end) .orderByDesc("escd.width") .orderByDesc("escd.height") ); } @Override public List<Map> getCacheInfo() { log.info(" 查询笼子内信息"); return downStorageCageMapper.selectJoinList( Map.class, new MPJQueryWrapper<DownStorageCage>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .orderByAsc("t.slot") ); } @Override public List<DownStorageCageDetails> getCacheLeisure() { log.info(" 查询笼子内空闲"); List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNull("escd.slot") .orderByAsc("escd.slot") ); return list; } @Override public List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width) { log.info(" 查询可进此片玻璃的栅格号 找到空格"); return downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNull("escd.slot") .apply("t.remain_width - " + width + " > 0") .orderByAsc("escd.sequence") ); } } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java
@@ -52,21 +52,6 @@ }; @Override public List<DownStorageCageDetails> getCacheLeisure() { log.info(" 查询笼子内空闲"); List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNull("escd.slot") .orderByAsc("escd.slot") ); return list; } @Override public List<Map> selectCacheEmpty(){ return baseMapper.selectJoinList( @@ -76,129 +61,6 @@ .isNull("escd.slot") ); } @Override public List<DownStorageCageDetails> getCacheOut(int start, int end) { log.info("根据传入的工位查询符合按照顺序和大小出片的小片"); return downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id and gi.flowcard_id=escd.flow_card_id ") .isNotNull("escd.slot") .between("dw.workstation_id", start, end) .orderByDesc("escd.width") .orderByDesc("escd.height") ); } @Override public List<Map> getCacheInfo() { log.info(" 查询笼子内信息"); return downStorageCageMapper.selectJoinList( Map.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .orderByAsc("t.slot") ); } @Override public List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width) { log.info(" 查询可进此片玻璃的栅格号 找到相同版图id并且大于前面的顺序的空格"); List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNotNull("escd.slot") .eq("escd.tempering_layout_id", tempering_layout_id) .lt("escd.tempering_feed_sequence", tempering_feed_sequence) .gt("t.remain_width", width) .orderByAsc("escd.tempering_feed_sequence") ); return list; } @Override public List<DownStorageCageDetails> IsExistIntoCacheByflowcardid(String flowcardid, double width) { log.info(" 查询可进此片玻璃的栅格号"); return downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNotNull("escd.slot") .lt("escd.flow_card_id", flowcardid) // 条件 t.remain_width - width > 0 .apply("t.remain_width - " + width + " > 0") .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence") ); } @Override public List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width) { log.info(" 查询可进此片玻璃的栅格号"); return downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNotNull("escd.slot") .lt("escd.tempering_layout_id", tempering_layout_id) // 条件 t.remain_width - width > 0 .apply("t.remain_width - " + width + " > 0") .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence") ); } @Override public List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width) { log.info(" 单片情况 查询可进此片玻璃的栅格号 找到相同流程卡号的空格"); return downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNotNull("escd.slot") .eq("escd.flow_card_id", flowcardid) .gt("t.remain_width", width) .orderByAsc("escd.sequence") ); } @@ -261,7 +123,7 @@ //存在此玻璃编号 if (GlassInfo != null) { //同找到同流程卡附近空格 List<DownStorageCageDetails> list = getIsExistIntoCacheByflowcardid(GlassInfo.getFlowcardId(), GlassInfo.getWidth()); List<DownStorageCageDetails> list = downStorageCageDetailsService.getIsExistIntoCacheByflowcardid(GlassInfo.getFlowcardId(), GlassInfo.getWidth()); List<Map> selectCacheEmpty=selectCacheEmpty(); @@ -336,7 +198,7 @@ //如果同时前后端都空闲 优先后端出片并且优先满架 else if (!list3.isEmpty()&&!list2.isEmpty()) { else if (!list2.isEmpty()&&!list3.isEmpty()) { DownStorageCageDetails item3 = list2.get(0); String endcell = "11"; @@ -359,7 +221,6 @@ DownGlassTask downGlassTask =createDownGlassTask(item,"0","06","2"); downGlassTaskService.insertCacheTask(downGlassTask); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "1"); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); return true; hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java
@@ -3,6 +3,7 @@ import com.mes.UnLoadGlassApplication; import com.mes.downstorage.entity.DownStorageCageDetails; import com.mes.downstorage.service.DownStorageCageDetailsService; import com.mes.downstorage.service.impl.DownStorageCageDetailsServiceImpl; import com.mes.downstorage.service.impl.DownStorageCageServiceImpl; import com.mes.downworkstation.service.DownWorkstationService; @@ -31,6 +32,8 @@ @Autowired DownStorageCageServiceImpl downStorageCageServiceImpl; @Autowired DownStorageCageDetailsServiceImpl downStorageCageDetailsServiceImpl; @Autowired DownStorageCageDetailsService downStorageCageDetailsService; @Autowired DownWorkstationServiceImpl downWorkstationServiceImpl; @@ -42,20 +45,20 @@ @Test public void testCacheGlass() { List<Map> map = downStorageCageServiceImpl.getCacheInfo(); List<Map> map = downStorageCageDetailsServiceImpl.getCacheInfo(); log.info("笼内信息:{}", Arrays.asList(map)); } @Test public void testselectCacheEmpty() { List<DownStorageCageDetails> map = downStorageCageServiceImpl.getCacheLeisure(); List<DownStorageCageDetails> map = downStorageCageDetailsServiceImpl.getCacheLeisure(); log.info("笼内空格:{}", Arrays.asList(map)); } @Test public void testgetCacheOut() { List<DownStorageCageDetails> map = downStorageCageServiceImpl.getCacheOut(1, 5); List<DownStorageCageDetails> map = downStorageCageDetailsServiceImpl.getCacheOut(1, 5); log.info("根据传入的工位查询符合按照顺序和大小出片的小片:{}", Arrays.asList(map)); } @@ -74,10 +77,12 @@ } @Test public void testin() { public void testin2() { log.info("测试进片"); downStorageCageServiceImpl.getIsExistIntoCacheByflowcardid("NG2023005",500); downStorageCageDetailsServiceImpl.getIsExistIntoCacheByflowcardid("NG2023005",500); } @@ -85,7 +90,7 @@ @Test public void selectCacheEmpty() { log.info("测试进片"); downStorageCageServiceImpl.selectCacheEmpty(); downStorageCageDetailsServiceImpl.getCacheLeisure(); }