| | |
| | | package com.mes; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.job.CacheGlassTask; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.taskcache.service.impl.TaskCacheServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = CacheGlassModuleApplication.class) |
| | | @SpringBootTest(classes = CacheGlassModuleApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | public class CacheGlassModuleApplicationTest { |
| | | |
| | | @Autowired |
| | | EdgStorageCageService edgStorageCageService; |
| | | @Autowired |
| | | EdgStorageCageDetailsService edgStorageCageDetailsService; |
| | | @Resource |
| | | TaskCacheMapper taskCacheMapper; |
| | | |
| | | @Autowired |
| | | TaskCacheServiceImpl taskCacheServiceImpl; |
| | | @Autowired |
| | | OptimizeDetailMapper optimizeDetailMapper; |
| | | @Autowired |
| | | GlassInfoService glassInfoService; |
| | | @Autowired |
| | | CacheGlassTask cacheGlassTask; |
| | | |
| | | @Autowired |
| | | TaskCacheService taskCacheService; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | | String url = getClass().getResource("").getPath(); |
| | | log.info("完整路径:{}", Arrays.asList(url)); |
| | | } |
| | | |
| | | @Test |
| | | public void queryChangeGlassInfo() { |
| | | cacheGlassTask.queryChangeGlassInfo(Const.A10_OUT_TARGET_POSITION, ""); |
| | | } |
| | | |
| | | @Test |
| | | public void testChangeCellSize() { |
| | | // String url=getClass().getResource("").getPath(); |
| | | // log.info("完整路径:{}", Arrays.asList(url)); |
| | | cacheGlassTask.queryChangeGlassInfo(Const.A09_OUT_TARGET_POSITION, ""); |
| | | } |
| | | |
| | | @Test |
| | | public void testCellSize() { |
| | | // String url=getClass().getResource("").getPath(); |
| | | // log.info("完整路径:{}", Arrays.asList(url)); |
| | | cacheGlassTask.outTo(0, 0, "", "NG24051802A001|1|1|1|1", 0); |
| | | } |
| | | |
| | | @Test |
| | | public void testinTo() { |
| | | // String url=getClass().getResource("").getPath(); |
| | | // log.info("完整路径:{}", Arrays.asList(url)); |
| | | // NG24051802A001|1|4|1|4 |
| | | // cacheGlassTask.inTo("NG24051802A001|1|1|1|1", "1", "1"); |
| | | // cacheGlassTask.inTo("NG24051802A001|1|4|1|4", "1", "1"); |
| | | cacheGlassTask.inTo("NG24051802A001|1|1|2|1", "1", "1"); |
| | | } |
| | | |
| | | @Test |
| | | public void testChangeGlassInfo() { |
| | | // String url=getClass().getResource("").getPath(); |
| | | // log.info("完整路径:{}", Arrays.asList(url)); |
| | | // NG24051802A001|1|4|1|4 |
| | | cacheGlassTask.queryAndChangeGlass("NG24051802A001|1|1|1|1"); |
| | | // cacheGlassTask.queryAndChangeGlass("NG24051802A001|1|4|1|4"); |
| | | } |
| | | |
| | | @Test |
| | | public void testSqlServer() { |
| | | List<TaskCache> list = taskCacheMapper.selectList(null); |
| | | log.info("数据{}", list); |
| | | log.info("Sql数据:{}", Arrays.asList(list)); |
| | | } |
| | | |
| | | @Test |
| | | public void testEdgtask() { |
| | | List<Map<String,Object>> list=taskCacheServiceImpl.selectEdgInfo("2001"); |
| | | log.info("数据{}",list); |
| | | log.info("Sql数据:{}", Arrays.asList(list)); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | List<Map<String, Object>> map = edgStorageCageService.selectEdgStorageCages(); |
| | | log.info("笼内信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testSelectCacheEmpty() { |
| | | // List<EdgStorageCage> map = edgStorageCageService.selectCacheEmpty(); |
| | | // log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testScan() { |
| | | List<Map<String, Object>> map = edgStorageCageDetailsService.selectCutTerritory(); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testEngineerCutTerritory() { |
| | | List<List<Map<String, Object>>> map = edgStorageCageDetailsService.selectCurrentCutTerritory("P24051806"); |
| | | log.info("切割工程版图信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testidentWorn() { |
| | | Map<String, String> arguments=new HashMap<>(); |
| | | arguments.put("glassId","P24060403|3|6");//玻璃ID |
| | | arguments.put("controlsId","300"); //拿走:200/破损:201 |
| | | arguments.put("line","2001"); //线路: |
| | | arguments.put("machine","冷加工"); //设备名称: |
| | | edgStorageCageDetailsService.identWorn(arguments); |
| | | log.info("识别台【破损/拿走】:{}", 1); |
| | | } |
| | | |
| | | @Test |
| | | public void testPpOptimizeDetail() { |
| | | List<OptimizeDetail> optimizeDetail = optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>() |
| | | .eq("project_no", "P24032204") |
| | | .eq("stock_id", 5) |
| | | ); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(optimizeDetail)); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void testOptimizeDetail() { |
| | | List<Map<String, Object>> map2 = optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth, "olWidth") |
| | | .selectAs(OptimizeLayout::getWidth, "olHeight") |
| | | .select(OptimizeLayout::getWidth, OptimizeLayout::getHeight) |
| | | .leftJoin(OptimizeLayout.class, on -> on.eq(OptimizeLayout::getProjectNo, OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId, OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo, "P24032204") |
| | | .eq(OptimizeDetail::getStockId, 5) |
| | | ); |
| | | log.info("切割当前版图信息1:{}", Arrays.asList(map2)); |
| | | } |
| | | |
| | | @Test |
| | | public void testOutTask() { |
| | | EdgStorageCageDetails edgStorageCageDetails = edgStorageCageDetailsService.selectConformGlass("1", 3); |
| | | |
| | | log.info("出片任务:{}", Arrays.asList(edgStorageCageDetails)); |
| | | } |
| | | |
| | | @Test |
| | | public void testedgTask() { |
| | | List<Map<String,Object>> EdgTasks = taskCacheService.selectEdgInfo("2001"); |
| | | |
| | | log.info("磨边任务:{}", Arrays.asList(EdgTasks)); |
| | | } |
| | | |
| | | } |