diff --git a/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYlInfo.java b/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYlInfo.java index 76f394f..e72e4d4 100644 --- a/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYlInfo.java +++ b/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYlInfo.java @@ -109,7 +109,9 @@ public class DmYlInfo { } dmYlInfo.炉批号= ydjh.getSllph(); - dmYlInfo.重量=ydjh.getBcylzl().toString(); + if (ydjh.getBcylzl()!=null){ + dmYlInfo.重量=ydjh.getBcylzl().toString(); + } dmYlInfo.来源船号=ydjh.getDcCh(); dmYlInfo.来源批量=ydjh.getDcPl(); dmYlInfo.来源图纸=ydjh.getTzbh(); diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java index 770482c..e7930e2 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java @@ -351,7 +351,9 @@ public class ZyjhController { ArrayList updateYlList = new ArrayList<>(); ArrayList MpDhsjSaveList = new ArrayList<>(); + ArrayList addYlList=new ArrayList<>(); for (DmYdjh item : list) { + //当前使用余料时需要修正余料库信息 if ("Y".equalsIgnoreCase(item.getYlbs())){ List ylList = ylInfoService.list(Wrappers.lambdaQuery() .eq(DmYlInfo::get使用船号, item.getDcCh()) @@ -378,7 +380,7 @@ public class ZyjhController { .filter(it -> StrUtil.isNotEmpty(it.getYlbh())) .map(it -> DmYlInfo.of(it,item)) .collect(Collectors.toList()); - ylInfoService.saveBatch(ylList); + addYlList.addAll(ylList); }catch (Exception e){ e.printStackTrace(); } @@ -412,10 +414,15 @@ public class ZyjhController { MpDhsjSaveList.add(mpDhsj); } } -// mpDhsjServcie.saveBatch(collect); } + mpDhsjServcie.saveBatch(MpDhsjSaveList); - ylInfoService.updateBatchById(updateYlList); + if (ObjUtil.isNotEmpty(updateYlList)){ + ylInfoService.updateBatchById(updateYlList); + } + if (ObjUtil.isNotEmpty(addYlList)){ + ylInfoService.saveBatch(addYlList); + } } zyjhService.updateBatchById(list); diff --git a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java index 54fbe53..5dda61d 100644 --- a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java +++ b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java @@ -182,34 +182,6 @@ public class ZyjhService extends ServiceImpl { ); ljService.saveBatch(ljInfo); - //自动生成无摆放位置的预配盘原则 - //2050401取消配盘原则自动生成功能,改为手动设置 -// Map> collect = ljInfo.stream() -// .collect(Collectors -// .groupingBy(item -> -// item.getCzbh() + " " -// + item.getPl() + " " -// + item.getFd() + " " -// + item.getZl() + " " -// + (StrUtil.isNotEmpty(item.getLx())?item.getLx():"") -// )); -// -// collect.keySet().forEach(item -> { -// DmYppyz dmYppyz = DmYppyz.of(item); -// if (dmYppyz!=null){ -// int count = yppyzService.count(Wrappers.lambdaQuery() -// .eq(DmYppyz::getDcCh, dmYppyz.getDcCh()) -// .eq(DmYppyz::getDcPl, dmYppyz.getDcPl()) -// .eq(DmYppyz::getDcFd, dmYppyz.getDcFd()) -// .eq(DmYppyz::getZl, dmYppyz.getZl()) -// .eq(StrUtil.isNotEmpty(dmYppyz.getLx()),DmYppyz::getLx, dmYppyz.getLx()) -// ); -// if (count==0){ -// yppyzService.save(dmYppyz); -// } -// } -// }); - return ljInfo; }