| | |
| | | package com.mes; |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.job.PlcStorageCageTask; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | |
| | | BigStorageCageService bigStorageCageService; |
| | | @Autowired |
| | | PlcStorageCageTask plcStorageCageTask; |
| | | @Autowired |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | @Autowired |
| | | BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | | |
| | | @Test |
| | | public void testInsertSlot() { |
| | | List<BigStorageCage> list = new ArrayList(); |
| | | for (int j = 1; j <= 5; j++) { |
| | | for (int i = 1 + (55 * (j - 1)); i <= 55 * j; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(j); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(4); |
| | | cage.setMaxThickness(6); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | } |
| | | for (int i = 276; i <= 300; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(6); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 301; i <= 330; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(7); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 331; i <= 355; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(8); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 356; i <= 380; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(9); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(15); |
| | | cage.setMaxThickness(19); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | bigStorageCageService.saveBatch(list); |
| | | } |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | |
| | | @Test |
| | | public void plcToHomeEdgOutTask() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | plcStorageCageTask.plcToHomeEdgOutTask(); |
| | | } |
| | | |
| | | @Test |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | plcStorageCageTask.plcToHomeEdgFreeCarTask(); |
| | | } |
| | | |
| | | @Test |
| | | public void plcStorageCageTask() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | List<String> list = new ArrayList<>(); |
| | | //2002 |
| | | // list.add("P24060403|4|3"); |
| | | // list.add("P24060403|5|4"); |
| | | // list.add("P24060403|2|1"); |
| | | // list.add("P24060403|3|2"); |
| | | // list.add("P24060403|1|3"); |
| | | // list.add("P24060403|3|1"); |
| | | // list.add("P24060403|2|3"); |
| | | // list.add("P24060403|1|1"); |
| | | // list.add("P24060403|8|6"); |
| | | // list.add("P24060403|7|2"); |
| | | //2001 |
| | | // list.add("P24060403|3|6"); |
| | | // list.add("P24060403|5|2"); |
| | | // list.add("P24060403|4|4"); |
| | | // list.add("P24060403|3|5"); |
| | | // list.add("P24060403|5|3"); |
| | | // list.add("P24060403|1|2"); |
| | | // list.add("P24060403|2|2"); |
| | | // list.add("P24060403|5|1"); |
| | | list.add("P24060403|2|4"); |
| | | list.add("P24060403|1|5"); |
| | | list.add("P24060403|4|2"); |
| | | list.add("P24060403|1|4"); |
| | | list.add("P24060403|4|1"); |
| | | list.add("P24060403|8|7"); |
| | | for (String e : list) { |
| | | plcStorageCageTask.plcToHomeEdgScan(e); |
| | | } |
| | | plcStorageCageTask.plcToHomeEdgScan(); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void computeTargetByLine() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | plcStorageCageTask.computeTargetByLine(2001); |
| | | } |
| | | |
| | | @Test |
| | | public void judgeGlassTypeStatus() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | plcStorageCageTask.judgeGlassTypeStatus("P24060403|6|7", Const.A09_OUT_TARGET_POSITION); |
| | | plcStorageCageTask.judgeGlassTypeStatus("P24060403|6|7", Const.A09_OUT_TARGET_POSITION, "mesD03Address"); |
| | | } |
| | | |
| | | @Test |
| | | public void getStartLine() { |
| | | // log.info("获取大理片笼信息:{}",bigStorageCageService.querybigStorageCageDetail()); |
| | | Integer startLine = plcStorageCageTask.getStartLine(); |
| | | log.info("---------{}", startLine); |
| | | } |
| | | |
| | | @Test |
| | | public void selectBigStorageCageUsage() { |
| | | // bigStorageCageService.querybigStorageCageDetail(1); |
| | | log.info("获取大理片笼信息:{}", bigStorageCageService.selectBigStorageCageUsage()); |
| | | } |
| | | |
| | | @Test |
| | | public void selectBigStorageCageDetails() { |
| | | log.info("获取大理片笼信息:{}", bigStorageCageDetailsService.selectBigStorageCageDetails("P24060403|3|6")); |
| | | } |
| | | |
| | | @Test |
| | | public void insertDamage() { |
| | | Damage damage=new Damage(); |
| | | damage.setGlassId("P24060403|3|6"); |
| | | damage.setLine(2001); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setRemark(""); |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | } |