master
xhj 2 years ago
parent b1e5314c6a
commit 1da25624bd

@ -1405,132 +1405,139 @@ public class BomUploadServiceImpl {
Comparator.comparing(
tc -> tc.getTjb().getWpgg() + ";" + tc.getTjb().getWpxh() + ";" + tc.getTjb().getTzbh()))), ArrayList::new));
collect.forEach(i -> {
DmBchxylp e = i.getTjb();
if (StringUtils.isNotBlank(e.getWpgg())) {
DmBom dmBom = new DmBom();
dmBom.setCs(2);
// dmBom.setQgcd(e.getYlzd4Z());
//dmBom.setHxcd(e.getHxcdZ());
dmBom.setTzbh(e.getTzbh());
// dmBom.setTlsl(e.getSl());
//dmBom.setLjbh(e.getWph());
//dmBom.setLjsl(e.getLjslZ());
dmBom.setDcch(e.getDcCh());
dmBom.setPl(e.getDcPl());
//dmBom.setFd(e.getWph().substring(0,4));
dmBom.setSjch(e.getDcCh());
dmBom.setWpcz(e.getWpxh());
dmBom.setWpgg(e.getWpgg());
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpgg().split("\\*")[0]);
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpgg());
dmBom.setBh(new BigDecimal(e.getWpgg().split("\\*")[0]));
dmBom.setBc(new BigDecimal(e.getWpgg().split("\\*")[2]));
String tzbh = e.getTzbh();
String hxlx = "";
// 根据图纸编号获取 手工,数控 跨位,组立,、
if (tzbh.substring(4, 5).equals("S")) {
hxlx = "1010";
} else if (tzbh.substring(4, 5).equals("N")) {
hxlx = "1020";
}
// 跨位
String s = kwxxMap.get(tzbh.substring(4, 7));
String zl = this.getZL(tzbh);
String zlbm = zllbMap.get(zl);
String zzcj = qgKwMap.get(s);
dmBom.setZl(zlbm);
dmBom.setKw(zzcj);
dmBom.setLqlb(hxlx);
// 领取表找打 fds
if (e.getHxfl().equals("B")) {
dmBom.setType("B");
List<BomVO> collect11 = list.stream().filter(fst -> null!= fst.getBclq() &&fst.getBclq().getWpgg().equals(e.getWpgg()) &&
fst.getBclq().getWpxh().equals(e.getWpxh()) && fst.getBclq().getDcPlZ().equals(e.getDcPl())
).collect(Collectors.toList());
if (collect11.size() > 0) {
dmBom.setFds(collect11.get(0).getBclq().getDcFdZ());
if(null !=i.getTjb()){
DmBchxylp e = i.getTjb();
if (StringUtils.isNotBlank(e.getWpgg())) {
DmBom dmBom = new DmBom();
dmBom.setCs(2);
// dmBom.setQgcd(e.getYlzd4Z());
//dmBom.setHxcd(e.getHxcdZ());
dmBom.setTzbh(e.getTzbh());
// dmBom.setTlsl(e.getSl());
//dmBom.setLjbh(e.getWph());
//dmBom.setLjsl(e.getLjslZ());
dmBom.setDcch(e.getDcCh());
dmBom.setPl(e.getDcPl());
//dmBom.setFd(e.getWph().substring(0,4));
dmBom.setSjch(e.getDcCh());
dmBom.setWpcz(e.getWpxh());
dmBom.setWpgg(e.getWpgg());
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpgg().split("\\*")[0]);
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpgg());
dmBom.setBh(new BigDecimal(e.getWpgg().split("\\*")[0]));
dmBom.setBc(new BigDecimal(e.getWpgg().split("\\*")[2]));
String tzbh = e.getTzbh();
String hxlx = "";
// 根据图纸编号获取 手工,数控 跨位,组立,、
if (tzbh.substring(4, 5).equals("S")) {
hxlx = "1010";
} else if (tzbh.substring(4, 5).equals("N")) {
hxlx = "1020";
}
} else {
// 跨位
String s = kwxxMap.get(tzbh.substring(4, 7));
String zl = this.getZL(tzbh);
String zlbm = zllbMap.get(zl);
String zzcj = qgKwMap.get(s);
dmBom.setZl(zlbm);
dmBom.setKw(zzcj);
dmBom.setLqlb(hxlx);
// 领取表找打 fds
if (e.getHxfl().equals("B")) {
dmBom.setType("B");
List<BomVO> collect11 = list.stream().filter(fst -> null!= fst.getBclq() &&fst.getBclq().getWpgg().equals(e.getWpgg()) &&
fst.getBclq().getWpxh().equals(e.getWpxh()) && fst.getBclq().getDcPlZ().equals(e.getDcPl())
).collect(Collectors.toList());
if (collect11.size() > 0) {
dmBom.setFds(collect11.get(0).getBclq().getDcFdZ());
}
} else {
BigDecimal cd=e.getXccd().divide(new BigDecimal("1000"));
List<BomVO> collect11 = list.stream().filter(fst -> null!= fst.getBclq() && fst.getBclq().getWpxh().equals(e.getWpgg()) &&
fst.getBclq().getWpgg().equals(e.getWpxh()) && fst.getBclq().getDcPlZ().equals(e.getDcPl()) && fst.getBclq().getYlzd11().compareTo(cd)==0
).collect(Collectors.toList());
if (collect11.size() > 0) {
dmBom.setFds(collect11.get(0).getBclq().getDcFdZ());
dmBom.setXcgs(collect11.get(0).getBclq().getSl());
dmBom.setXcshms(collect11.get(0).getBclq().getShms());
BigDecimal cd=e.getXccd().divide(new BigDecimal("1000"));
List<BomVO> collect11 = list.stream().filter(fst -> null!= fst.getBclq() && fst.getBclq().getWpxh().equals(e.getWpgg()) &&
fst.getBclq().getWpgg().equals(e.getWpxh()) && fst.getBclq().getDcPlZ().equals(e.getDcPl()) && fst.getBclq().getYlzd11().compareTo(cd)==0
).collect(Collectors.toList());
if (collect11.size() > 0) {
dmBom.setFds(collect11.get(0).getBclq().getDcFdZ());
dmBom.setXcgs(collect11.get(0).getBclq().getSl());
dmBom.setXcshms(collect11.get(0).getBclq().getShms());
}
dmBom.setType("X");
}
dmBom.setType("X");
adds.add(dmBom);
}
adds.add(dmBom);
}
});
} else {
list.forEach(i -> {
DmBchxmxp e = i.getTlt();
if (StringUtils.isNotBlank(e.getWpggZ())) {
DmBom dmBom = new DmBom();
dmBom.setCs(3);
dmBom.setQgcd(e.getYlzd4Z());
dmBom.setHxcd(e.getHxcdZ());
dmBom.setTzbh(e.getTzbhZ());
dmBom.setTlsl(e.getSl());
dmBom.setLjbh(e.getWph());
dmBom.setLjsl(e.getLjslZ());
dmBom.setDcch(e.getDcChZ());
dmBom.setPl(e.getDcPlZ());
dmBom.setFd(e.getWph().substring(0, 4));
dmBom.setSjch(e.getDcChZ());
dmBom.setWpcz(e.getWpxhZ());
dmBom.setWpgg(e.getWpggZ());
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpggZ().split("\\*")[0]);
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpggZ());
dmBom.setBh(new BigDecimal(e.getWpggZ().split("\\*")[0]));
dmBom.setBc(new BigDecimal(e.getWpggZ().split("\\*")[2]));
String tzbh = e.getTzbhZ();
String hxlx = "";
// 根据图纸编号获取 手工,数控 跨位,组立,、
if (tzbh.substring(4, 5).equals("S")) {
hxlx = "1010";
} else if (tzbh.substring(4, 5).equals("N")) {
hxlx = "1020";
}
// 跨位
System.out.println("tzbh = " + tzbh);
String s = kwxxMap.get(tzbh.substring(4, 7));
String zl = this.getZL(tzbh);
String zlbm = zllbMap.get(zl);
String zzcj = qgKwMap.get(s);
dmBom.setZl(zlbm);
dmBom.setKw(zzcj);
dmBom.setLqlb(hxlx);
dmBom.setLqbs("Y");
if(tzbh.substring(4, 5).equals("X")){ // 型材
// 先去 统计表中查找
if(null!= i.getTlt()){
DmBchxmxp e = i.getTlt();
if (StringUtils.isNotBlank(e.getWpggZ())) {
DmBom dmBom = new DmBom();
dmBom.setCs(3);
dmBom.setQgcd(e.getYlzd4Z());
dmBom.setHxcd(e.getHxcdZ());
dmBom.setTzbh(e.getTzbhZ());
dmBom.setTlsl(e.getSl());
dmBom.setLjbh(e.getWph());
dmBom.setLjsl(e.getLjslZ());
dmBom.setDcch(e.getDcChZ());
dmBom.setPl(e.getDcPlZ());
dmBom.setFd(e.getWph().substring(0, 4));
dmBom.setSjch(e.getDcChZ());
dmBom.setWpcz(e.getWpxhZ());
dmBom.setWpgg(e.getWpggZ());
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpggZ().split("\\*")[0]);
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpggZ());
dmBom.setBh(new BigDecimal(e.getWpggZ().split("\\*")[0]));
dmBom.setBc(new BigDecimal(e.getWpggZ().split("\\*")[2]));
String tzbh = e.getTzbhZ();
String hxlx = "";
// 根据图纸编号获取 手工,数控 跨位,组立,、
if (tzbh.substring(4, 5).equals("S")) {
hxlx = "1010";
} else if (tzbh.substring(4, 5).equals("N")) {
hxlx = "1020";
}
// 跨位
System.out.println("tzbh = " + tzbh);
String s = kwxxMap.get(tzbh.substring(4, 7));
String zl = this.getZL(tzbh);
String zlbm = zllbMap.get(zl);
String zzcj = qgKwMap.get(s);
dmBom.setZl(zlbm);
dmBom.setKw(zzcj);
dmBom.setLqlb(hxlx);
dmBom.setLqbs("Y");
if(tzbh.substring(4, 5).equals("X")){ // 型材
// 先去 统计表中查找
// List<BomVO> collect11 = list.stream().filter(fst -> null!= fst.getTjb() && fst.getTjb().getWpxh().equals(e.getWpxhZ()) &&
// fst.getTjb().getWpgg().equals(e.getWpggZ()) && fst.getTjb().getDcPl().equals(e.getDcPlZ())
// ).collect(Collectors.toList());
List<BomVO> collect11 = list.stream().filter(fst -> null!= fst.getTjb() && tzbh.equals(fst.getTjb().getTzbh())
).collect(Collectors.toList());
// 找到长度
List<BomVO> collect11 = list.stream().filter(fst -> null!= fst.getTjb() && tzbh.equals(fst.getTjb().getTzbh())
).collect(Collectors.toList());
// 找到长度
BigDecimal cd=collect11.get(0).getTjb().getXccd().divide(new BigDecimal("1000"));
List<BomVO> collect111 = list.stream().filter(fst -> null!= fst.getBclq() && fst.getBclq().getWpgg().equals(e.getWpxhZ()) &&
fst.getBclq().getWpxh().equals(e.getWpggZ()) && fst.getBclq().getDcPlZ().equals(e.getDcPlZ()) && fst.getBclq().getYlzd11().compareTo(cd)==0
).collect(Collectors.toList());
if (collect111.size() > 0) {
List<BomVO> collect111 = list.stream().filter(fst -> null!= fst.getBclq() && fst.getBclq().getWpgg().equals(e.getWpxhZ()) &&
fst.getBclq().getWpxh().equals(e.getWpggZ()) && fst.getBclq().getDcPlZ().equals(e.getDcPlZ()) && fst.getBclq().getYlzd11().compareTo(cd)==0
).collect(Collectors.toList());
if (collect111.size() > 0) {
// dmBom.setFds(collect11.get(0).getBclq().getDcFdZ());
dmBom.setXcgs(collect111.get(0).getBclq().getSl());
dmBom.setXcshms(collect111.get(0).getBclq().getShms());
dmBom.setXcgs(collect111.get(0).getBclq().getSl());
dmBom.setXcshms(collect111.get(0).getBclq().getShms());
}
dmBom.setType("X");
}else {
dmBom.setType("B");
}
dmBom.setType("X");
}else {
dmBom.setType("B");
}
adds.add(dmBom);
adds.add(dmBom);
}
}
});
}
dmBomService.insertBoms(adds);

@ -62,8 +62,9 @@ public class DmBomServiceImpl extends ServiceImpl<DmBomMapper, DmBom> implements
// }else{
List<DmBom> list = this.list(new QueryWrapper<DmBom>().eq("dcch", map.get("dcch"))
.eq(StrUtil.isNotEmpty((String) map.get("fd")), "fd", map.get("dcfd"))
.eq(StrUtil.isNotEmpty((String) map.get("pl")), "fd", map.get("dcpl"))
.eq(StrUtil.isNotEmpty((String) map.get("dcpl")), "pl", map.get("dcpl"))
.eq(StrUtil.isNotEmpty((String) map.get("zt")), "zt", map.get("zt"))
.orderBy(true,true,"pl","fd")
);
return list;
// }

@ -116,7 +116,9 @@
<if test=" zzcj!=null and zzcj!=''">
and DM_BCLQJBP.zzcj=#{zzcj}
</if>
<if test=" dcfd!=null and dcfd!=''">
and DM_BCLQMXP.DC_FD like'%'+#{dcfd}+'%'
</if>
<if test=" delx!=null and delx!=''">
and DM_BCLQJBP.DELX=#{delx}

Loading…
Cancel
Save