From f2ea663c986c5309a6b1d3f283c13bd312ecbed7 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期三, 17 七月 2024 13:52:17 +0800
Subject: [PATCH] 图片测试
---
hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 106 insertions(+), 9 deletions(-)
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java
index 53f728a..4bf1348 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java
@@ -1,11 +1,21 @@
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.edgstoragecage.service.impl.EdgStorageCageServiceImpl;
+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.impl.TaskCacheServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -13,6 +23,7 @@
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.List;
import java.util.Map;
@@ -24,46 +35,132 @@
*/
@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;
@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> map= edgStorageCageService.selectEdgStorageCages();
+ List<Map<String, Object>> map = edgStorageCageService.selectEdgStorageCages();
log.info("绗煎唴淇℃伅锛歿}", Arrays.asList(map));
}
+
@Test
- public void testselectCacheEmpty() {
- List<Map> map= edgStorageCageService.selectCacheEmpty();
+ public void testSelectCacheEmpty() {
+ List<EdgStorageCage> map = edgStorageCageService.selectCacheEmpty();
log.info("绗煎唴绌烘牸锛歿}", Arrays.asList(map));
}
+
@Test
public void testScan() {
- List<OptimizeDetail> map= edgStorageCageDetailsService.selectCutTerritory();
+ List<Map<String, Object>> map = edgStorageCageDetailsService.selectCutTerritory();
log.info("鍒囧壊褰撳墠鐗堝浘淇℃伅锛歿}", Arrays.asList(map));
}
@Test
public void testPpOptimizeDetail() {
- List<OptimizeDetail> optimizeDetail=optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>()
+ List<OptimizeDetail> optimizeDetail = optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>()
.eq("project_no", "P24032204")
- .eq("stock_id",5)
+ .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));
+ }
+
}
--
Gitblit v1.8.0