1.增加终止排产,当bom无法上料时终止并进行提醒

master
董哲奇 12 months ago
parent ab4fab389f
commit 603ea180df

@ -41,6 +41,13 @@ public class 三月滚动排产控制器 {
.execute(from,to);
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (RuntimeException e) {
e.printStackTrace();
ResultBean<?> resultBean = new ResultBean<>();
resultBean.setStatus(10000);
resultBean.setSuccess(false);
resultBean.setMessage(e.getMessage());
return resultBean;
} finally {
semaphore.release();
}

@ -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){

@ -33,8 +33,7 @@ public abstract class 套料图工序 implements 套料图工序接口 {
protected Date _;
protected List<Constant.> ;
@Override
public void run() {
public void run(AtomicBoolean atomicBoolean) {
if (ObjUtil.isEmpty(this.bom)||StrUtil.isEmpty(this.bom.getTzbh())){
return;
}
@ -56,11 +55,9 @@ public abstract class 套料图工序 implements 套料图工序接口 {
}
}
if (bom.get().size()==0||bom.get().get(0) != _) {
if (_ == Constant..){
if (bom.get().size()==0||bom.get().get(0) != Constant..) {
Manager..add(this.bom);
System.out.println(this.bom.toString());
}
atomicBoolean.set(true);
}
}
});

@ -17,17 +17,15 @@ public class 排产 {
List<> list;
public static void execute(@NotNull String from, @NotNull String to) {
_=null;
try {
_ = .of(from,to);
_ = .of(from, to);
Manager. = _;
Manager.from = from;
Manager.to = to;
DataFactory.();
DataFactory.();
DataFactory.();
DataFactory.();
DataFactory.2();
}catch (Exception e){
e.printStackTrace();
}finally {
if (_!=null){
_.complete = true;
}
}
}
private static of(@NotNull String from, @NotNull String to){
@ -36,13 +34,6 @@ public class 排产 {
.to = to;
.complete = false;
.list = new ArrayList<>();
Manager. = ;
Manager.from = from;
Manager.to = to;
DataFactory.();
DataFactory.();
DataFactory.();
DataFactory.();
return Manager.;
}

@ -153,8 +153,8 @@ public class SYService {
* @param bmm
* @return
*/
@Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
// @Transactional
// @Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
@Transactional
public String f_getpjh(String zxt,String jg,String bmm){
entityManager.clear(); // 清除缓存
QDmBhdyp bhdy=QDmBhdyp.dmBhdyp;

Loading…
Cancel
Save