1.优化代码,优化逻辑

master
董哲奇 1 month ago
parent 308a197720
commit 336ff2e226

@ -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();

@ -351,7 +351,9 @@ public class ZyjhController {
ArrayList<DmYlInfo> updateYlList = new ArrayList<>();
ArrayList<MpDhsj> MpDhsjSaveList = new ArrayList<>();
ArrayList<DmYlInfo> addYlList=new ArrayList<>();
for (DmYdjh item : list) {
//当前使用余料时需要修正余料库信息
if ("Y".equalsIgnoreCase(item.getYlbs())){
List<DmYlInfo> ylList = ylInfoService.list(Wrappers.<DmYlInfo>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);

@ -182,34 +182,6 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
);
ljService.saveBatch(ljInfo);
//自动生成无摆放位置的预配盘原则
//2050401取消配盘原则自动生成功能,改为手动设置
// Map<String, List<DmYdjhLj>> 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.<DmYppyz>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;
}

Loading…
Cancel
Save