|
|
|
@ -43,22 +43,33 @@ public abstract class 套料图工序 implements 套料图工序接口 {
|
|
|
|
|
|
|
|
|
|
public void run(){
|
|
|
|
|
fail=new AtomicBoolean(false);
|
|
|
|
|
基础设置();
|
|
|
|
|
this.run(fail);
|
|
|
|
|
if (基础设置()){
|
|
|
|
|
this.run(fail);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void 基础设置(){
|
|
|
|
|
if (this.zlType==ZlType.小组){
|
|
|
|
|
protected boolean 基础设置(){
|
|
|
|
|
if (this.zlType==ZlType.小组||this.zlType==ZlType.焊接机器人肘板){
|
|
|
|
|
this.set需求日期(this.xzglxq);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.zlType==ZlType.大组){
|
|
|
|
|
this.set需求日期(this.dzglxq);
|
|
|
|
|
if (this.dzglxq==null){
|
|
|
|
|
this.set需求日期(this.xzglxq);
|
|
|
|
|
this.bom.缺少大组需求期使用小组需求替代();
|
|
|
|
|
}else {
|
|
|
|
|
this.set需求日期(this.dzglxq);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.zlType==ZlType.大组&&this.工序.contains(Constant.工序.曲型)){
|
|
|
|
|
//大组需求有曲外板,需要按照大组需求期计算
|
|
|
|
|
this.set需求日期(dzglxq);
|
|
|
|
|
if (this.dzglxq==null){
|
|
|
|
|
this.set需求日期(this.xzglxq);
|
|
|
|
|
this.bom.缺少大组需求期使用小组需求替代();
|
|
|
|
|
}else {
|
|
|
|
|
this.set需求日期(this.dzglxq);
|
|
|
|
|
}
|
|
|
|
|
//曲外板批量名称设置
|
|
|
|
|
this.bom.set_pl(this.bom.getPl()+"Q");
|
|
|
|
|
}
|
|
|
|
@ -71,25 +82,39 @@ public abstract class 套料图工序 implements 套料图工序接口 {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ObjUtil.isEmpty(this.bom)||StrUtil.isEmpty(this.bom.getTzbh())){
|
|
|
|
|
return;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
this._需求日期 = DateUtil.parse(this.需求日期, "yyyy/MM/dd");
|
|
|
|
|
|
|
|
|
|
Map<String,List<订货计划>> _订货计划=DataFactory.获取订货计划();
|
|
|
|
|
this.订货计划s = _订货计划.get(bom.getDcch());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void run(AtomicBoolean atomicBoolean) {
|
|
|
|
|
if (!this.是否订货()){
|
|
|
|
|
if (!this.订货()){
|
|
|
|
|
System.out.println(String.format("船号:%s,批量:%s,未订货",this.bom.getDcch(),this.bom.getPl()));
|
|
|
|
|
bom.没有订货();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.工序.forEach(_工序 -> {
|
|
|
|
|
资源 _资源 = this.占用资源2(_工序, 需求数量);
|
|
|
|
|
|
|
|
|
|
if (_工序==Constant.工序.上料&&!this.能否到货(_资源)){
|
|
|
|
|
if (_工序==Constant.工序.上料&&!this.到货(_资源)){
|
|
|
|
|
this.bom.上料之前无法到货();
|
|
|
|
|
//使用中日程定义需求日期
|
|
|
|
|
if (this.中日程==null){
|
|
|
|
|
this.bom.缺少中日程();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.zlType==ZlType.小组&&this.中日程.getGjjsXz()==null){
|
|
|
|
|
this.bom.中日期无小组需求期();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.zlType==ZlType.大组&&this.中日程.getGjjsDz()==null){
|
|
|
|
|
this.bom.中日程无大组需求期();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this._需求日期=this.zlType==ZlType.小组?DateUtil.parse(this.中日程.getGjjsXz()):DateUtil.parse(this.中日程.getGjjsDz());
|
|
|
|
|
//再次计算上料日期
|
|
|
|
|
this.占用资源2(_工序, 需求数量);
|
|
|
|
@ -114,23 +139,22 @@ public abstract class 套料图工序 implements 套料图工序接口 {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected boolean 是否订货(){
|
|
|
|
|
protected boolean 订货(){
|
|
|
|
|
AtomicBoolean 是否订货=new AtomicBoolean(false);
|
|
|
|
|
if (ObjUtil.isEmpty(订货计划s)){
|
|
|
|
|
return 是否订货.get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ObjUtil.isNotEmpty(订货计划s)){
|
|
|
|
|
订货计划s.forEach(item->{
|
|
|
|
|
if (item.getPlList().contains(bom.getPl())){
|
|
|
|
|
是否订货.set(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
订货计划s.forEach(item->{
|
|
|
|
|
if (item.getPlList().contains(bom.getPl())){
|
|
|
|
|
是否订货.set(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return 是否订货.get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected boolean 能否到货(资源 _资源){
|
|
|
|
|
protected boolean 到货(资源 _资源){
|
|
|
|
|
AtomicBoolean 能否到货=new AtomicBoolean(false);
|
|
|
|
|
if (ObjUtil.isNotEmpty(订货计划s)){
|
|
|
|
|
订货计划s.forEach(item->{
|
|
|
|
|