1.排产结果显示到页面

2.优化排产数据查询结果集结构
master
董哲奇 1 year ago
parent c5a65c1623
commit 6ba6bed2be

@ -16,19 +16,19 @@ import com.dsic.gj_erp.bean.jhgk.DmSygd;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx; import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmYdjhxf; import com.dsic.gj_erp.bean.jhgk.DmYdjhxf;
import com.dsic.gj_erp.handler.ComputePlan; import com.dsic.gj_erp.handler.ComputePlan;
import com.dsic.gj_erp.pc.Manager;
import com.dsic.gj_erp.pc.;
import com.dsic.gj_erp.service.jcsj.EmGcrlService; import com.dsic.gj_erp.service.jcsj.EmGcrlService;
import com.dsic.gj_erp.service.jcsj.EmSbcnpService; import com.dsic.gj_erp.service.jcsj.EmSbcnpService;
import com.dsic.gj_erp.service.jhgk.DmSygdMxService; import com.dsic.gj_erp.service.jhgk.DmSygdMxService;
import com.dsic.gj_erp.service.sy.SYService; import com.dsic.gj_erp.service.sy.SYService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
import java.util.concurrent.Semaphore;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -126,6 +126,49 @@ public class DmSygdMxController {
return service.sygdPC(); return service.sygdPC();
} }
private static Semaphore semaphore = new Semaphore(1);
@GetMapping("pc")
public ResultBean<?> pc(String from, String to){
try {
semaphore.acquire();
.execute(from,to);
} catch (InterruptedException e) {
throw new RuntimeException(e);
} finally {
semaphore.release();
}
return new ResultBean<>();
}
@GetMapping("sygdjh")
public ResultBean<?> (String from, String to) throws InterruptedException {
semaphore.acquire();
if (!StrUtil.isAllNotEmpty(from,to)){
semaphore.release();
return new ResultBean<>();
}
HashMap<Object, Object> map = new HashMap<>();
if (from.equals(Manager.from)&&to.equals(Manager.to)){
semaphore.release();
map.put("result",Manager.);
map.put("zy",Manager.);
return new ResultBean<>(map);
}
try {
.execute(from,to);
}finally {
semaphore.release();
}
map.put("result",Manager.);
map.put("zy",Manager.);
return new ResultBean<>(map);
}
@RequestMapping("/saveList") @RequestMapping("/saveList")
@AuthFunction @AuthFunction
public ResultBean saveList( @RequestBody List<DmSygdMx> list ){ public ResultBean saveList( @RequestBody List<DmSygdMx> list ){

@ -43,13 +43,13 @@ public interface Constant {
02(., "火焰02", "", 0.3, 11.5, 3.9, 0, 3.9), 02(., "火焰02", "", 0.3, 11.5, 3.9, 0, 3.9),
02(., "数控02", "", 1.4, 3.0, 0, 18.2, 18.2), 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", "", 2.0, 3.0, 10.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, 10.0, 13.0, 13.0),
01(., "曲加工01", "", 2.0, 3.0, 1.0, 13.0, 13.0), 01(., "曲加工01", "", 2.0, 3.0, 10.0, 13.0, 13.0),
01(., "打磨01", "", 2.0, 3.0, 1.0, 13.0, 13.0), 01(., "打磨01", "", 2.0, 3.0, 10.0, 13.0, 13.0),
01(.NULL, "未知01", "", 2.0, 3.0, 1.0, 13.0, 13.0), 01(.NULL, "未知01", "", 2.0, 3.0, 10.0, 13.0, 13.0),
; ;
public _; public _;
public String ; public String ;

@ -12,9 +12,12 @@ import com.dsic.gj_erp.bean.jcsj.EmGcrl;
import com.dsic.gj_erp.bean.jcsj.EmSbcnp; import com.dsic.gj_erp.bean.jcsj.EmSbcnp;
import com.dsic.gj_erp.bean.jcsj.EmSbjbb; import com.dsic.gj_erp.bean.jcsj.EmSbjbb;
import com.dsic.gj_erp.bean.jhgk.DmSygdxq; import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.data.;
import com.dsic.gj_erp.pc.dto.gx.*; import com.dsic.gj_erp.pc.dto.gx.*;
import com.dsic.gj_erp.pc.dto.sb.*; import com.dsic.gj_erp.pc.dto.sb.*;
import com.dsic.gj_erp.pc.dto.tlt.*; import com.dsic.gj_erp.pc.dto.tlt.*;
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.service.jcsj.EmGcrlService; import com.dsic.gj_erp.service.jcsj.EmGcrlService;
import com.dsic.gj_erp.service.jcsj.EmSbcnpService; import com.dsic.gj_erp.service.jcsj.EmSbcnpService;
@ -37,8 +40,9 @@ public class DataFactory {
public static void 2() { public static void 2() {
.clear(); .clear();
List<DmSygdxq> = getBean(DmSygdxqService.class).getXqWithBom(from, to); List<> list=();
.forEach( -> {
list.forEach( -> {
CountDownLatch latch = new CountDownLatch(.getBomList().size()); CountDownLatch latch = new CountDownLatch(.getBomList().size());
.getBomList().forEach(bom -> { .getBomList().forEach(bom -> {
_ = (bom); _ = (bom);
@ -56,25 +60,29 @@ public class DataFactory {
} }
}); });
try { try {
latch.await(10, TimeUnit.SECONDS); // 指定超时时间 latch.await(10, TimeUnit.SECONDS);// 指定超时时间
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
}); });
//========调试打印=========== //清理冗余数据
.forEach((day, item) -> { list.forEach(->{
System.out.println("====打印资源==="); .getBomList().forEach(bom -> {
System.out.println(day); if (bom.get()!=null){
Map<Constant., > MAP = item.getMAP(); bom.set(null);
MAP.forEach((, ) -> { }
if (.get().size() > 0) { if (bom.get()!=null){
System.out.println("工序:" + ); bom.set(null);
System.out.println("工序产能:" + .get().size());
} }
}); });
System.out.println("====打印资源完成===");
}); });
//========调试打印结束=========== }
public static List<> (){
List<> list=new ArrayList<>();
List<DmSygdxq> = getBean(DmSygdxqService.class).getXqWithBom(from, to);
.forEach(item-> list.add(.of(item)));
return list;
} }
public static void () { public static void () {
@ -83,6 +91,7 @@ public class DataFactory {
List<DmBom> = new ArrayList<>(); List<DmBom> = new ArrayList<>();
list.clear(); list.clear();
List<DmSygdxq> = getBean(DmSygdxqService.class).getXqWithBom(from, to); List<DmSygdxq> = getBean(DmSygdxqService.class).getXqWithBom(from, to);
.forEach( -> { .forEach( -> {
.getBomList().forEach(bom -> { .getBomList().forEach(bom -> {
Arrays.stream(Constant..values()).forEach(gx -> { Arrays.stream(Constant..values()).forEach(gx -> {
@ -156,6 +165,7 @@ public class DataFactory {
}); });
}); });
}); });
// Manager.排产结果=按需求日期排序的钢料需求;
//========调试打印=========== //========调试打印===========
.forEach((day,item)->{ .forEach((day,item)->{
System.out.println("====打印资源==="); System.out.println("====打印资源===");
@ -209,7 +219,7 @@ public class DataFactory {
}); });
} }
public static (DmBom bom) { public static (Bom bom) {
switch (bom.getKw() + bom.getZl()) { switch (bom.getKw() + bom.getZl()) {
case "51010": case "51010":
return new T().(bom); return new T().(bom);

@ -2,7 +2,7 @@ package com.dsic.gj_erp.pc;
import com.dsic.gj_erp.bean.jcsj.EmGcrl; import com.dsic.gj_erp.bean.jcsj.EmGcrl;
import com.dsic.gj_erp.bean.jcsj.EmSbjbb; import com.dsic.gj_erp.bean.jcsj.EmSbjbb;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.data.;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import java.util.ArrayList; import java.util.ArrayList;
@ -24,6 +24,8 @@ public class Manager {
public static final ExecutorService es; public static final ExecutorService es;
public static List<> ;
static { static {
int poolSize =Runtime.getRuntime().availableProcessors() * 2; int poolSize =Runtime.getRuntime().availableProcessors() * 2;
// BlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(512); // BlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(512);

@ -0,0 +1,39 @@
package com.dsic.gj_erp.pc.dto.data;
import cn.hutool.core.bean.BeanUtil;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.pc.dto.;
import com.dsic.gj_erp.pc.dto.;
import lombok.Getter;
import lombok.Setter;
import java.util.Map;
@Getter
@Setter
public class Bom {
private String dcch;
private String pl;
private String fd;
private String xzglxq;
private String dzglxq;
private String zl;
private String kw;
private String tzbh;
private String wpgg;
private String wpcz;
private String ljsl;
private Map<String,String> degs;
private ;
private ;
public static Bom of(String xzxq, String dzxq, DmBom bom){
Bom _bom = new Bom();
BeanUtil.copyProperties(bom,_bom);
_bom.xzglxq=xzxq;
_bom.dzglxq=dzxq;
return _bom;
}
}

@ -0,0 +1,27 @@
package com.dsic.gj_erp.pc.dto.data;
import cn.hutool.core.bean.BeanUtil;
import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.stream.Collectors;
@Getter
@Setter
public class {
private String dcCh;
private String dcPl;
private String dcFd;
private String xzglxq;
private String dzglxq;
private List<Bom> bomList;
public static of(DmSygdxq qfxq){
_ = new ();
BeanUtil.copyProperties(qfxq,_,"bomList");
_.bomList=qfxq.getBomList().stream().map(item->Bom.of(_.getXzglxq(),_.getDzglxq(),item)).collect(Collectors.toList());
return _;
}
}

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "7"; this.kw = "7";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -21,7 +21,7 @@ public class 一跨平直大板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "7"; this.kw = "7";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,17 +1,17 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class 线 extends { public class 线 extends {
public 线 (DmBom bom) { public 线 (Bom bom) {
return null; return null;
} }
public 线 (DmBom bom) { public 线 (Bom bom) {
this.kw = "8"; this.kw = "8";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "16"; this.kw = "16";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -24,7 +24,7 @@ public class 七跨型板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "16"; this.kw = "16";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "14"; this.kw = "14";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -21,7 +21,7 @@ public class 三跨厚板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "14"; this.kw = "14";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "6"; this.kw = "6";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -24,7 +24,7 @@ public class 三跨平铁 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "6"; this.kw = "6";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;
@ -41,7 +41,7 @@ public class 三跨平铁 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "6"; this.kw = "6";
this.zl = "4230"; this.zl = "4230";
this. = ImmutableList.<Constant.>builder() this. = ImmutableList.<Constant.>builder()

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "13"; this.kw = "13";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -15,7 +15,7 @@ public class 三跨曲板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "13"; this.kw = "13";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class T extends { public class T extends {
public T (DmBom bom) { public T (Bom bom) {
this.kw = "11"; this.kw = "11";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -15,7 +15,7 @@ public class 二跨T型材腹板 extends 套料图工序 {
return this; return this;
} }
public T (DmBom bom) { public T (Bom bom) {
this.kw = "11"; this.kw = "11";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class T extends { public class T extends {
public T (DmBom bom) { public T (Bom bom) {
this.kw = "5"; this.kw = "5";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -15,7 +15,7 @@ public class 二跨T型材面板 extends 套料图工序 {
return this; return this;
} }
public T (DmBom bom) { public T (Bom bom) {
this.kw = "5"; this.kw = "5";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "12"; this.kw = "12";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -21,7 +21,7 @@ public class 二跨激光切割板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "12"; this.kw = "12";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "10"; this.kw = "10";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -22,7 +22,7 @@ public class 二跨超长超宽曲板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
_ = new (); _ = new ();
_.kw = "10"; _.kw = "10";
_.zl = "1110"; _.zl = "1110";

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "9"; this.kw = "9";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -15,7 +15,7 @@ public class 二跨超长超宽板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "9"; this.kw = "9";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "17"; this.kw = "17";
this.zl = "1120"; this.zl = "1120";
this.bom = bom; this.bom = bom;
@ -22,7 +22,7 @@ public class 光电 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
return null; return null;
} }

@ -1,13 +1,13 @@
package com.dsic.gj_erp.pc.dto.tlt; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.; import com.dsic.gj_erp.pc.dto.;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class extends { public class extends {
public (DmBom bom) { public (Bom bom) {
this.kw = "15"; this.kw = "15";
this.zl = "1010"; this.zl = "1010";
this.bom = bom; this.bom = bom;
@ -15,7 +15,7 @@ public class 四跨普通板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "15"; this.kw = "15";
this.zl = "1110"; this.zl = "1110";
this.bom = bom; this.bom = bom;
@ -23,7 +23,7 @@ public class 四跨普通板 extends 套料图工序 {
return this; return this;
} }
public (DmBom bom) { public (Bom bom) {
this.kw = "15"; this.kw = "15";
this.zl = "4230"; this.zl = "4230";
this.bom = bom; this.bom = bom;

@ -4,8 +4,9 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil; 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.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.data.;
import com.dsic.gj_erp.pc.service.; import com.dsic.gj_erp.pc.service.;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -26,7 +27,8 @@ import static com.dsic.gj_erp.pc.Manager.套料图所占工序的资源;
public abstract class implements { public abstract class implements {
protected String kw; protected String kw;
protected String zl; protected String zl;
protected DmBom bom; protected _;
protected Bom bom;
protected String ; protected String ;
protected Date _; protected Date _;
protected List<Constant.> ; protected List<Constant.> ;
@ -40,48 +42,31 @@ public abstract class 套料图工序 implements 套料图工序接口 {
double = 1; double = 1;
this..forEach(_ -> { this..forEach(_ -> {
if (!this.(_)&&!this.(_,)){ if (!this.(_)&&!this.(_,)){
if (bom.get() == null) { if (bom.get() == null) {
Optional<> = (_, DateUtil.parse(from, "yyyy/MM/dd"), this._, ); Optional<> = (_, DateUtil.parse(from, "yyyy/MM/dd"), this._, );
.ifPresent(tmp -> { .ifPresent(_ -> {
_ = tmp.getMAP().get(_); _.(_,this.bom,);
Optional<> _ = _.(0);
_.ifPresent(tmp -> {
this.(tmp,_,tmp,);
});
}); });
} }
//没有可用资源放入月末(强占),待手工调整 //没有可用资源放入月末(强占),待手工调整
if (bom.get() == null) { if (bom.get() == null) {
tmp = (DateUtil.endOfMonth(DateUtil.parse(this., "yyyy/MM/dd"))); _ = (DateUtil.endOfMonth(DateUtil.parse(this., "yyyy/MM/dd")));
_ = tmp.getMAP().get(_); _.(_,this.bom,);
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 ){ protected boolean (Constant. _,double ){
Integer cd = CD.get(_); Integer cd = CD.get(_);
DateTime dateTime = DateUtil.offsetDay(this._, cd); DateTime dateTime = DateUtil.offsetDay(this._, cd);
_ = (dateTime); _ = (dateTime);
= _.getMAP().get(_);
AtomicBoolean =new AtomicBoolean(false); AtomicBoolean =new AtomicBoolean(false);
try { try {
Optional<> _ = .(); _.(_,this.bom,);
_.ifPresent(tmp -> { this.bom.set(_);
this.(_,,tmp,);
.set(true); .set(true);
});
}catch (Exception e){ }catch (Exception e){
} }
@ -108,4 +93,9 @@ public abstract class 套料图工序 implements 套料图工序接口 {
return .get(this.bom.getTzbh()); return .get(this.bom.getTzbh());
} }
@Override
public ( _) {
this._=_;
return this;
}
} }

@ -1,6 +1,7 @@
package com.dsic.gj_erp.pc.dto; package com.dsic.gj_erp.pc.dto;
import com.dsic.gj_erp.pc.Constant; import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.service.; import com.dsic.gj_erp.pc.service.;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -9,6 +10,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.ConcurrentLinkedDeque;
@Getter @Getter
@Setter @Setter
@ -21,7 +23,7 @@ public abstract class 工序产能 implements 工序排产处理接口 {
protected int cd; protected int cd;
protected Constant. CD;//需要根据对应工序进行计算cd protected Constant. CD;//需要根据对应工序进行计算cd
protected Map<String,> ; protected Map<String,> ;
protected List<String> ; protected ConcurrentLinkedDeque<String> ;
/** /**
* *
@ -34,7 +36,7 @@ public abstract class 工序产能 implements 工序排产处理接口 {
this.=0; this.=0;
this.(); this.();
this.cd=Constant.CD.get(); this.cd=Constant.CD.get();
=new ArrayList<>(); =new ConcurrentLinkedDeque<>();
} }
public (Constant. , Map<String,> ,double ,double ){ public (Constant. , Map<String,> ,double ,double ){
@ -45,7 +47,7 @@ public abstract class 工序产能 implements 工序排产处理接口 {
this.=0; this.=0;
this.(); this.();
this.cd=Constant.CD.get(); this.cd=Constant.CD.get();
=new ArrayList<>(); this.=new ConcurrentLinkedDeque<>();
} }
private void (){ private void (){
@ -89,4 +91,19 @@ public abstract class 工序产能 implements 工序排产处理接口 {
this..add(); this..add();
} }
public void (String ,double , Bom bom){
Optional<> = this.();
.ifPresent(it->{
it.();
it.(bom);
});
}
public void (String ,double , Bom bom){
Optional<> _ = this..values().stream().findAny();
_.ifPresent(it->{
it.();
it.(bom);
});
}
} }

@ -1,12 +1,12 @@
package com.dsic.gj_erp.pc.dto; package com.dsic.gj_erp.pc.dto;
import com.dsic.gj_erp.pc.Constant; import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.service.; import com.dsic.gj_erp.pc.service.;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.util.ArrayList; import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.List;
@Getter @Getter
@Setter @Setter
@ -17,7 +17,8 @@ public abstract class 设备 implements 设备接口 {
protected double ; protected double ;
protected double ; protected double ;
protected volatile double =0.0; protected volatile double =0.0;
protected List<String> ; protected ConcurrentLinkedDeque<String> ;
protected ConcurrentLinkedDeque<Bom> ;
@Override @Override
public void (double , double ) { public void (double , double ) {
@ -39,12 +40,19 @@ public abstract class 设备 implements 设备接口 {
this..add(); this..add();
} }
@Override
public void (Bom bom) {
this..add(bom.getTzbh());
this..add(bom);
}
public (Constant. _){ public (Constant. _){
this.= _.; this.= _.;
this.= _.; this.= _.;
this.= _.; this.= _.;
this.= _.; this.= _.;
this.=new ArrayList<>(); this.=new ConcurrentLinkedDeque<>();
this.=new ConcurrentLinkedDeque<>();
} }
} }

@ -1,6 +1,7 @@
package com.dsic.gj_erp.pc.dto; package com.dsic.gj_erp.pc.dto;
import com.dsic.gj_erp.pc.Constant; import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -18,10 +19,33 @@ public class 资源 {
Optional.of().ifPresent(it->{ Optional.of().ifPresent(it->{
if (it.()){ if (it.()){
it.(,); it.(,);
();
} }
}); });
} }
public void (Constant. , Bom bom, double ){
= MAP.get();
Optional.of().ifPresent(it->{
if (it.()){
it.(,bom);
(bom.getTzbh());
}
});
}
public void (Constant. ,Bom bom,double ){
= MAP.get();
Optional.of().ifPresent(it->{
it.(,bom);
(bom.getTzbh());
});
}
protected void (String ) {
//套料图所占工序的资源.put(套料图号,this);
}
public static of(String date,Map<Constant.,> MAP){ public static of(String date,Map<Constant.,> MAP){
= new (); = new ();
.date=date; .date=date;

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

@ -1,5 +1,7 @@
package com.dsic.gj_erp.pc.service; package com.dsic.gj_erp.pc.service;
import com.dsic.gj_erp.pc.dto.data.Bom;
public interface { public interface {
void (double ,double ); void (double ,double );
@ -9,9 +11,30 @@ public interface 工序排产处理接口 {
(); ();
} }
default void (String ,double , Bom bom){
();
();
(,,bom);
}
default void (double , Bom bom){
();
(bom.getTzbh());
(bom.getTzbh(),,bom);
}
default void (double , Bom bom){
();
(bom.getTzbh());
(bom.getTzbh(),,bom);
}
void (); void ();
void (double ); void (double );
void (String ); void (String );
void (String , double , Bom bom);
void (String ,double , Bom bom);
} }

@ -1,5 +1,7 @@
package com.dsic.gj_erp.pc.service; package com.dsic.gj_erp.pc.service;
import com.dsic.gj_erp.pc.dto.data.Bom;
public interface { public interface {
void (double ,double ); void (double ,double );
@ -8,7 +10,14 @@ public interface 设备接口 {
(); ();
} }
default void (Bom bom, double ){
();
(bom);
}
void (double ); void (double );
void (String ); void (String );
void (Bom bom);
} }

@ -7,7 +7,6 @@ import lombok.Setter;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.Semaphore;
@Getter @Getter
@Setter @Setter
@ -16,12 +15,10 @@ public class 排产 {
private String to; private String to;
private boolean complete; private boolean complete;
List<> list; List<> list;
private static Semaphore semaphore = new Semaphore(1);
public static void execute(@NotNull String from, @NotNull String to) { public static void execute(@NotNull String from, @NotNull String to) {
_=null; _=null;
try { try {
semaphore.acquire();
_ = .of(from,to); _ = .of(from,to);
DataFactory.2(); DataFactory.2();
}catch (Exception e){ }catch (Exception e){
@ -30,7 +27,6 @@ public class 排产 {
if (_!=null){ if (_!=null){
_.complete = true; _.complete = true;
} }
semaphore.release();
} }
} }

Loading…
Cancel
Save