rev: 压机送料上下分配规则
This commit is contained in:
@@ -7,6 +7,8 @@ import org.nl.wms.ext.mes.service.dto.MesMudConsumptionDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
@@ -19,8 +21,39 @@ public class TestDemo {
|
||||
private MesRequestMapper mesRequestMapper;
|
||||
@Autowired
|
||||
private WmsToMesService wmsToMesService;
|
||||
private static AtomicInteger countUp = new AtomicInteger(0); // 上层数量
|
||||
private static AtomicInteger countLower = new AtomicInteger(0); // 下层数量
|
||||
@Test
|
||||
public void test01() {
|
||||
wmsToMesService.reportProductData("1701105828406366210");
|
||||
for (int i = 0; i < 13; i++) {
|
||||
toAdd();
|
||||
int up = countUp.get();
|
||||
int lower = countLower.get();
|
||||
if (lower == 0 || lower != 5) {
|
||||
countLower.incrementAndGet();
|
||||
} else {
|
||||
countUp.incrementAndGet();
|
||||
}
|
||||
if (up == 4) {
|
||||
countLower = new AtomicInteger(0);
|
||||
}
|
||||
if (lower == 4 && up == 4) {
|
||||
countUp = new AtomicInteger(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void toAdd() {
|
||||
int up = countUp.get();
|
||||
int lower = countLower.get();
|
||||
boolean isASC = false;
|
||||
if (lower == 0 || lower != 5) {
|
||||
isASC = true;
|
||||
}
|
||||
if (isASC) {
|
||||
System.out.println("下面第" + lower + "次");
|
||||
} else {
|
||||
System.out.println("上面第" + up + "次");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user