diff --git a/SQL/20230705124518.nb3 b/SQL/20230705124518.nb3 new file mode 100644 index 0000000..d20f192 Binary files /dev/null and b/SQL/20230705124518.nb3 differ diff --git a/shkj-admin/src/test/java/com/shkj/testB.java b/shkj-admin/src/test/java/com/shkj/testB.java new file mode 100644 index 0000000..7ad6b08 --- /dev/null +++ b/shkj-admin/src/test/java/com/shkj/testB.java @@ -0,0 +1,104 @@ +//package com.shkj; +// +// +//import io.swagger.models.auth.In; +//import org.apache.commons.lang3.tuple.ImmutablePair; +//import org.apache.commons.lang3.tuple.Pair; +//import org.apache.poi.ss.formula.functions.T; +//import org.junit.Test; +// +//import java.util.*; +//import java.util.stream.Collectors; +// +//public class testB { +// +// +// +// +// public class WeightRandomStrategy { +// private TreeMap weightMap = new TreeMap<>(); +// private Map map =new HashMap(); +// private Map nmap =new HashMap(); +// private TreeMap Map = new TreeMap<>(); +// +// public WeightRandomStrategy(List> list) { +// for (Pair pair : list) { +// nmap.put(pair.getKey(),pair.getValue()); +// map.put(String.valueOf(pair.getKey()),0); +// double lastWeight = this.weightMap.size() == 0 ? 0 : this.weightMap.lastKey(); +// this.weightMap.put(pair.getValue().doubleValue() + lastWeight, pair.getKey()); +// } +// } +// +// public java.lang.String randome(){ +// Map.putAll(weightMap); +// String k = random(); +// return k; +// } +// +// public String random() { +// +// Double aDouble = this.Map.lastKey(); +// double random = Math.random(); +// double randomWeight = aDouble* random; +// SortedMap tailMap = this.Map.tailMap(randomWeight, false); +// String k = String.valueOf(this.Map.get(tailMap.firstKey())); +// int o = (Integer) this.nmap.get(k); +// int o2 = (Integer)map.get(k); +// if (o2==o){ +// System.out.println("========"+k); +// Map.remove(tailMap.firstKey()); +// +// if (Map.size()==0){ +// List collect = map.entrySet().stream().map(java.util.Map.Entry::getKey).collect(Collectors.toList()); +// collect.stream().forEach(e->{ +// map.put(String.valueOf(e),0); +// }); +// Map.putAll(weightMap); +// } +// k=random(); +// return k; +// } +// Integer o1 = (Integer) map.get(k); +// map.put(k,o1+1); +// return k; +// } +// } +// @Test +// public void testb(){ +// List> list = new ArrayList<>(); +// list.add(new ImmutablePair<>("RKu", 2)); +// list.add(new ImmutablePair<>("Cku", 2)); +// list.add(new ImmutablePair<>("CKong", 1)); +// list.add(new ImmutablePair<>("YChang", 1)); +// list.add(new ImmutablePair<>("HLiu", 1)); +// list.add(new ImmutablePair<>("JinCK", 1)); +// list.add(new ImmutablePair<>("TE",3)); +// WeightRandomStrategy strategy = new WeightRandomStrategy<>(list); +// int a = 0, b = 0,c = 0,d = 0,e = 0,f =0,g = 0; +// for (int i = 0; i < 10014; i++) { +// String randome = strategy.randome(); +// System.out.println(randome); +// switch (randome){ +// case "RKu": a++;break; +// case "Cku":b++;break; +// case "CKong":c++;break; +// case "YChang":d++;break; +// case "HLiu":e++;break; +// case "JinCK":f++;break; +// case "TE":g++;break; +// } +// } +// System.out.println("a=" + a + ", b=" + b+", c=" + c+", d=" + d+", e=" + e+", f=" + f+", g=" + g); +// System.out.println("a+b=" + (a + b+c+d+e+f+g)); +// +// } +// +// @Test +// public void test01(){ +// List list = new ArrayList(); +// System.out.println(list.size()); +// } +// +// +//} diff --git a/shkj-wms/src/main/java/com/shkj/wms/third/rcs/Test.java b/shkj-wms/src/main/java/com/shkj/wms/third/rcs/Test.java new file mode 100644 index 0000000..00c5258 --- /dev/null +++ b/shkj-wms/src/main/java/com/shkj/wms/third/rcs/Test.java @@ -0,0 +1,126 @@ +package com.shkj.wms.third.rcs; + +import com.shkj.common.core.domain.Result; +import com.shkj.wms.third.rcs.dto.RcsCreateTaskDto; +import com.shkj.wms.third.rcs.enums.RCSTaskTypeEnum; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +@Component("testTask") +public class Test { + + @Autowired + private RCSUtil rcsUtil; + + //@Scheduled(cron = " 10 * * * * ? ") + public void startTestTask(){ + System.out.println("任务下发开始+++++++++++++++++++++++++++++++"); + + //下挂->入库口 + RcsCreateTaskDto rcsCreateTaskDto = new RcsCreateTaskDto(); + rcsCreateTaskDto.setTaskId(String.valueOf((int)(Math.random()*10000))); + rcsCreateTaskDto.setTaskType(RCSTaskTypeEnum.A_TO_B_HAND_PUT.getValue()); + List targetList = new ArrayList(); + + targetList.add("KW17"); + targetList.add("LY106"); + Random random = new Random(); + int randomNumber = random.nextInt(3) + 1; + if (randomNumber== 1){ + targetList.add("KW5"); + } + if (randomNumber== 2){ + targetList.add("KW7"); + } + if (randomNumber== 3){ + targetList.add("KW9"); + } + + rcsCreateTaskDto.setTargets(targetList); + Result result = rcsUtil.rcsCreateTask(rcsCreateTaskDto); + if (result.getCode() == 200){ + System.out.println("++++++++++++++++++++++++++++++++++++++下挂->入库口任务成功++++++++++++"); + }else { + System.out.println("++++++++++++++++++++++++++++"+result.getMsg()+"+++++++++++++++++++++++++++++++"); + } + + //立库出小组装 + RcsCreateTaskDto rcsCreateTaskDto1 = new RcsCreateTaskDto(); + rcsCreateTaskDto1.setTaskId(String.valueOf((int)(Math.random()*10000))); + rcsCreateTaskDto1.setTaskType(31); + List targetList1 = new ArrayList(); + if (randomNumber== 1){ + targetList.add("KW6"); + } + if (randomNumber== 2){ + targetList.add("KW8"); + } + if (randomNumber== 3){ + targetList.add("KW10"); + } + targetList1.add("LY106"); + targetList1.add("KW5"); + targetList1.add("KW19"); + rcsCreateTaskDto1.setTargets(targetList1); + Result result1 = rcsUtil.rcsCreateTask(rcsCreateTaskDto1); + if (result1.getCode() == 200){ + System.out.println("++++++++++++++++++++++++++++++++++++++立库出小组装任务成功++++++++++++"); + }else { + System.out.println("++++++++++++++++++++++++++++"+result1.getMsg()+"+++++++++++++++++++++++++++++++"); + } + + //小组装回机械手 + RcsCreateTaskDto rcsCreateTaskDto2 = new RcsCreateTaskDto(); + rcsCreateTaskDto2.setTaskId(String.valueOf((int)(Math.random()*10000))); + rcsCreateTaskDto2.setTaskType(RCSTaskTypeEnum.TO_B_AND_PUT1.getValue()); + List targetList2 = new ArrayList(); + targetList2.add("KW19"); + targetList2.add("LY106"); + targetList2.add("KW17"); + rcsCreateTaskDto2.setTargets(targetList2); + Result result2 = rcsUtil.rcsCreateTask(rcsCreateTaskDto2); + if (result.getCode() == 200){ + System.out.println("++++++++++++++++++++++++++++++++++++++小组装回机械手任务成功++++++++++++"); + }else { + System.out.println("++++++++++++++++++++++++++++"+result2.getMsg()+"+++++++++++++++++++++++++++++++"); + } + + //机械手入平库 + RcsCreateTaskDto rcsCreateTaskDto3 = new RcsCreateTaskDto(); + rcsCreateTaskDto3.setTaskId(String.valueOf((int)(Math.random()*10000))); + rcsCreateTaskDto3.setTaskType(RCSTaskTypeEnum.A_TO_B_NO_PUT.getValue()); + List targetList3 = new ArrayList(); + targetList3.add("KW17"); + targetList3.add("LY106"); + targetList3.add("KW18"); + rcsCreateTaskDto3.setTargets(targetList3); + Result result3 = rcsUtil.rcsCreateTask(rcsCreateTaskDto3); + if (result.getCode() == 200){ + System.out.println("++++++++++++++++++++++++++++++++++++++机械手入平库任务成功++++++++++++"); + }else { + System.out.println("++++++++++++++++++++++++++++"+result3.getMsg()+"+++++++++++++++++++++++++++++++"); + } + + //平库回机械手 + RcsCreateTaskDto rcsCreateTaskDto4 = new RcsCreateTaskDto(); + rcsCreateTaskDto4.setTaskId(String.valueOf((int)(Math.random()*10000))); + rcsCreateTaskDto4.setTaskType(RCSTaskTypeEnum.TO_B_AND_PUT1.getValue()); + List targetList4 = new ArrayList(); + targetList4.add("KW18"); + targetList4.add("LY106"); + targetList4.add("KW17"); + rcsCreateTaskDto4.setTargets(targetList4); + Result result4 = rcsUtil.rcsCreateTask(rcsCreateTaskDto4); + if (result.getCode() == 200){ + System.out.println("++++++++++++++++++++++++++++++++++++++平库回机械手任务成功++++++++++++"); + }else { + System.out.println("++++++++++++++++++++++++++++"+result4.getMsg()+"+++++++++++++++++++++++++++++++"); + } + } + +} diff --git a/项目计划---7月22日更新.xlsx b/项目计划---7月22日更新.xlsx new file mode 100644 index 0000000..0e36eee Binary files /dev/null and b/项目计划---7月22日更新.xlsx differ