1.排产临时提交

master
董哲奇 1 year ago
parent 039f774a9a
commit c5a65c1623

@ -14,11 +14,16 @@ public interface Constant {
.put(., -5)
.put(., -3)
.put(., -2)
.put(., -5)
.put(., -5)
.put(., -5)
.put(., 0)
.put(., -3)
.put(.,0)
.put(.,0)
.put(.,0)
.put(.,0)
.put(., 0)
.put(.NULL, 0)
.build();
@Getter
@ -32,18 +37,19 @@ public interface Constant {
01(.,"龙门01","",2.4,3.6,9.6,15.6,25.2),
01(.,"火焰01","",0.3,11.5,2.0,0,2.0),
01(.,"数控01","",1.5,3.0,0,8.5,8.5),
03(.,"火焰03","",0.3,11.5,2.0,0,2.0),
03(.,"数控03","",2.0,4.2,0,14.0,14.0),
03(.,"龙门03","",1.6,3.2,7.2,11.2,18.4),
03(., "火焰03", "", 0.3, 11.5, 2.0, 0, 2.0),
03(., "数控03", "", 2.0, 4.2, 0, 14.0, 14.0),
03(., "龙门03", "", 1.6, 3.2, 7.2, 11.2, 18.4),
02(.,"火焰02","",0.3,11.5,3.9,0,3.9),
02(.,"数控02","",1.4,3.0,0,18.2,18.2),
02(.,"龙门02","",2.0,3.0,1.0,13.0,13.0),
02(., "火焰02", "", 0.3, 11.5, 3.9, 0, 3.9),
02(., "数控02", "", 1.4, 3.0, 0, 18.2, 18.2),
02(., "龙门02", "", 2.0, 3.0, 1.0, 13.0, 13.0),
01(.,"坡口01","",2.0,3.0,1.0,13.0,13.0),
01(.,"型材01","",2.0,3.0,1.0,13.0,13.0),
01(.,"曲加工01","",2.0,3.0,1.0,13.0,13.0),
01(.,"打磨01","",2.0,3.0,1.0,13.0,13.0),
01(., "坡口01", "", 2.0, 3.0, 1.0, 13.0, 13.0),
01(., "型材01", "", 2.0, 3.0, 1.0, 13.0, 13.0),
01(., "曲加工01", "", 2.0, 3.0, 1.0, 13.0, 13.0),
01(., "打磨01", "", 2.0, 3.0, 1.0, 13.0, 13.0),
01(.NULL, "未知01", "", 2.0, 3.0, 1.0, 13.0, 13.0),
;
public _;
public String ;
@ -56,22 +62,27 @@ public interface Constant {
}
@AllArgsConstructor
enum {
enum {
NULL(""),
("19"),
("20"),
("21"),
线("01"),
("03,04,05,06"),
// 一跨龙门切割("03"),一跨数控切割("04"),二跨数控切割("04"),三跨数控切割("04"),三跨平铁切割("05"),手工切割("06"),
// 一跨龙门切割("03"),一跨数控切割("04"),二跨数控切割("04"),三跨数控切割("04"),三跨平铁切割("05"),手工切割("06"),
("08"),
("17"),
("18"),
("14,15"),
("18"),
("13,16"),
// 平铁打磨("13"),手工打磨("16"),
("02"),
// 平铁打磨("13"),手工打磨("16"),
("09"),
("11"),
(""),
(""),
(""),
;
@Getter

@ -14,10 +14,8 @@ import com.dsic.gj_erp.bean.jcsj.EmSbjbb;
import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
import com.dsic.gj_erp.pc.dto.gx.*;
import com.dsic.gj_erp.pc.dto.sb.*;
import com.dsic.gj_erp.pc.dto.;
import com.dsic.gj_erp.pc.dto.;
import com.dsic.gj_erp.pc.dto.;
import com.dsic.gj_erp.pc.dto.;
import com.dsic.gj_erp.pc.dto.tlt.*;
import com.dsic.gj_erp.pc.dto.*;
import com.dsic.gj_erp.service.jcsj.EmGcrlService;
import com.dsic.gj_erp.service.jcsj.EmSbcnpService;
import com.dsic.gj_erp.service.jcsj.EmSbjbbService;
@ -27,6 +25,8 @@ import com.google.common.collect.ImmutableMap;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static com.dsic.gj_erp.pc.Constant.CD;
@ -35,77 +35,124 @@ import static com.dsic.gj_erp.pc.Manager.*;
public class DataFactory {
public static void (){
public static void 2() {
.clear();
List<DmSygdxq> = getBean(DmSygdxqService.class).getXqWithBom(from, to);
.forEach( -> {
CountDownLatch latch = new CountDownLatch(.getBomList().size());
.getBomList().forEach(bom -> {
_ = (bom);
if (_!=null){
_.set(.getXzglxq());
es.execute(() -> {
try{
_.run();
}finally {
latch.countDown();
}
});
}else {
latch.countDown();
}
});
try {
latch.await(10, TimeUnit.SECONDS); // 指定超时时间
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
});
//========调试打印===========
.forEach((day, item) -> {
System.out.println("====打印资源===");
System.out.println(day);
Map<Constant., > MAP = item.getMAP();
MAP.forEach((, ) -> {
if (.get().size() > 0) {
System.out.println("工序:" + );
System.out.println("工序产能:" + .get().size());
}
});
System.out.println("====打印资源完成===");
});
//========调试打印结束===========
}
public static void () {
.clear();
List<> list = .list;
List<DmBom> =new ArrayList<>();
List<DmBom> = new ArrayList<>();
list.clear();
List<DmSygdxq> = getBean(DmSygdxqService.class).getXqWithBom(from, to);
.forEach(->{
.getBomList().forEach(bom->{
Arrays.stream(Constant..values()).forEach(gx->{
if (StrUtil.isEmpty(gx.getCode()))return;
//todo 由于工序code存在多个值的情况,这里需要抽象套料图工序,修改后可支持多线程运算
if (ObjUtil.isNotEmpty(.get(bom.getKw()+bom.getZl()+"_"+gx.getCode()))){
Integer cd = CD.get(gx);
DateTime parse = DateUtil.parse(.getXzglxq(), "yyyy/MM/dd");
DateTime dateTime = DateUtil.offsetDay(parse, cd);
_ = (dateTime);
//除切割工序外默认需求数量都是1
//todo 如果是切割工序需要获取切割长度
double =bom.getTlsl().doubleValue();
Optional.of(_).ifPresent(it->{
=null;
= .get(bom.getTzbh());
if (!=null){
= .getMAP().get(gx);
}
if (!=null&&.get().contains(bom.getTzbh())){
bom.set(it);
Optional<> _ = .(bom.getTzbh());
_.ifPresent(bom::set);
}else{
= it.getMAP().get(gx);
Optional<> _ = .();
final = ;
_.ifPresent(tmp->{
bom.set(tmp);
tmp.(bom.getTzbh(),);
.forEach( -> {
.getBomList().forEach(bom -> {
Arrays.stream(Constant..values()).forEach(gx -> {
if (StrUtil.isEmpty(gx.getCode())) return;
//todo 由于工序code存在多个值的情况,这里需要抽象套料图工序,修改后同时可支持多线程运算
Optional<String> first = .keySet().stream()
.filter(it -> it.startsWith(bom.getKw() + bom.getZl()))
.filter(it -> gx.getCode().contains(it.split("_")[1])).findFirst();
first.ifPresent(_code -> {
if (ObjUtil.isNotEmpty(.get(_code))) {
Integer cd = CD.get(gx);
DateTime parse = DateUtil.parse(.getXzglxq(), "yyyy/MM/dd");
DateTime dateTime = DateUtil.offsetDay(parse, cd);
_ = (dateTime);
//除切割工序外默认需求数量都是1
//todo 如果是切割工序需要获取切割长度
double = bom.getTlsl().doubleValue();
Optional.of(_).ifPresent(it -> {
= null;
= .get(bom.getTzbh());
if ( != null) {
= .getMAP().get(gx);
}
if ( != null && .get().contains(bom.getTzbh())) {
bom.set(it);
final.(bom.getTzbh(), );
.put(bom.getTzbh(),it);
Optional<> _ = .(bom.getTzbh());
_.ifPresent(bom::set);
} else {
= it.getMAP().get(gx);
Optional<> _ = .();
final = ;
_.ifPresent(tmp -> {
bom.set(tmp);
tmp.(bom.getTzbh(), );
bom.set(it);
final.(bom.getTzbh(), );
.put(bom.getTzbh(), it);
});
}
});
//没有可用资源是全局搜索可用资源,进行排产
if (bom.get() == null) {
Optional<> = (gx, DateUtil.parse(from, "yyyy/MM/dd"), parse, );
.ifPresent(tmp -> {
_ = tmp.getMAP().get(gx);
Optional<> _ = _.(0);
_.ifPresent(tmp -> {
tmp.(bom.getTzbh(), );
bom.set(tmp);
_.(bom.getTzbh(), );
bom.set(tmp);
.put(bom.getTzbh(), tmp);
});
});
}
});
//没有可用资源是全局搜索可用资源,进行排产
if (bom.get()==null){
Optional<> = (gx, DateUtil.parse(from,"yyyy/MM/dd"), parse,);
.ifPresent(tmp->{
//没有可用资源放入月末(强占),待手工调整
if (bom.get() == null) {
.add(bom);
tmp = (DateUtil.endOfMonth(DateUtil.parse(.getXzglxq(), "yyyy/MM/dd")));
_ = tmp.getMAP().get(gx);
Optional<> _ = _.(0);
_.ifPresent(tmp->{
tmp.(bom.getTzbh(),);
bom.set(tmp);
_.(bom.getTzbh(), );
bom.set(tmp);
.put(bom.getTzbh(),tmp);
});
});
}
//没有可用资源放入月末(强占),待手工调整
if (bom.get()==null){
.add(bom);
tmp = (DateUtil.endOfMonth(DateUtil.parse(.getXzglxq(), "yyyy/MM/dd")));
_ = tmp.getMAP().get(gx);
Optional<> _ = _.get().values().stream().findAny();
bom.set(_.get());
bom.set(tmp);
_.(bom.getTzbh(),0);
.put(bom.getTzbh(),tmp);
Optional<> _ = _.get().values().stream().findAny();
bom.set(_.get());
bom.set(tmp);
_.(bom.getTzbh(), 0);
.put(bom.getTzbh(), tmp);
}
}
}
});
});
});
});
@ -148,23 +195,85 @@ public class DataFactory {
public static void (){
.clear();
.stream().filter(item -> "1".equals(item.getXxr()))
.forEach(item -> {
Map<Constant., > map=new HashMap<>();
Arrays.stream(Constant..values()).forEach(_item->{
if (StrUtil.isNotEmpty(_item.getCode())){
map.put(_item,(_item));
.forEach(item -> {
Map<Constant., > map = new HashMap<>();
Arrays.stream(Constant..values()).forEach(_item -> {
if (StrUtil.isNotEmpty(_item.getCode())) {
= (_item);
if (!=null){
map.put(_item, );
}
});
.put(item.getGl(),.of(item.getGl(), map));
}
});
.put(item.getGl(), .of(item.getGl(), map));
});
}
public static (DmBom bom) {
switch (bom.getKw() + bom.getZl()) {
case "51010":
return new T().(bom);
case "51110":
return new T().(bom);
case "61010":
return new ().(bom);
case "61110":
return new ().(bom);
case "64230":
return new ().(bom);
case "71010":
return new ().(bom);
case "71110":
return new ().(bom);
case "81110":
return new 线().(bom);
case "91010":
return new ().(bom);
case "91110":
return new ().(bom);
case "101010":
return new ().(bom);
case "101110":
return new ().(bom);
case "111010":
return new T().(bom);
case "111110":
return new T().(bom);
case "121010":
return new ().(bom);
case "121110":
return new ().(bom);
case "131010":
return new ().(bom);
case "131110":
return new ().(bom);
case "141010":
return new ().(bom);
case "141110":
return new ().(bom);
case "151010":
return new ().(bom);
case "151110":
return new ().(bom);
case "154230":
return new ().(bom);
case "161010":
return new ().(bom);
case "161110":
return new ().(bom);
case "171010":
return new ().(bom);
default:
return null;
}
}
public static (Constant. _){
Map<String,> _=null;
switch (_){
public static (Constant. _) {
Map<String, > _ = null;
switch (_) {
case :
_= ImmutableMap.<String, >builder()
.put(Constant..01.,new 01(Constant..01))
_ = ImmutableMap.<String, >builder()
.put(Constant..01., new 01(Constant..01))
.build();
return new 01(_);
case :
@ -205,14 +314,14 @@ public class DataFactory {
.put(Constant..01.,new 10(Constant..01))
.build();
return new 10(_);
case :
case :
_=ImmutableMap.<String, >builder()
.put(Constant..01.,new 08(Constant..01))
.build();
return new 08(_);
case :
_=ImmutableMap.<String, >builder()
.put(Constant..01.,new 09(Constant..01))
.put(Constant..01., new 09(Constant..01))
.build();
return new 09(_);
// case 预配盘:
@ -222,7 +331,7 @@ public class DataFactory {
// case 配送:
// return new 工序01上料(_工序,_设备);
default:
return new 99(Constant..NULL,_);
return null;
}
}

@ -9,7 +9,7 @@ import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.*;
public class Manager {
public static String from;
@ -21,8 +21,15 @@ public class Manager {
public static final Map<String,> = new ConcurrentHashMap<>();
public static final Map<String, Constant.> = new ConcurrentHashMap<>();
public static final List<EmSbjbb> = new ArrayList<>();
//实时加载
public static Map<Constant., Map<String, >> ;
public static final ExecutorService es;
static {
int poolSize =Runtime.getRuntime().availableProcessors() * 2;
// BlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(512);
// RejectedExecutionHandler policy = new ThreadPoolExecutor.DiscardPolicy();
es=new ThreadPoolExecutor(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
}
private Manager(){}
}

@ -12,7 +12,7 @@ import java.util.Map;
@Setter
public class 08 extends {
public 08(Map<String, > _) {
super(Constant..,_);
super(Constant.., _);
}
@Override

@ -0,0 +1,39 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "7";
this.zl = "1010";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..线)
.add(Constant..)
.build();
return this;
}
public (DmBom bom) {
this.kw = "7";
this.zl = "1110";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..线)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
}

@ -0,0 +1,28 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class 线 extends {
public 线 (DmBom bom) {
return null;
}
public 线 (DmBom bom) {
this.kw = "8";
this.zl = "1110";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
}

@ -0,0 +1,44 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "16";
this.zl = "1010";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
public (DmBom bom) {
this.kw = "16";
this.zl = "1110";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
}

@ -0,0 +1,38 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "14";
this.zl = "1010";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
public (DmBom bom) {
this.kw = "14";
this.zl = "1110";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
}

@ -0,0 +1,58 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "6";
this.zl = "1010";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..线)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
public (DmBom bom) {
this.kw = "6";
this.zl = "1110";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..线)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
public (DmBom bom) {
this.kw = "6";
this.zl = "4230";
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..线)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
}

@ -0,0 +1,35 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "13";
this.zl = "1010";
this.bom = bom;
this.();
return this;
}
public (DmBom bom) {
this.kw = "13";
this.zl = "1110";
this.bom = bom;
this.();
return this;
}
private void () {
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
}
}

@ -0,0 +1,36 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class T extends {
public T (DmBom bom) {
this.kw = "11";
this.zl = "1010";
this.bom = bom;
this.();
return this;
}
public T (DmBom bom) {
this.kw = "11";
this.zl = "1110";
this.bom = bom;
this.();
return this;
}
private void () {
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..线)
.add(Constant..)
.add(Constant..)
.build();
}
}

@ -0,0 +1,38 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class T extends {
public T (DmBom bom) {
this.kw = "5";
this.zl = "1010";
this.bom = bom;
this.();
return this;
}
public T (DmBom bom) {
this.kw = "5";
this.zl = "1110";
this.bom = bom;
this.();
return this;
}
private void () {
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..线)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
}
}

@ -0,0 +1,38 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "12";
this.zl = "1010";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
public (DmBom bom) {
this.kw = "12";
this.zl = "1110";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
}

@ -0,0 +1,41 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "10";
this.zl = "1010";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
public (DmBom bom) {
_ = new ();
_.kw = "10";
_.zl = "1110";
_.bom = bom;
_. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return _;
}
}

@ -0,0 +1,35 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "9";
this.zl = "1010";
this.bom = bom;
this.();
return this;
}
public (DmBom bom) {
this.kw = "9";
this.zl = "1110";
this.bom = bom;
this.();
return this;
}
private void () {
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
}
}

@ -0,0 +1,29 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "17";
this.zl = "1120";
this.bom = bom;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
return this;
}
public (DmBom bom) {
return null;
}
}

@ -0,0 +1,45 @@
package com.dsic.gj_erp.pc.dto.tlt;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList;
public class extends {
public (DmBom bom) {
this.kw = "15";
this.zl = "1010";
this.bom = bom;
this.();
return this;
}
public (DmBom bom) {
this.kw = "15";
this.zl = "1110";
this.bom = bom;
this.();
return this;
}
public (DmBom bom) {
this.kw = "15";
this.zl = "4230";
this.bom = bom;
this.();
return this;
}
private void () {
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
.add(Constant..)
.add(Constant..线)
.add(Constant..)
.add(Constant..)
.add(Constant..)
.build();
}
}

@ -0,0 +1,111 @@
package com.dsic.gj_erp.pc.dto;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.service.;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import static com.dsic.gj_erp.pc.Constant.CD;
import static com.dsic.gj_erp.pc.DataFactory.;
import static com.dsic.gj_erp.pc.DataFactory.;
import static com.dsic.gj_erp.pc.Manager.from;
import static com.dsic.gj_erp.pc.Manager.;
@Getter
@Setter
public abstract class implements {
protected String kw;
protected String zl;
protected DmBom bom;
protected String ;
protected Date _;
protected List<Constant.> ;
@Override
public void run() {
if (ObjUtil.isEmpty(this.bom)||StrUtil.isEmpty(this.bom.getTzbh())){
return;
}
this._ = DateUtil.parse(this., "yyyy/MM/dd");
double = 1;
this..forEach(_ -> {
if (!this.(_)&&!this.(_,)){
if (bom.get() == null) {
Optional<> = (_, DateUtil.parse(from, "yyyy/MM/dd"), this._, );
.ifPresent(tmp -> {
_ = tmp.getMAP().get(_);
Optional<> _ = _.(0);
_.ifPresent(tmp -> {
this.(tmp,_,tmp,);
});
});
}
//没有可用资源放入月末(强占),待手工调整
if (bom.get() == null) {
tmp = (DateUtil.endOfMonth(DateUtil.parse(this., "yyyy/MM/dd")));
_ = tmp.getMAP().get(_);
Optional<> _ = _.get().values().stream().findAny();
this.(tmp,_,_.get(),);
}
}
});
}
protected void ( _, , tmp,double ){
bom.set(tmp);
tmp.(bom.getTzbh(), );
bom.set(_);
.(bom.getTzbh(), );
.put(bom.getTzbh(), _);
}
protected boolean (Constant. _,double ){
Integer cd = CD.get(_);
DateTime dateTime = DateUtil.offsetDay(this._, cd);
_ = (dateTime);
= _.getMAP().get(_);
AtomicBoolean =new AtomicBoolean(false);
try {
Optional<> _ = .();
_.ifPresent(tmp -> {
this.(_,,tmp,);
.set(true);
});
}catch (Exception e){
}
return .get();
}
protected boolean (Constant. _){
= this.();
= null;
if ( != null) {
= .getMAP().get(_);
}
if ( != null && .get().contains(bom.getTzbh())) {
bom.set();
Optional<> _ = .(bom.getTzbh());
_.ifPresent(bom::set);
return true;
}
return false;
}
protected () {
return .get(this.bom.getTzbh());
}
}

@ -0,0 +1,10 @@
package com.dsic.gj_erp.pc.service;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.dto.;
public interface extends Runnable {
(DmBom bom);
(DmBom bom);
}

@ -23,7 +23,7 @@ public class 排产 {
try {
semaphore.acquire();
_ = .of(from,to);
DataFactory.();
DataFactory.2();
}catch (Exception e){
e.printStackTrace();
}finally {
@ -32,24 +32,21 @@ public class 排产 {
}
semaphore.release();
}
}
private static of(@NotNull String from, @NotNull String to){
if (!from.equals(Manager.from)||!to.equals(Manager.to)){
= new ();
.from=from;
.to=to;
.complete=false;
.list=new ArrayList<>();
Manager.=;
Manager.from = from;
Manager.to = to;
DataFactory.();
DataFactory.();
DataFactory.();
DataFactory.();
}
= new ();
.from = from;
.to = to;
.complete = false;
.list = new ArrayList<>();
Manager. = ;
Manager.from = from;
Manager.to = to;
DataFactory.();
DataFactory.();
DataFactory.();
DataFactory.();
return Manager.;
}

Loading…
Cancel
Save