From d90f0e1d65c60d5d8f382595cc2b51e36ba26546 Mon Sep 17 00:00:00 2001 From: longyvfengyun <496960745@qq.com> Date: 星期三, 27 七月 2022 11:25:52 +0800 Subject: [PATCH] Merge branch 'master' of http://118.89.139.230:10101/r/~whyclxw/CadDrawManager --- src/main/java/com/whyc/service/WorksheetLinkService.java | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/whyc/service/WorksheetLinkService.java b/src/main/java/com/whyc/service/WorksheetLinkService.java index 23040b1..5be7048 100644 --- a/src/main/java/com/whyc/service/WorksheetLinkService.java +++ b/src/main/java/com/whyc/service/WorksheetLinkService.java @@ -107,7 +107,7 @@ currentVersion = 0; } Integer nextVersion = currentVersion+1; - //鏇存柊鍒皃roduct_bom_history,闇�瑕乻Version鍜宔Version + //鏇存柊鍒皃roduct_bom_history,澧炲姞杩涘幓鐨勯渶瑕乻Version鍜宔Version涓�鑷� //澧炲姞鎵�鏈夐儴浠�,鎺掓煡鍑虹浉鍏崇殑鍘熼儴浠�,闈炰篃鏄洿鏂� List<ProductBomHistory> currentHistoryList = historyService.getListByParentModel(approvingList.get(0).getParentModel(),currentVersion); List<String> currentSubNameList = currentHistoryList.stream().map(ProductBomHistory::getSubName).collect(Collectors.toList()); @@ -124,7 +124,7 @@ his.setCategory(approvingBom.getCategory()); his.setCreateDate(approvingBom.getCreateDate()); his.setDwgUrl(approvingBom.getDwgUrl()); - his.seteVersion(nextVersion); + his.setEVersion(nextVersion); his.setFileUrl(approvingBom.getFileUrl()); his.setMaterial(approvingBom.getMaterial()); his.setNotes(approvingBom.getNotes()); @@ -139,7 +139,7 @@ his.setSubModel(approvingBom.getSubModel()); his.setSubName(approvingBom.getSubName()); his.setSurfaceDetail(approvingBom.getSurfaceDetail()); - his.setsVersion(nextVersion); + his.setSVersion(nextVersion); his.setThickness(approvingBom.getThickness()); his.setType(approvingBom.getType()); his.setUnit(approvingBom.getUnit()); @@ -151,12 +151,19 @@ //鏈瀹℃牳涓瓙浠惰淇敼鐨勫瓙浠堕泦鍚� List<String> approvingUpdateSubNameList = approvingList.stream().filter(approvingBom -> approvingBom.getVersion() == 1).map(ProductBomApproving::getSubName).collect(Collectors.toList()); - //鏇存柊鍒皃roduct_bom historyService.addBatch(newHistoryList); /*鏇存柊浜у搧鐨勫綋鍓嶇増鏈�,鏇存柊鍒版渶鏂扮殑鐗堟湰*/ - //褰撳墠鐗堟湰鐨勬墍鏈塨om,鎺掗櫎 - //currentHistoryList.stream().filter(currentHistory->currentHistory.getSubName()); + //褰撳墠鐗堟湰鐨勬墍鏈塨om鐨別Version鏇存柊,鎺掗櫎琚慨鏀圭殑瀛愪欢 + List<ProductBomHistory> newVersionCurrentHistoryList = currentHistoryList.stream() + .filter(currentHistory -> !approvingUpdateSubNameList.contains(currentHistory.getSubName())) + .collect(Collectors.toList()); + newVersionCurrentHistoryList.forEach(history->{history.setEVersion(nextVersion);}); + historyService.updateVersionBatch(newVersionCurrentHistoryList); + /*鏇存柊鍒皃roduct_bom*/ + //鏌ヨ鏂扮殑鐗堟湰 + List<ProductBomHistory> newBomList = historyService.getListByParentModel(approvingList.get(0).getParentModel(), nextVersion); + bomService.updateNewBom(newBomList); /*String projectDir = CommonUtil.getProjectDir(); FileUtil.copyDir()*/ -- Gitblit v1.9.1