he wei
2022-08-11 774e1e7283ce4bc5d4e8166806cc7a6f117adf39
'仲培调试'
1个文件已修改
40 ■■■■■ 已修改文件
src/main/java/com/whyc/service/WorksheetLinkService.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorksheetLinkService.java
@@ -309,14 +309,16 @@
                                nowHistoryList.remove(nowHistory);
                            }
                        });*/
                        Iterator<ComponentProductHistory> iterator = nowHistoryList.iterator();
                        while (iterator.hasNext()){
                            ComponentProductHistory next = iterator.next();
                            if(replace.getComponentId().intValue() == next.getComponentId()
                                && replace.getSubName().equals(next.getSubName())
                            ){
                                iterator.remove();
                                break;
                        if(nowHistoryList.size()!=0) {
                            Iterator<ComponentProductHistory> iterator = nowHistoryList.iterator();
                            while (iterator.hasNext()) {
                                ComponentProductHistory next = iterator.next();
                                if (replace.getComponentId().intValue() == next.getComponentId()
                                        && replace.getSubName().equals(next.getSubName())
                                ) {
                                    iterator.remove();
                                    break;
                                }
                            }
                        }
                        //下个版本新增替换的散装件-产品列表
@@ -352,14 +354,16 @@
                            nowHistoryList.remove(nowHistory);
                        }
                    });*/
                    Iterator<ComponentProductHistory> iterator = nowHistoryList.iterator();
                    while (iterator.hasNext()){
                        ComponentProductHistory next = iterator.next();
                        if(add.getComponentId().intValue() == next.getComponentId()
                            && add.getSubName().equals(next.getSubName())
                        ){
                            iterator.remove();
                            break;
                    if(nowHistoryList.size()!=0) {
                        Iterator<ComponentProductHistory> iterator = nowHistoryList.iterator();
                        while (iterator.hasNext()) {
                            ComponentProductHistory next = iterator.next();
                            if (add.getComponentId().intValue() == next.getComponentId()
                                    && add.getSubName().equals(next.getSubName())
                            ) {
                                iterator.remove();
                                break;
                            }
                        }
                    }
@@ -377,8 +381,8 @@
                //处理完成,进行表单数据更新,分为nowHistoryList,newHistoryList,nowBomHistoryList
                //nowHistoryList.forEach(nowHis->nowHis.setEVersion(nextVersion));
                newHistoryList.forEach(newHis->{newHis.setEVersion(nextVersion);newHis.setSVersion(nextVersion);});
                nowBomHistoryList.forEach(nowBomHis->nowBomHis.setEVersion(nextVersion));
                if(newHistoryList.size()!=0){newHistoryList.forEach(newHis->{newHis.setEVersion(nextVersion);newHis.setSVersion(nextVersion);});}
                if(nowBomHistoryList.size()!=0){nowBomHistoryList.forEach(nowBomHis->nowBomHis.setEVersion(nextVersion));}
                if(nowHistoryList.size()!=0){cphService.updateVersionBatch(nowHistoryList);}
                if(newHistoryList.size()!=0){cphService.insertBatch(newHistoryList);}