Merge remote-tracking branch 'origin/master'

master
xhj 6 months ago
commit 9fa85e2a5d

@ -178,9 +178,9 @@ public class DmDhqdpServiceImpl extends ServiceImpl<DmDhqdpMapper, DmDhqdp> impl
List<DmDhqdp> dmDhqdps = reader.read(1, 2, DmDhqdp.class); List<DmDhqdp> dmDhqdps = reader.read(1, 2, DmDhqdp.class);
String day = DateUtil.format(DateUtil.date(), "yyyy/MM/dd"); String day = DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
String user = (String) req.getAttribute("yhms"); String user = (String) req.getAttribute("yhms");
this.remove(new QueryWrapper<DmDhqdp>().eq("Dc_ch", dcch) this.remove(new QueryWrapper<DmDhqdp>().eq("Dc_ch", map.get("dcch"))
.eq("qdh", ddh) .eq("qdh", map.get("ddh"))
.eq("qc", qc)); .eq("qc", map.get("qc")));
dmDhqdps.stream().filter(item->StrUtil.isNotEmpty(item.getXh())&&!item.getXh().contains("合计")) dmDhqdps.stream().filter(item->StrUtil.isNotEmpty(item.getXh())&&!item.getXh().contains("合计"))
.forEach(l -> { .forEach(l -> {
l.setDcCh(map.get("dcch")); l.setDcCh(map.get("dcch"));

@ -16,8 +16,8 @@ import com.dsic.gj_erp.bean.jhgk.DmDhqdp;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx; import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmSygdxq; import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
import com.dsic.gj_erp.bean.jhgk.DmSygdxqOld; import com.dsic.gj_erp.bean.jhgk.DmSygdxqOld;
import com.dsic.gj_erp.exception.ServiceException;
import com.dsic.gj_erp.mapper.jhgk.DmSygdxqMapper; import com.dsic.gj_erp.mapper.jhgk.DmSygdxqMapper;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.service.jcsj.DmBomService; import com.dsic.gj_erp.service.jcsj.DmBomService;
import com.dsic.gj_erp.service.jcsj.DmCbxxpService; import com.dsic.gj_erp.service.jcsj.DmCbxxpService;
import com.dsic.gj_erp.service.jhgk.DmDhqdpService; import com.dsic.gj_erp.service.jhgk.DmDhqdpService;
@ -171,6 +171,7 @@ public class DmSygdxqServiceImpl extends ServiceImpl<DmSygdxqMapper, DmSygdxq> i
.eq(DmBom::getPl, xq.getDcPl()) .eq(DmBom::getPl, xq.getDcPl())
.eq(DmBom::getFd, xq.getDcFd()) .eq(DmBom::getFd, xq.getDcFd())
); );
bomList.forEach(item->item.setDcch(xq.getDcCh()));//系列船获取bom船号修正为当前船只
xq.setBomList(bomList); xq.setBomList(bomList);
}else{//bom不存在从订货清单获取数据 }else{//bom不存在从订货清单获取数据
List<DmDhqdp> list = dhqdpService.list(Wrappers.<DmDhqdp>lambdaQuery().eq(DmDhqdp::getDcCh, xq.getDcCh())); List<DmDhqdp> list = dhqdpService.list(Wrappers.<DmDhqdp>lambdaQuery().eq(DmDhqdp::getDcCh, xq.getDcCh()));
@ -178,49 +179,61 @@ public class DmSygdxqServiceImpl extends ServiceImpl<DmSygdxqMapper, DmSygdxq> i
List<DmBom> bomList=new ArrayList<>(); List<DmBom> bomList=new ArrayList<>();
collect.forEach(item->{ collect.forEach(item->{
int num = item.getSdzs().intValue(); if (item.getKdzlsl()==null){
for (int i=0;i<num;i++){ return;
DmBom bom = new DmBom(); }
bom.setDcch(dcch); String[] kdzlsls=item.getKdzlsl().split("/");
bom.setPl(pl);
bom.setWpcz(item.getWpxh());
bom.setWpgg(StrUtil.format("{}*{}*{}",item.getThickness(),item.getWidth(),item.getLength()));
Optional.ofNullable(item.getKdzlsl()).ifPresent(it->{ for (String kdzlsl:kdzlsls){
Optional.ofNullable(kdzlsl).ifPresent(it->{
String kd= String.valueOf(it.charAt(1)); String kd= String.valueOf(it.charAt(1));
String kw= String.valueOf(it.charAt(0)); String kw= String.valueOf(it.charAt(0));
String kw4= String.valueOf(it.charAt(2)); String kw4= String.valueOf(it.charAt(2));
String zl=String.valueOf(it.charAt(3)); String zl=String.valueOf(it.charAt(3));
switch (kd){ String sl=kdzlsl.split("=")[1];
case "1": try {
this.handlerFor1(bom,zl,kw,kw4); int slI = Integer.parseInt(sl);
break; for (int i=0;i<slI;i++){
case "2": DmBom bom = new DmBom();
this.handlerFor2(bom,zl,kw,kw4); bom.setDcch(dcch);
break; bom.setPl(pl);
case "3": bom.setWpcz(item.getWpxh());
this.handlerFor3(bom,zl,kw,kw4); bom.setWpgg(StrUtil.format("{}*{}*{}",item.getThickness(),item.getWidth(),item.getLength()));
break;
case "4": switch (kd){
this.handlerFor4(bom,zl,kw,kw4); case "1":
break; this.handlerFor1(bom,zl,kw,kw4);
case "7"://型材 break;
this.handlerFor7(bom,zl,kw,kw4); case "2":
break; this.handlerFor2(bom,zl,kw,kw4);
case "8"://光电 break;
this.handlerFor8(bom,zl,kw,kw4); case "3":
break; this.handlerFor3(bom,zl,kw,kw4);
} break;
case "4":
this.handlerFor4(bom,zl,kw,kw4);
break;
case "7"://型材
this.handlerFor7(bom,zl,kw,kw4);
break;
case "8"://光电
this.handlerFor8(bom,zl,kw,kw4);
break;
}
bomList.add(bom);
}
}catch (Exception ignored){}
}); });
bomList.add(bom);
} }
}); });
xq.setBomList(bomList); xq.setBomList(bomList);
}
if (ObjUtil.isEmpty(xq.getBomList())){
throw new ServiceException(10001,StrUtil.format("船只:{},批次{}无法从系列船或订货清单获取基础数据,请先核对数据后再次排产!",xq.getDcCh(),xq.getDcPl()));
} }
} }
} }
return xqWithBom; return xqWithBom;
} }

@ -49,11 +49,11 @@
bom.ljsl as bom_ljsl, bom.ljsl as bom_ljsl,
bom.fkgs as bom_fkgs, bom.fkgs as bom_fkgs,
bom.tlsl as bom_tlsl, bom.tlsl as bom_tlsl,
ROW_NUMBER() over(partition by bom.dcch,bom.pl,bom.tzbh order by bom.tzbh) rn ROW_NUMBER() over(partition by xq.dc_ch,xq.dc_pl,bom.tzbh order by bom.tzbh) rn
from from
dm_sygdxq xq left join dm_bom bom on bom.dcch = xq.DC_CH and bom.pl = xq.DC_PL and bom.fd = xq.DC_FD dm_sygdxq xq left join dm_bom bom on bom.dcch = xq.DC_CH and bom.pl = xq.DC_PL and bom.fd = xq.DC_FD
where where
xq.xzglxq between #{from} and #{to} and bom.type='b' xq.xzglxq between #{from} and #{to} and (bom.type='b' or isnull(bom.type,'')='')
<if test="dcch!=null and dcch!=''"> <if test="dcch!=null and dcch!=''">
and xq.DC_CH=#{dcch} and xq.DC_CH=#{dcch}
</if> </if>

Loading…
Cancel
Save