master
xhj 2 years ago
parent b1e5314c6a
commit 1da25624bd

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

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

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

Loading…
Cancel
Save