|
|
|
@ -30,6 +30,7 @@ import java.io.OutputStream;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@ -48,11 +49,12 @@ public class DataFactory {
|
|
|
|
|
CountDownLatch latch = new CountDownLatch(钢料需求.getBomList().size());
|
|
|
|
|
钢料需求.getBomList().forEach(bom -> {
|
|
|
|
|
套料图工序 _套料图工序 = 套料图工序工厂(bom);
|
|
|
|
|
AtomicBoolean atomicBoolean = new AtomicBoolean(false);
|
|
|
|
|
if (_套料图工序!=null){
|
|
|
|
|
_套料图工序.set需求日期(钢料需求.getXzglxq());
|
|
|
|
|
es.execute(() -> {
|
|
|
|
|
try{
|
|
|
|
|
_套料图工序.run();
|
|
|
|
|
_套料图工序.run(atomicBoolean);
|
|
|
|
|
}finally {
|
|
|
|
|
latch.countDown();
|
|
|
|
|
}
|
|
|
|
@ -60,6 +62,12 @@ public class DataFactory {
|
|
|
|
|
}else {
|
|
|
|
|
latch.countDown();
|
|
|
|
|
}
|
|
|
|
|
if(atomicBoolean.get()){
|
|
|
|
|
String errText = StrUtil.format("船号:{},批量:{},图号:{},需求日期:{},不满足上料需求",
|
|
|
|
|
bom.getDcch(), bom.getPl(), bom.getTzbh(), bom.getXzglxq());
|
|
|
|
|
清理冗余数据(list);
|
|
|
|
|
throw new RuntimeException(errText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
try {
|
|
|
|
|
latch.await(10, TimeUnit.SECONDS);// 指定超时时间
|
|
|
|
@ -68,7 +76,10 @@ public class DataFactory {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
System.out.println(Manager.排产结果.size());
|
|
|
|
|
//清理冗余数据
|
|
|
|
|
清理冗余数据(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void 清理冗余数据(List<钢料需求> list){
|
|
|
|
|
list.forEach(钢料需求->{
|
|
|
|
|
钢料需求.getBomList().forEach(bom -> {
|
|
|
|
|
if (bom.get所在设备()!=null){
|
|
|
|
|