From ded54ebe7e7bd7a233f1227dbece53a6513b6002 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Tue, 12 Sep 2023 16:35:18 +0800 Subject: [PATCH 001/185] =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ProjectLibraryBaseServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 00b571f64..f99bd3606 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -1393,10 +1393,12 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl params, List targetMarketList, ProjectLibraryBase projectLibraryBase) { List dictModelList = new ArrayList<>(); - for (String s : projectLibraryBase.getTargetMarket().split(",")) { - List dictModelListTemp = targetMarketList.stream() - .filter(e -> s.equals(e.getValue())).collect(Collectors.toList()); - dictModelList.addAll(dictModelListTemp); + if(StringUtils.isNotBlank(projectLibraryBase.getTargetMarket())){ + for (String s : projectLibraryBase.getTargetMarket().split(",")) { + List dictModelListTemp = targetMarketList.stream() + .filter(e -> s.equals(e.getValue())).collect(Collectors.toList()); + dictModelList.addAll(dictModelListTemp); + } } String targetMarket = ""; if(dictModelList.size() != 0){ From 9f4600a74c788066b6e114f31a2cdec21985120e Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Tue, 12 Sep 2023 17:03:16 +0800 Subject: [PATCH 002/185] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BA=93=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/common/lang/en-us.js | 3 + jero-web/src/common/lang/zh-cn.js | 3 + jero-web/src/config/router.config.js | 5 + .../platformItemLibrary/index.vue | 470 ++ .../ParameterItemCollectionList.vue | 2981 +++++++++++++ .../components/ProjectDetails.vue | 386 ++ .../components/TaskList.vue | 960 +++++ .../components/TaskListModel.vue | 340 ++ .../components/TaskParameterCollection.vue | 663 +++ .../components/addModel.vue | 630 +++ .../components/addModelconformance.vue | 778 ++++ .../components/batSetting.vue | 667 +++ .../components/batchChangeModel.vue | 216 + .../components/batchModel.vue | 182 + .../components/batchSettingPersonnel.vue | 418 ++ .../components/batchUpdateDeadline.vue | 196 + .../components/certificationActivity.vue | 401 ++ .../components/certificationDirectory.vue | 321 ++ .../components/certificationDirectoryAdd.vue | 318 ++ .../components/addCodeNumber.vue | 289 ++ .../components/addConfiguration.vue | 140 + .../certificationList/components/addModel.vue | 1238 ++++++ .../components/batSetting.vue | 474 +++ .../components/deadlineForm.vue | 143 + .../components/modifyHistoryList.vue | 179 + .../components/reasonForReturn.vue | 139 + .../components/referenceDeliverablesList.vue | 266 ++ .../components/transferList.vue | 290 ++ .../components/transferListvirtal.vue | 329 ++ .../components/certificationList/index.vue | 2724 ++++++++++++ .../components/commentList.vue | 402 ++ .../complianceCertificationForm.vue | 302 ++ .../components/cuibanModel.vue | 189 + .../components/customizeList.vue | 280 ++ .../components/detilModel.vue | 507 +++ .../components/fixedPlateForm.vue | 138 + .../components/historicalVersionList.vue | 105 + .../components/listAddModel.vue | 346 ++ .../components/listEditModel.vue | 1211 ++++++ .../components/listOfRegulations.vue | 3776 +++++++++++++++++ .../components/listOfRegulationsView.vue | 623 +++ .../components/modifyOperator.vue | 165 + .../components/nonConformance.vue | 701 +++ .../components/projectStatus.vue | 74 + .../components/regulatoryCompliance.vue | 397 ++ .../components/responsibilityList.vue | 157 + .../components/resultReportedUpload.vue | 245 ++ .../components/settingList.vue | 267 ++ .../components/taskBatSetting.vue | 251 ++ .../components/toResubmitForm.vue | 452 ++ .../components/transferList.vue | 268 ++ .../components/transferListRxswin.vue | 233 + .../components/transferListvirtal.vue | 411 ++ .../components/transferListvirtalRxswin.vue | 370 ++ .../components/versionStatistics.vue | 195 + .../platformItemLibraryDetails/index.vue | 701 +++ 56 files changed, 28915 insertions(+) create mode 100644 jero-web/src/views/projectManagement/platformItemLibrary/index.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/ParameterItemCollectionList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/ProjectDetails.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskListModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskParameterCollection.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModelconformance.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batSetting.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchChangeModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchSettingPersonnel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchUpdateDeadline.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationActivity.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationDirectory.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationDirectoryAdd.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addCodeNumber.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addConfiguration.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/batSetting.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/deadlineForm.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/modifyHistoryList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/reasonForReturn.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/referenceDeliverablesList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/transferList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/transferListvirtal.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/commentList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/complianceCertificationForm.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/cuibanModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/customizeList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/detilModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/fixedPlateForm.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/historicalVersionList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listAddModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listEditModel.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulations.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulationsView.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/modifyOperator.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/nonConformance.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/projectStatus.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/regulatoryCompliance.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/responsibilityList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/resultReportedUpload.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/settingList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/taskBatSetting.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/toResubmitForm.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferList.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListRxswin.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtal.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtalRxswin.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/versionStatistics.vue create mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/index.vue diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index cea607c6f..31619136c 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1969,4 +1969,7 @@ module.exports = { Listcreationtime:'List creation time', Chinesecharacters:'The role code cannot enter Chinese characters', alreadyexistssystem:'The role encoding already exists', + maximum:'A maximum of 20 nodes can be added', + Nodename:'Node Name', + Nodedate:'Node Time', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 4385f38cd..6134024bc 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -3925,4 +3925,7 @@ module.exports = { Fileupload:'文件上传', Addresslink:'地址链接', Problemanagement:'问题管理', + maximum:'最多添加20个节点', + Nodename:'节点名称', + Nodedate:'节点时间', } \ No newline at end of file diff --git a/jero-web/src/config/router.config.js b/jero-web/src/config/router.config.js index 5f5916571..73a763b95 100644 --- a/jero-web/src/config/router.config.js +++ b/jero-web/src/config/router.config.js @@ -338,6 +338,11 @@ export const constantRouterMap = [ name: 'certificationListMaintenance', component: () => import(/* webpackChunkName: "user" */ '@/views/virtualAuthenticationList/virtualAuthenticationListDesign/certificationListMaintenance') }, + { + path: '/platformItemLibraryDetails', + name: 'platformItemLibraryDetails', + component: () => import(/* webpackChunkName: "user" */ '@/views/projectManagement/platformItemLibraryDetails/index') + }, { path: '/ProjectDetails', name: 'ProjectDetails', diff --git a/jero-web/src/views/projectManagement/platformItemLibrary/index.vue b/jero-web/src/views/projectManagement/platformItemLibrary/index.vue new file mode 100644 index 000000000..88622b8ce --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibrary/index.vue @@ -0,0 +1,470 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/ParameterItemCollectionList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/ParameterItemCollectionList.vue new file mode 100644 index 000000000..2bed0caca --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/ParameterItemCollectionList.vue @@ -0,0 +1,2981 @@ + + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/ProjectDetails.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/ProjectDetails.vue new file mode 100644 index 000000000..42cdbc327 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/ProjectDetails.vue @@ -0,0 +1,386 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskList.vue new file mode 100644 index 000000000..d4c6cbdc4 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskList.vue @@ -0,0 +1,960 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskListModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskListModel.vue new file mode 100644 index 000000000..7eac348a5 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskListModel.vue @@ -0,0 +1,340 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskParameterCollection.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskParameterCollection.vue new file mode 100644 index 000000000..103769c3c --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/TaskParameterCollection.vue @@ -0,0 +1,663 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue new file mode 100644 index 000000000..daf5a259c --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue @@ -0,0 +1,630 @@ + + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModelconformance.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModelconformance.vue new file mode 100644 index 000000000..0bdd14ac0 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModelconformance.vue @@ -0,0 +1,778 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batSetting.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batSetting.vue new file mode 100644 index 000000000..41b4cde95 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batSetting.vue @@ -0,0 +1,667 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchChangeModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchChangeModel.vue new file mode 100644 index 000000000..69dc2e078 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchChangeModel.vue @@ -0,0 +1,216 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchModel.vue new file mode 100644 index 000000000..8d93615c4 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchModel.vue @@ -0,0 +1,182 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchSettingPersonnel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchSettingPersonnel.vue new file mode 100644 index 000000000..4f35950e6 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchSettingPersonnel.vue @@ -0,0 +1,418 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchUpdateDeadline.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchUpdateDeadline.vue new file mode 100644 index 000000000..df10263db --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchUpdateDeadline.vue @@ -0,0 +1,196 @@ + + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationActivity.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationActivity.vue new file mode 100644 index 000000000..b1deb6f1d --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationActivity.vue @@ -0,0 +1,401 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationDirectory.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationDirectory.vue new file mode 100644 index 000000000..e15fbb63f --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationDirectory.vue @@ -0,0 +1,321 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationDirectoryAdd.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationDirectoryAdd.vue new file mode 100644 index 000000000..01505e1bf --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationDirectoryAdd.vue @@ -0,0 +1,318 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addCodeNumber.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addCodeNumber.vue new file mode 100644 index 000000000..dc711e17d --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addCodeNumber.vue @@ -0,0 +1,289 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addConfiguration.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addConfiguration.vue new file mode 100644 index 000000000..50f854958 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addConfiguration.vue @@ -0,0 +1,140 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue new file mode 100644 index 000000000..b47e38a8d --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue @@ -0,0 +1,1238 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/batSetting.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/batSetting.vue new file mode 100644 index 000000000..b4d746f2f --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/batSetting.vue @@ -0,0 +1,474 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/deadlineForm.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/deadlineForm.vue new file mode 100644 index 000000000..62d6ee45c --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/deadlineForm.vue @@ -0,0 +1,143 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/modifyHistoryList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/modifyHistoryList.vue new file mode 100644 index 000000000..32eb8dcaf --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/modifyHistoryList.vue @@ -0,0 +1,179 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/reasonForReturn.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/reasonForReturn.vue new file mode 100644 index 000000000..95aecf4cd --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/reasonForReturn.vue @@ -0,0 +1,139 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/referenceDeliverablesList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/referenceDeliverablesList.vue new file mode 100644 index 000000000..2a67fb149 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/referenceDeliverablesList.vue @@ -0,0 +1,266 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/transferList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/transferList.vue new file mode 100644 index 000000000..548f3c44d --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/transferList.vue @@ -0,0 +1,290 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/transferListvirtal.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/transferListvirtal.vue new file mode 100644 index 000000000..973bd500f --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/transferListvirtal.vue @@ -0,0 +1,329 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue new file mode 100644 index 000000000..496f75338 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue @@ -0,0 +1,2724 @@ + + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/commentList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/commentList.vue new file mode 100644 index 000000000..e7fae0bfd --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/commentList.vue @@ -0,0 +1,402 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/complianceCertificationForm.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/complianceCertificationForm.vue new file mode 100644 index 000000000..acb5fb4b2 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/complianceCertificationForm.vue @@ -0,0 +1,302 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/cuibanModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/cuibanModel.vue new file mode 100644 index 000000000..762dd87cd --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/cuibanModel.vue @@ -0,0 +1,189 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/customizeList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/customizeList.vue new file mode 100644 index 000000000..c03b4c806 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/customizeList.vue @@ -0,0 +1,280 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/detilModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/detilModel.vue new file mode 100644 index 000000000..23e0d70f7 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/detilModel.vue @@ -0,0 +1,507 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/fixedPlateForm.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/fixedPlateForm.vue new file mode 100644 index 000000000..7be6ec98d --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/fixedPlateForm.vue @@ -0,0 +1,138 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/historicalVersionList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/historicalVersionList.vue new file mode 100644 index 000000000..e45f92d50 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/historicalVersionList.vue @@ -0,0 +1,105 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listAddModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listAddModel.vue new file mode 100644 index 000000000..85bc82d41 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listAddModel.vue @@ -0,0 +1,346 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listEditModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listEditModel.vue new file mode 100644 index 000000000..f7581f1be --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listEditModel.vue @@ -0,0 +1,1211 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulations.vue new file mode 100644 index 000000000..8ad6ad738 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulations.vue @@ -0,0 +1,3776 @@ + + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulationsView.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulationsView.vue new file mode 100644 index 000000000..25a12d88f --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulationsView.vue @@ -0,0 +1,623 @@ + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/modifyOperator.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/modifyOperator.vue new file mode 100644 index 000000000..b9cbbdbcd --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/modifyOperator.vue @@ -0,0 +1,165 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/nonConformance.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/nonConformance.vue new file mode 100644 index 000000000..816b9ba99 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/nonConformance.vue @@ -0,0 +1,701 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/projectStatus.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/projectStatus.vue new file mode 100644 index 000000000..add208228 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/projectStatus.vue @@ -0,0 +1,74 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/regulatoryCompliance.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/regulatoryCompliance.vue new file mode 100644 index 000000000..9b9619dbe --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/regulatoryCompliance.vue @@ -0,0 +1,397 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/responsibilityList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/responsibilityList.vue new file mode 100644 index 000000000..86259d364 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/responsibilityList.vue @@ -0,0 +1,157 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/resultReportedUpload.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/resultReportedUpload.vue new file mode 100644 index 000000000..a45c9d3a3 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/resultReportedUpload.vue @@ -0,0 +1,245 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/settingList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/settingList.vue new file mode 100644 index 000000000..f1413d6d5 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/settingList.vue @@ -0,0 +1,267 @@ + + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/taskBatSetting.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/taskBatSetting.vue new file mode 100644 index 000000000..4984c404f --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/taskBatSetting.vue @@ -0,0 +1,251 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/toResubmitForm.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/toResubmitForm.vue new file mode 100644 index 000000000..d61438078 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/toResubmitForm.vue @@ -0,0 +1,452 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferList.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferList.vue new file mode 100644 index 000000000..2c77137b0 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferList.vue @@ -0,0 +1,268 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListRxswin.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListRxswin.vue new file mode 100644 index 000000000..06462dac8 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListRxswin.vue @@ -0,0 +1,233 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtal.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtal.vue new file mode 100644 index 000000000..e7bacbf3a --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtal.vue @@ -0,0 +1,411 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtalRxswin.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtalRxswin.vue new file mode 100644 index 000000000..f3e961882 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtalRxswin.vue @@ -0,0 +1,370 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/versionStatistics.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/versionStatistics.vue new file mode 100644 index 000000000..2dc681fe3 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/versionStatistics.vue @@ -0,0 +1,195 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/index.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/index.vue new file mode 100644 index 000000000..83188bba9 --- /dev/null +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/index.vue @@ -0,0 +1,701 @@ + + + + + + \ No newline at end of file From f680da60e6c3a293465a01a212067566d0f7dae4 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Tue, 12 Sep 2023 17:07:38 +0800 Subject: [PATCH 003/185] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectPlatformController.java | 311 ++ .../mapper/ProjectPlatformMapper.java | 32 + .../mapper/xml/ProjectPlatform.xml | 303 ++ .../service/IProjectPlatformService.java | 191 + .../impl/ProjectPlatformServiceImpl.java | 3573 +++++++++++++++++ 5 files changed, 4410 insertions(+) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/controller/ProjectPlatformController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/mapper/ProjectPlatformMapper.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/mapper/xml/ProjectPlatform.xml create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/service/IProjectPlatformService.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/service/impl/ProjectPlatformServiceImpl.java diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/controller/ProjectPlatformController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/controller/ProjectPlatformController.java new file mode 100644 index 000000000..3d02d8201 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/controller/ProjectPlatformController.java @@ -0,0 +1,311 @@ +package com.jero.modules.projectPlatform.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.common.system.base.controller.JeroController; +import com.jero.common.system.vo.DictModel; +import com.jero.modules.project.entity.ProjectLibraryBase; +import com.jero.modules.project.service.IProjectLibraryBaseService; +import com.jero.modules.projectPlatform.service.IProjectPlatformService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + + +/** + * @Description: 项目库基础表 + * @Author: jero-boot + * @Date: 2022-04-11 + * @Version: V1.0 + */ +@Api(tags="平台件项目库") +@RestController +@RequestMapping("/project/platform") +@Slf4j +public class ProjectPlatformController extends JeroController { + @Autowired + private IProjectPlatformService projectPlatformService; + + /** + * 分页列表查询 + * + * @return + */ + @AutoLog(value = "项目库基础表-分页列表查询") + @ApiOperation(value="项目库基础表-分页列表查询", notes="项目库基础表-分页列表查询") + @PostMapping(value = "/page") + public Result queryPageList(@RequestBody Map params) { + List pageList= projectPlatformService.queryPageList(params); + Page pages = projectPlatformService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), pageList); + return Result.OK(params.get("cut").toString(),pages); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "项目库基础表-列表查询") + @ApiOperation(value="项目库基础表-列表查询", notes="项目库基础表-列表查询") + @GetMapping(value = "/list") + public Result> queryList(ProjectLibraryBase projectLibraryBase) { + List list = projectPlatformService.getList(projectLibraryBase); + return Result.OK(list); + } + + /** + * 添加 + * + * @param projectLibraryBase + * @return + */ + @AutoLog(value = "项目库基础表-添加") + @ApiOperation(value="项目库基础表-添加", notes="项目库基础表-添加") + @RequiresPermissions("projectLibraryBase:add") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException { + projectPlatformService.add(projectLibraryBase); + return Result.OK("添加成功!"); + } + /** + * 项目扩展(添加子项目子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致) + * + * @param projectLibraryBase + * @return + */ + @AutoLog(value = "项目扩展(添加子项目)") + @ApiOperation(value="项目扩展(添加子项目)", notes="项目扩展(添加子项目)") + @RequiresPermissions("projectLibraryBase:add") + @PostMapping(value = "/addChild") + public Result addChild(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException { + projectPlatformService.addChild(projectLibraryBase); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param projectLibraryBase + * @return + */ + @AutoLog(value = "项目库基础表-编辑") + @ApiOperation(value="项目库基础表-编辑", notes="项目库基础表-编辑") + @RequiresPermissions("projectLibraryBase:edit") + @PutMapping(value = "/edit") + public Result edit(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) { + projectPlatformService.editById(projectLibraryBase); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "项目库基础表-通过id删除") + @ApiOperation(value="项目库基础表-通过id删除", notes="项目库基础表-通过id删除") + @RequiresPermissions("projectLibraryBase:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id, + @RequestParam(name="cut",required=true) String cut) { + projectPlatformService.deleteById(id,cut); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "项目库基础表-批量删除") + @ApiOperation(value="项目库基础表-批量删除", notes="项目库基础表-批量删除") + @RequiresPermissions("projectLibraryBase:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids, + @RequestParam(name="cut",required=true) String cut) { + this.projectPlatformService.deleteByIds(Arrays.asList(ids.split(",")),cut); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "项目库基础表-通过id查询") + @ApiOperation(value="项目库基础表-通过id查询", notes="项目库基础表-通过id查询") + @RequiresPermissions("projectLibraryBase:queryById") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id, + @RequestParam(name="cut",required=true) String cut) { + List data = projectPlatformService.queryById(id,cut); + if(data==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(cut,data); + } + + /** + * 导出excel + * + * @param request + * @param projectLibraryBase + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ProjectLibraryBase projectLibraryBase) { + return super.exportXls(request, projectLibraryBase, ProjectLibraryBase.class, "项目库基础表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ProjectLibraryBase.class); + } + + /** + * 项目详情-统计接口 + * @param id 项目库id + * @return + */ + @AutoLog(value = "项目详情-统计接口") + @ApiOperation(value="项目详情-统计接口", notes="项目详情-统计接口") + @GetMapping(value = "/getProjectDetailsStatistics") + public Result getProjectDetailsStatistics(@RequestParam(name="id",required=true) String id, + @RequestParam(name="cut",required=true) String cut) { + Map data = projectPlatformService.getProjectDetailsStatistics(id); + return Result.OK(cut,data); + } + + /** + * 项目详情-统计接口-根据领域分组 + * @return + */ + @AutoLog(value = "项目详情-统计接口-根据领域分组") + @ApiOperation(value="项目详情-统计接口-根据领域分组", notes="项目详情-统计接口-根据领域分组") + @GetMapping(value = "/getProjectDetailsStatisticsGroupByTerritory") + public Result getProjectDetailsStatisticsGroupByTerritory(@RequestParam Map params) { + Map data = projectPlatformService.getProjectDetailsStatisticsGroupByTerritory(params); + return Result.OK((String)params.get("cut"),data); + } + + /** + * 导出excel + * + * @param request + * @param params + */ + @RequestMapping(value = "/exportProjectDetailsStatisticsGroupByTerritoryXls") + public void exportProjectDetailsStatisticsGroupByTerritoryXls(HttpServletResponse response,HttpServletRequest request, @RequestParam Map params) { + projectPlatformService.exportProjectDetailsStatisticsGroupByTerritoryXls(response,request, params); + } + + + /** + * 项目置顶,取消置顶(只置顶主项目) + * @param id + * @param flag 0为置顶, 1为取消置顶 + * @return + */ + @AutoLog(value = "项目置顶,取消置顶(只置顶主项目)") + @ApiOperation(value="项目置顶,取消置顶(只置顶主项目)", notes="项目置顶,取消置顶(只置顶主项目)") + @GetMapping(value = "/top") + public Result top(String id,String flag) { + projectPlatformService.top(id,flag); + return Result.OK("编辑成功!"); + } + + /** + * 获取项目所有的版本(主版本和子版本的集合) + * @param id 项目id + * @return + */ + @AutoLog(value = "获取项目所有的版本(主版本和子版本的集合)") + @ApiOperation(value="获取项目所有的版本(主版本和子版本的集合)", notes="获取项目所有的版本(主版本和子版本的集合)") + @GetMapping(value = "/getVersionsInfo") + public Result getVersionsInfo(String id) { + List versionsInfoList = projectPlatformService.getVersionsInfo(id); + return Result.OK(versionsInfoList); + } + + /** + * 版本统计 + * @return + */ + @AutoLog(value = "版本统计") + @ApiOperation(value="版本统计)", notes="版本统计") + @PostMapping(value = "/versionStatistics") + public Result versionStatistics(@RequestBody Map params) { + List projectLibraryBasesList = projectPlatformService.versionStatistics(String.valueOf(params.get("id"))); + Page pages = projectPlatformService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), projectLibraryBasesList); + return Result.OK(pages); + } + + @AutoLog(value = "对接火山引擎接口getProjectInfo") + @ApiOperation(value="对接火山引擎接口-获取项目统计信息1", notes="对接火山引擎接口-获取项目统计信息1") + @PostMapping(value = "/getProjectInfo") + public Result getProjectInfo(){ + JSONArray resList = projectPlatformService.getProjectInfo(); + return Result.OK(resList); + } + + @AutoLog(value = "对接火山引擎接口getProjectProgressInfo") + @ApiOperation(value="对接火山引擎接口-获取项目统计信息2", notes="对接火山引擎接口-获取项目统计信息2") + @PostMapping(value = "/getProjectProgressInfo") + public Result getProjectProgressInfo(){ + JSONArray resList = this.projectPlatformService.getProjectProgressInfo(); + return Result.OK(resList); + } + + // 导出项目进度统计(状态导出) + @RequestMapping(value = "/exportProjectProgressStatisticsXls") + public void exportProjectProgressStatisticsXls(HttpServletResponse response,HttpServletRequest request, @RequestParam Map params) { + this.projectPlatformService.exportProjectProgressStatisticsXls(response,request, params); + } + + @AutoLog(value = "获取用户在该项目中所有的责任领域") + @ApiOperation(value="获取用户在该项目中所有的责任领域", notes="获取用户在该项目中所有的责任领域") + @GetMapping(value = "/getUserAllDutyTerritoryList") + public Result> getUserAllDutyTerritoryList(@RequestParam Map params){ + List resList = this.projectPlatformService.getUserAllDutyTerritoryList(params); + return Result.OK(resList); + } + + @AutoLog(value = "全局替换用户") + @ApiOperation(value="全局替换用户", notes="全局替换用户") + @PostMapping(value = "/overallReplacementUser") + public Result overallReplacementUser(@RequestBody JSONObject json){ + return this.projectPlatformService.overallReplacementUser(json); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/mapper/ProjectPlatformMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/mapper/ProjectPlatformMapper.java new file mode 100644 index 000000000..20c20cead --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/mapper/ProjectPlatformMapper.java @@ -0,0 +1,32 @@ +package com.jero.modules.projectPlatform.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.project.entity.ProjectLibraryBase; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @Description: 项目库基础表 + * @Author: jero-boot + * @Date: 2022-04-11 + * @Version: V1.0 + */ +public interface ProjectPlatformMapper extends BaseMapper { + /**分页列表*/ + List queryPageList(@Param("params") Map params); + List queryMaimList(); +// IPage queryPageList(IPage page, Map params); + + List getList(@Param("projectLibraryBase") ProjectLibraryBase projectLibraryBase); + + /**根据id查询*/ + List queryById(String id); + + ProjectLibraryBase selectProjectName(@Param("projectLibraryId") String projectLibraryId); + + List getListByIds(@Param("idList") List idList); + + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/mapper/xml/ProjectPlatform.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/mapper/xml/ProjectPlatform.xml new file mode 100644 index 000000000..aae850b73 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/mapper/xml/ProjectPlatform.xml @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select + plb.id, + plb.project_name_id, + pni.project_name as project_name, + pyni.id as year_name_id, + pyni.year_name, + plb.target_market, + plb.project_status, + plb.studio_engineer, + studiouser.username as studio_engineer_name, + plb.certification_engineer, + plb.vehicle_platform, + plb.digital_platform, + plb.ipd_info, + plb.vehicle_development_plan, + plb.attestation_plan, + plb.create_by, + plb.create_time, + plb.sys_org_code, + plb.update_by, + plb.update_time, + plb.parent_id, + plb.project_version, + plb.explanation, + plb.software_version, + plb.sort, + plb.flag, + plb.brand, + sdi.item_text brandText, + sdi.en_name brandTextEn + from project_library_base as plb + left join project_name_info as pni on plb.project_name_id=pni.id + left join sys_user as studiouser on plb.studio_engineer=studiouser.id + left join project_year_name_info as pyni on plb.year_name_id=pyni.id + left join sys_dict_item as sdi on sdi.item_value = plb.brand + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/service/IProjectPlatformService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/service/IProjectPlatformService.java new file mode 100644 index 000000000..7a3996700 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/service/IProjectPlatformService.java @@ -0,0 +1,191 @@ +package com.jero.modules.projectPlatform.service; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.common.api.vo.Result; +import com.jero.common.system.vo.DictModel; +import com.jero.modules.project.entity.ProjectLibraryBase; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; +import java.util.List; +import java.util.Map; + +/** + * @Description: 项目库基础表 + * @Author: jero-boot + * @Date: 2022-04-11 + * @Version: V1.0 + */ +public interface IProjectPlatformService extends IService { + + /** + * 保存 + * + * @param projectLibraryBase + * @return + */ + void add(ProjectLibraryBase projectLibraryBase) throws ParseException; + + /** + * 项目扩展(添加子项目-子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致) + * + * @param projectLibraryBase + * @return + */ + void addChild(ProjectLibraryBase projectLibraryBase) throws ParseException; + + /** + * 更新 + * + * @param projectLibraryBase + * @return + */ + void editById(ProjectLibraryBase projectLibraryBase); + + /** + * 通过id删除 + * + * @param id + * @return + */ + void deleteById(String id, String cut); + + /** + * 批量删除 + * + * @param ids + * @return + */ + void deleteByIds(List ids,String cut); + + /** + * 通过id查询 + * + * @param id + * @return + */ + List queryById(String id,String cut); + + /** + * 列表查询 + * + * @return + */ + List getList(ProjectLibraryBase projectLibraryBase); + + /** + * 分页列表查询 + * + * @return + */ + List queryPageList(Map params); +// IPage queryPageList(Map params); + + /** + * 项目详情-统计接口 + * @param id + * @return + */ + Map getProjectDetailsStatistics(String id); + + /** + * 项目详情-统计接口-根据领域分组 + * @param params + * @return + */ + Map getProjectDetailsStatisticsGroupByTerritory(Map params); + + void exportProjectDetailsStatisticsGroupByTerritoryXls(HttpServletResponse response, HttpServletRequest request, Map params); + + void checkData(String id, String cut); + + void disposeData(List records,String cut,boolean disposeTargetMarketFlag); + + Page getPages(Integer currentPage, Integer pageSize, List list); + + /** + * 项目置顶,取消置顶(只置顶主项目) + * @param id + * @param flag 0为置顶, 1为取消置顶 + * @return + */ + void top(String id,String flag); + + /** + * 获取项目所有的版本(主版本和子版本的集合) + * @param id + * @return + */ + List getVersionsInfo(String id); + + /** + * 版本统计 + * @param id + * @return + */ + List versionStatistics(String id); + + /** + * 通过主项目id和子项目版本号 + * @param version + * @param parentId + * @return + */ + String getIdByVersionAndParentId(String version, String parentId); + + /** + * 查询主项目及其所有子项目 + * @param parentId + * @return + */ + List getParentAndChildern(String parentId); + + /** + * 根据id查询项目库详情信息 发送飞书消息时使用,之前的 queryById不太兼容 + * @param projectLibraryId + * @return + */ + ProjectLibraryBase selectById(String projectLibraryId); + + /** + * 对接火山引擎接口-获取项目统计信息 + * @return + */ + JSONArray getProjectInfo(); + + /** + * 对接火山引擎接口-获取项目统计信息 + * @return + */ + JSONArray getProjectProgressInfo(); + + /** + * 导出项目进度统计(状态导出) + * @param response + * @param request + * @param params + */ + void exportProjectProgressStatisticsXls(HttpServletResponse response, HttpServletRequest request, Map params); + + /** + * 获取用户在该项目中所有的责任领域数组 + * @param params + * @return + */ + List getUserAllDutyTerritoryList(Map params); + + /** + * 全局替换用户 + * @param json + * @return + */ + Result overallReplacementUser(JSONObject json); + + List queryList(List projectIdList); + + List getListByIds(List projectIdList); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/service/impl/ProjectPlatformServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/service/impl/ProjectPlatformServiceImpl.java new file mode 100644 index 000000000..e328bc564 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/projectPlatform/service/impl/ProjectPlatformServiceImpl.java @@ -0,0 +1,3573 @@ +package com.jero.modules.projectPlatform.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.common.api.vo.Result; +import com.jero.common.constant.enums.CutEnum; +import com.jero.common.exception.JeroBootException; +import com.jero.common.system.vo.DictModel; +import com.jero.common.system.vo.LoginUser; +import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO; +import com.jero.modules.cert.collect.entity.ParamsManifestEO; +import com.jero.modules.cert.collect.enums.CollectManifestStateEnum; +import com.jero.modules.cert.collect.enums.CollectManifestStatisticsStateEnum; +import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService; +import com.jero.modules.cert.collect.service.IParamsManifestEOService; +import com.jero.modules.cert.template.enums.ControlTypeEnum; +import com.jero.modules.dummy.enums.OrderEnum; +import com.jero.modules.enums.DictCodeEnum; +import com.jero.modules.feishu.enums.TemplateInfoEnum2; +import com.jero.modules.ota.service.impl.OtaManageApplyEOServiceImpl; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; +import com.jero.modules.project.entity.ProjectLawsInventoryEO; +import com.jero.modules.project.entity.ProjectLawsInventoryLogEO; +import com.jero.modules.project.entity.ProjectLibraryBase; +import com.jero.modules.project.entity.ProjectLibraryRoleRelEO; +import com.jero.modules.project.entity.ProjectRelatedPersonnel; +import com.jero.modules.project.entity.ProjectTaskInventoryEO; +import com.jero.modules.project.entity.ProjectTaskPlanning; +import com.jero.modules.project.entity.ProjectUserPermission; +import com.jero.modules.project.enums.CertificationFlowNodeEnum; +import com.jero.modules.project.enums.CertificationInventoryFlowStatusEnum; +import com.jero.modules.project.enums.CertificationProgressEnum; +import com.jero.modules.project.enums.ComplianceFlowStatusEnum; +import com.jero.modules.project.enums.DesignComplianceStatusEnum; +import com.jero.modules.project.enums.HSStatisticalNodesEnum; +import com.jero.modules.project.enums.OperatorTypeEnum; +import com.jero.modules.project.enums.PermissionDescriptionEnum; +import com.jero.modules.project.enums.ProjectRoleEnum; +import com.jero.modules.project.enums.ProjectTaskPlanningNameEnum; +import com.jero.modules.project.enums.ProjectUserLocationEnum; +import com.jero.modules.project.enums.RoleRelModelTypeEnum; +import com.jero.modules.project.enums.TaskAffirmStatusEnum; +import com.jero.modules.project.enums.TaskStatusEnum; +import com.jero.modules.project.enums.TopEnum; +import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper; +import com.jero.modules.project.mapper.ProjectLibraryBaseMapper; +import com.jero.modules.project.mapper.ProjectNameInfoEOMapper; +import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper; +import com.jero.modules.project.mapper.ProjectTaskInventoryEOMapper; +import com.jero.modules.project.mapper.ProjectUserPermissionMapper; +import com.jero.modules.project.service.IConditionAssessmentEOService; +import com.jero.modules.project.service.IProjectCertificationInventoryEOService; +import com.jero.modules.project.service.IProjectLibraryBaseService; +import com.jero.modules.project.service.IProjectLibraryRoleRelEOService; +import com.jero.modules.project.service.IProjectLibraryStatisticsService; +import com.jero.modules.project.service.IProjectUserPermissionService; +import com.jero.modules.project.service.impl.ProjectLawsInventoryEOServiceImpl; +import com.jero.modules.project.service.impl.ProjectLawsInventoryLogEOServiceImpl; +import com.jero.modules.project.service.impl.ProjectNameInfoEOServiceImpl; +import com.jero.modules.project.service.impl.ProjectRelatedPersonnelServiceImpl; +import com.jero.modules.project.service.impl.ProjectTaskPlanningServiceImpl; +import com.jero.modules.project.vo.TimeNodeVO; +import com.jero.modules.projectPlatform.mapper.ProjectPlatformMapper; +import com.jero.modules.projectPlatform.service.IProjectPlatformService; +import com.jero.modules.system.entity.SysDictItem; +import com.jero.modules.system.entity.SysUser; +import com.jero.modules.system.enums.DicCodeEnum; +import com.jero.modules.system.mapper.SysDictItemMapper; +import com.jero.modules.system.mapper.SysRoleMapper; +import com.jero.modules.system.mapper.SysUserMapper; +import com.jero.modules.system.service.IProjectUserBrandService; +import com.jero.modules.system.service.ISysDictService; +import com.jero.modules.system.service.ISysUserService; +import com.jero.modules.system.service.impl.SysDictItemServiceImpl; +import com.jero.modules.system.util.StringUtils; +import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO; +import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService; +import com.jero.modules.top.entity.TopProjectEO; +import com.jero.modules.top.service.ITopProjectEOService; +import com.jero.modules.wkflow.enums.FlowTypeEnum; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.shiro.SecurityUtils; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.text.Collator; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * @Description: 项目库基础表 + * @Author: jero-boot + * @Date: 2022-04-11 + * @Version: V1.0 + */ +@Service +public class ProjectPlatformServiceImpl extends ServiceImpl implements IProjectPlatformService { + @Autowired + private ProjectLibraryBaseMapper projectLibraryBaseMapper; + + @Autowired + private SysDictItemMapper sysDictItemMapper; + + @Autowired + private SysUserMapper sysUserMapper; + + @Autowired + private ProjectRelatedPersonnelServiceImpl projectRelatedPersonnelService; + @Autowired + private ProjectTaskPlanningServiceImpl projectTaskPlanningService; + + @Autowired + private ProjectLawsInventoryEOMapper projectLawsInventoryEOMapper; + + @Autowired + private ProjectTaskInventoryEOMapper projectTaskInventoryEOMapper; + + @Autowired + private IConditionAssessmentEOService conditionAssessmentEOService; + + @Autowired + private SysDictItemServiceImpl sysDictItemServiceImpl; + + @Autowired + private ProjectNameInfoEOMapper projectNameInfoEOMapper; + @Autowired + private ProjectNameInfoEOServiceImpl projectNameInfoEOService; + + @Autowired + private IProjectLibraryRoleRelEOService projectLibraryRoleRelEOService; + + @Autowired + private ProjectLawsInventoryEOServiceImpl projectLawsInventoryEOService; + + @Autowired + private ProjectLawsInventoryLogEOServiceImpl projectLawsInventoryLogEOService; + + @Autowired + private ProjectRelatedPersonnelMapper projectRelatedPersonnelMapper; + + @Autowired + private IParamsManifestEOService paramsManifestEOService; + + @Autowired + private ISysDictService sysDictService; + + @Autowired + private ISysUserService sysUserService; + + @Autowired + private SysRoleMapper sysRoleMapper; + + @Autowired + private IProjectUserPermissionService projectUserPermissionService; + + @Autowired + private ProjectUserPermissionMapper projectUserPermissionMapper; + + @Autowired + private IProjectUserBrandService projectUserBrandService; + + @Autowired + private ITopProjectEOService iTopProjectEOService; + + @Autowired + private IProjectCertificationInventoryEOService projectCertificationInventoryEOService; + + @Autowired + private IProcessInfoDetailEOService processInfoDetailEOService; + + @Autowired + private IParamsCollectManifestEOService paramsCollectManifestEOService; + + @Autowired + private IProjectLibraryStatisticsService projectLibraryStatisticsService; + @Autowired + private OtaManageApplyEOServiceImpl otaManageApplyEOService; + + private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + private static DecimalFormat df = new DecimalFormat("#.00"); + private static String percentSign = "%"; + + /** + * 保存 + * + * @param projectLibraryBase + * @return + */ + @Override + @Transactional + public void add(ProjectLibraryBase projectLibraryBase) throws ParseException { + Date now = new Date(); + + projectLibraryBase.setCreateTime(now); + projectLibraryBase.setUpdateTime(now); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + projectLibraryBase.setCreateBy(sysUser.getUsername()); + projectLibraryBase.setUpdateBy(sysUser.getUsername()); + + checkExitData(projectLibraryBase); + save(projectLibraryBase); + + //创建任务计划时间轴 + projectTaskPlanningService.setProjectTaskPlanning(projectLibraryBase.getId()); + + List projectLibraryRoleRelEOList = new ArrayList<>(); + //初始化当前项目的studio与项目库 法规清单 角色关系 + ProjectLibraryRoleRelEO lawsInventoryRoleRelEO = new ProjectLibraryRoleRelEO(); + lawsInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId()); + lawsInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer()); + lawsInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue()); + lawsInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.LAWS_INVENTORY.getValue()); + projectLibraryRoleRelEOList.add(lawsInventoryRoleRelEO); + + // 初始化当前项目的studio与项目库 认证清单 角色关系 + ProjectLibraryRoleRelEO certificationInventoryRoleRelEO = new ProjectLibraryRoleRelEO(); + certificationInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId()); + certificationInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer()); + certificationInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue()); + certificationInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.CERTIFICATION_INVENTORY.getValue()); + projectLibraryRoleRelEOList.add(certificationInventoryRoleRelEO); + this.projectLibraryRoleRelEOService.saveBatch(projectLibraryRoleRelEOList); + + //项目权限表添加 + List adds = new ArrayList<>(); + if (ObjectUtils.isNotEmpty(projectLibraryBase.getStudioEngineer())) { + ProjectUserPermission projectUserPermission = new ProjectUserPermission(); + projectUserPermission.setProjectId(projectLibraryBase.getId()); + projectUserPermission.setUserId(projectLibraryBase.getStudioEngineer()); + projectUserPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue()); + projectUserPermission.setCreateTime(now); + projectUserPermission.setUpdateTime(now); + adds.add(projectUserPermission); + } + if (ObjectUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer())) { + for (String id : projectLibraryBase.getCertificationEngineer().split(",")) { + ProjectUserPermission projectUserPermission = new ProjectUserPermission(); + projectUserPermission.setProjectId(projectLibraryBase.getId()); + projectUserPermission.setUserId(id); + projectUserPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue()); + projectUserPermission.setCreateTime(now); + projectUserPermission.setUpdateTime(now); + adds.add(projectUserPermission); + } + } + if (ObjectUtils.isNotEmpty(adds)) { + projectUserPermissionService.saveBatch(adds); + } + + } + + + + /** + * 项目扩展(添加子项目--子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致) + * @param projectLibraryBase + * @throws ParseException + */ + @Override + @Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) + public void addChild(ProjectLibraryBase projectLibraryBase) throws ParseException { + String id = projectLibraryBase.getId();//主项目id + String projectId = UUID.randomUUID().toString().replace("-", ""); + //主表中添加数据 + ProjectLibraryBase projectLibraryBaseTemp = this.getById(id); + projectLibraryBaseTemp.setCreateBy(null); + projectLibraryBaseTemp.setCreateTime(null); + projectLibraryBaseTemp.setUpdateBy(null); + projectLibraryBaseTemp.setUpdateTime(null); + projectLibraryBaseTemp.setId(projectId); + projectLibraryBaseTemp.setParentId(id); + projectLibraryBaseTemp.setProjectVersion(projectLibraryBase.getProjectVersion()); + projectLibraryBaseTemp.setExplanation(projectLibraryBase.getExplanation()); + this.save(projectLibraryBaseTemp); + + //处理版本号排序问题,如果版本号插入到中间,后面版本数字顺眼 + checkVersionOrder(id,projectLibraryBase.getProjectVersion(),projectId); + + Date now = new Date(); + //相关人员名单中添加数据 + List projectRelatedPersonnelList = projectRelatedPersonnelMapper.queryPageList(id, + DictCodeEnum.DUTY_TERRITORY.getValue(), + null, + null, + null, + null,null); + if(projectRelatedPersonnelList.size() != 0){ + List relatedPersonnelPermissionList = new ArrayList<>(); + for (ProjectRelatedPersonnel projectRelatedPersonnel : projectRelatedPersonnelList) { + String relatedPersonnelId = UUID.randomUUID().toString().replace("-", ""); + projectRelatedPersonnel.setId(relatedPersonnelId); + projectRelatedPersonnel.setProjectId(projectId); + + //添加人员权限 + if (ObjectUtils.isNotEmpty(projectRelatedPersonnel.getLawEngineer())) { + for (String lawEngineerId : projectRelatedPersonnel.getLawEngineer().split(",")) { + //projectUserPermissionService.queryRelatedPersonnelPermission(projectLibraryBase.getId(),lawEngineerId,ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_LAW.getValue()); + ProjectUserPermission permission = new ProjectUserPermission(); + permission.setProjectId(projectId); + permission.setUserId(lawEngineerId); + permission.setBelong(ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_LAW.getValue()); + permission.setDescription(PermissionDescriptionEnum.PROJECT_RELATED_PERSONNEL.getValue() + relatedPersonnelId); + permission.setCreateTime(now); + permission.setUpdateTime(now); + relatedPersonnelPermissionList.add(permission); + } + } + if (ObjectUtils.isNotEmpty(projectRelatedPersonnel.getEngineeringInterfacePerson())) { + for (String engineeringInterfacePersonId : projectRelatedPersonnel.getEngineeringInterfacePerson().split(",")) { + ProjectUserPermission permission = new ProjectUserPermission(); + permission.setProjectId(projectId); + permission.setUserId(engineeringInterfacePersonId); + permission.setBelong(ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_INTERFACE.getValue()); + permission.setDescription(PermissionDescriptionEnum.PROJECT_RELATED_PERSONNEL.getValue() + relatedPersonnelId); + permission.setCreateTime(now); + permission.setUpdateTime(now); + relatedPersonnelPermissionList.add(permission); + } + } + if (ObjectUtils.isNotEmpty(projectRelatedPersonnel.getCertificationEngineer())) { + for (String certificationEngineerId : projectRelatedPersonnel.getCertificationEngineer().split(",")) { + ProjectUserPermission permission = new ProjectUserPermission(); + permission.setProjectId(projectId); + permission.setUserId(certificationEngineerId); + permission.setBelong(ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue()); + permission.setDescription(PermissionDescriptionEnum.PROJECT_RELATED_PERSONNEL.getValue() + relatedPersonnelId); + permission.setCreateTime(now); + permission.setUpdateTime(now); + relatedPersonnelPermissionList.add(permission); + } + + } + + } + projectRelatedPersonnelService.saveBatch(projectRelatedPersonnelList); + if (ObjectUtils.isNotEmpty(relatedPersonnelPermissionList)) { + projectUserPermissionService.saveBatch(relatedPersonnelPermissionList); + } + } + + //法规/认证任务计划添加数据 projectTaskPlanningService + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(ProjectTaskPlanning::getProjectId,projectLibraryBase.getId()); + ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningService.getOne(wrapper); + if(ObjectUtils.isNotEmpty(projectTaskPlanning)){ + projectTaskPlanning.setId(UUID.randomUUID().toString().replace("-", "")); + projectTaskPlanning.setProjectId(projectId); + projectTaskPlanningService.add(projectTaskPlanning); + } + + + //初始化当前项目的studio与项目库 角色关系 projectLibraryRoleRelEOService + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(ProjectLibraryRoleRelEO::getProjectLibraryId,projectLibraryBase.getId()); + List projectLibraryRoleRelEOList = projectLibraryRoleRelEOService.list(queryWrapper); + + List studioUserPermissions = new ArrayList<>(); + if(ObjectUtils.isNotEmpty(projectLibraryRoleRelEOList)){ + for (ProjectLibraryRoleRelEO projectLibraryRoleRelEO : projectLibraryRoleRelEOList) { + projectLibraryRoleRelEO.setId(UUID.randomUUID().toString().replace("-", "")); + projectLibraryRoleRelEO.setProjectLibraryId(projectId); + projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO); + //添加studio权限 + ProjectUserPermission studioUserPermission = new ProjectUserPermission(); + studioUserPermission.setProjectId(projectId); + studioUserPermission.setUserId(projectLibraryRoleRelEO.getUserId()); + studioUserPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue()); + studioUserPermission.setCreateTime(now); + studioUserPermission.setUpdateTime(now); + studioUserPermissions.add(studioUserPermission); + } + } + if (ObjectUtils.isNotEmpty(studioUserPermissions)) { + projectUserPermissionService.saveBatch(studioUserPermissions); + } + } + + /** + * 如果创建的子项目版本号重复,处理排序 + * @param id + * @param version + * @param projectId + */ + private void checkVersionOrder(String id,String version,String projectId) { + LambdaQueryWrapper wrapperVer = new LambdaQueryWrapper<>(); + //查找其他统计子版本项目 + wrapperVer.eq(ProjectLibraryBase::getParentId, id); + wrapperVer.orderByAsc(ProjectLibraryBase::getProjectVersion); + List clist = this.list(wrapperVer); + int tmpInt = Integer.parseInt(version); + for (ProjectLibraryBase plb : clist) { + int ver = Integer.parseInt(plb.getProjectVersion()); + if(!plb.getId().equals(projectId) && ver == tmpInt){ + tmpInt++; + String verStr = String.valueOf(tmpInt); + if(verStr.length() <= 1){ + verStr= "0" + verStr; + } + plb.setProjectVersion(verStr); + this.updateById(plb); + } + } + } + + + /**检查车型名称id,年款号,目标市场,版本同时存在,报错*/ + public void checkExitData(ProjectLibraryBase projectLibraryBase){ + String projectNameId = projectLibraryBase.getProjectNameId(); + String yearNameId = projectLibraryBase.getYearNameId(); + String targetMarket = projectLibraryBase.getTargetMarket(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("project_name_id",projectNameId) + .eq("year_name_id",yearNameId) + .eq("target_market",targetMarket) + .eq("project_version",targetMarket); + if(StringUtils.isNotBlank(projectLibraryBase.getId())){ + queryWrapper.ne("id",projectLibraryBase.getId()); + } + Integer count = projectLibraryBaseMapper.selectCount(queryWrapper); + if (count > 0) { + if(CutEnum.CN.getValue().equals(projectLibraryBase.getCut())) { + throw new JeroBootException("已存在车型名称,年款号,目标市场均同的数据"); + }else{ + throw new JeroBootException("There are data with the same model name, model number and target market."); + } + } + } + /** + * 更新 + * + * @param projectLibraryBase + * @return + */ + @Override + public void editById(ProjectLibraryBase projectLibraryBase) { + Date now = new Date(); + projectLibraryBase.setUpdateTime(now); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + projectLibraryBase.setUpdateBy(sysUser.getUsername()); + + ProjectLibraryBase original = baseMapper.selectById(projectLibraryBase.getId()); + + // 如果studio编辑了认证工程师,需要给旧的认证工程师发送认证清单任务消息 + if(StringUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer()) && StringUtils.isNotEmpty(original.getCertificationEngineer())){ + this.editCertificationEngineer(projectLibraryBase, original); + } + + checkExitData(projectLibraryBase); + saveOrUpdate(projectLibraryBase); + checkVersionOrder(projectLibraryBase.getParentId(),projectLibraryBase.getProjectVersion(),projectLibraryBase.getId()); + + // 删除当前项目的studio与项目库 角色关系 + QueryWrapper deleteLibraryRoleRelWrapper = new QueryWrapper<>(); + deleteLibraryRoleRelWrapper.lambda().eq(ProjectLibraryRoleRelEO::getProjectLibraryId,projectLibraryBase.getId()); + projectLibraryRoleRelEOService.remove(deleteLibraryRoleRelWrapper); + //删除当前项目studio项目权限 + QueryWrapper delStudioPermission = new QueryWrapper<>(); + delStudioPermission.eq("project_id", projectLibraryBase.getId()).eq("belong", ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue()); + projectUserPermissionService.remove(delStudioPermission); + //删除当前项目certification engineer项目权限 + QueryWrapper delCertificationPermission = new QueryWrapper<>(); + delCertificationPermission.eq("project_id", projectLibraryBase.getId()).eq("belong", ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue()); + projectUserPermissionService.remove(delCertificationPermission); + + /*// 初始化当前项目的studio与项目库 角色关系 + ProjectLibraryRoleRelEO projectLibraryRoleRelEO = new ProjectLibraryRoleRelEO(); + projectLibraryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId()); + projectLibraryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer()); + projectLibraryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue()); + projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO);*/ + + List projectLibraryRoleRelEOList = new ArrayList<>(); + //初始化当前项目的studio与项目库 法规清单 角色关系 + ProjectLibraryRoleRelEO lawsInventoryRoleRelEO = new ProjectLibraryRoleRelEO(); + lawsInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId()); + lawsInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer()); + lawsInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue()); + lawsInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.LAWS_INVENTORY.getValue()); + projectLibraryRoleRelEOList.add(lawsInventoryRoleRelEO); + + // 初始化当前项目的studio与项目库 认证清单 角色关系 + ProjectLibraryRoleRelEO certificationInventoryRoleRelEO = new ProjectLibraryRoleRelEO(); + certificationInventoryRoleRelEO.setProjectLibraryId(projectLibraryBase.getId()); + certificationInventoryRoleRelEO.setUserId(projectLibraryBase.getStudioEngineer()); + certificationInventoryRoleRelEO.setRoleCode(ProjectRoleEnum.STUDIO_ENGINEER.getValue()); + certificationInventoryRoleRelEO.setModelType(RoleRelModelTypeEnum.CERTIFICATION_INVENTORY.getValue()); + projectLibraryRoleRelEOList.add(certificationInventoryRoleRelEO); + this.projectLibraryRoleRelEOService.saveBatch(projectLibraryRoleRelEOList); + + //重新设置当前项目studio项目权限 + List engineers = new ArrayList<>(); + ProjectUserPermission studioPermission = new ProjectUserPermission(); + studioPermission.setProjectId(projectLibraryBase.getId()); + studioPermission.setUserId(projectLibraryBase.getStudioEngineer()); + studioPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_STUDIO.getValue()); + studioPermission.setCreateTime(now); + studioPermission.setUpdateTime(now); + engineers.add(studioPermission); + //重新设置当前项目certification engineer项目权限 + if (ObjectUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer())) { + for (String certificationEngineer : projectLibraryBase.getCertificationEngineer().split(",")) { + ProjectUserPermission certificationPermission = new ProjectUserPermission(); + certificationPermission.setProjectId(projectLibraryBase.getId()); + certificationPermission.setUserId(certificationEngineer); + certificationPermission.setBelong(ProjectUserLocationEnum.PROJECT_ADD_CERTIFICATION.getValue()); + certificationPermission.setCreateTime(now); + certificationPermission.setUpdateTime(now); + engineers.add(certificationPermission); + } + } + if (ObjectUtils.isNotEmpty(engineers)) { + projectUserPermissionService.saveBatch(engineers); + } + + //编辑时如果认证工程师发生变化,同步修改相关人员名单中的认证工程师 + List result = projectRelatedPersonnelMapper.queryPageList(projectLibraryBase.getId(), + DictCodeEnum.DUTY_TERRITORY.getValue(), null, null, null, null,null); + //项目的认证工程师 + String certificationEngineer = projectLibraryBase.getCertificationEngineer(); + //一个都不选的情况下 + if ("".equals(certificationEngineer)) { + //删除当前项目的相关人员名单中认证工程师权限 + QueryWrapper delWrapper = new QueryWrapper<>(); + delWrapper.eq("project_id", projectLibraryBase.getId()) + .eq("belong", ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue()); + projectUserPermissionService.remove(delWrapper); + //删除当前项目的法规清单中认证工程师权限 + QueryWrapper delLawInventoryWrapper = new QueryWrapper<>(); + delLawInventoryWrapper.eq("project_id", projectLibraryBase.getId()) + .eq("belong", ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue()); + projectUserPermissionService.remove(delLawInventoryWrapper); + } + //选择了其他工程师 + if(StringUtils.isNotBlank(certificationEngineer)){ + if(StringUtils.isNotEmpty(original.getCertificationEngineer())){ + for (String id : original.getCertificationEngineer().split(",")) { + if (!certificationEngineer.contains(id)) { + //如果原来的认证工程师被删除了,则需要同步删除当前项目的相关人员名单中该认证工程师权限 + QueryWrapper delWrapper = new QueryWrapper<>(); + delWrapper.eq("project_id", projectLibraryBase.getId()).eq("user_id",id). + eq("belong", ProjectUserLocationEnum.PROJECT_DETAIL_RELEVANT_PERSONNEL_CERTIFICATION.getValue()); + projectUserPermissionService.remove(delWrapper); + //如果原来的认证工程师被删除了,则需要同步删除当前项目的法规清单中该认证工程师权限 + QueryWrapper delLawInventoryWrapper = new QueryWrapper<>(); + delLawInventoryWrapper.eq("project_id", projectLibraryBase.getId()).eq("user_id",id). + eq("belong", ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue()); + projectUserPermissionService.remove(delLawInventoryWrapper); + } + } + } + + + for (ProjectRelatedPersonnel projectRelatedPersonnel : result) { + //相关人员名单的认证工程师 + String certificationEngineerTemp = projectRelatedPersonnel.getCertificationEngineer(); + if(StringUtils.isNotBlank(certificationEngineerTemp)){ + StringBuilder sb = new StringBuilder(); + for (String s : certificationEngineerTemp.split(",")) { + if(certificationEngineer.contains(s)){ + sb.append(s + ","); + } + } + String substring = ""; + if(StringUtils.isNotBlank(sb)){ + substring = sb.substring(0, sb.length() - 1); + } + projectRelatedPersonnel.setCertificationEngineer(substring); + } + } + //批量修改相关人员名单信息中的认证工程师 + projectRelatedPersonnelService.updateBatchById(result); + } + /** + *法规清单发起任务前或任务结束后修改studio或者修改认证工程师时, + *如果设计符合性确认、Pre-Homo确认、 验证符合性确认中的发起人跟责任人引用到了这两人, + *而且这两个人不属于相关人员名单的工程接口人和法规工程师,同步删除这两人的权限 + */ + + List belongs = new ArrayList<>(); + belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_INITIATOR.getValue()); + belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_DUTY.getValue()); + belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_INITIATOR.getValue()); + belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_DUTY.getValue()); + belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_INITIATOR.getValue()); + belongs.add(ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_DUTY.getValue()); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("project_library_id", projectLibraryBase.getId()); + List list = projectLawsInventoryEOService.list(queryWrapper); + if (ObjectUtils.isNotEmpty(list)) { + for (ProjectLawsInventoryEO lawsInventoryEO : list) { + boolean boo = false; + //发起任务前 + if (TaskAffirmStatusEnum.NOT_STARTED.getValue().equals(lawsInventoryEO.getTaskAffirmStatus())) { + boo = true; + } + //任务结束后 + if (!boo) { + int count = 0; + QueryWrapper taskInventoryQueryWrapper = new QueryWrapper<>(); + taskInventoryQueryWrapper.eq("project_laws_inventory_id",lawsInventoryEO.getId()); + List taskInventoryRecords = projectTaskInventoryEOMapper.selectList(taskInventoryQueryWrapper); + for (ProjectTaskInventoryEO taskInventoryRecord : taskInventoryRecords) { + String designStatus = taskInventoryRecord.getDesignStatus(); + String verifyStatus = taskInventoryRecord.getVerifyStatus(); + String prehomoStatus = taskInventoryRecord.getPrehomoStatus(); + boolean designStatusFlag = StringUtils.isBlank(designStatus) || designStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue()); + boolean verifyStatusFlag = StringUtils.isBlank(verifyStatus) || verifyStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue()); + boolean prehomoStatusFlag = StringUtils.isBlank(prehomoStatus) || prehomoStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue()); + if (designStatusFlag && verifyStatusFlag && prehomoStatusFlag) { + count++; + } + } + if (count == 3) { + boo = true; + } + } + if (boo) { + QueryWrapper personnelQueryWrapper = new QueryWrapper<>(); + personnelQueryWrapper.eq("duty_territory", lawsInventoryEO.getDutyTerritory()).eq("project_id", projectLibraryBase.getId()); + List personnels = projectRelatedPersonnelService.list(personnelQueryWrapper); + + if (!original.getStudioEngineer().equals(projectLibraryBase.getStudioEngineer())) { + StringBuilder participator = new StringBuilder(); + if (ObjectUtils.isNotEmpty(personnels)) { + if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) { + participator.append(personnels.get(0).getLawEngineer() + ","); + } + if (ObjectUtils.isNotEmpty(personnels.get(0).getCertificationEngineer())) { + participator.append(personnels.get(0).getCertificationEngineer() + ","); + } + if (ObjectUtils.isNotEmpty(personnels.get(0).getEngineeringInterfacePerson())) { + participator.append(personnels.get(0).getEngineeringInterfacePerson() + ","); + } + } + if (!participator.toString().contains(original.getStudioEngineer())) { + //删除当前studio在法规清单中的人员权限 + QueryWrapper del = new QueryWrapper<>(); + del.eq("project_id", projectLibraryBase.getId()).eq("user_id", original.getStudioEngineer()).in("belong",belongs). + eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryEO.getId()); + projectUserPermissionService.remove(del); + } + } + if (ObjectUtils.isNotEmpty(original.getCertificationEngineer())) { + for (String id : original.getCertificationEngineer().split(",")) { + if (!certificationEngineer.contains(id)) { + StringBuilder participator = new StringBuilder(); + if (ObjectUtils.isNotEmpty(personnels)) { + if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) { + participator.append(personnels.get(0).getLawEngineer() + ","); + } + if (ObjectUtils.isNotEmpty(personnels.get(0).getEngineeringInterfacePerson())) { + participator.append(personnels.get(0).getEngineeringInterfacePerson() + ","); + } + } + participator.append(original.getStudioEngineer()); + if (!participator.toString().contains(id)) { + //删除当前studio在法规清单中的人员权限 + QueryWrapper del = new QueryWrapper<>(); + del.eq("project_id", projectLibraryBase.getId()).eq("user_id", id).in("belong",belongs). + eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryEO.getId()); + projectUserPermissionService.remove(del); + } + } + } + } + } + } + } + + } + + /** + * 编辑认证工程师逻辑处理 + * @param newPlbEO + * @param oldPlbEO + */ + private void editCertificationEngineer(ProjectLibraryBase newPlbEO, ProjectLibraryBase oldPlbEO) { + List oldCertificationEngineerIdList = Arrays.asList(oldPlbEO.getCertificationEngineer().split(",")); + List newCertificationEngineerIdList = Arrays.asList(newPlbEO.getCertificationEngineer().split(",")); + + oldCertificationEngineerIdList = oldCertificationEngineerIdList.stream().filter(originalCertificationEngineerId -> { + boolean flag = true; + for (String newCertificationEngineerId : newCertificationEngineerIdList) { + // 如果新传进来的 认证工程师id跟现有的认证工程师id一致,不用发消息 + if(StringUtils.equals(newCertificationEngineerId,originalCertificationEngineerId)){ + flag = false; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(oldCertificationEngineerIdList)){ + // 判断当前项目下是否还有需要认证工程师操作的数据 只有清单待校核、结果待审查 这两个状态的数据由认证工程师操作。 + List flowStatusList = new ArrayList<>(); + flowStatusList.add(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); + flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()); + + QueryWrapper certificationInventoryEOQueryWrapper = new QueryWrapper<>(); + certificationInventoryEOQueryWrapper.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId, newPlbEO.getId()); + certificationInventoryEOQueryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); + List projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(certificationInventoryEOQueryWrapper); + if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){ + this.projectCertificationInventoryEOService.certificationInventoryEOListSortByEndTimeAsc(projectCertificationInventoryEOList); + List userInfoList = this.sysUserService.querySysUserListByIdList(oldCertificationEngineerIdList); + this.projectCertificationInventoryEOService.sendMessageByTemplateId( + projectCertificationInventoryEOList, + TemplateInfoEnum2.CERTIFICATION_MESSAGE13.getValue(), + oldCertificationEngineerIdList, + userInfoList, + projectCertificationInventoryEOList.get(0).getEndTime(),"" + ); + } + } + + this.setRzlcCertificationEngineerTask(newPlbEO); + } + + /** + * 重新设置认证工程师在待办中心的 认证流程的 待办任务。 + * @param projectLibraryBase + */ + private void setRzlcCertificationEngineerTask(ProjectLibraryBase projectLibraryBase) { + if(org.apache.commons.lang3.StringUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer())){ + List certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId, projectLibraryBase.getId()); + List pciEOList = this.projectCertificationInventoryEOService.list(pciQueryWrap); + + if(CollectionUtils.isNotEmpty(pciEOList)){ + // 清单待校核的数据 + List pciToBeCheckedList = pciEOList.stream().filter(pci -> { + boolean flag = false; + if(StringUtils.equals(pci.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + // 如果该项目下清单待校核的数据不为空,给这些认证工程师分配待办任务。 + if(CollectionUtils.isNotEmpty(pciToBeCheckedList)){ + // 删除待办中心(是这个项目库的 pre-Homo流程的待办任务, 认证工程师接受任务节点的数据) + QueryWrapper pidQueryWrap = new QueryWrapper<>(); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, projectLibraryBase.getId()); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSJSRW.getKey()); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue()); + pidQueryWrap.orderByAsc("end_time"); + List pidEoList = this.processInfoDetailEOService.list(pidQueryWrap); + if(CollectionUtils.isNotEmpty(pidEoList)){ + List pidEoIdList = pidEoList.stream().map(ProcessInfoDetailEO::getId).distinct().collect(Collectors.toList()); + this.processInfoDetailEOService.deleteByIds(pidEoIdList); + } + + // 获取责任确认截止时间 最早的时间 + this.projectCertificationInventoryEOService.certificationInventoryEOListSortByTaskConfirmEndTimeAsc(pciToBeCheckedList); + Date endTime = pciToBeCheckedList.get(0).getInventoryVerifyEndTime(); + if(ObjectUtils.isEmpty(endTime)){ + endTime = pidEoList.get(0).getEndTime(); + } + + // 给认证工程师分配任务 + List processInfoDetailEOList = new ArrayList<>(); + for (String userId : certificationEngineerIdList) { + ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO(); + processInfoDetailEO.setUserId(userId); + processInfoDetailEO.setTaskDefinitionKey(CertificationFlowNodeEnum.RZGCSJSRW.getKey()); + processInfoDetailEO.setCreateTime(new Date()); + processInfoDetailEO.setStatus(TaskStatusEnum.NOT_DONE.getValue()); + processInfoDetailEO.setProcessInfoId(projectLibraryBase.getId()); + processInfoDetailEO.setActiProcInstId(projectLibraryBase.getId()); + processInfoDetailEO.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue()); + processInfoDetailEO.setEndTime(endTime); + processInfoDetailEOList.add(processInfoDetailEO); + } + this.processInfoDetailEOService.saveBatch(processInfoDetailEOList); + } + + // 结果待提交的数据 + List pciToBeReviewEDList = pciEOList.stream().filter(pci -> { + boolean flag = false; + if(StringUtils.equals(pci.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(pciToBeReviewEDList)){ + // 删除待办中心(是这个项目库的 pre-Homo流程的待办任务, 认证工程师审查 任务节点的数据) + QueryWrapper pidQueryWrap = new QueryWrapper<>(); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, projectLibraryBase.getId()); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSSC.getKey()); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue()); + pidQueryWrap.orderByAsc("end_time"); + List pidEoList = this.processInfoDetailEOService.list(pidQueryWrap); + + // 获取截止日期最早的一天。 + this.projectCertificationInventoryEOService.certificationInventoryEOListSortByEndTimeAsc(pciToBeReviewEDList); + Date endTime = pciToBeReviewEDList.get(0).getEndTime(); + if(CollectionUtils.isNotEmpty(pidEoList)){ + endTime = pidEoList.get(0).getEndTime(); + + List pidEoIdList = pidEoList.stream().map(ProcessInfoDetailEO::getId).distinct().collect(Collectors.toList()); + this.processInfoDetailEOService.deleteByIds(pidEoIdList); + } + + // 给认证工程师分配任务 + List processInfoDetailEOList = new ArrayList<>(); + for (String userId : certificationEngineerIdList) { + ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO(); + processInfoDetailEO.setUserId(userId); + processInfoDetailEO.setTaskDefinitionKey(CertificationFlowNodeEnum.RZGCSSC.getKey()); + processInfoDetailEO.setCreateTime(new Date()); + processInfoDetailEO.setStatus(TaskStatusEnum.NOT_DONE.getValue()); + processInfoDetailEO.setProcessInfoId(projectLibraryBase.getId()); + processInfoDetailEO.setActiProcInstId(projectLibraryBase.getId()); + processInfoDetailEO.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue()); + processInfoDetailEO.setEndTime(endTime); + processInfoDetailEOList.add(processInfoDetailEO); + } + this.processInfoDetailEOService.saveBatch(processInfoDetailEOList); + } + } + } + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @Override + public void deleteById(String id,String cut) { + checkData(id,cut); + + // 关联删除项目下的所有收集清单 + paramsManifestEOService.deleteByProjectId(id); + + //删除主项目 + removeById(id); + + //删除子项目 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProjectLibraryBase::getParentId,id); + List list = this.list(wrapper); + if(ObjectUtils.isNotEmpty(list)){ + List idList = list.stream().map(ProjectLibraryBase::getId).collect(Collectors.toList()); + this.removeByIds(idList); + } + + //关联删除-相关人员 + QueryWrapper relatedPersonnelQueryWrapper = new QueryWrapper<>(); + relatedPersonnelQueryWrapper.eq("project_id",id); + projectRelatedPersonnelService.remove(relatedPersonnelQueryWrapper); + + //关联删除-任务计划时间轴 + QueryWrapper taskPlanningQueryWrapper = new QueryWrapper<>(); + taskPlanningQueryWrapper.eq("project_id",id); + projectTaskPlanningService.remove(taskPlanningQueryWrapper); + + //关联删除-法规清单 + QueryWrapper lawsInventoryEOQueryWrapper = new QueryWrapper<>(); + lawsInventoryEOQueryWrapper.eq("project_library_id ",id); + projectLawsInventoryEOService.remove(lawsInventoryEOQueryWrapper); + + //关联删除-法规清单log + QueryWrapper logEOQueryWrapper = new QueryWrapper<>(); + logEOQueryWrapper.in("project_library_id",id); + projectLawsInventoryLogEOService.remove(logEOQueryWrapper); + + //删除权限 + QueryWrapper permissionQueryWrapper = new QueryWrapper<>(); + permissionQueryWrapper.eq("project_id", id); + projectUserPermissionService.remove(permissionQueryWrapper); + } + + /* + * 判断是否可以删除 + */ + @Override + public void checkData(String id, String cut) { + //判断该条项目是否是自己创建,如果不是则不能删除 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List projectLibraryBases = this.queryById(id,null); + //管理员和创建人可以删除,其余人不能删除 + boolean administrator = sysUserService.isAdministrator(); + if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy()) && !administrator){ + if(CutEnum.CN.getValue().equals(cut)){ + throw new JeroBootException("该条项目非本人创建,不能删除"); + }else{ + throw new JeroBootException("This item is not created by myself and cannot be deleted"); + } + } + QueryWrapper lawsInventoryQueryWrapper = new QueryWrapper<>(); + lawsInventoryQueryWrapper.eq("project_library_id",id); + List lawsInventoryRecords = projectLawsInventoryEOMapper.selectList(lawsInventoryQueryWrapper); + for(ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryRecords){ + String inventoryAffirmStatus = projectLawsInventoryEO.getInventoryAffirmStatus();//清单确认状态 + //清单确认状态(未发起、接受、拒绝) + boolean inventoryAffirmFlag = ( + org.apache.commons.lang3.StringUtils.equals(inventoryAffirmStatus,TaskAffirmStatusEnum.NOT_STARTED.getValue()) || + org.apache.commons.lang3.StringUtils.equals(inventoryAffirmStatus,TaskAffirmStatusEnum.ACCEPTED.getValue()) || + org.apache.commons.lang3.StringUtils.equals(inventoryAffirmStatus,TaskAffirmStatusEnum.REJECTED.getValue()) + ); + + String taskAffirmStatus = projectLawsInventoryEO.getTaskAffirmStatus();//任务确认状态 + //任务确认状态(未发起、接受、拒绝) + boolean taskAffirmFlag = ( + org.apache.commons.lang3.StringUtils.equals(taskAffirmStatus,TaskAffirmStatusEnum.NOT_STARTED.getValue()) || + org.apache.commons.lang3.StringUtils.equals(taskAffirmStatus,TaskAffirmStatusEnum.ACCEPTED.getValue()) || + org.apache.commons.lang3.StringUtils.equals(taskAffirmStatus,TaskAffirmStatusEnum.REJECTED.getValue()) + ); + + if (!(inventoryAffirmFlag && taskAffirmFlag)) { + if (CutEnum.CN.getValue().equals(cut)) { + throw new JeroBootException("当前项目下有未走完的流程,不能删除"); + }else{ + throw new JeroBootException("There are unfinished processes under the current project and cannot be deleted."); + } + } + + String lawsInventoryId = projectLawsInventoryEO.getId(); + + QueryWrapper taskInventoryQueryWrapper = new QueryWrapper<>(); + taskInventoryQueryWrapper.eq("project_laws_inventory_id",lawsInventoryId); + List taskInventoryRecords = projectTaskInventoryEOMapper.selectList(taskInventoryQueryWrapper); + //设计、验证、prehomo流程(流程状态是空 或 审查完成) + for(ProjectTaskInventoryEO projectTaskInventoryEO : taskInventoryRecords){ + String designStatus = projectTaskInventoryEO.getDesignStatus(); + String verifyStatus = projectTaskInventoryEO.getVerifyStatus(); + String prehomoStatus = projectTaskInventoryEO.getPrehomoStatus(); + + boolean designStatusFlag = StringUtils.isBlank(designStatus) || designStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue()); + boolean verifyStatusFlag = StringUtils.isBlank(verifyStatus) || verifyStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue()); + boolean prehomoStatusFlag = StringUtils.isBlank(prehomoStatus) || prehomoStatus.equals(DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue()); + + if (!(designStatusFlag && verifyStatusFlag && prehomoStatusFlag)) { + if (CutEnum.CN.getValue().equals(cut)) { + throw new JeroBootException("当前项目下有未走完的流程,不能删除"); + }else{ + throw new JeroBootException("There are unfinished processes under the current project and cannot be deleted."); + } + } + } + } + } + /** + * 批量删除 + * + * @param ids + * @return + */ + @Override + public void deleteByIds(List ids,String cut) { + for(String id :ids){ + checkData(id,cut); + } + removeByIds(ids); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override + public List queryById(String id,String cut) { + List records = projectLibraryBaseMapper.queryById(id); + disposeData(records,"",false); + //目标市场数据字典 + List targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode()); + for(ProjectLibraryBase projectLibraryBase: records){ + //历史数据的主版本没有版本号,所以默认给00 + if(StringUtils.isBlank(projectLibraryBase.getParentId()) && StringUtils.isBlank(projectLibraryBase.getProjectVersion())){ + projectLibraryBase.setProjectVersion("00"); + } + //目标市场 + Map param = new HashMap<>(); + param.put("cut",cut); + String targetMarket = getMarket(param, targetMarketList, projectLibraryBase); + //主项目的版本号 + String projectVersion = ""; + if(StringUtils.isBlank(projectLibraryBase.getParentId())){ + projectVersion = "00"; + }else{ + projectVersion = projectLibraryBase.getProjectVersion(); + } + if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){ + projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + + "-" + projectLibraryBase.getYearName() + + "-" + targetMarket); +// projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() +// + "-" + projectLibraryBase.getYearName() +// + "-" + targetMarket +// + "-" + projectVersion); + } + } + return records; + } + + /** + * 列表查询 + * + * @return + */ + @Override + public List getList(ProjectLibraryBase projectLibraryBase) { + List list = projectLibraryBaseMapper.getList(projectLibraryBase); + return list; + } + + /** + * 分页列表查询 + * + * @return + */ + @Override + public List queryPageList(Map params) { + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + Integer isViewer = sysRoleMapper.queryUserRoleByCode(ProjectRoleEnum.VIEWER.getName(), loginUser.getId()); + Set projectIds = new HashSet<>(); + //根据项目用户权限表筛选有权访问的项目 + Set permissionProjectIds = projectUserPermissionMapper.queryProjectIdsByUserId(loginUser.getId()); + if (ObjectUtils.isNotEmpty(permissionProjectIds)) { + projectIds.addAll(permissionProjectIds); + } + if (isViewer > 0) { + //如果是Viewer,根据配置的品牌筛选可访问的项目 + List brandTypes = projectUserBrandService.queryBrandByUserId(loginUser.getId()); + if (ObjectUtils.isNotEmpty(brandTypes)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("brand",brandTypes); + if (ObjectUtils.isNotEmpty(list(queryWrapper))) { + projectIds.addAll(list(queryWrapper).stream().map(ProjectLibraryBase::getId).collect(Collectors.toSet())); + } + } + } + + List result = projectLibraryBaseMapper.queryPageList(params); + disposeData(result,"",false); + //目标市场 + List targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode()); + + //置顶 + List idList = result.stream().map(ProjectLibraryBase::getId).collect(Collectors.toList()); + List topProjectEOList = new ArrayList<>(); + if(ObjectUtils.isNotEmpty(idList)){ + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(TopProjectEO::getCreateBy,loginUser.getUsername()).in(TopProjectEO::getProjectLibraryBaseId,idList).orderByDesc(TopProjectEO::getSort); + topProjectEOList = iTopProjectEOService.list(wrapper); + } + + for(ProjectLibraryBase projectLibraryBase: result){ + //置顶处理 + if(ObjectUtils.isNotEmpty(topProjectEOList)){ + List collect = topProjectEOList.stream() + .filter(e -> projectLibraryBase.getId().equals(e.getProjectLibraryBaseId()) + && loginUser.getUsername().equals(e.getCreateBy())) + .collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect)){ + projectLibraryBase.setFlag(collect.get(0).getFlag()); + projectLibraryBase.setSort(collect.get(0).getSort()); + }else{ + projectLibraryBase.setSort("0"); + } + }else{ + projectLibraryBase.setSort("0"); + } + //目标市场 + String targetMarket = getMarket(params, targetMarketList, projectLibraryBase); + //主项目的版本号 + String projectVersion = ""; + if(StringUtils.isBlank(projectLibraryBase.getParentId())){ + projectVersion = "00"; + }else{ + projectVersion = projectLibraryBase.getProjectVersion(); + } + if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){ + projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + + "-" + projectLibraryBase.getYearName() + + "-" + targetMarket + + "-" + projectVersion); + } + } + + if(ObjectUtils.isEmpty(params.get("orderByField"))){ + Collections.sort(result, new Comparator() { + @Override + public int compare(ProjectLibraryBase o1, ProjectLibraryBase o2) { + return -o1.getSort().compareTo(o2.getSort()); + } + }); + } + + //所有主项目 + List projectLibraryBaseListParent = projectLibraryBaseMapper.queryMaimList(); + disposeData(projectLibraryBaseListParent,"",false); + for(ProjectLibraryBase projectLibraryBase: projectLibraryBaseListParent){ + //目标市场 + String targetMarket = getMarket(params, targetMarketList, projectLibraryBase); + //主项目的版本号 + String projectVersion = ""; + if(StringUtils.isBlank(projectLibraryBase.getParentId())){ + projectVersion = "00"; + }else{ + projectVersion = projectLibraryBase.getProjectVersion(); + } + if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){ + projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + + "-" + projectLibraryBase.getYearName() + + "-" + targetMarket + + "-" + projectVersion); + } + } + + //项目名称模糊查询特殊处理(因为项目名称是多字段拼接的) + if(ObjectUtils.isNotEmpty(params.get("projectName"))){ + result = result.stream().filter(e->e.getProjectName().toLowerCase().contains(String.valueOf(params.get("projectName")).toLowerCase())).collect(Collectors.toList()); + } + List projectLibraryBaseParentList = result.stream().filter(e -> StringUtils.isBlank(e.getParentId())).distinct().collect(Collectors.toList()); + //处理搜索版本号,(因为列表展示数据是以主项目为主并绑定子项目, 所以搜索的时候只有子项目这种情况需要特殊处理) + List resultNew = getProjectLibraryBases(result, projectLibraryBaseListParent); + disposeData(resultNew,"",false); + + + //数据组装 +// List resultTemp = new LinkedList<>(); +// for (ProjectLibraryBase projectLibraryBase : result) { +// if(StringUtils.isBlank(projectLibraryBase.getParentId())){ +// resultTemp.add(projectLibraryBase); +// } +// } + + for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseParentList) { + //子项目 + List children = result.stream() + .filter(e -> StringUtils.isNotBlank(e.getParentId()) && projectLibraryBase.getId().equals(e.getParentId())).collect(Collectors.toList()); + if(children.size() != 0){ + //子项目的基础上添加的子项目 + List childrenIdList = children.stream().map(ProjectLibraryBase::getId).distinct().collect(Collectors.toList()); + List childrenList = result.stream() + .filter(e -> StringUtils.isNotBlank(e.getParentId()) && childrenIdList.contains(e.getParentId())).collect(Collectors.toList()); + children.addAll(childrenList); + + //按版本排序 + Collections.sort(children); + projectLibraryBase.setChildren(children); + //最后一个版本号(主项目和主项目都需要设置) + String versionLast = children.get(children.size() - 1).getProjectVersion(); + //主版本设置最后一个版本号(用于项目扩展中的版本号) + projectLibraryBase.setVersionLast(versionLast); + for (ProjectLibraryBase child : children) { + //每个子版本版本设置最后一个版本号(用于项目扩展中的版本号) + child.setVersionLast(versionLast); + } + } + } + + List resultLast = new ArrayList<>(); + //权限筛选 + if (sysUserService.isAdministrator()) { + //管理员查看全部 + if(ObjectUtils.isNotEmpty(projectLibraryBaseParentList)){ + resultLast = projectLibraryBaseParentList; + }else{ + resultLast = resultNew; + } + } else { + for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseParentList) { + //判断父项目是否有权限 + if (!projectIds.contains(projectLibraryBase.getId())) { + //判断子项目是否有权限 + List children = projectLibraryBase.getChildren(); + if (ObjectUtils.isNotEmpty(children)) { + for (ProjectLibraryBase child : children) { + //将有权限的放入最后返回的集合中 + if (projectIds.contains(child.getId())) { + resultLast.add(child); + } + } + } + } else { + List children = projectLibraryBase.getChildren(); + if (ObjectUtils.isNotEmpty(children)) { + List lastChild = new ArrayList<>(); + //判断子项目是否有权限 + for (ProjectLibraryBase child : children) { + if (projectIds.contains(child.getId())) { + lastChild.add(child); + } + } + projectLibraryBase.setChildren(lastChild); + } + resultLast.add(projectLibraryBase); + } + + } + } + //表头排序 + hearSort(params, resultLast); + return resultLast; + } + + private void hearSort(Map params, List resultLast) { + if(ObjectUtils.isNotEmpty(params.get("orderByField"))){ + Collator comparator = Collator.getInstance(Locale.CHINESE); + //项目名称,R&H Studio,车型平台,数字平台 + if("projectName".equals(params.get("orderByField"))){ + if(OrderEnum.POSITIVE.getValue().equals(params.get("orderBy"))){ + Collections.sort(resultLast,(e1, e2)->{ + return comparator.compare(e1.getProjectName(),e2.getProjectName()); + }); + }else if(OrderEnum.REVERSE.getValue().equals(params.get("orderBy"))){ + Collections.sort(resultLast,(e1,e2)->{ + return comparator.compare(e2.getProjectName(),e1.getProjectName()); + }); + } + } + //R&H Studio + if("studioEngineerName".equals(params.get("orderByField"))){ + if(OrderEnum.POSITIVE.getValue().equals(params.get("orderBy"))){ + Collections.sort(resultLast,(e1, e2)->{ + return comparator.compare(e1.getStudioEngineerName(),e2.getStudioEngineerName()); + }); + }else if(OrderEnum.REVERSE.getValue().equals(params.get("orderBy"))){ + Collections.sort(resultLast,(e1,e2)->{ + return comparator.compare(e2.getStudioEngineerName(),e1.getStudioEngineerName()); + }); + } + } + //车型平台 + if("vehiclePlatform".equals(params.get("orderByField"))){ + if(OrderEnum.POSITIVE.getValue().equals(params.get("orderBy"))){ + Collections.sort(resultLast,(e1, e2)->{ + return comparator.compare(e1.getVehiclePlatform(),e2.getVehiclePlatform()); + }); + }else if(OrderEnum.REVERSE.getValue().equals(params.get("orderBy"))){ + Collections.sort(resultLast,(e1,e2)->{ + return comparator.compare(e2.getVehiclePlatform(),e1.getVehiclePlatform()); + }); + } + } + //数字平台 + if("digitalPlatform".equals(params.get("orderByField"))){ + if(OrderEnum.POSITIVE.getValue().equals(params.get("orderBy"))){ + Collections.sort(resultLast,(e1, e2)->{ + return comparator.compare(e1.getDigitalPlatform(),e2.getDigitalPlatform()); + }); + }else if(OrderEnum.REVERSE.getValue().equals(params.get("orderBy"))){ + Collections.sort(resultLast,(e1,e2)->{ + return comparator.compare(e2.getDigitalPlatform(),e1.getDigitalPlatform()); + }); + } + } + } + } + + @NotNull + private List getProjectLibraryBases(List result, List projectLibraryBaseListParent) { + //result中的主项目以及子项目对应的主项目 + List resultParent = new LinkedList<>(); + for (ProjectLibraryBase projectLibraryBase : result) { + if(StringUtils.isBlank(projectLibraryBase.getParentId())){ + resultParent.add(projectLibraryBase); + }else{ + //子项目 + List collect = result.stream() + .filter(e -> projectLibraryBase.getId().equals(e.getParentId())) + .collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect)){ + resultParent.addAll(collect); + } + + } + } + + //搜索结果中子项目的子项目 + List resultChild = new ArrayList<>(); + //所有子项目 + List childrenListTemp = result.stream().filter(e -> StringUtils.isNotBlank(e.getParentId())).collect(Collectors.toList()); + List childrenIdListTemp = childrenListTemp.stream().map(ProjectLibraryBase::getId).collect(Collectors.toList()); + + //子项目的子项目 + List collect3 = result.stream().filter(e -> StringUtils.isNotBlank(e.getParentId()) && childrenIdListTemp.contains(e.getParentId())).collect(Collectors.toList()); + + if(ObjectUtils.isNotEmpty(collect3)){ + //子项目的子项目的父id + List childList = collect3.stream().map(ProjectLibraryBase::getParentId).collect(Collectors.toList()); + //子项目 + resultChild = childrenListTemp.stream().filter(e -> childList.contains(e.getId())).collect(Collectors.toList()); + } + + + //所有的主项目与通过筛选条件查询来的主项目进行过滤 + List resultNew = new LinkedList<>(); + //主项目 + List collect1 = result.stream().filter(e -> StringUtils.isBlank(e.getParentId())).collect(Collectors.toList()); + resultNew.addAll(collect1); + List projectLibraryBaseList = new ArrayList<>(); + for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseListParent) { + List resultNewTemp = new ArrayList<>(); + //子项目 + List collect = result.stream().filter(e -> projectLibraryBase.getId().equals(e.getParentId())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect)){ + resultNewTemp.addAll(collect); + } + //子项目的子项目 + if(ObjectUtils.isNotEmpty(resultChild)){ + List collect2 = resultChild.stream().filter(e -> e.getParentId().equals(projectLibraryBase.getId())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect2)){ + resultNewTemp.addAll(collect2); + } + } + if(ObjectUtils.isNotEmpty(resultNewTemp)){ + projectLibraryBase.setChildren(resultNewTemp); + projectLibraryBaseList.add(projectLibraryBase); + } + } +// resultNew = resultNew.stream().distinct().collect(Collectors.toList()); + return projectLibraryBaseList; + } +// /** +// * 分页列表查询 +// * +// * @return +// */ +// @Override +// public List queryPageList(Map params) { +// List result = projectLibraryBaseMapper.queryPageList(params); +// disposeData(result,"",false); +// //目标市场 +// List targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode()); +// +// for(ProjectLibraryBase projectLibraryBase: result){ +// //目标市场 +// String targetMarket = getMarket(params, targetMarketList, projectLibraryBase); +// //主项目的版本号 +// String projectVersion = ""; +// if(StringUtils.isBlank(projectLibraryBase.getParentId())){ +// projectVersion = "00"; +// }else{ +// projectVersion = projectLibraryBase.getProjectVersion(); +// } +// if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){ +// projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() +// + "-" + projectLibraryBase.getYearName() +// + "-" + targetMarket +// + "-" + projectVersion); +// } +// } +// //项目名称模糊查询特殊处理(因为项目名称是多字段拼接的) +// if(ObjectUtils.isNotEmpty(params.get("projectName"))){ +// result = result.stream().filter(e->e.getProjectName().toLowerCase().contains(String.valueOf(params.get("projectName")).toLowerCase())).collect(Collectors.toList()); +// } +// //数据组装 +// List resultTemp = new LinkedList<>(); +// for (ProjectLibraryBase projectLibraryBase : result) { +// if(StringUtils.isBlank(projectLibraryBase.getParentId())){ +// resultTemp.add(projectLibraryBase); +// } +// } +// +// for (ProjectLibraryBase projectLibraryBase : resultTemp) { +// //子项目 +// List children = result.stream() +// .filter(e -> StringUtils.isNotBlank(e.getParentId()) && projectLibraryBase.getId().equals(e.getParentId())).collect(Collectors.toList()); +// if(children.size() != 0){ +// //子项目的基础上添加的子项目 +// List childrenIdList = children.stream().map(ProjectLibraryBase::getId).distinct().collect(Collectors.toList()); +// List childrenList = result.stream() +// .filter(e -> StringUtils.isNotBlank(e.getParentId()) && childrenIdList.contains(e.getParentId())).collect(Collectors.toList()); +// children.addAll(childrenList); +// +// //按版本排序 +// Collections.sort(children); +// projectLibraryBase.setChildren(children); +// //最后一个版本号(主项目和主项目都需要设置) +// String versionLast = children.get(children.size() - 1).getProjectVersion(); +// //主版本设置最后一个版本号(用于项目扩展中的版本号) +// projectLibraryBase.setVersionLast(versionLast); +// for (ProjectLibraryBase child : children) { +// //每个子版本版本设置最后一个版本号(用于项目扩展中的版本号) +// child.setVersionLast(versionLast); +// } +// } +// } +// return resultTemp; +// } + + public String getMarket(Map params, List targetMarketList, ProjectLibraryBase projectLibraryBase) { + List dictModelList = new ArrayList<>(); + if(StringUtils.isNotBlank(projectLibraryBase.getTargetMarket())){ + for (String s : projectLibraryBase.getTargetMarket().split(",")) { + List dictModelListTemp = targetMarketList.stream() + .filter(e -> s.equals(e.getValue())).collect(Collectors.toList()); + dictModelList.addAll(dictModelListTemp); + } + } + String targetMarket = ""; + if(dictModelList.size() != 0){ + StringBuilder sb = new StringBuilder(); + for (DictModel dictModel : dictModelList) { + if(CutEnum.CN.getValue().equals(params.get("cut"))){ + sb.append(dictModel.getText()+","); + }else{ + sb.append(dictModel.getTextEn()+","); + } + } + if(StringUtils.isNotBlank(sb)){ + targetMarket = sb.substring(0,sb.length()-1); + } + } + return targetMarket; + } + + public Page getPages(Integer currentPage, Integer pageSize, List list){ + Page page =new Page(); + if(list==null){ + return null; + } + int size = list.size(); + if(pageSize > size){ + pageSize = size; + } + if(pageSize!=0){ + //求出最⼤页数,防⽌currentPage越界 + int maxPage = size % pageSize ==0? size / pageSize : size / pageSize +1; + if(currentPage > maxPage){ + currentPage = maxPage; + } + } + //当前页第⼀条数据的下标 + int curIdx = currentPage >1?(currentPage -1)* pageSize :0; + List pageList =new ArrayList(); + //将当前页的数据放进pageList + for(int i =0; i < pageSize && curIdx + i < size; i++){ + pageList.add(list.get(curIdx + i)); + } + page.setCurrent(currentPage).setSize(pageSize).setTotal(list.size()).setRecords(pageList); + return page; + } + + +// /** +// * 分页列表查询 +// * +// * @return +// */ +// @Override +// public IPage queryPageList(Map params) { +// Integer pageNo = Integer.parseInt(params.get("pageNo").toString()); +// Integer pageSize = Integer.parseInt(params.get("pageSize").toString()); +// IPage page = new Page(pageNo, pageSize); +// IPage result = projectLibraryBaseMapper.queryPageList(page, params); +// List records = result.getRecords(); +// disposeData(records,"",false); +// for(ProjectLibraryBase projectLibraryBase: records){ +// if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){ +// projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName()); +// } +// } +// return result; +// } + + @Override + public void disposeData(List records,String cut,boolean disposeTargetMarketFlag) { + List targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode()); + for (ProjectLibraryBase projectLibraryBase : records) { + List sysUsers = new ArrayList<>(); + //认证工程师多个id查询 + if (StringUtils.isNotEmpty(projectLibraryBase.getCertificationEngineer())) { + List certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); + if (CollectionUtils.isNotEmpty(certificationEngineerIdList)) { + certificationEngineerIdList = certificationEngineerIdList.stream().distinct().collect(Collectors.toList()); + QueryWrapper userqueryWrapper = new QueryWrapper<>(); + userqueryWrapper.in("id ", certificationEngineerIdList); + sysUsers = sysUserMapper.selectList(userqueryWrapper); + } + + if (CollectionUtils.isNotEmpty(sysUsers)) { + String certificationEngineerId = projectLibraryBase.getCertificationEngineer(); + String certificationEngineerName = null; + StringBuilder certificationName = new StringBuilder(); + + for (String data : certificationEngineerIdList) { + if (StringUtils.isNotEmpty(certificationEngineerId)) { + certificationEngineerName = sysUsers.stream().filter(e -> data.equals(e.getId())) + .map(sysUser -> sysUser.getUsername()).collect(Collectors.joining(",")); + } + certificationName.append(certificationEngineerName).append(","); + } + if(StringUtils.isNotBlank(certificationName)){ + String substring = certificationName.substring(0, certificationName.length() - 1); + projectLibraryBase.setCertificationEngineerName(substring); + } + } + } + + if(disposeTargetMarketFlag){ + if(StringUtils.isNotEmpty(projectLibraryBase.getTargetMarket())){ + String targetMarketName = ""; + String[] targetMarketArr = projectLibraryBase.getTargetMarket().split(","); + if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + targetMarketName = targetMarketList.stream().filter(targetMarket -> { + boolean flag = false; + for (String s : targetMarketArr) { + if (StringUtils.equals(s, targetMarket.getValue())) { + flag = true; + } + } + return flag; + }).map(DictModel::getTextEn).collect(Collectors.joining(",")); + }else { + targetMarketName = targetMarketList.stream().filter(targetMarket -> { + boolean flag = false; + for (String s : targetMarketArr) { + if (StringUtils.equals(s, targetMarket.getValue())) { + flag = true; + } + } + return flag; + }).map(DictModel::getText).collect(Collectors.joining(",")); + } + projectLibraryBase.setTargetMarketName(targetMarketName); + } + } + + } + } + + @Override + public Map getProjectDetailsStatistics(String id) { + Map result = new HashMap<>(); + + //当前项目状态 + Map currentProjectStatusMap = new HashMap<>(); + //清单确认 + Map listingToConfirmMap = new HashMap<>(); + //任务确认 + Map taskToConfirmMap = new HashMap<>(); + //设计符合性 + Map designComplianceMap = new HashMap<>(); + //prehomo确认 + Map prehomoMap = new HashMap<>(); + //验证符合性 + Map verifyComplianceMap = new HashMap<>(); + //认证进度 + Map certificationProgressMap = new HashMap<>(); + // 认证任务确认 + Map rzTaskToConfirmMap = new HashMap<>(); + + //清单确认统计 + /*List> listingToConfirmMapList = this.projectLawsInventoryEOMapper.getlistingToConfirmStatistics(id); + listingToConfirmMap.put("listingToConfirmMapList",listingToConfirmMapList); + result.put("listingToConfirmMap",listingToConfirmMap);*/ + + QueryWrapper lawsInventoryEOQueryWrapper = new QueryWrapper<>(); + lawsInventoryEOQueryWrapper.lambda().in(ProjectLawsInventoryEO::getProjectLibraryId,Arrays.asList(id.split(","))); + List projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper); + if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){ + List projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); + + //任务确认统计 + List> taskToConfirmMapList = this.projectLawsInventoryEOService.getTaskToConfirmStatistics(projectLawsInventoryEOList); + int taskAffirmStatusCount = 0; + if(CollectionUtils.isNotEmpty(taskToConfirmMapList)){ + //taskAffirmStatusCount + for (Map taskToConfirm : taskToConfirmMapList) { + taskAffirmStatusCount += (int) taskToConfirm.get("taskAffirmStatusCount"); + } + } + taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList); + taskToConfirmMap.put("count",taskAffirmStatusCount); + result.put("taskToConfirmMap",taskToConfirmMap); + + //当前项目状态统计 获取一个 最差的结果 统计的数据 就是studio看到的数据。 + /*List> currentProjectStatusMapList = new ArrayList<>(); + CurrentProjectStatusEnum[] values = CurrentProjectStatusEnum.values(); + for (CurrentProjectStatusEnum value : values) { + Map map = new HashMap<>(); + map.put("color",value.getValue()); + currentProjectStatusMapList.add(map); + } + int currentProjectStatusTotal; + List projectStatusAssessList = this.conditionAssessmentEOService.getProjectStatusAssessList(projectLawsInventoryIdList); + + for (Map map : currentProjectStatusMapList) { + List collect = projectStatusAssessList.stream().filter( + projectStatusAssess -> StringUtils.equals(projectStatusAssess.getConditionAssessment(),map.get("color").toString()) + ).collect(Collectors.toList()); + map.put("conditionAssessmentCount",collect.size()); + } + + currentProjectStatusTotal = currentProjectStatusMapList.stream().filter( + currentProjectStatus -> Integer.parseInt(currentProjectStatus.get("conditionAssessmentCount").toString()) != 0 + ).mapToInt(currentProjectStatus -> Integer.parseInt(currentProjectStatus.get("conditionAssessmentCount").toString())).sum(); + + currentProjectStatusMap.put("currentProjectStatusMapList",currentProjectStatusMapList); + currentProjectStatusMap.put("currentProjectStatusTotal",currentProjectStatusTotal); + result.put("currentProjectStatusMap",currentProjectStatusMap);*/ + + //设计符合性 + List> designComplianceMapList = this.projectLawsInventoryEOService.getDesignComplianceStatistice(projectLawsInventoryEOList); + int designFlowTaskStatusCount = 0; + if(CollectionUtils.isNotEmpty(designComplianceMapList)){ + for (Map designCompliance : designComplianceMapList) { + designFlowTaskStatusCount += (int) designCompliance.get("designFlowTaskStatusCount"); + } + } + designComplianceMap.put("designComplianceMapList",designComplianceMapList); + designComplianceMap.put("count",designFlowTaskStatusCount); + result.put("designComplianceMap",designComplianceMap); + + //验证符合性 + List> verifyComplianceMapList = this.projectLawsInventoryEOService.getVerifyComplianceStatistice(projectLawsInventoryEOList); + int verifyFlowTaskStatusCount = 0; + if(CollectionUtils.isNotEmpty(verifyComplianceMapList)){ + for (Map verifyCompliance : verifyComplianceMapList) { + verifyFlowTaskStatusCount += (int) verifyCompliance.get("verifyFlowTaskStatusCount"); + } + } + verifyComplianceMap.put("verifyComplianceMapList",verifyComplianceMapList); + verifyComplianceMap.put("count",verifyFlowTaskStatusCount); + result.put("verifyComplianceMap",verifyComplianceMap); + + //认证进度统计 + /*int certificationProgressTotal; + List> certificationProgressMapList = this.projectTaskInventoryEOMapper.getCertificationProgressStatistics(projectLawsInventoryIdList); + certificationProgressTotal = certificationProgressMapList.stream().filter( + certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString()) != 0 + ).mapToInt(certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString())).sum(); + + CertificationProgressEnum[] CertificationProgressEnumValues = CertificationProgressEnum.values(); + for (CertificationProgressEnum certificationProgressEnumValue : CertificationProgressEnumValues) { + boolean flag = true; + for (Map map : certificationProgressMapList) { + if(map.get("certificationProgress") != null){ + if(StringUtils.equals(certificationProgressEnumValue.getValue(),map.get("certificationProgress").toString())){ + flag = false; + break; + } + } + } + if(flag){ + Map map = new HashMap<>(); + map.put("certificationProgress",certificationProgressEnumValue.getValue()); + map.put("certificationProgressCount",0); + certificationProgressMapList.add(map); + } + } + + certificationProgressMap.put("certificationProgressTotal",certificationProgressTotal); + certificationProgressMap.put("certificationProgressMapList",certificationProgressMapList); + result.put("certificationProgressMap",certificationProgressMap);*/ + } + + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(id.split(","))); + List pciEoList = this.projectCertificationInventoryEOService.list(pciQueryWrap).stream().filter(pciEo -> { + boolean flag = false; + if (!StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.UNINVOLVED.getValue())) { + flag = true; + } + return flag; + }).distinct().collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(pciEoList)){ + // 认证清单-任务确认统计 + List> rzTaskToConfirmMapList = this.projectCertificationInventoryEOService.getTaskToConfirmStatistics(pciEoList); + int taskAffirmStatusCount = 0; + if(CollectionUtils.isNotEmpty(rzTaskToConfirmMapList)){ + for (Map rzTaskToConfirm : rzTaskToConfirmMapList) { + taskAffirmStatusCount += (int) rzTaskToConfirm.get("taskAffirmStatusCount"); + } + } + rzTaskToConfirmMap.put("rzTaskToConfirmMapList",rzTaskToConfirmMapList); + rzTaskToConfirmMap.put("count",taskAffirmStatusCount); + result.put("rzTaskToConfirmMap",rzTaskToConfirmMap); + + // Pre-Homo 统计 + List> prehomoMapList = this.projectCertificationInventoryEOService.getPrehomoStatistice(pciEoList); + int preHomoCount = 0; + if (CollectionUtils.isNotEmpty(prehomoMapList)) { + for (Map prehomo : prehomoMapList) { + preHomoCount += (int) prehomo.get("taskAffirmStatusCount"); + } + } + prehomoMap.put("prehomoMapList",prehomoMapList); + prehomoMap.put("count",preHomoCount); + result.put("prehomoMap",prehomoMap); + + // 认证进度 统计 + List> allMapList = this.projectCertificationInventoryEOService.getAllCertificationProgressStatistics(pciEoList); + List> carMapList = this.projectCertificationInventoryEOService.getCarCertificationProgressStatistics(pciEoList); + List> partMapList = this.projectCertificationInventoryEOService.getPartCertificationProgressStatistics(pciEoList); + certificationProgressMap.put("allMapList",allMapList);// 全部 + certificationProgressMap.put("carMapList",carMapList);// 整车 + certificationProgressMap.put("partMapList",partMapList);// 零部件 + int allCount = 0; + if(CollectionUtils.isNotEmpty(allMapList)){ + for (Map all : allMapList) { + allCount += (int) all.get("certificationProgressCount"); + } + } + int carCount = 0; + if(CollectionUtils.isNotEmpty(carMapList)){ + for (Map car : carMapList) { + carCount += (int) car.get("certificationProgressCount"); + } + } + int partCount = 0; + if(CollectionUtils.isNotEmpty(partMapList)){ + for (Map part : partMapList) { + partCount += (int) part.get("certificationProgressCount"); + } + } + + certificationProgressMap.put("allCount",allCount);// 全部 + certificationProgressMap.put("carCount",carCount);// 整车 + certificationProgressMap.put("partCount",partCount);// 零部件 + result.put("certificationProgressMap",certificationProgressMap); + } + + return result; + } +// @Override +// public Map getProjectDetailsStatistics(String id) { +// Map result = new HashMap<>(); +// +// //当前项目状态 +// Map currentProjectStatusMap = new HashMap<>(); +// //清单确认 +// Map listingToConfirmMap = new HashMap<>(); +// //任务确认 +// Map taskToConfirmMap = new HashMap<>(); +// //设计符合性 +// Map designComplianceMap = new HashMap<>(); +// //prehomo确认 +// Map prehomoMap = new HashMap<>(); +// //验证符合性 +// Map verifyComplianceMap = new HashMap<>(); +// //认证进度 +// Map certificationProgressMap = new HashMap<>(); +// +// //清单确认统计 +// List> listingToConfirmMapList = this.projectLawsInventoryEOMapper.getlistingToConfirmStatistics(id); +// listingToConfirmMap.put("listingToConfirmMapList",listingToConfirmMapList); +// result.put("listingToConfirmMap",listingToConfirmMap); +// +// //任务确认统计 +// List> taskToConfirmMapList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatistics(id); +// taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList); +// result.put("taskToConfirmMap",taskToConfirmMap); +// +// QueryWrapper lawsInventoryEOQueryWrapper = new QueryWrapper<>(); +// lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,id); +// //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue()); +// //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue()); +// List projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper); +// if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){ +// List projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); +// +// //当前项目状态统计 获取一个 最差的结果 统计的数据 就是studio看到的数据。 +// List> currentProjectStatusMapList = new ArrayList<>(); +// CurrentProjectStatusEnum[] values = CurrentProjectStatusEnum.values(); +// for (CurrentProjectStatusEnum value : values) { +// Map map = new HashMap<>(); +// map.put("color",value.getValue()); +// currentProjectStatusMapList.add(map); +// } +// int currentProjectStatusTotal; +// List projectStatusAssessList = this.conditionAssessmentEOService.getProjectStatusAssessList(projectLawsInventoryIdList); +// +// for (Map map : currentProjectStatusMapList) { +// List collect = projectStatusAssessList.stream().filter( +// projectStatusAssess -> StringUtils.equals(projectStatusAssess.getConditionAssessment(),map.get("color").toString()) +// ).collect(Collectors.toList()); +// map.put("conditionAssessmentCount",collect.size()); +// } +// +// currentProjectStatusTotal = currentProjectStatusMapList.stream().filter( +// currentProjectStatus -> Integer.parseInt(currentProjectStatus.get("conditionAssessmentCount").toString()) != 0 +// ).mapToInt(currentProjectStatus -> Integer.parseInt(currentProjectStatus.get("conditionAssessmentCount").toString())).sum(); +// +// currentProjectStatusMap.put("currentProjectStatusMapList",currentProjectStatusMapList); +// currentProjectStatusMap.put("currentProjectStatusTotal",currentProjectStatusTotal); +// result.put("currentProjectStatusMap",currentProjectStatusMap); +// +// //设计符合性 +// List> designComplianceMapList = this.projectTaskInventoryEOMapper.getDesignComplianceStatistice(projectLawsInventoryIdList); +// designComplianceMap.put("designComplianceMapList",designComplianceMapList); +// result.put("designComplianceMap",designComplianceMap); +// +// //prehomo确认 +// List> prehomoMapList = this.projectTaskInventoryEOMapper.getPrehomoStatistice(projectLawsInventoryIdList); +// prehomoMap.put("prehomoMapList",prehomoMapList); +// result.put("prehomoMap",prehomoMap); +// +// //验证符合性 +// List> verifyComplianceMapList = this.projectTaskInventoryEOMapper.getVerifyComplianceStatistice(projectLawsInventoryIdList); +// verifyComplianceMap.put("verifyComplianceMapList",verifyComplianceMapList); +// result.put("verifyComplianceMap",verifyComplianceMap); +// +// //认证进度统计 +// int certificationProgressTotal; +// List> certificationProgressMapList = this.projectTaskInventoryEOMapper.getCertificationProgressStatistics(projectLawsInventoryIdList); +// certificationProgressTotal = certificationProgressMapList.stream().filter( +// certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString()) != 0 +// ).mapToInt(certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString())).sum(); +// +// CertificationProgressEnum[] CertificationProgressEnumValues = CertificationProgressEnum.values(); +// for (CertificationProgressEnum certificationProgressEnumValue : CertificationProgressEnumValues) { +// boolean flag = true; +// for (Map map : certificationProgressMapList) { +// if(map.get("certificationProgress") != null){ +// if(StringUtils.equals(certificationProgressEnumValue.getValue(),map.get("certificationProgress").toString())){ +// flag = false; +// break; +// } +// } +// } +// if(flag){ +// Map map = new HashMap<>(); +// map.put("certificationProgress",certificationProgressEnumValue.getValue()); +// map.put("certificationProgressCount",0); +// certificationProgressMapList.add(map); +// } +// } +// +// certificationProgressMap.put("certificationProgressTotal",certificationProgressTotal); +// certificationProgressMap.put("certificationProgressMapList",certificationProgressMapList); +// result.put("certificationProgressMap",certificationProgressMap); +// } +// +// return result; +// } + + /** + * 项目详情-统计接口-根据领域分组 + * @param params + * @return + */ + @Override + public Map getProjectDetailsStatisticsGroupByTerritory(Map params) { + String operatorType = (String) params.get("operatorType"); + String projectLibraryId = (String) params.get("projectLibraryId"); + if(StringUtils.isEmpty(projectLibraryId)){ + throw new JeroBootException("项目库id不能为空!"); + } + String cut = (String) params.get("cut"); + Map result = new HashMap<>(); + List> dataList = new ArrayList<>(); + + QueryWrapper lawsInventoryEOQueryWrapper = new QueryWrapper<>(); + lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId); + List projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper); + + List sysDictItems = new ArrayList<>(); + // 法规清单所有的责任领域 + String pliDutyTerritoryStr = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getDutyTerritory).collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(pliDutyTerritoryStr)) { + List pliDutyTerritoryList = Arrays.asList(pliDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pliDutyTerritory : pliDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pliDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + + Map pliEoMap = new HashMap<>(); + + Map> firstLevelDutyTerritoryMapFG = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMapFG)){ + // 根据责任领域组装法规清单数据,后续计算使用 + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMapFG.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pliEoList = projectLawsInventoryEOList.stream().filter(pliEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pliEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + JSONObject json = new JSONObject(); + json.put("dutyTerritoryList",dutyTerritoryList); + json.put("pliEoList",pliEoList); + pliEoMap.put(key,json); + } + } + String status = (String) params.get("status"); + if (CollectionUtils.isNotEmpty(projectLawsInventoryEOList)) { + for (Map.Entry pliMap : pliEoMap.entrySet()) { + String key = pliMap.getKey(); + JSONObject json = (JSONObject) pliMap.getValue(); + List pliEoList = (List) json.get("pliEoList"); + Map dataMaps = new HashMap<>(); + if(StringUtils.equals(OperatorTypeEnum.QUERY_FG_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritory(pliEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getDesignComplianceStatisticeGroupByTerritory(pliEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getVerifyComplianceStatisticeGroupByTerritory(pliEoList,params); + } + if(ObjectUtils.isEmpty(dataMaps)){ + continue; + } + Map dataMap = (Map) dataMaps.get(status); + double amount = (double) dataMap.get("amount"); + if(amount != 0){ + dataMap.put("dutyTerritoryName",key); + dataList.add(dataMap); + } + } + if(CollectionUtils.isNotEmpty(dataList)){ + this.projectDetailsStatisticsGroupByTerritoryHearSort(dataList,params); + result.put("dataList",dataList); + return result; + } +// if(StringUtils.equals(OperatorTypeEnum.QUERY_FG_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ +// if(ObjectUtils.isNotEmpty(pliEoMap)){ +// +// List> dataList = new ArrayList<>(); +// for (Map.Entry pliMap : pliEoMap.entrySet()) { +// String key = pliMap.getKey(); +// JSONObject json = (JSONObject) pliMap.getValue(); +// List pliEoList = (List) json.get("pliEoList"); +// Map dataMaps = this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritory(pliEoList,params); +// Map dataMap = (Map) dataMaps.get(status); +// double amount = (double) dataMap.get("amount"); +// if(amount != 0){ +// dataMap.put("dutyTerritoryName",key); +// dataList.add(dataMap); +// } +// } +// result.put("dataList",dataList); +// } +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CURRENT_PROJECT_STATUS_STATISTICS.getValue(),operatorType)){ +// params.put("projectLawsInventoryIdList",projectLawsInventoryIdList); +// List> conditionAssessmentMapList = this.conditionAssessmentEOService.getProjectStatusAssessStatisticsGroupByTerritory(params); +// disposeData(conditionAssessmentMapList,cut); +// result.put("dataList",conditionAssessmentMapList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_LISTING_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ +// //清单确认 状态 +// String inventoryAffirmStatus = (String) params.get("inventoryAffirmStatus"); +// List> listingToConfirmList = this.projectLawsInventoryEOMapper.getListingToConfirmStatisticsGroupByTerritory(projectLibraryId,inventoryAffirmStatus); +// disposeData(listingToConfirmList,cut); +// result.put("dataList",listingToConfirmList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ +// //任务确认 状态 +// String taskAffirmStatus = (String) params.get("taskAffirmStatus"); +// List> taskToConfirmList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatisticsGroupByTerritory(projectLibraryId,taskAffirmStatus); +// disposeData(taskToConfirmList,cut); +// result.put("dataList",taskToConfirmList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ +// //设计符合性 +// List> dataList = new ArrayList<>(); +// for (Map.Entry pliMap : pliEoMap.entrySet()) { +// String key = pliMap.getKey(); +// JSONObject json = (JSONObject) pliMap.getValue(); +// List pliEoList = (List) json.get("pliEoList"); +// Map dataMaps = this.projectLibraryStatisticsService.getDesignComplianceStatisticeGroupByTerritory(pliEoList,params); +// Map dataMap = (Map) dataMaps.get(status); +// double amount = (double) dataMap.get("amount"); +// if(amount != 0){ +// dataMap.put("dutyTerritoryName",key); +// dataList.add(dataMap); +// } +// } +// result.put("dataList",dataList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ +// //prehomo确认 流程任务状态 +// String prehomoFlowTaskStatus = (String) params.get("prehomoFlowTaskStatus"); +// if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ +// List> prehomoList = this.projectTaskInventoryEOMapper.getPrehomoStatisticeGroupByTerritory(projectLawsInventoryIdList,prehomoFlowTaskStatus); +// disposeData(prehomoList,cut); +// result.put("dataList",prehomoList); +// } +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ +// //验证符合性 流程任务状态 +// List> dataList = new ArrayList<>(); +// for (Map.Entry pliMap : pliEoMap.entrySet()) { +// String key = pliMap.getKey(); +// JSONObject json = (JSONObject) pliMap.getValue(); +// List pliEoList = (List) json.get("pliEoList"); +// Map dataMaps = this.projectLibraryStatisticsService.getVerifyComplianceStatisticeGroupByTerritory(pliEoList,params); +// Map dataMap = (Map) dataMaps.get(status); +// double amount = (double) dataMap.get("amount"); +// if(amount != 0){ +// dataMap.put("dutyTerritoryName",key); +// dataList.add(dataMap); +// } +// } +// result.put("dataList",dataList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS.getValue(),operatorType)){ +// //认证进度 流程任务状态 +// String certificationProgress = (String) params.get("certificationProgress"); +// +// if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ +// List> certificationProgressList = this.projectTaskInventoryEOMapper.getCertificationProgressStatisticsGroupByTerritory(projectLawsInventoryIdList,certificationProgress); +// disposeData(certificationProgressList,cut); +// result.put("dataList",certificationProgressList); +// } +// } + } + + Map pciEoMap = new HashMap<>(); + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryId); + List projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(pciQueryWrap); + String pciDutyTerritoryStr = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyTerritory).collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(pciDutyTerritoryStr)) { + List pciDutyTerritoryList = Arrays.asList(pciDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pliDutyTerritory : pciDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pliDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + Map> firstLevelDutyTerritoryMapRZ = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMapRZ)){ + // 根据责任领域组装法规清单数据,后续计算使用 + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMapRZ.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pciEoList = projectCertificationInventoryEOList.stream().filter(pciEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pciEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + JSONObject json = new JSONObject(); + json.put("dutyTerritoryList",dutyTerritoryList); + json.put("pciEoList",pciEoList); + pciEoMap.put(key,json); + } + } + if (CollectionUtils.isNotEmpty(projectCertificationInventoryEOList) && ObjectUtils.isNotEmpty(pciEoMap)) { + for (Map.Entry pciMap : pciEoMap.entrySet()) { + String key = pciMap.getKey(); + JSONObject json = (JSONObject) pciMap.getValue(); + List pciEoList = (List) json.get("pciEoList"); + Map dataMaps = new HashMap<>(); + if(StringUtils.equals(OperatorTypeEnum.QUERY_RZ_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getRZTaskToConfirmStatisticsGroupByTerritory(pciEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getPrehomoStatisticeGroupByTerritory(pciEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_ALL.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getAllCertificationProgressStatisticsGroupByTerritory(pciEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_CAR.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getCarCertificationProgressStatisticsGroupByTerritory(pciEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_PART.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getPartCertificationProgressStatisticsGroupByTerritory(pciEoList,params); + } + if(ObjectUtils.isEmpty(dataMaps)){ + continue; + } + Map dataMap = (Map) dataMaps.get(status); + double amount = (double) dataMap.get("amount"); + if(amount != 0){ + dataMap.put("dutyTerritoryName",key); + dataList.add(dataMap); + } + } + this.projectDetailsStatisticsGroupByTerritoryHearSort(dataList,params); + result.put("dataList",dataList); + } + return result; + } + + /** + * 项目库详情统计-根据责任领域分组统计数据-表头排序 + * @param dataList + * @param params + */ + private void projectDetailsStatisticsGroupByTerritoryHearSort(List> dataList,Map params) { + String orderByField = (String) params.get("orderByField"); + String orderBy = (String) params.get("orderBy"); + if(CollectionUtils.isNotEmpty(dataList)){ + Collator comparator = Collator.getInstance(Locale.CHINESE); + Collections.sort(dataList,(data1,data2)->{ + String param1 = ""; + String param2 = ""; + // 一级责任领域名称 + if("dutyTerritoryName".equals(orderByField)){ + param1 = StringUtils.isNotEmpty((String) data1.get("dutyTerritoryName")) ? (String) data1.get("dutyTerritoryName") : ""; + param2 = StringUtils.isNotEmpty((String) data2.get("dutyTerritoryName")) ? (String) data2.get("dutyTerritoryName") : ""; + if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ + return comparator.compare(param1,param2); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + return comparator.compare(param2,param1); + } + } + // 数量 + if(StringUtils.isEmpty(orderByField) || "amount".equals(orderByField)){ + double p1 = data1.get("amount") != null ? (double) data1.get("amount") : 0; + double p2 = data2.get("amount") != null ? (double) data2.get("amount") : 0; + if(StringUtils.isEmpty(orderBy) || OrderEnum.POSITIVE.getValue().equals(orderBy)){ + return (int)(p1 - p2); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + return (int)(p2 - p1); + } + } + // 占比 + if("percentage".equals(orderByField)){ + double p1 = StringUtils.isNotEmpty((String) data1.get("percentage")) ? Double.parseDouble (((String) data1.get("percentage")).replace("%","")) : 0; + double p2 = StringUtils.isNotEmpty((String) data2.get("percentage")) ? Double.parseDouble (((String) data2.get("percentage")).replace("%","")) : 0; + if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ + return (int)(p1 - p2); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + return (int)(p2 - p1); + } + } + return 0; + }); + } + } + + @Override + public void exportProjectDetailsStatisticsGroupByTerritoryXls(HttpServletResponse response, HttpServletRequest request, Map params) { + Map projectDetailsStatisticsGroupByTerritory = getProjectDetailsStatisticsGroupByTerritory(params); + String operatorType = (String) params.get("operatorType"); + String cut = (String) params.get("cut"); + String sheetName = ""; + String title = ""; + if (StringUtils.equals(cut,CutEnum.CN.getValue())) { + title = "责任领域,数量,责任领域内占比"; + if(StringUtils.equals(OperatorTypeEnum.QUERY_FG_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + sheetName = "法规任务确认"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ + sheetName = "设计符合性"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ + sheetName = "验证符合性"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_RZ_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + sheetName = "认证任务确认"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ + sheetName = "Pre-Homo流程"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_ALL.getValue(),operatorType)){ + sheetName = "认证进度"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_CAR.getValue(),operatorType)){ + sheetName = "认证进度"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_PART.getValue(),operatorType)){ + sheetName = "认证进度"; + } + /*if(StringUtils.equals(OperatorTypeEnum.QUERY_CURRENT_PROJECT_STATUS_STATISTICS.getValue(),operatorType)){ + sheetName = "项目状态"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_LISTING_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + sheetName = "清单确认"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + sheetName = "任务确认"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ + sheetName = "设计符合性"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ + sheetName = "Pre-homo"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ + sheetName = "验证符合性"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS.getValue(),operatorType)){ + sheetName = "认证进度"; + }*/ + }else if (StringUtils.equals(cut,CutEnum.EN.getValue())) { + title = "Responsible Field,Quantity,Proportion within the area of responsibility"; + if(StringUtils.equals(OperatorTypeEnum.QUERY_FG_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + sheetName = "Regulation Task Confirmation"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ + sheetName = "Design Compliance"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ + sheetName = "Verify Compliance"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_RZ_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + sheetName = "Certification Task Confirmation"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ + sheetName = "Pre-Homo flow"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_ALL.getValue(),operatorType)){ + sheetName = "Homologation Progress"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_CAR.getValue(),operatorType)){ + sheetName = "Homologation Progress"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_PART.getValue(),operatorType)){ + sheetName = "Homologation Progress"; + } + /*if(StringUtils.equals(OperatorTypeEnum.QUERY_CURRENT_PROJECT_STATUS_STATISTICS.getValue(),operatorType)){ + sheetName = "Project status"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_LISTING_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + sheetName = "Listing to confirm"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + sheetName = "Task to confirm"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ + sheetName = "Design compliance"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ + sheetName = "Pre-homo"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ + sheetName = "Verify compliance"; + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS.getValue(),operatorType)){ + sheetName = "Certification progress"; + }*/ + } + + + OutputStream os = null; + HSSFWorkbook workbook = new HSSFWorkbook(); + + try { + String fileName = sheetName + ".xlsx"; + response.setHeader("Content-Disposition", + "attachment; filename=" + fileName); + response.setContentType("application/force-download"); + + HSSFSheet sheet = workbook.createSheet(sheetName); + + String[] titleArr = title.split(","); + Row firstRow = sheet.createRow(0); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + for (int i = 0; i < 3; i++){ + sheet.setColumnWidth(i, 5000); + Cell cell = firstRow.createCell(i); + cell.setCellStyle(cellStyleTitle); + cell.setCellValue(titleArr[i]); + } + + createSheetData(sheet,projectDetailsStatisticsGroupByTerritory,params); + + os = response.getOutputStream(); + workbook.write(os); + os.flush(); + }catch (IOException ex){ + if(CutEnum.CN.getValue().equals(cut)){ + throw new JeroBootException("下载文件失败"); + }else{ + throw new JeroBootException("Failed to download file"); + } + } + } + + public void createSheetData(HSSFSheet sheet,Map exportDataMap, Map params){ + List> exportDataList = (List>) exportDataMap.get("dataList"); + int rowIndex = 1; + for (int dataIndex = 0; dataIndex < exportDataList.size(); dataIndex++) { + Row dataRow = sheet.createRow(rowIndex); + dataRow.createCell(0).setCellValue(exportDataList.get(dataIndex).get("dutyTerritoryName").toString()); + dataRow.createCell(1).setCellValue(String.valueOf(Math.round((Double) exportDataList.get(dataIndex).get("amount")))); + dataRow.createCell(2).setCellValue(exportDataList.get(dataIndex).get("percentage").toString()); + rowIndex ++; + } + } + + /** + * 处理 根据领域统计的数据 + * @param datas + * @param cut + */ + public void disposeData(List> datas,String cut){ + List dutyTerritoryList = sysDictItemServiceImpl.selectItemsByDictCode("duty_territory"); + if(CollectionUtils.isNotEmpty(datas)){ + for (Map data : datas) { + if(data.get("dutyTerritory") != null){ + String[] dutyTerritorieArr = data.get("dutyTerritory").toString().split(","); + String dutyTerritories = ""; + for (String dutyTerritorie : dutyTerritorieArr) { + List collect = new ArrayList<>(); + if(StringUtils.equals(cut,CutEnum.CN.getValue())){ + collect = dutyTerritoryList.stream() + .filter(e -> StringUtils.equals(dutyTerritorie, e.getItemValue())) + .map(SysDictItem::getItemText) + .collect(Collectors.toList()); + }else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + collect = dutyTerritoryList.stream() + .filter(e -> StringUtils.equals(dutyTerritorie, e.getItemValue())) + .map(SysDictItem::getEnName) + .collect(Collectors.toList()); + } + if(CollectionUtils.isNotEmpty(collect)){ + dutyTerritories += collect.get(0) + ","; + } + } + + if(StringUtils.isNotEmpty(dutyTerritories)){ + dutyTerritories = dutyTerritories.substring(0,dutyTerritories.length()-1); + } +// data.put("dutyTerritory",dutyTerritories); + data.put("dutyTerritoryName",dutyTerritories); + } + } + } + } + + @Override + public void top(String id, String flag) { + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + ProjectLibraryBase projectLibraryBase = this.getById(id); + //置顶的时候将取消置顶标识传过来即:flag=1 + if(TopEnum.TOP_CANCEL.getValue().equals(flag)){ + TopProjectEO topProjectEO = new TopProjectEO(); + topProjectEO.setProjectLibraryBaseId(id); + topProjectEO.setFlag(TopEnum.TOP_CANCEL.getValue()); + topProjectEO.setCreateBy(loginUser.getUsername()); + + //置顶 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(TopProjectEO::getCreateBy,loginUser.getUsername()).orderByDesc(TopProjectEO::getSort); + List list = iTopProjectEOService.list(wrapper); + if(list.size() != 0){ + String sort = list.get(0).getSort(); + int sortTemp = Integer.valueOf(sort) + 1; + topProjectEO.setSort(String.valueOf(sortTemp)); + }else{ + //首个置顶的项目排序为1 + topProjectEO.setSort("1"); + } + iTopProjectEOService.save(topProjectEO); + + }else{ + //取消置顶 + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.in(TopProjectEO::getCreateBy,loginUser.getUsername()).in(TopProjectEO::getProjectLibraryBaseId,id); + iTopProjectEOService.remove(wrapper); + } + } +// @Override +// public void top(String id, String flag) { +// ProjectLibraryBase projectLibraryBase = this.getById(id); +// //置顶的时候将取消置顶标识传过来即:flag=1 +// if(TopEnum.TOP_CANCEL.getValue().equals(flag)){ +// //置顶 +// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); +// wrapper.isNotNull(ProjectLibraryBase::getSort).orderByDesc(ProjectLibraryBase::getSort); +// List list = this.list(wrapper); +// if(list.size() != 0){ +// String sort = list.get(list.size() - 1).getSort(); +// int sortTemp = Integer.valueOf(sort) + 1; +// projectLibraryBase.setSort(String.valueOf(sortTemp)); +// }else{ +// //首个置顶的项目排序为1 +// projectLibraryBase.setSort("1"); +// } +// projectLibraryBase.setFlag(TopEnum.TOP_CANCEL.getValue()); +// this.updateById(projectLibraryBase); +// +// }else{ +// //取消置顶 +// LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); +// updateWrapper.in(ProjectLibraryBase::getId,id); +// updateWrapper.set(ProjectLibraryBase::getSort,null).set(ProjectLibraryBase::getFlag,null); +// this.update(projectLibraryBase,updateWrapper); +// } +// } + + @Override + public List getVersionsInfo(String id) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.in(ProjectLibraryBase::getId,id).or().in(ProjectLibraryBase::getParentId,id); + List list = this.list(wrapper); + List result = new ArrayList<>(); + if(list.size() != 0){ + result = list.stream().map(ProjectLibraryBase::getProjectVersion).collect(Collectors.toList()); + Collections.sort(result); + } + return result; + } + + /** + * 版本统计 + * @param id + * @return + */ + @Override + public List versionStatistics(String id) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.in(ProjectLibraryBase::getId,id).or().in(ProjectLibraryBase::getParentId,id); + List list = this.list(wrapper); + if(list.size() != 0){ +// Collections.sort(list); + } + return list; + } + + /** + * 通过主项目id和子项目版本号 + * @param version + * @param parentId + * @return + */ + @Override + public String getIdByVersionAndParentId(String version, String parentId) { + if ("00".equals(version)) { + return parentId; + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProjectLibraryBase::getProjectVersion,version); + wrapper.eq(ProjectLibraryBase::getParentId, parentId); + List list = this.list(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + return list.get(0).getId(); + } else { + return null; + } + + } + + @Override + public List getParentAndChildern(String parentId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProjectLibraryBase::getId,parentId); + wrapper.or().eq(ProjectLibraryBase::getParentId, parentId); + List list = this.list(wrapper); + return list; + } + + @Override + public ProjectLibraryBase selectById(String projectLibraryId) { + ProjectLibraryBase result = null; + List records = this.projectLibraryBaseMapper.queryById(projectLibraryId); + if(CollectionUtils.isNotEmpty(records)){ + List studioEngineerUserIdList = records.stream().map(ProjectLibraryBase::getStudioEngineer).distinct().collect(Collectors.toList()); + List studioEngineerUserInfo = this.sysUserService.querySysUserListByIdList(studioEngineerUserIdList); + disposeData(records,"",false); + + List targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode()); + for(ProjectLibraryBase projectLibraryBase: records){ + //历史数据的主版本没有版本号,所以默认给00 + if(StringUtils.isBlank(projectLibraryBase.getParentId()) && StringUtils.isBlank(projectLibraryBase.getProjectVersion())){ + projectLibraryBase.setProjectVersion("00"); + } + //目标市场 英文 + Map paramEn = new HashMap<>(); + paramEn.put("cut",CutEnum.EN.getValue()); + String targetMarketEn = getMarket(paramEn, targetMarketList, projectLibraryBase); + + //目标市场 中文 + Map paramCn = new HashMap<>(); + paramCn.put("cut",CutEnum.CN.getValue()); + String targetMarketCn = getMarket(paramCn, targetMarketList, projectLibraryBase); + + //主项目的版本号 + String projectVersion = ""; + if(StringUtils.isBlank(projectLibraryBase.getParentId())){ + projectVersion = "00"; + }else{ + projectVersion = projectLibraryBase.getProjectVersion(); + } + if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){ + projectLibraryBase.setProjectNameEn(projectLibraryBase.getProjectName() + + "-" + projectLibraryBase.getYearName() + + "-" + targetMarketEn + + "-" + projectVersion); + + projectLibraryBase.setProjectNameCn(projectLibraryBase.getProjectName() + + "-" + projectLibraryBase.getYearName() + + "-" + targetMarketCn + + "-" + projectVersion); + } + + if(StringUtils.isNotEmpty(projectLibraryBase.getStudioEngineer())){ + if(CollectionUtils.isNotEmpty(studioEngineerUserInfo)){ + String studioEngineerUserName = studioEngineerUserInfo.stream().filter(studioEngineerUser -> { + boolean flag = false; + if (StringUtils.equals(projectLibraryBase.getStudioEngineer(), studioEngineerUser.getId())) { + flag = true; + } + return flag; + }).map(SysUser::getUsername).collect(Collectors.joining(",")); + + projectLibraryBase.setStudioEngineerName(studioEngineerUserName); + } + } + } + + result = records.get(0); + } + return result; + } + + /** + * 对接火山引擎接口-获取项目统计信息 + * @return + */ + @Override + public JSONArray getProjectInfo() { + Date now = new Date(); + List plbList = this.getList(new ProjectLibraryBase()); + JSONArray resList = new JSONArray(); + for (ProjectLibraryBase plb: plbList) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("projectId",plb.getId()); + jsonObject.put("projectName",plb.getShowName()); + List> TimeNodeVOsList = projectTaskPlanningService.queryByProjectId(plb.getId(),CutEnum.CN.getValue()); + //获取前置节点 + TimeNodeVO preNodeTnVo = null; + //获取后置节点 + TimeNodeVO postNodeTnVo = null; + if (ObjectUtils.isNotEmpty(TimeNodeVOsList) && TimeNodeVOsList.size() > 0) { + List TimeNodeVOList = TimeNodeVOsList.get(0); + for (TimeNodeVO tnVo : TimeNodeVOList) { + if(tnVo.isG()){ + continue; + } + if (null != postNodeTnVo) { + break; + } + tnVo.setProjectId(plb.getId()); + if (now.after(tnVo.getTime())) { + preNodeTnVo = tnVo; + } + if (now.before(tnVo.getTime())) { + postNodeTnVo = tnVo; + } + } + } + JSONArray preNodeList = getNodeList(preNodeTnVo); + jsonObject.put("preNode", preNodeList); + JSONArray postNodeList = getNodeList(postNodeTnVo); + jsonObject.put("postNode",postNodeList); + resList.add(jsonObject); + } + return resList; + } + + @Override + public JSONArray getProjectProgressInfo() { + List plbList = this.getList(new ProjectLibraryBase()); + JSONArray resList = new JSONArray(); + for (ProjectLibraryBase plb: plbList) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("projectId",plb.getId()); + jsonObject.put("projectName",plb.getShowName()); + jsonObject.put("studio",plb.getStudioEngineerName()); + List> TimeNodeVOsList = projectTaskPlanningService.queryByProjectId(plb.getId(),CutEnum.CN.getValue()); + + JSONArray preNodeList = new JSONArray(); + if (ObjectUtils.isNotEmpty(TimeNodeVOsList) && TimeNodeVOsList.size() > 0) { + List TimeNodeVOList = TimeNodeVOsList.get(0); + for (TimeNodeVO tnVo : TimeNodeVOList) { + if(tnVo.isG()){ + continue; + } + tnVo.setProjectId(plb.getId()); + preNodeList.addAll(getNodeProgressList(tnVo)); + } + } + jsonObject.put("preNode", preNodeList); + resList.add(jsonObject); + } + return resList; + } + + @Override + public void exportProjectProgressStatisticsXls(HttpServletResponse response, HttpServletRequest request, Map params) { + String fileName = ""; + String cut = (String) params.get("cut"); + String projectLibraryId = (String) params.get("projectLibraryId"); + if(StringUtils.isEmpty(projectLibraryId)){ + throw new JeroBootException("项目库id不能为空!"); + } + OutputStream ops = null; + HSSFWorkbook workbook = new HSSFWorkbook(); + this.exportRegulatoryManagement(workbook,params); + this.exportCertificationManagement(workbook,params); + this.exportParameterCollecting(workbook,params); + this.exportOtaCollecting(workbook,params); + try { + response.setHeader("Content-Disposition", + "attachment; filename=" + fileName); + response.setContentType("application/force-download"); + ops = response.getOutputStream(); + workbook.write(ops); + ops.flush(); + }catch (IOException ex){ + if(CutEnum.CN.getValue().equals(cut)){ + throw new JeroBootException("下载文件失败"); + }else{ + throw new JeroBootException("Failed to download file"); + } + } + } + + @Override + public List getUserAllDutyTerritoryList(Map params) { + List result = new ArrayList<>(); + List sysDictItems = this.sysDictItemServiceImpl.selectItemsAll(); + List dutyTerritorySdiList = sysDictItems.stream().filter(sysDictItem -> { + return (StringUtils.equals(sysDictItem.getDictCode(), DicCodeEnum.DUTY_TERRITORY.getCode())); + }).collect(Collectors.toList()); + params.put("dutyTerritorySdiList",dutyTerritorySdiList); + + List userAllDutyTerritorySdiList = new ArrayList<>(); + List prpSdiList = this.projectRelatedPersonnelService.getUserDutyTerritoryList(params); + if(CollectionUtils.isNotEmpty(prpSdiList)){ + userAllDutyTerritorySdiList.addAll(prpSdiList); + } + List pliSdiList = this.projectLawsInventoryEOService.getUserDutyTerritoryList(params); + if(CollectionUtils.isNotEmpty(pliSdiList)){ + userAllDutyTerritorySdiList.addAll(pliSdiList); + } + List pciSdiList = this.projectCertificationInventoryEOService.getUserDutyTerritoryList(params); + if(CollectionUtils.isNotEmpty(pciSdiList)){ + userAllDutyTerritorySdiList.addAll(pciSdiList); + } + String projectLibraryId = (String) params.get("projectLibraryId"); + ProjectLibraryBase projectLibraryBase = this.selectById(projectLibraryId); + params.put("parentId",projectLibraryBase.getParentId()); + List pmSdiList = this.paramsManifestEOService.getUserDutyTerritoryList(params); + if(CollectionUtils.isNotEmpty(pmSdiList)){ + userAllDutyTerritorySdiList.addAll(pmSdiList); + } + + userAllDutyTerritorySdiList = userAllDutyTerritorySdiList.stream().distinct().collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(userAllDutyTerritorySdiList)){ + for (SysDictItem sysDictItem : userAllDutyTerritorySdiList) { + DictModel dictModel = new DictModel(); + dictModel.setText(sysDictItem.getItemText()); + dictModel.setTextEn(sysDictItem.getEnName()); + dictModel.setValue(sysDictItem.getItemValue()); + result.add(dictModel); + } + } + return result; + } + + /** + * 全局替换用户 + * @param json + * @return + */ + @Override + public Result overallReplacementUser(JSONObject json) { + this.projectRelatedPersonnelService.replacementUser(json); + this.projectLawsInventoryEOService.replacementUser(json); + this.projectCertificationInventoryEOService.replacementUser(json); + String projectLibraryId = json.getString("projectLibraryId"); + ProjectLibraryBase projectLibraryBase = this.selectById(projectLibraryId); + json.put("parentId",projectLibraryBase.getParentId()); + this.paramsManifestEOService.replacementUser(json); + return Result.OK("全局替换成功!"); + } + + /** + * 导出法规符合性管理 + * @param workbook + * @param params + */ + private void exportRegulatoryManagement(HSSFWorkbook workbook,Map params) { + String cut = (String) params.get("cut"); + String sheetName = "法规符合性管理"; + String firstTitle = "法规任务确认," + + "设计符合性确认," + + "验证符合性确认"; + String secondTitle = "责任领域(一级)," + + "未发起,待确认,接受,拒绝,完成度," + + "未发起,待确认,符合,不符合,完成度," + + "未发起,待确认,符合,不符合,完成度"; + if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + sheetName = "Regulatory compliance management"; + firstTitle = "Regulatory task confirmation," + + "Design Conformity Verification," + + "Verification Conformity Confirmation"; + secondTitle = "Area of responsibility (level 1)," + + "Not launched,To be confirmed,Accept,Refuse,Degree of completion," + + "Not launched,To be confirmed,Meet,Not meet,Degree of completion," + + "Not launched,To be confirmed,Meet,Not meet,Degree of completion"; + } + HSSFSheet sheet = workbook.createSheet(sheetName); + //合并单元格 起始行,结束行,起始列,结束列 + CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 5); + sheet.addMergedRegion(region1); + CellRangeAddress region2 = new CellRangeAddress(0, 0, 6, 10); + sheet.addMergedRegion(region2); + CellRangeAddress region3 = new CellRangeAddress(0, 0, 11, 15); + sheet.addMergedRegion(region3); + + String[] firstTitleArr = firstTitle.split(","); + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + for (int i = 0; i <= 15; i++){ + sheet.setColumnWidth(i, 3500); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 1){ + firstRowCell.setCellValue(firstTitleArr[0]); + }else if(i==6){ + firstRowCell.setCellValue(firstTitleArr[1]); + }else if(i==11){ + firstRowCell.setCellValue(firstTitleArr[2]); + } + + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellValue(secondTitleArr[i]); + } + + String projectLibraryId = (String) params.get("projectLibraryId"); + + QueryWrapper pliQueryWrap = new QueryWrapper<>(); + pliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId); + List pliEOList = this.projectLawsInventoryEOMapper.selectList(pliQueryWrap); + List sysDictItems = new ArrayList<>(); + String pliDutyTerritoryStr = pliEOList.stream().map(ProjectLawsInventoryEO::getDutyTerritory).collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(pliDutyTerritoryStr)) { + List pliDutyTerritoryList = Arrays.asList(pliDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pliDutyTerritory : pliDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pliDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + + Map> firstLevelDutyTerritoryMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMap)){ + int dataIndex = 2; + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMap.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pliEoList = pliEOList.stream().filter(pliEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pliEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + this.exportRegulatoryManagementSetData(params, sheet, dataIndex ,key,pliEoList); + dataIndex ++; + } + } + } + + /** + * 导出法规符合性管理-设置数据 + * @param params + * @param sheet + * @param dataIndex + * @param key + * @param pliEoList + */ + private void exportRegulatoryManagementSetData(Map params, HSSFSheet sheet, int dataIndex, String key, List pliEoList) { + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(key); + + Map taskConfirmMap= this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritory(pliEoList, params); + Map taskConfirmNotStartedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double taskConfirmNotStartedAmount = (double) taskConfirmNotStartedMap.get("amount"); + Map taskConfirmToConfirmMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double taskConfirmToConfirmAmount = (double) taskConfirmToConfirmMap.get("amount"); + Map taskConfirmAcceptedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.ACCEPTED.getValue()); + double taskConfirmAcceptedAmount = (double) taskConfirmAcceptedMap.get("amount"); + Map taskConfirmRejectedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.REJECTED.getValue()); + double taskConfirmRejectedAmount = (double) taskConfirmRejectedMap.get("amount"); + dataRow.createCell(1).setCellValue(taskConfirmNotStartedAmount); + dataRow.createCell(2).setCellValue(taskConfirmToConfirmAmount); + dataRow.createCell(3).setCellValue(taskConfirmAcceptedAmount); + dataRow.createCell(4).setCellValue(taskConfirmRejectedAmount); + double taskConfirmCount = taskConfirmNotStartedAmount + taskConfirmToConfirmAmount + taskConfirmAcceptedAmount + taskConfirmRejectedAmount; + double taskConfirmPercentage = (taskConfirmAcceptedAmount / taskConfirmCount) * 100; + String taskConfirmPercentageStr = (taskConfirmPercentage != 0 && (taskConfirmCount !=0 )) ? df.format(taskConfirmPercentage) : "0"; + dataRow.createCell(5).setCellValue(taskConfirmPercentageStr + percentSign); + + Map designMap = this.projectLibraryStatisticsService.getDesignComplianceStatisticeGroupByTerritory(pliEoList, params); + Map designNotStartedMap = (Map) designMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double designNotStartedAmount = (double) designNotStartedMap.get("amount"); + Map designToConfirmMap = (Map) designMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double designToConfirmAmount = (double) designToConfirmMap.get("amount"); + Map designComplianceMap = (Map) designMap.get(ComplianceFlowStatusEnum.CONFORMITY.getValue()); + double designComplianceAmount = (double) designComplianceMap.get("amount"); + Map designNonComplianceMap = (Map) designMap.get(ComplianceFlowStatusEnum.INCONFORMITY.getValue()); + double designNonComplianceAmount = (double) designNonComplianceMap.get("amount"); + dataRow.createCell(6).setCellValue(designNotStartedAmount); + dataRow.createCell(7).setCellValue(designToConfirmAmount); + dataRow.createCell(8).setCellValue(designComplianceAmount); + dataRow.createCell(9).setCellValue(designNonComplianceAmount); + double designCount = designNotStartedAmount + designToConfirmAmount + designComplianceAmount + designNonComplianceAmount; + double designPercentage = (designComplianceAmount / designCount) * 100; + String designPercentageStr = (designPercentage != 0 && (designCount !=0 )) ? df.format(designPercentage) : "0"; + dataRow.createCell(10).setCellValue(designPercentageStr + percentSign); + + Map verifyMap = this.projectLibraryStatisticsService.getVerifyComplianceStatisticeGroupByTerritory(pliEoList, params); + Map verifyNotStartedMap = (Map) verifyMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double verifyNotStartedAmount = (double) verifyNotStartedMap.get("amount"); + Map verifyToConfirmMap = (Map) verifyMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double verifyToConfirmAmount = (double) verifyToConfirmMap.get("amount"); + Map verifyComplianceMap = (Map) verifyMap.get(ComplianceFlowStatusEnum.CONFORMITY.getValue()); + double verifyComplianceAmount = (double) verifyComplianceMap.get("amount"); + Map verifyNonComplianceMap = (Map) verifyMap.get(ComplianceFlowStatusEnum.INCONFORMITY.getValue()); + double verifyNonComplianceAmount = (double) verifyNonComplianceMap.get("amount"); + dataRow.createCell(11).setCellValue(verifyNotStartedAmount); + dataRow.createCell(12).setCellValue(verifyToConfirmAmount); + dataRow.createCell(13).setCellValue(verifyComplianceAmount); + dataRow.createCell(14).setCellValue(verifyNonComplianceAmount); + double verifyCount = verifyNotStartedAmount + verifyToConfirmAmount + verifyComplianceAmount + verifyNonComplianceAmount; + double verifyPercentage = (verifyComplianceAmount / verifyCount) * 100; + String verifyPercentageStr = (verifyPercentage != 0 && (verifyCount !=0 )) ? df.format(verifyPercentage) : "0"; + dataRow.createCell(15).setCellValue(verifyPercentageStr + percentSign); + } + + /** + * 导出认证活动管理 + * @param workbook + * @param params + */ + private void exportCertificationManagement(HSSFWorkbook workbook,Map params){ + String cut = (String) params.get("cut"); + String sheetName = "认证活动管理"; + String firstTitle = "认证任务确认," + + "Pre-Homo," + + "认证进度"; + String secondTitle = "责任领域(一级)," + + "未发起,待确认,接受,拒绝,完成度," + + "未发起,待确认,审查通过,审查退回,完成度," + + "未开始,进行中,实验通过,实验失败,部件报告未上传,部件报告已上传,部件报告已入库,完成度"; + if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + sheetName = "Certification Activity Management"; + firstTitle = "Authentication task confirmation," + + "Pre-Homo," + + "Certification progress"; + secondTitle = "Area of responsibility (level 1)," + + "Not launched,To be confirmed,Accept,Refuse,Degree of completion," + + "Not launched,To be confirmed,Review of the adoption,Review return,Degree of completion," + + "Not started,In progress,Experiment passed,Experiment failed,Parts report not uploaded,Parts report uploaded,Parts report in stock,Degree of completion"; + } + HSSFSheet sheet = workbook.createSheet(sheetName); + + //合并单元格 起始行,结束行,起始列,结束列 + CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 5); + sheet.addMergedRegion(region1); + CellRangeAddress region2 = new CellRangeAddress(0, 0, 6, 10); + sheet.addMergedRegion(region2); + CellRangeAddress region3 = new CellRangeAddress(0, 0, 11, 18); + sheet.addMergedRegion(region3); + CellRangeAddress region4 = new CellRangeAddress(0, 0, 19, 23); + sheet.addMergedRegion(region4); + + String[] firstTitleArr = firstTitle.split(","); + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + for (int i = 0; i <= 18; i++){ + sheet.setColumnWidth(i, 3500); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 1){ + firstRowCell.setCellValue(firstTitleArr[0]); + }else if(i==6){ + firstRowCell.setCellValue(firstTitleArr[1]); + }else if(i==11){ + firstRowCell.setCellValue(firstTitleArr[2]); + }else if(i==19){ + firstRowCell.setCellValue(firstTitleArr[3]); + } + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellValue(secondTitleArr[i]); + } + + String projectLibraryId = (String) params.get("projectLibraryId"); + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryId); + List projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(pciQueryWrap).stream().filter(pciEo -> { + boolean flag = false; + if (!StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.UNINVOLVED.getValue())) { + flag = true; + } + return flag; + }).distinct().collect(Collectors.toList()); + String pciDutyTerritoryStr = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyTerritory).collect(Collectors.joining(",")); + List sysDictItems = new ArrayList<>(); + if (StringUtils.isNotEmpty(pciDutyTerritoryStr)) { + List pciDutyTerritoryList = Arrays.asList(pciDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pliDutyTerritory : pciDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pliDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + Map> firstLevelDutyTerritoryMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMap)){ + int dataIndex = 2; + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMap.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pciEoList = projectCertificationInventoryEOList.stream().filter(pciEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pciEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + this.exportCertificationManagementSetData(params, sheet, dataIndex, key, pciEoList); + + dataIndex ++; + } + } + } + + /** + * 导出认证活动管理-设置数据 + * @param params + * @param sheet + * @param dataIndex + * @param key + * @param pciEoList + */ + private void exportCertificationManagementSetData(Map params, HSSFSheet sheet, int dataIndex, String key, List pciEoList) { + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(key); + + Map taskConfirmMap = this.projectLibraryStatisticsService.getRZTaskToConfirmStatisticsGroupByTerritory(pciEoList, params); + Map taskConfirmNotStartedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double taskConfirmNotStartedAmount = (double) taskConfirmNotStartedMap.get("amount"); + Map taskConfirmToConfirmMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double taskConfirmToConfirmAmount = (double) taskConfirmToConfirmMap.get("amount"); + Map taskConfirmAcceptedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.ACCEPTED.getValue()); + double taskConfirmAcceptedAmount = (double) taskConfirmAcceptedMap.get("amount"); + Map taskConfirmRejectedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.REJECTED.getValue()); + double taskConfirmRejectedAmount = (double) taskConfirmRejectedMap.get("amount"); + dataRow.createCell(1).setCellValue(taskConfirmNotStartedAmount); + dataRow.createCell(2).setCellValue(taskConfirmToConfirmAmount); + dataRow.createCell(3).setCellValue(taskConfirmAcceptedAmount); + dataRow.createCell(4).setCellValue(taskConfirmRejectedAmount); + double taskConfirmCount = taskConfirmNotStartedAmount + taskConfirmToConfirmAmount + taskConfirmAcceptedAmount + taskConfirmRejectedAmount; + double taskConfirmPercentage = (taskConfirmAcceptedAmount / taskConfirmCount) * 100; + String taskConfirmPercentageStr = (taskConfirmPercentage != 0 && (taskConfirmCount !=0 )) ? df.format(taskConfirmPercentage) : "0"; + dataRow.createCell(5).setCellValue(taskConfirmPercentageStr + percentSign); + + Map prehomoMap = this.projectLibraryStatisticsService.getPrehomoStatisticeGroupByTerritory(pciEoList, params); + Map prehomoNotStartedMap = (Map) prehomoMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double prehomoNotStartedAmount = (double) prehomoNotStartedMap.get("amount"); + Map prehomoToConfirmMap = (Map) prehomoMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double prehomoToConfirmAmount = (double) prehomoToConfirmMap.get("amount"); + Map prehomoAcceptedMap = (Map) prehomoMap.get(CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()); + double prehomoAcceptedAmount = (double) prehomoAcceptedMap.get("amount"); + Map prehomoRejectedMap = (Map) prehomoMap.get(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()); + double prehomoRejectedAmount = (double) prehomoRejectedMap.get("amount"); + dataRow.createCell(6).setCellValue(prehomoNotStartedAmount); + dataRow.createCell(7).setCellValue(prehomoToConfirmAmount); + dataRow.createCell(8).setCellValue(prehomoAcceptedAmount); + dataRow.createCell(9).setCellValue(prehomoRejectedAmount); + double prehomoCount = prehomoNotStartedAmount + prehomoToConfirmAmount + prehomoAcceptedAmount + prehomoRejectedAmount; + double prehomoPercentage = (prehomoAcceptedAmount / prehomoCount) * 100; + String prehomoPercentageStr = (prehomoPercentage != 0 && (prehomoCount !=0 )) ? df.format(prehomoPercentage) : "0"; + dataRow.createCell(10).setCellValue(prehomoPercentageStr + percentSign); + + Map certificationProgressMap = this.projectLibraryStatisticsService.getPartCertificationProgressStatisticsGroupByTerritory(pciEoList, params); + Map certificationProgressNotStartMap = (Map)certificationProgressMap.get(CertificationProgressEnum.NOT_START.getValue()); + double certificationProgressNotStartAmount = (double) certificationProgressNotStartMap.get("amount"); + Map certificationProgressInProgressMap = (Map)certificationProgressMap.get(CertificationProgressEnum.IN_PROGRESS.getValue()); + double certificationProgressInProgressAmount = (double) certificationProgressInProgressMap.get("amount"); + Map certificationProgressTestPassedMap = (Map)certificationProgressMap.get(CertificationProgressEnum.TEST_PASSED.getValue()); + double certificationProgressTestPassedAmount = (double) certificationProgressTestPassedMap.get("amount"); + Map certificationProgressTestFailedMap = (Map)certificationProgressMap.get(CertificationProgressEnum.TEST_FAILED.getValue()); + double certificationProgressTestFailedAmount = (double) certificationProgressTestFailedMap.get("amount"); + Map certificationProgressNotSubmitMap = (Map)certificationProgressMap.get(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue()); + double certificationProgressNotSubmitAmount = (double) certificationProgressNotSubmitMap.get("amount"); + Map certificationProgressSubmitMap = (Map)certificationProgressMap.get(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue()); + double certificationProgressSubmitAmount = (double) certificationProgressSubmitMap.get("amount"); + Map certificationProgressStoredMap = (Map)certificationProgressMap.get(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue()); + double certificationProgressStoredAmount = (double) certificationProgressStoredMap.get("amount"); + dataRow.createCell(11).setCellValue(certificationProgressNotStartAmount); + dataRow.createCell(12).setCellValue(certificationProgressInProgressAmount); + dataRow.createCell(13).setCellValue(certificationProgressTestPassedAmount); + dataRow.createCell(14).setCellValue(certificationProgressTestFailedAmount); + dataRow.createCell(15).setCellValue(certificationProgressNotSubmitAmount); + dataRow.createCell(16).setCellValue(certificationProgressSubmitAmount); + dataRow.createCell(17).setCellValue(certificationProgressStoredAmount); + double certificationProgressCount = certificationProgressNotStartAmount + certificationProgressInProgressAmount + + certificationProgressTestPassedAmount + certificationProgressTestFailedAmount + + certificationProgressNotSubmitAmount + certificationProgressSubmitAmount + + certificationProgressStoredAmount; + double certificationProgressPercentage = (certificationProgressTestPassedAmount / certificationProgressCount) * 100; + String certificationProgressPercentageStr = (certificationProgressPercentage != 0 && (certificationProgressCount !=0 )) ? df.format(certificationProgressPercentage) : "0"; + dataRow.createCell(18).setCellValue(certificationProgressPercentageStr + percentSign); + } + + /** + * 导出认证参数收集 + * @param workbook + * @param params + */ + private void exportParameterCollecting(HSSFWorkbook workbook, Map params) { + String cut = (String) params.get("cut"); + String sheetName = "认证参数收集"; + String firstTitle = "认证参数收集"; + String secondTitle = "责任领域(一级),未开始,收集中,已提交,已同步至上报库,完成度"; + if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + sheetName = "Authentication parameter collection"; + firstTitle = "Authentication parameter collection"; + secondTitle = "Area of responsibility (level 1),Not started,Collecting,Has submitted,Synced to the report library,Degree of completion"; + } + HSSFSheet sheet = workbook.createSheet(sheetName); + //合并单元格 起始行,结束行,起始列,结束列 + CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 5); + sheet.addMergedRegion(region1); + + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + for (int i = 0; i <= 5; i++){ + sheet.setColumnWidth(i, 3500); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 1){ + firstRowCell.setCellValue(firstTitle); + } + + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellValue(secondTitleArr[i]); + } + + String projectLibraryId = (String) params.get("projectLibraryId"); + + QueryWrapper pmQueryWrap = new QueryWrapper<>(); + pmQueryWrap.lambda().eq(ParamsManifestEO::getProjectId,projectLibraryId); + List pmEoList = this.paramsManifestEOService.list(pmQueryWrap); + if(CollectionUtils.isNotEmpty(pmEoList)){ + List pmIdList = pmEoList.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pcmQueryWrap = new QueryWrapper<>(); + pcmQueryWrap.lambda().in(ParamsCollectManifestEO::getParamsManifestId,pmIdList); + List pcmEoList = this.paramsCollectManifestEOService.list(pcmQueryWrap); + pcmEoList = pcmEoList.stream().filter(pcmEo -> !StringUtils.equals(pcmEo.getControlType(),ControlTypeEnum.Title.getValue())).collect(Collectors.toList()); + + List sysDictItems = new ArrayList<>(); + String pcmDutyTerritoryStr = pcmEoList.stream().map(ParamsCollectManifestEO::getDutyTerritory).collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(pcmDutyTerritoryStr)) { + List pcmDutyTerritoryList = Arrays.asList(pcmDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pcmDutyTerritory : pcmDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pcmDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + + Map> firstLevelDutyTerritoryMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMap)){ + int dataIndex = 2; + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMap.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pcmEos = pcmEoList.stream().filter(pcmEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pcmEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(pcmEos)){ + this.exportParameterCollectingSetData(params, sheet, dataIndex ,key,pcmEos); + } + dataIndex ++; + } + } + } + } + private void exportOtaCollecting(HSSFWorkbook workbook, Map params) { + String cut = (String) params.get("cut"); + String sheetName = "OTA状态"; + String firstTitle = "匹配状态统计,OTA认证进度统计"; + String secondTitle = "软件版本,待匹配,待审批,锁定,退回,未开始,进行中,实验通过,实验失败,部件报告未提交,部件报告已提交,部件报告已入库"; + if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + sheetName = "OTA status"; + firstTitle = "Matching state statistics,OTA authentication progress statistics"; + secondTitle = "Software version," + + "To be matched," + + "To be approved," + + "lock," + + "Reject,"+ + "Not started," + + "Ongoing," + + "Test Passed," + + "Test Failed," + + "Component report not submitted," + + "Component report submitted," + + "Component report has been stored"; + } + HSSFSheet sheet = workbook.createSheet(sheetName); + //合并单元格 起始行,结束行,起始列,结束列 + CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 4); + sheet.addMergedRegion(region1); + CellRangeAddress region2 = new CellRangeAddress(0, 0, 5, 11); + sheet.addMergedRegion(region2); + + String[] firstTitleArr = firstTitle.split(","); + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + for (int i = 0; i <= 11; i++){ + sheet.setColumnWidth(i, 3500); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 1){ + firstRowCell.setCellValue(firstTitleArr[0]); + }else if(i==5){ + firstRowCell.setCellValue(firstTitleArr[1]); + } + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellValue(secondTitleArr[i]); + } + + String projectLibraryId = (String) params.get("projectLibraryId"); + List> mapList = otaManageApplyEOService.getStatisticalStatus(projectLibraryId, null, cut,null); + + if(ObjectUtils.isNotEmpty(mapList)){ + int dataIndex = 2; + for (Map map : mapList) { + String plannedBpLaunchBatch = (String) map.get("plannedBpLaunchBatch"); + Map matchStatusMap = (Map)map.get("matchStatusMap"); + Map attestationScheduleMap = (Map)map.get("attestationScheduleMap"); + + String.valueOf(matchStatusMap.get("locked")); + String locked = String.valueOf(matchStatusMap.get("locked")); + String rejected = String.valueOf(matchStatusMap.get("rejected")); + String to_be_approved = String.valueOf(matchStatusMap.get("to_be_approved")); + String to_be_matched = String.valueOf(matchStatusMap.get("to_be_matched")); + String Component_report_has_been_stored = String.valueOf(attestationScheduleMap.get("Component_report_has_been_stored")); + String Component_report_not_submitted = String.valueOf(attestationScheduleMap.get("Component_report_not_submitted")); + String Component_report_submitted = String.valueOf(attestationScheduleMap.get("Component_report_submitted")); + String In_progress = String.valueOf(attestationScheduleMap.get("In_progress")); + String Not_start =String.valueOf(attestationScheduleMap.get("Not_start")); + String Test_failed = String.valueOf(attestationScheduleMap.get("Test_failed")); + String Test_passed = String.valueOf(attestationScheduleMap.get("Test_passed")); + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(plannedBpLaunchBatch); + dataRow.createCell(1).setCellValue(to_be_matched); + dataRow.createCell(2).setCellValue(to_be_approved); + dataRow.createCell(3).setCellValue(locked); + dataRow.createCell(4).setCellValue(rejected); + dataRow.createCell(5).setCellValue(Not_start); + dataRow.createCell(6).setCellValue(In_progress); + dataRow.createCell(7).setCellValue(Test_passed); + dataRow.createCell(8).setCellValue(Test_failed); + dataRow.createCell(9).setCellValue(Component_report_not_submitted); + dataRow.createCell(10).setCellValue(Component_report_submitted); + dataRow.createCell(11).setCellValue(Component_report_has_been_stored); + dataIndex ++; + } + } + } + + /** + * 导出认证参数收集-设置数据 + * @param params + * @param sheet + * @param dataIndex + * @param key + * @param pcmEos + */ + private void exportParameterCollectingSetData(Map params, HSSFSheet sheet, int dataIndex, String key, List pcmEos) { + Map parameterCollectingMap = this.projectLibraryStatisticsService.getParameterCollectingStatisticsGroupByTerritory(pcmEos,params); + Map notStartMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.NOT_START.getValue()); + double notStartAmount = (double) notStartMap.get("amount"); + Map collectingMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.COLLECTING.getValue()); + double collectingAmount = (double) collectingMap.get("amount"); + Map submitMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SUBMIT.getValue()); + double submitAmount = (double) submitMap.get("amount"); + Map syncReporMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SYNC_REPORT.getValue()); + double syncReporAmount = (double) syncReporMap.get("amount"); + + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(key); + dataRow.createCell(1).setCellValue(notStartAmount); + dataRow.createCell(2).setCellValue(collectingAmount); + dataRow.createCell(3).setCellValue(submitAmount); + dataRow.createCell(4).setCellValue(syncReporAmount); + double parameterCollectingCount = notStartAmount + collectingAmount + submitAmount + syncReporAmount; + double completionCount = submitAmount + syncReporAmount; + double parameterCollectingPercentage = (completionCount / parameterCollectingCount) * 100; + String parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (completionCount !=0 )) ? df.format(parameterCollectingPercentage) : "0"; + dataRow.createCell(5).setCellValue(parameterCollectingPercentageStr + percentSign); + } + + private JSONArray getNodeProgressList(TimeNodeVO nodeTnVo) { + //根据节点获取对应进度和时间 + JSONArray nodeList = new JSONArray(); + if(ObjectUtils.isNotEmpty(nodeTnVo)){ + String projectId = nodeTnVo.getProjectId(); + + QueryWrapper pliQueryWrap = new QueryWrapper<>(); + pliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectId); + List pliEoList = this.projectLawsInventoryEOService.list(pliQueryWrap); + + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectId); + List pciEoList = this.projectCertificationInventoryEOService.list(pciQueryWrap); + + QueryWrapper pmQueryWrap = new QueryWrapper<>(); + pmQueryWrap.lambda().eq(ParamsManifestEO::getProjectId,projectId); + List pmEoList = this.paramsManifestEOService.list(pmQueryWrap); + List pcmEoList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(pmEoList)){ + List pmIdList = pmEoList.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pcmQueryWrap = new QueryWrapper<>(); + pcmQueryWrap.lambda().in(ParamsCollectManifestEO::getParamsManifestId,pmIdList); + pcmEoList = this.paramsCollectManifestEOService.list(pcmQueryWrap); + } + + Map getProgressParams = new HashMap<>(); + getProgressParams.put("pliEoList",pliEoList); + getProgressParams.put("pciEoList",pciEoList); + getProgressParams.put("pcmEoList",pcmEoList); + + if(ProjectTaskPlanningNameEnum.LEGAL_TASK_CONFIRMATION.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "法规任务确认"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_FGRWQR.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + + JSONObject preNode1 = new JSONObject(); + preNode1.put("nodeName", "认证任务确认"); + preNode1.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_RZRWQR.getValue(),getProgressParams)); + preNode1.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode1); + }else if(ProjectTaskPlanningNameEnum.DESIGN_DEADLINE.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "设计符合性流程"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_SJFHX.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + }else if(ProjectTaskPlanningNameEnum.VERIFY_DEADLINE.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "验证符合性流程"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_YZFHX.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + }else if(ProjectTaskPlanningNameEnum.ATTESTATION_START_TIME.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "Pre-Homo流程"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_PRE_HOMO.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + + JSONObject preNode1 = new JSONObject(); + preNode1.put("nodeName", "参数收集进度"); + preNode1.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_CSSJJD.getValue(),getProgressParams)); + preNode1.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode1); + }else if(ProjectTaskPlanningNameEnum.ATTESTATION_END_TIME.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "认证进度"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_RZJD.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + } + } + return nodeList; + } + + private JSONArray getNodeList(TimeNodeVO nodeTnVo) { + //根据节点获取对应进度和时间 + JSONArray nodeList = new JSONArray(); + if(ObjectUtils.isNotEmpty(nodeTnVo)){ + String projectId = nodeTnVo.getProjectId(); + + QueryWrapper pliQueryWrap = new QueryWrapper<>(); + pliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectId); + List pliEoList = this.projectLawsInventoryEOService.list(pliQueryWrap); + + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectId); + List pciEoList = this.projectCertificationInventoryEOService.list(pciQueryWrap); + + QueryWrapper pmQueryWrap = new QueryWrapper<>(); + pmQueryWrap.lambda().eq(ParamsManifestEO::getProjectId,projectId); + List pmEoList = this.paramsManifestEOService.list(pmQueryWrap); + List pcmEoList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(pmEoList)){ + List pmIdList = pmEoList.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pcmQueryWrap = new QueryWrapper<>(); + pcmQueryWrap.lambda().in(ParamsCollectManifestEO::getParamsManifestId,pmIdList); + pcmEoList = this.paramsCollectManifestEOService.list(pcmQueryWrap); + } + + Map getProgressParams = new HashMap<>(); + getProgressParams.put("pliEoList",pliEoList); + getProgressParams.put("pciEoList",pciEoList); + getProgressParams.put("pcmEoList",pcmEoList); + + if(ProjectTaskPlanningNameEnum.LIST_CONFIRMATION.getName().equals(nodeTnVo.getName()) || ProjectTaskPlanningNameEnum.LEGAL_TASK_CONFIRMATION.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "法规任务确认"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_FGRWQR.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + + JSONObject preNode1 = new JSONObject(); + preNode1.put("nodeName", "认证任务确认"); + preNode1.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_RZRWQR.getValue(),getProgressParams)); + preNode1.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode1); + }else if(ProjectTaskPlanningNameEnum.DESIGN_DEADLINE.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "设计符合性流程"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_SJFHX.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + }else if(ProjectTaskPlanningNameEnum.PREHOMO_DEADLINE.getName().equals(nodeTnVo.getName()) ||ProjectTaskPlanningNameEnum.ATTESTATION_START_TIME.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "Pre-Homo流程"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_PRE_HOMO.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + + JSONObject preNode1 = new JSONObject(); + preNode1.put("nodeName", "参数收集进度"); + preNode1.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_CSSJJD.getValue(),getProgressParams)); + preNode1.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode1); + }else if(ProjectTaskPlanningNameEnum.CERTIFICATION_SUBMISSION.getName().equals(nodeTnVo.getName()) || ProjectTaskPlanningNameEnum.ATTESTATION_END_TIME.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "认证进度"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_RZJD.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + + JSONObject preNode1 = new JSONObject(); + preNode1.put("nodeName", "参数收集进度"); + preNode1.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_CSSJJD.getValue(),getProgressParams)); + preNode1.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode1); + }else if(ProjectTaskPlanningNameEnum.VERIFY_DEADLINE.getName().equals(nodeTnVo.getName())){ + JSONObject preNode = new JSONObject(); + preNode.put("nodeName", "验证符合性流程"); + preNode.put("progress", this.getProgress(nodeTnVo,HSStatisticalNodesEnum.HS_YZFHX.getValue(),getProgressParams)); + preNode.put("date", sdf.format(nodeTnVo.getTime())); + nodeList.add(preNode); + } + } + return nodeList; + } + + public String getProgress(TimeNodeVO nodeTnVo,String statisticalNode,Map params){ + DecimalFormat df = new DecimalFormat("#.00"); + double result = 0; + List pliEoList = (List) params.get("pliEoList"); + List pciEoList = (List) params.get("pciEoList"); + List pcmEoList = (List) params.get("pcmEoList"); + + if (StringUtils.equals(statisticalNode,HSStatisticalNodesEnum.HS_FGRWQR.getValue())) { + int count = pliEoList.size() * 2; + if (count > 0) { + double designCompleteCount = (double) pliEoList.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue()) + ); + return flag; + }).count(); + + double verifyCompleteCount = (double) pliEoList.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue()) + ); + return flag; + }).count(); + + result = ((designCompleteCount + verifyCompleteCount) / count) * 100; + } + } else if (StringUtils.equals(statisticalNode,HSStatisticalNodesEnum.HS_RZRWQR.getValue())) { + int count = pciEoList.size(); + if (count > 0) { + double completeCount = (double) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).count(); + + result = (completeCount / count) * 100; + } + } else if (StringUtils.equals(statisticalNode,HSStatisticalNodesEnum.HS_SJFHX.getValue())) { + int count = pliEoList.size(); + if (count > 0) { + double completeCount = (double) pliEoList.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).count(); + + result = (completeCount / count) * 100; + } + } else if (StringUtils.equals(statisticalNode,HSStatisticalNodesEnum.HS_PRE_HOMO.getValue())) { + int count = pciEoList.size(); + if (count > 0) { + double completeCount = (double) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).count(); + + result = (completeCount / count) * 100; + } + } else if (StringUtils.equals(statisticalNode,HSStatisticalNodesEnum.HS_RZJD.getValue())) { + // 认证清单认证进度为 实验通过的是完成。 + int count = pciEoList.size(); + if (count > 0) { + double completeCount = (double)pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.TEST_PASSED.getValue()) + ); + return flag; + }).count(); + + result = (completeCount / count) * 100; + } + } else if (StringUtils.equals(statisticalNode,HSStatisticalNodesEnum.HS_YZFHX.getValue())) { + int count = pliEoList.size(); + if (count > 0) { + double completeCount = (double) pliEoList.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).count(); + + result = (completeCount / count) * 100; + } + } else if (StringUtils.equals(statisticalNode,HSStatisticalNodesEnum.HS_CSSJJD.getValue())) { + if(CollectionUtils.isNotEmpty(pcmEoList)){ + int count = pcmEoList.size(); + double completeCount = (double) pcmEoList.stream().filter(pcmEo -> { + boolean flag = ( + StringUtils.equals(pcmEo.getState(), CollectManifestStateEnum.SUBMIT.getValue()) + || StringUtils.equals(pcmEo.getState(),CollectManifestStateEnum.SYNC_REPORT.getValue()) + ); + return flag; + }).count(); + + result = (completeCount / count) * 100; + } + } + + return result != 0 ? df.format(result) : "0"; + } + + + @Override + public List queryList(List projectIdList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("id",projectIdList); + List res = this.list(queryWrapper); + return res; + } + + @Override + public List getListByIds(List projectIdList) { + List res = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(projectIdList)){ + res = this.getBaseMapper().getListByIds(projectIdList); + } + return res; + } +} + + From d092e00267459b6531f6c1239bc5b4d5402a92f8 Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Wed, 13 Sep 2023 10:52:29 +0800 Subject: [PATCH 004/185] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=20=E6=B3=95?= =?UTF-8?q?=E8=A7=84=E6=B8=85=E5=8D=95=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../certificationList/components/addModel.vue | 88 ++--- .../components/certificationList/index.vue | 157 ++------ .../components/listOfRegulations.vue | 28 +- .../components/transferListRxswin.vue | 233 ----------- .../components/transferListvirtalRxswin.vue | 370 ------------------ 5 files changed, 79 insertions(+), 797 deletions(-) delete mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListRxswin.vue delete mode 100644 jero-web/src/views/projectManagement/platformItemLibraryDetails/components/transferListvirtalRxswin.vue diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue index b47e38a8d..09fc9060d 100644 --- a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue @@ -196,28 +196,28 @@ :prop="'dataList.'+index+'.dutyTerritory'" :rules="[{ required: true, message: $t('areaOfResponsibility') + $t('cannotEmpty'), trigger: 'change'},]" > - - - - {{ val.itemText }} - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -460,28 +460,28 @@ - - - - {{ item.itemText }} - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue index 496f75338..7378538fb 100644 --- a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue @@ -110,7 +110,7 @@ -
{{ $t('preservation') }} @@ -123,7 +123,7 @@
-
{{ $t('BatchSetting') }} @@ -136,13 +136,6 @@ {{ $t('CertificationDirectory') }}
- -
- - {{ $t('bringInRelevantPersonnel') }} -
@@ -168,21 +161,21 @@
{{ $t('add') }}
{{ $t('addConfiguration') }}
{{ $t('templateDownload') }} @@ -190,21 +183,21 @@
{{ $t('export') }}
-
+
{{ $t('BatchDelete') }} @@ -212,7 +205,7 @@
{{ $t('processReset') }} @@ -220,21 +213,15 @@
+ v-if="roleSwitchingCode == 1 || roleSwitchingCode == 2"> ...{{ $t('more') }}
- -
- - {{ $t('release') }} -
- -
+
{{ $t('withdraw') }}
@@ -305,7 +292,7 @@
-
{{ $t('question') }} @@ -334,7 +321,7 @@ {{ $t('edit') }} @@ -343,7 +330,7 @@ {{ $t('history') }} {{ $t('deleteLib') }} @@ -400,7 +387,7 @@ {{text}} -
- - {{result.certificationProgress_dictText ? result.certificationProgress_dictText : $t('toBeStarted')}} - -
item.id) + // console.log(this.selectedRowKeys) this.dataSource.forEach(value => { if (value.flowStatusName == '清单待校核') { value.flowStatusName = '任务待发起' @@ -1263,52 +1234,6 @@ dateChange(item) { this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : '' }, - releaseClick() { - // this.listTitle = this.$t('Deadline') - // if (this.selectedRowKeysList.length < 1) { - // this.$message.warning(this.$t('selectLeastOne')) - // } else { - // this.visible = true - // } - if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { - let ids = [] - let notConditions = [] - for (let i = 0; i < this.selectedRowKeysList.length; i++) { - if ((this.selectedRowKeysList[i].flowStatus == 'List to be released' && - this.selectedRowKeysList[i].deliverableType == '1635545748968783874') || - (this.selectedRowKeysList[i].flowStatus == 'Certification returned' && - this.selectedRowKeysList[i].deliverableType == '1635545748968783874')) { - ids.push(this.selectedRowKeysList[i].id) - } else if ((this.selectedRowKeysList[i].flowStatus == 'List to be released' && - this.selectedRowKeysList[i].endTime) || - (this.selectedRowKeysList[i].flowStatus == 'Certification returned' && - this.selectedRowKeysList[i].endTime)) { - ids.push(this.selectedRowKeysList[i].id) - } else { - notConditions.push(this.selectedRowKeysList[i].inspectionItem) - } - } - let data = '' - if (notConditions && notConditions.length > 0) { - data = this.$t('inspectionItems') + '"' + notConditions.join('、') + '"' + this.$t('conditionsNotMet') + ',' + this.$t('onlyDataListReleasedAndCertificationReturnCanSelected') - } - if (ids && ids.length > 0) { - // this.releaseData(ids, notConditions, data) - let query = { - ids: ids, - notConditions: notConditions, - data: data, - dutyDueDate: 'inventoryVerifyEndTime', - title: this.$t('release') - } - this.$refs.deadlineFormRef.getData(JSON.parse(JSON.stringify(query))) - } else { - this.failedMessage(data) - } - } else { - this.$message.warning(this.$t('selectLeastOne')) - } - }, deadlineDataForm(val, formInline) { if (val.title == this.$t('release')) { this.releaseData(val.ids, val.notConditions, val.data, formInline) @@ -1466,7 +1391,7 @@ let ids = [] let notConditions = [] let data = '' - if (this.roleSwitchingCode == 0) { + if (this.roleSwitchingCode == 1 || this.roleSwitchingCode == 2) { for (let i = 0; i < this.selectedRowKeysList.length; i++) { if (this.selectedRowKeysList[i].flowStatus == 'List to be checked' || this.selectedRowKeysList[i].flowStatus == 'Certification returned' || @@ -1856,11 +1781,6 @@ deliveryChange() { this.preservationClick() }, - CertificationProgressClick(val) { - let item = JSON.parse(JSON.stringify(val)) - item.roleCode = this.roleSwitchingCode - this.$refs.TaskListModelRef.getData(item, this.$t('CertificationProgress')) - }, //发起流程 initiatingProcessClick(value, prompt) { if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { @@ -2283,31 +2203,6 @@ this.$message.warning(this.$t('selectLeastOne')) } }, - bringInRelevantPersonnelClick(){ - let _this = this - // if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { - this.$confirm({ - content: _this.$t('confirmBringInRelevantPersonnel'), - onOk() { - // let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys)) - postAction('/project/projectCertificationInventoryEO/matchRelevantPeople', { - // ids: selectedRowKeys.join(','), - projectLibraryId: _this.$route.query.id - }).then((res) => { - if (res.success) { - _this.$message.success(_this.$t('OperationSuccessful')) - _this.selectedRowKeys = [] - _this.getList() - } else { - _this.$message.warning(_this.$t('operationFailed')) - } - }) - } - }) - // } else { - // this.$message.warning(this.$t('selectLeastOne')) - // } - }, } } diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulations.vue index 8ad6ad738..0ea88a2d0 100644 --- a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/listOfRegulations.vue @@ -1,3 +1,4 @@ +
@@ -695,6 +701,7 @@ + @@ -705,6 +712,7 @@ import designCompliance from '../../toDoCenter/projectRegulationTasks/components/designCompliance' import listAddModel from './listAddModel' import listEditModel from './listEditModel' + import flowstatusdetial from './flowstatusdetial' import batSetting from './batSetting' import transferList from './transferList' import associatedplat from './associatedplat' @@ -733,6 +741,7 @@ ImportFile, listAddModel, listEditModel, + flowstatusdetial, batSetting, transferList, associatedplat, @@ -1824,6 +1833,11 @@ } } this.$refs.designComplianceRef.getList(JSON.parse(JSON.stringify(query)), name) + + + }, + a(){ + this.$refs.flowstatusdetialRef.addModel() }, //查看列表页面 From 92dc4fc0966a03524f3cb163bbd9dafaf9aabf95 Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Wed, 20 Sep 2023 16:24:02 +0800 Subject: [PATCH 079/185] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BA=93=20=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=BB=B6=E4=B8=8D=E5=8B=BE=E9=80=89=E6=B3=95=E8=A7=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/associatedplatthree.vue | 12 ++++++++++-- .../components/associatedplattwo.vue | 19 ++++++++++++------- .../components/listOfRegulations.vue | 10 ++++++---- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/associatedplatthree.vue b/jero-web/src/views/projectManagement/components/associatedplatthree.vue index 00e41c0f6..a55cc93d2 100644 --- a/jero-web/src/views/projectManagement/components/associatedplatthree.vue +++ b/jero-web/src/views/projectManagement/components/associatedplatthree.vue @@ -149,6 +149,7 @@ pageSize: 10, total: 0, type:'', + flag:'', id:'', ids:'', } @@ -157,9 +158,11 @@ }, methods: { - transferModel(id,type,ids) { + transferModel(id,flag,type,ids) { + console.log(id,flag,type,ids) this.id = id this.type = type + this.flag = flag, this.ids = ids this.queryParam = {} this.selectQuery = {} @@ -180,8 +183,13 @@ projectLibraryIds: this.id, ...this.queryParam } + let val = { + projectLibraryIds: this.ids, + platformProjectLibraryIds: this.id, + ...this.queryParam + } this.loading = true - postAction('project/projectLibraryBase/listPlatform', query).then((res) => { + postAction(this.flag == '2' ? '/project/projectLibraryBase/listPlatformAll' : 'project/projectLibraryBase/listPlatform', this.flag == '2' ? val : query).then((res) => { if (res.success) { this.data = res.result || [] this.data.forEach((item,index) => { diff --git a/jero-web/src/views/projectManagement/components/associatedplattwo.vue b/jero-web/src/views/projectManagement/components/associatedplattwo.vue index cdb39f4ce..3ff14e24c 100644 --- a/jero-web/src/views/projectManagement/components/associatedplattwo.vue +++ b/jero-web/src/views/projectManagement/components/associatedplattwo.vue @@ -124,14 +124,14 @@ export default { }, { title: this.$t('design') + '-' + this.$t('typeOfDeliverables'), - dataIndex: 'designdeliverableTypeName', + dataIndex: 'designDeliverableTypeName', align: 'left', ellipsis: true, width: 120 }, { title: this.$t('verify') + '-' + this.$t('typeOfDeliverables'), - dataIndex: 'deliverableTypeName', + dataIndex: 'verifyDeliverableTypeName', align: 'left', ellipsis: true, width: 120 @@ -143,8 +143,9 @@ export default { pageNo: 1, pageSize: 10, total: 0, - flag:'', + id:'', type:'', + flag:'', ids:'', } }, @@ -152,11 +153,12 @@ export default { }, methods: { - transferModel(flag,type,ids) { + transferModel(id,flag,type,ids) { this.visible = true - this.flag = flag + this.id = id this.type = type this.ids = ids + this.flag = flag this.queryParam = {} this.selectedRowKeys = [] this.replacePage() @@ -180,13 +182,16 @@ export default { this.replacePage() }, replacePage() { + console.log(this.id) let query = { pageNo: this.pageNo, pageSize: this.pageSize, + projectLibraryId: this.id, + roleCode: 0, ...this.queryParam } this.loading = true - postAction(this.url.transferUrl, query).then((res) => { + getAction('/platform/projectLawsInventoryEO/page', query).then((res) => { if (res.success) { this.dataList = res.result.records || [] this.total = res.result.total @@ -210,7 +215,7 @@ export default { this.confirmLoading = true let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) this.confirmLoading = false - this.$emit('associatedplattwoForm',selectedRowKeys.join(','),this.type,this.ids) + this.$emit('associatedplattwoForm',selectedRowKeys.join(','),this.flag,this.type,this.ids) this.selectedRowKeys = [] // postAction(this.url.addModel, { // dummyInventoryBaseId: selectedRowKeys.join(','), diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index 5be71b891..3676fec0d 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -1982,18 +1982,20 @@ } }else{ flag = '2' + this.selectedRowKeys = this.dataSource.map(val => val.id) + console.log(this.selectedRowKeys) this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) } }, associatedplatForm(id,flag,type,ids){ if(flag == '1'){ - this.$refs.associatedplatthreeRef.transferModel(id,type,ids) + this.$refs.associatedplatthreeRef.transferModel(id,flag,type,ids) }else{ - this.$refs.associatedplattwoRef.transferModel(id,type,ids) + this.$refs.associatedplattwoRef.transferModel(id,flag,type,ids) } }, - associatedplattwoForm(id,type,ids){ - this.$refs.associatedplatthreeRef.transferModel(id,type,ids) + associatedplattwoForm(id,flag,type,ids){ + this.$refs.associatedplatthreeRef.transferModel(id,flag,type,ids) }, associatedplatthreeForm(id){ this.getList() From c68e0d946d4f2101adb283728830959a049a956e Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Wed, 20 Sep 2023 16:36:16 +0800 Subject: [PATCH 080/185] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BA=93=20=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E6=B8=85=E5=8D=95=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/certificationList/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/certificationList/index.vue b/jero-web/src/views/projectManagement/components/certificationList/index.vue index acd258b30..3358f9955 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/index.vue @@ -1286,10 +1286,9 @@ } } for (let i = 0; i < dataSource.length; i++) { - if (dataSource[i].verifyFlowStatus == 'List to be released' && - dataSource[i].designFlowStatus == 'List to be released') { + if (dataSource[i].flowStatus == 'List to be released') { flag = '1' - this.$refs.associatedplatRef.transferModel(flag,type) + this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) } else { this.$message.warning(this.$t('unpublishedregulationsselected')) return @@ -1301,6 +1300,7 @@ } }, associatedplatForm(id,flag,type,ids){ + console.log(type) // if(flag == '1'){ // this.$refs.associatedplatthreeRef.transferModel(id,type,ids) // }else{ From 46fc2db7a57fb61555f5d50beff95c55f4ef01eb Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Wed, 20 Sep 2023 16:45:00 +0800 Subject: [PATCH 081/185] =?UTF-8?q?=E4=B8=8D=E5=8B=BE=E9=80=89=E6=B3=95?= =?UTF-8?q?=E8=A7=84=E6=B8=85=E5=8D=95=E8=BF=9B=E8=A1=8C=E5=85=B3=E8=81=94?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLibraryBaseController.java | 18 ++- .../service/IProjectLibraryBaseService.java | 9 +- .../impl/ProjectLibraryBaseServiceImpl.java | 113 +++++++++++++++++- 3 files changed, 135 insertions(+), 5 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java index 2ecf13b82..ba98706f0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java @@ -63,17 +63,29 @@ public class ProjectLibraryBaseController extends JeroController listPlatform(@RequestBody Map params) { List> mapList = projectLibraryBaseService.listPlatform(params); return Result.OK(params.get("cut").toString(),mapList); } + /** + * 不勾选法规清单进行关联平台件 + * + * @return + */ + @AutoLog(value = "不勾选法规清单进行关联平台件") + @ApiOperation(value="不勾选法规清单进行关联平台件", notes="不勾选法规清单进行关联平台件") + @PostMapping(value = "/listPlatformAll") + public Result listPlatformAll(@RequestBody Map params) { + List> mapList = projectLibraryBaseService.listPlatformAll(params); + return Result.OK(params.get("cut").toString(),mapList); + } /** * 列表查询 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java index 26a2b99dc..4f9f6f60e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java @@ -87,11 +87,18 @@ public interface IProjectLibraryBaseService extends IService List queryPageList(Map params); /** - * 法规清单关联平台件 + * 勾选法规清单进行关联平台件 * @param params * @return */ List> listPlatform(Map params); + + /** + * 不勾选法规清单进行关联平台件 + * @param params + * @return + */ + List> listPlatformAll(Map params); // IPage queryPageList(Map params); /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 3aa0f273f..25d289488 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -1265,7 +1265,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl 1){ + map.put("lawsInventoryId",projectLawsInventoryEO.getId()); + map.put("title",serialNumber+" "+dutyTerritoryNew+" "+subtitle+"在平台件项目中包含多条匹配内容,请选择关联"); + map.put("result",projectLawsInventoryEOS); + mapList.add(map); + }else if(!projectLawsInventoryEOS.isEmpty() && projectLawsInventoryEOS.size() == 1){ + Map mapTemp = new HashMap<>(); + mapTemp.put("lawsInventoryId",projectLawsInventoryEO.getId()); + mapTemp.put("result",projectLawsInventoryEOS); + mapListOne.add(mapTemp); + } + } + if(!mapListOne.isEmpty()){ + //匹配一条平台件时直接新增 + List lawsInventoryPlatformEOS = new ArrayList<>(); + for (Map map : mapListOne) { + LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO(); + inventoryPlatformEO.setCreateTime(new Date()); + inventoryPlatformEO.setUpdateTime(new Date()); + inventoryPlatformEO.setLawsInventoryId((String) map.get("lawsInventoryId")); + List projectLawsInventoryEOS = (List) map.get("result"); + inventoryPlatformEO.setPlatformLawsInventoryId(projectLawsInventoryEOS.get(0).getId()); + lawsInventoryPlatformEOS.add(inventoryPlatformEO); + } + + if (!lawsInventoryPlatformEOS.isEmpty()) { + lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS); + } + } + return mapList; + } + /** + * 不勾选法规清单进行关联平台件 + * + * @return + */ + @Override + public List> listPlatformAll(Map params) { + String cut = (String) params.get("cut");// + String projectLibraryIds = (String) params.get("projectLibraryIds");//法规清单id + String platformProjectLibraryIds = (String) params.get("platformProjectLibraryIds");//平台件法规id + + //法规清单数据 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(ProjectLawsInventoryEO::getId,Arrays.asList(projectLibraryIds.split(","))); + List lawsInventoryEOList = projectLawsInventoryEOService.list(wrapper); + //只有法规的设计符合性确认和验证符合性确认中的流程状态均为清单待发布的时候,才能关联平台件数据 + lawsInventoryEOList = lawsInventoryEOList.stream() + .filter(e->ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue().equals(e.getDesignFlowStatus()) + && ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue().equals(e.getVerifyFlowStatus())).collect(Collectors.toList()); + + //平台件项目对应的法规清单数据 + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.in(ProjectLawsInventoryEO::getId,Arrays.asList(platformProjectLibraryIds.split(","))); + List lawsInventoryEOS = projectLawsInventoryEOService.list(wrapper1); + + //平台件项目信息 + List projectLibraryBaseList = new ArrayList<>(); + if(!lawsInventoryEOList.isEmpty()){ + List projectIdList = lawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); + LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); + wrapper2.in(ProjectLibraryBase::getId,projectIdList); + projectLibraryBaseList = this.list(wrapper2); + } + + //普通数据字典 + List sysDictItemList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue()); + List> mapList = new ArrayList<>(); + List> mapListOne = new ArrayList<>(); + List projectLawsInventoryEOList = new ArrayList<>(); + for (ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryEOList) { + Map map = new HashMap<>(); + List projectLawsInventoryEOS = new ArrayList<>(); + //serialNumber dutyTerritory + String serialNumber = projectLawsInventoryEO.getSerialNumber(); + String dutyTerritory = projectLawsInventoryEO.getDutyTerritory(); + String subtitle = projectLawsInventoryEO.getSubtitle(); + + //责任领域 + List list = new LinkedList<>(); + if(StringUtils.isNotBlank(dutyTerritory)){ + for (String s : dutyTerritory.split(",")) { + List collect = sysDictItemList.stream().filter(e -> e.getItemValue().equals(s)).collect(Collectors.toList()); + if(CutEnum.CN.getValue().equals(cut) && !collect.isEmpty()){ + list.add(collect.get(0).getItemText()); + }else if(CutEnum.EN.getValue().equals(cut) && !collect.isEmpty()){ + list.add(collect.get(0).getEnName()); + } + } + } + String dutyTerritoryNew = ""; + if(!list.isEmpty()){ + dutyTerritoryNew = StringUtils.join(list, ","); + } + + for (ProjectLawsInventoryEO lawsInventoryEO : lawsInventoryEOS) { + String serialNumberTemp = lawsInventoryEO.getSerialNumber(); + String dutyTerritoryTemp = lawsInventoryEO.getDutyTerritory(); + if(serialNumber.equals(serialNumberTemp) && StringUtils.isNotBlank(dutyTerritory) && dutyTerritory.equals(dutyTerritoryTemp)){ + List projectLibraryBases = projectLibraryBaseList.stream().filter(e -> e.getId().equals(lawsInventoryEO.getProjectLibraryId())).collect(Collectors.toList()); + if(!projectLibraryBases.isEmpty()){ + lawsInventoryEO.setProjectName(projectLibraryBases.get(0).getProjectNameId()); + } + if(!list.isEmpty()){ + lawsInventoryEO.setDutyTerritory_dictText(dutyTerritoryNew); + } + projectLawsInventoryEOS.add(lawsInventoryEO); + } + } + + if(!projectLawsInventoryEOS.isEmpty() && projectLawsInventoryEOS.size() > 1){ map.put("lawsInventoryId",projectLawsInventoryEO.getId()); map.put("title",serialNumber+" "+dutyTerritoryNew+" "+subtitle+"在平台件项目中包含多条匹配内容,请选择关联"); From bc305082d6c961fcb66e2d7491763b7602c35c01 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Wed, 20 Sep 2023 17:55:43 +0800 Subject: [PATCH 082/185] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 2 +- .../impl/ProjectLibraryBaseServiceImpl.java | 22 +++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index 2b3e83858..ca601940e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -1827,7 +1827,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl categoryList, List technologyTerritoryList) { + public String getTreeName(String cut, List categoryList, List technologyTerritoryList) { StringBuilder sb = new StringBuilder(); for (String technologyTerritory : technologyTerritoryList) { List collect = categoryList.stream().filter(e -> technologyTerritory.equals(e.getId())).collect(Collectors.toList()); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 25d289488..4709f34b9 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -61,6 +61,7 @@ import com.jero.modules.project.service.IProjectLibraryRoleRelEOService; import com.jero.modules.project.service.IProjectLibraryStatisticsService; import com.jero.modules.project.service.IProjectUserPermissionService; import com.jero.modules.project.vo.TimeNodeVO; +import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.enums.DicCodeEnum; @@ -70,6 +71,7 @@ import com.jero.modules.system.mapper.SysUserMapper; import com.jero.modules.system.service.IProjectUserBrandService; import com.jero.modules.system.service.ISysDictService; import com.jero.modules.system.service.ISysUserService; +import com.jero.modules.system.service.impl.SysCategoryServiceImpl; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import com.jero.modules.system.util.StringUtils; import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO; @@ -206,6 +208,8 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl sysDictItemList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue()); + List categoryList = sysCategoryService.list(); List> mapList = new ArrayList<>(); List> mapListOne = new ArrayList<>(); - List projectLawsInventoryEOList = new ArrayList<>(); for (ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryEOList) { Map map = new HashMap<>(); List projectLawsInventoryEOS = new ArrayList<>(); @@ -1323,6 +1327,19 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl 1){ map.put("lawsInventoryId",projectLawsInventoryEO.getId()); map.put("title",serialNumber+" "+dutyTerritoryNew+" "+subtitle+"在平台件项目中包含多条匹配内容,请选择关联"); From 4ca7876bb6c35ccfa2ba921b6c80723c7f60ae70 Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Wed, 20 Sep 2023 17:58:16 +0800 Subject: [PATCH 083/185] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BA=93=20=E5=85=B3=E8=81=94=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectManagement/components/associatedplatthree.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/associatedplatthree.vue b/jero-web/src/views/projectManagement/components/associatedplatthree.vue index a55cc93d2..96a610c85 100644 --- a/jero-web/src/views/projectManagement/components/associatedplatthree.vue +++ b/jero-web/src/views/projectManagement/components/associatedplatthree.vue @@ -77,14 +77,14 @@ }, { title: this.$t('regulatoryEngineer'), - dataIndex: 'regulationOwnerName', + dataIndex: 'createBy', align: 'left', ellipsis: true, width: 120 }, { title: this.$t('design') + '-' + this.$t('typeOfDeliverables'), - dataIndex: 'designdeliverableTypeName', + dataIndex: 'designDeliverableTypeName', align: 'left', ellipsis: true, width: 130 From 0bef771651d56de814c9e3bc6fac70ac0ed5d17f Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Wed, 20 Sep 2023 19:00:32 +0800 Subject: [PATCH 084/185] =?UTF-8?q?=E5=8B=BE=E9=80=89=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E8=BF=9B=E8=A1=8C=E5=85=B3=E8=81=94=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ectCertificationInventoryEOController.java | 54 +++++++---- ...rojectCertificationInventoryEOService.java | 12 ++- ...ctCertificationInventoryEOServiceImpl.java | 97 +++++++++++++++++++ 3 files changed, 143 insertions(+), 20 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java index c943f39cb..4c6b640f6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java @@ -1,32 +1,39 @@ package com.jero.modules.project.controller; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import com.alibaba.fastjson.JSONObject; -import com.jero.common.api.vo.Result; -import com.jero.common.system.query.QueryGenerator; -import com.jero.modules.project.entity.ProjectCertificationInventoryEO; -import com.jero.modules.project.entity.ProjectLawsInventoryEO; -import com.jero.modules.project.service.IProjectCertificationInventoryEOService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.jero.modules.system.entity.SysRole; -import lombok.extern.slf4j.Slf4j; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.system.base.controller.JeroController; +import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; +import com.jero.modules.project.service.IProjectCertificationInventoryEOService; +import com.jero.modules.system.entity.SysRole; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import com.jero.common.aspect.annotation.AutoLog; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; +import java.util.Map; /** @@ -86,6 +93,19 @@ public class ProjectCertificationInventoryEOController extends JeroController listPlatform(@RequestBody Map params) { + projectCertificationInventoryEOService.listPlatform(params); + return Result.OK(); + } + /** * 列表查询 * diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 16dcdbaaf..472446bd3 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -4,10 +4,9 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.jero.common.api.vo.Result; -import com.jero.common.system.vo.DictModel; -import com.jero.modules.project.entity.ProjectCertificationInventoryEO; import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.common.api.vo.Result; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysRole; @@ -339,4 +338,11 @@ public interface IProjectCertificationInventoryEOService extends IService matchRelevantPeople(Map params); + + /** + * 勾选认证清单进行关联平台件 + * @param params + * @return + */ + void listPlatform(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 7c04dc814..830ccfbd3 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -31,6 +31,7 @@ import com.jero.modules.feishu.enums.TemplateInfoEnum2; import com.jero.modules.feishu.service.IFeishuService; import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.service.IOSSFileService; +import com.jero.modules.project.entity.LawsInventoryPlatformEO; import com.jero.modules.project.entity.ProjectCertificationInventoryDutyEnginnerEO; import com.jero.modules.project.entity.ProjectCertificationInventoryDutyEnginnerEOEn; import com.jero.modules.project.entity.ProjectCertificationInventoryEO; @@ -227,6 +228,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl params) { + String cut = (String) params.get("cut");// + String ids = (String) params.get("ids");//认证清单id + String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id + + //认证清单数据 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(","))); + List certificationInventoryEOList = this.list(wrapper); + + //平台件项目对应的认证清单数据 + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(projectLibraryIds.split(","))); + List certificationInventoryEOS = this.list(wrapper1); + + //平台件项目信息 + List projectLibraryBaseList = new ArrayList<>(); + if(!certificationInventoryEOList.isEmpty()){ + List projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); + LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); + wrapper2.in(ProjectLibraryBase::getId,projectIdList); + projectLibraryBaseList = projectLibraryBaseService.list(wrapper2); + } + + List lawsInventoryPlatformEOS = new ArrayList<>(); + + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { + Map map = new HashMap<>(); + List projectLawsInventoryEOS = new ArrayList<>(); + //类别 + String category = projectCertificationInventoryEO.getCategory(); + //检验项目 + String inspectionItem = projectCertificationInventoryEO.getInspectionItem(); + //配置项 + String configItem = projectCertificationInventoryEO.getConfigItem(); + //编号 + String serialNumber = projectCertificationInventoryEO.getSerialNumber(); + //责任领域 + String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory(); + + for (ProjectCertificationInventoryEO certificationInventoryEO : certificationInventoryEOS) { + List libraryBaseList = projectLibraryBaseList.stream() + .filter(e -> certificationInventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); + //平台件项目库中的认证清单的配置项为平台件项目名称 + String configItemTemp = ""; + if(!libraryBaseList.isEmpty()){ + //配置项 + configItemTemp = libraryBaseList.get(0).getProjectNameId(); + } + //类别 + String categoryTemp = certificationInventoryEO.getCategory(); + //检验项目 + String inspectionItemTemp = certificationInventoryEO.getInspectionItem(); + //编号 + String serialNumberTemp = certificationInventoryEO.getSerialNumber(); + //责任领域 + String dutyTerritoryTemp = certificationInventoryEO.getDutyTerritory(); + + if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ + //如果车型项目库中的配置项为空或为标配时,直接将平台件信息添加到关联表 + setData(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO); + }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ + //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 + //如果一致,则用类别,检验项目,编号,责任领域去做匹配 + if(configItem.equals(configItemTemp) + && category.equals(categoryTemp) + && inspectionItem.equals(inspectionItemTemp) + && serialNumber.equals(serialNumberTemp) + && dutyTerritory.equals(dutyTerritoryTemp)){ + setData(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO); + } + } + } + } + if(!lawsInventoryPlatformEOS.isEmpty()){ + lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS); + } + } + + private void setData(List lawsInventoryPlatformEOS, ProjectCertificationInventoryEO projectCertificationInventoryEO, ProjectCertificationInventoryEO certificationInventoryEO) { + LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO(); + inventoryPlatformEO.setCreateTime(new Date()); + inventoryPlatformEO.setUpdateTime(new Date()); + inventoryPlatformEO.setLawsInventoryId(projectCertificationInventoryEO.getId()); + inventoryPlatformEO.setPlatformLawsInventoryId(certificationInventoryEO.getId()); + lawsInventoryPlatformEOS.add(inventoryPlatformEO); + } + } From a8507c3210de7cc0292830eaf23ff9145a564e3d Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Thu, 21 Sep 2023 09:54:17 +0800 Subject: [PATCH 085/185] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BA=93=20=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/certificationList/index.vue | 15 ++++++++++++++- .../components/listEditModel.vue | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/jero-web/src/views/projectManagement/components/certificationList/index.vue b/jero-web/src/views/projectManagement/components/certificationList/index.vue index 3358f9955..645dbe1ea 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/index.vue @@ -1300,7 +1300,20 @@ } }, associatedplatForm(id,flag,type,ids){ - console.log(type) + console.log(id,flag,type,ids) + let query ={ + ids:ids, + projectLibraryIds:id + } + if(type == '认证'){ + postAction('/project/projectCertificationInventoryEO/listPlatform', query).then((res) => { + if (res.success) { + this.$refs.associatedplatRef.visible = false + this.$message.success(this.$t('OperationSuccessful')) + this.getList() + } + }) + } // if(flag == '1'){ // this.$refs.associatedplatthreeRef.transferModel(id,type,ids) // }else{ diff --git a/jero-web/src/views/projectManagement/components/listEditModel.vue b/jero-web/src/views/projectManagement/components/listEditModel.vue index 39498ce70..60de12437 100644 --- a/jero-web/src/views/projectManagement/components/listEditModel.vue +++ b/jero-web/src/views/projectManagement/components/listEditModel.vue @@ -845,6 +845,8 @@ } this.formInline.designDutyIdName = this.dataList && this.dataList.length>0 ? this.dataList[0].designDutyIdName : '' this.formInline.verifyDutyIdName = this.dataList && this.dataList.length>0 ? this.dataList[0].verifyDutyIdName : '' + this.formInline.designDutyId = this.dataList && this.dataList.length>0 ? this.dataList[0].designDutyId : '' + this.formInline.verifyDutyId = this.dataList && this.dataList.length>0 ? this.dataList[0].verifyDutyId : '' this.formInline.designDueDate = this.dataList && this.dataList.length>0 ? this.dataList[0].designDueDate : '' this.formInline.verifyDueDate = this.dataList && this.dataList.length>0 ? this.dataList[0].verifyDueDate : '' this.formInline.designDeliverableTemplate = this.dataList && this.dataList.length>0 ? this.dataList[0].designDeliverableTemplate : '' From 9ca563bc67f1436a16794ec4635982bbd4a8b1cc Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 13:36:44 +0800 Subject: [PATCH 086/185] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95-?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctCertificationInventoryEOServiceImpl.java | 188 ++++++++++++++---- 1 file changed, 152 insertions(+), 36 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 830ccfbd3..9bd34fcd7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -6857,7 +6857,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl params) { - String cut = (String) params.get("cut");// String ids = (String) params.get("ids");//认证清单id String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id @@ -6882,9 +6881,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl lawsInventoryPlatformEOS = new ArrayList<>(); + List projectCertificationInventoryEOList = new ArrayList<>(); for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { - Map map = new HashMap<>(); - List projectLawsInventoryEOS = new ArrayList<>(); //类别 String category = projectCertificationInventoryEO.getCategory(); //检验项目 @@ -6896,52 +6894,170 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl libraryBaseList = projectLibraryBaseList.stream() - .filter(e -> certificationInventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); - //平台件项目库中的认证清单的配置项为平台件项目名称 - String configItemTemp = ""; - if(!libraryBaseList.isEmpty()){ - //配置项 - configItemTemp = libraryBaseList.get(0).getProjectNameId(); + List result = new ArrayList<>(); + //如果车型项目库中的配置项为空或为标配时,不去匹配直接关联 + if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ + if(!certificationInventoryEOS.isEmpty()){ + result = setData(certificationInventoryEOS, projectCertificationInventoryEOList, projectCertificationInventoryEO); } - //类别 - String categoryTemp = certificationInventoryEO.getCategory(); - //检验项目 - String inspectionItemTemp = certificationInventoryEO.getInspectionItem(); - //编号 - String serialNumberTemp = certificationInventoryEO.getSerialNumber(); - //责任领域 - String dutyTerritoryTemp = certificationInventoryEO.getDutyTerritory(); + }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ + //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 + //如果一致,则用类别,检验项目,编号,责任领域去做匹配 + + List projectCertificationInventoryEOS = new ArrayList<>(); + for (int i = 0; i < certificationInventoryEOS.size(); i++) { + int finalI = i; + List libraryBaseList = projectLibraryBaseList.stream() + .filter(e -> certificationInventoryEOS.get(finalI).getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); + //平台件项目库中的认证清单的配置项为平台件项目名称 + String configItemTemp = ""; + if(!libraryBaseList.isEmpty()){ + //配置项 + configItemTemp = libraryBaseList.get(0).getProjectNameId(); + } + //类别 + String categoryTemp = certificationInventoryEOS.get(i).getCategory(); + //检验项目 + String inspectionItemTemp = certificationInventoryEOS.get(i).getInspectionItem(); + //编号 + String serialNumberTemp = certificationInventoryEOS.get(i).getSerialNumber(); + //责任领域 + String dutyTerritoryTemp = certificationInventoryEOS.get(i).getDutyTerritory(); - if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ - //如果车型项目库中的配置项为空或为标配时,直接将平台件信息添加到关联表 - setData(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO); - }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ - //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 - //如果一致,则用类别,检验项目,编号,责任领域去做匹配 if(configItem.equals(configItemTemp) && category.equals(categoryTemp) && inspectionItem.equals(inspectionItemTemp) && serialNumber.equals(serialNumberTemp) && dutyTerritory.equals(dutyTerritoryTemp)){ - setData(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO); + + projectCertificationInventoryEOS.add(certificationInventoryEOS.get(i)); } } + if(!projectCertificationInventoryEOS.isEmpty()){ + result = setData(certificationInventoryEOS, projectCertificationInventoryEOS, projectCertificationInventoryEO); + this.saveOrUpdateBatch(result); + } } } - if(!lawsInventoryPlatformEOS.isEmpty()){ - lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS); - } } - private void setData(List lawsInventoryPlatformEOS, ProjectCertificationInventoryEO projectCertificationInventoryEO, ProjectCertificationInventoryEO certificationInventoryEO) { - LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO(); - inventoryPlatformEO.setCreateTime(new Date()); - inventoryPlatformEO.setUpdateTime(new Date()); - inventoryPlatformEO.setLawsInventoryId(projectCertificationInventoryEO.getId()); - inventoryPlatformEO.setPlatformLawsInventoryId(certificationInventoryEO.getId()); - lawsInventoryPlatformEOS.add(inventoryPlatformEO); + private List setData(List certificationInventoryEOS, + List projectCertificationInventoryEOList, + ProjectCertificationInventoryEO projectCertificationInventoryEO) { + List projectCertificationInventoryEOS = new ArrayList<>(); + //设置平台件认证清单数据 + setProjectCertificationInventoryEO(certificationInventoryEOS.get(0), projectCertificationInventoryEO); + projectCertificationInventoryEOS.add(projectCertificationInventoryEO); + + //如果车型项目库中的配置项为空或为标配时,不去匹配直接关联,此时一对多,一指的是车型库认证清单,多指的是平台件认证清单 + //例:一条车型库认证清单对应3条平台件认证清单,此时需要复制两条项目库认证清单,将这两条认证清单中的交付物模板到生产企业名称 + //的字段值替换为平台件认证清单的数据,原有的那条认证清单这部分数据也需要替换 + for (int i = 1; i < certificationInventoryEOS.size(); i++) { + ProjectCertificationInventoryEO certificationInventoryEO = new ProjectCertificationInventoryEO(); + BeanUtils.copyProperties(projectCertificationInventoryEO,certificationInventoryEO); + certificationInventoryEO.setId(UUID.randomUUID().toString().replace("-","")); + //设置平台件认证清单数据 + setProjectCertificationInventoryEO(certificationInventoryEOS.get(i), certificationInventoryEO); + projectCertificationInventoryEOS.add(certificationInventoryEO); + } + return projectCertificationInventoryEOS; } + private void setProjectCertificationInventoryEO(ProjectCertificationInventoryEO certificationInventoryEO, ProjectCertificationInventoryEO projectCertificationInventoryEO) { + //交付物模板-deliverableTemplate + projectCertificationInventoryEO.setDeliverableTemplate(certificationInventoryEO.getDeliverableTemplate()); + //交付物类型-deliverableType + projectCertificationInventoryEO.setDeliverableType(certificationInventoryEO.getDeliverableType()); + //交付结果-deliveryResult + projectCertificationInventoryEO.setDeliveryResult(certificationInventoryEO.getDeliveryResult()); + //截止日期-endTime + projectCertificationInventoryEO.setEndTime(certificationInventoryEO.getEndTime()); + //流程状态-flowStatus + projectCertificationInventoryEO.setFlowStatus(certificationInventoryEO.getFlowStatus()); + //报告编号-reportNumber + projectCertificationInventoryEO.setReportNumber(certificationInventoryEO.getReportNumber()); + //产品型号-productModel + projectCertificationInventoryEO.setProductModel(certificationInventoryEO.getProductModel()); + //生产企业名称-productionEnterpriseName + projectCertificationInventoryEO.setProductionEnterpriseName(certificationInventoryEO.getProductionEnterpriseName()); + } +// public void listPlatform(Map params) { +// String cut = (String) params.get("cut");// +// String ids = (String) params.get("ids");//认证清单id +// String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id +// +// //认证清单数据 +// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); +// wrapper.in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(","))); +// List certificationInventoryEOList = this.list(wrapper); +// +// //平台件项目对应的认证清单数据 +// LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); +// wrapper1.in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(projectLibraryIds.split(","))); +// List certificationInventoryEOS = this.list(wrapper1); +// +// //平台件项目信息 +// List projectLibraryBaseList = new ArrayList<>(); +// if(!certificationInventoryEOList.isEmpty()){ +// List projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); +// LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); +// wrapper2.in(ProjectLibraryBase::getId,projectIdList); +// projectLibraryBaseList = projectLibraryBaseService.list(wrapper2); +// } +// +// List lawsInventoryPlatformEOS = new ArrayList<>(); +// +// for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { +// Map map = new HashMap<>(); +// List projectLawsInventoryEOS = new ArrayList<>(); +// //类别 +// String category = projectCertificationInventoryEO.getCategory(); +// //检验项目 +// String inspectionItem = projectCertificationInventoryEO.getInspectionItem(); +// //配置项 +// String configItem = projectCertificationInventoryEO.getConfigItem(); +// //编号 +// String serialNumber = projectCertificationInventoryEO.getSerialNumber(); +// //责任领域 +// String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory(); +// +// for (ProjectCertificationInventoryEO certificationInventoryEO : certificationInventoryEOS) { +// List libraryBaseList = projectLibraryBaseList.stream() +// .filter(e -> certificationInventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); +// //平台件项目库中的认证清单的配置项为平台件项目名称 +// String configItemTemp = ""; +// if(!libraryBaseList.isEmpty()){ +// //配置项 +// configItemTemp = libraryBaseList.get(0).getProjectNameId(); +// } +// //类别 +// String categoryTemp = certificationInventoryEO.getCategory(); +// //检验项目 +// String inspectionItemTemp = certificationInventoryEO.getInspectionItem(); +// //编号 +// String serialNumberTemp = certificationInventoryEO.getSerialNumber(); +// //责任领域 +// String dutyTerritoryTemp = certificationInventoryEO.getDutyTerritory(); +// +// if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ +// //如果车型项目库中的配置项为空或为标配时,直接将平台件信息添加到关联表 +// setData(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO); +// }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ +// //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 +// //如果一致,则用类别,检验项目,编号,责任领域去做匹配 +// if(configItem.equals(configItemTemp) +// && category.equals(categoryTemp) +// && inspectionItem.equals(inspectionItemTemp) +// && serialNumber.equals(serialNumberTemp) +// && dutyTerritory.equals(dutyTerritoryTemp)){ +// setData(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO); +// } +// } +// } +// } +// if(!lawsInventoryPlatformEOS.isEmpty()){ +// lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS); +// } +// } + } From 4c836792ee5af7fad9eec6761acd1ef9aba948a6 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 14:09:55 +0800 Subject: [PATCH 087/185] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProjectCertificationInventoryEOServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 9bd34fcd7..1107ba247 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -6935,9 +6935,11 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl Date: Thu, 21 Sep 2023 14:16:05 +0800 Subject: [PATCH 088/185] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProjectCertificationInventoryEOServiceImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 1107ba247..e876f5618 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -6898,7 +6898,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl setData(List certificationInventoryEOS, - List projectCertificationInventoryEOList, ProjectCertificationInventoryEO projectCertificationInventoryEO) { List projectCertificationInventoryEOS = new ArrayList<>(); //设置平台件认证清单数据 From ea804a0ce82843b3439bf8c9fb406ae355532d2c Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 14:27:45 +0800 Subject: [PATCH 089/185] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctCertificationInventoryEOServiceImpl.java | 138 +++++++++--------- 1 file changed, 70 insertions(+), 68 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index e876f5618..e38cb5c4d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -6870,75 +6870,77 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationInventoryEOS = this.list(wrapper1); - //平台件项目信息 - List projectLibraryBaseList = new ArrayList<>(); - if(!certificationInventoryEOList.isEmpty()){ - List projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); - LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); - wrapper2.in(ProjectLibraryBase::getId,projectIdList); - projectLibraryBaseList = projectLibraryBaseService.list(wrapper2); - } - - List lawsInventoryPlatformEOS = new ArrayList<>(); - - List projectCertificationInventoryEOList = new ArrayList<>(); - for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { - //类别 - String category = projectCertificationInventoryEO.getCategory(); - //检验项目 - String inspectionItem = projectCertificationInventoryEO.getInspectionItem(); - //配置项 - String configItem = projectCertificationInventoryEO.getConfigItem(); - //编号 - String serialNumber = projectCertificationInventoryEO.getSerialNumber(); - //责任领域 - String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory(); - - List result = new ArrayList<>(); - //如果车型项目库中的配置项为空或为标配时,不去匹配直接关联 - if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ - if(!certificationInventoryEOS.isEmpty()){ - result = setData(certificationInventoryEOS, projectCertificationInventoryEO); - } - }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ - //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 - //如果一致,则用类别,检验项目,编号,责任领域去做匹配 - - List projectCertificationInventoryEOS = new ArrayList<>(); - for (int i = 0; i < certificationInventoryEOS.size(); i++) { - int finalI = i; - List libraryBaseList = projectLibraryBaseList.stream() - .filter(e -> certificationInventoryEOS.get(finalI).getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); - //平台件项目库中的认证清单的配置项为平台件项目名称 - String configItemTemp = ""; - if(!libraryBaseList.isEmpty()){ - //配置项 - configItemTemp = libraryBaseList.get(0).getProjectNameId(); - } - //类别 - String categoryTemp = certificationInventoryEOS.get(i).getCategory(); - //检验项目 - String inspectionItemTemp = certificationInventoryEOS.get(i).getInspectionItem(); - //编号 - String serialNumberTemp = certificationInventoryEOS.get(i).getSerialNumber(); - //责任领域 - String dutyTerritoryTemp = certificationInventoryEOS.get(i).getDutyTerritory(); - - if(configItem.equals(configItemTemp) - && category.equals(categoryTemp) - && inspectionItem.equals(inspectionItemTemp) - && serialNumber.equals(serialNumberTemp) - && dutyTerritory.equals(dutyTerritoryTemp)){ - - projectCertificationInventoryEOS.add(certificationInventoryEOS.get(i)); - } - } - if(!projectCertificationInventoryEOS.isEmpty()){ - result = setData(projectCertificationInventoryEOS, projectCertificationInventoryEO); - } + if(!certificationInventoryEOS.isEmpty()){ + //平台件项目信息 + List projectLibraryBaseList = new ArrayList<>(); + if(!certificationInventoryEOList.isEmpty()){ + List projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); + LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); + wrapper2.in(ProjectLibraryBase::getId,projectIdList); + projectLibraryBaseList = projectLibraryBaseService.list(wrapper2); } - if(!result.isEmpty()){ - this.saveOrUpdateBatch(result); + + List lawsInventoryPlatformEOS = new ArrayList<>(); + + List projectCertificationInventoryEOList = new ArrayList<>(); + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { + //类别 + String category = projectCertificationInventoryEO.getCategory(); + //检验项目 + String inspectionItem = projectCertificationInventoryEO.getInspectionItem(); + //配置项 + String configItem = projectCertificationInventoryEO.getConfigItem(); + //编号 + String serialNumber = projectCertificationInventoryEO.getSerialNumber(); + //责任领域 + String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory(); + + List result = new ArrayList<>(); + //如果车型项目库中的配置项为空或为标配时,不去匹配直接关联 + if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ + if(!certificationInventoryEOS.isEmpty()){ + result = setData(certificationInventoryEOS, projectCertificationInventoryEO); + } + }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ + //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 + //如果一致,则用类别,检验项目,编号,责任领域去做匹配 + + List projectCertificationInventoryEOS = new ArrayList<>(); + for (int i = 0; i < certificationInventoryEOS.size(); i++) { + int finalI = i; + List libraryBaseList = projectLibraryBaseList.stream() + .filter(e -> certificationInventoryEOS.get(finalI).getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); + //平台件项目库中的认证清单的配置项为平台件项目名称 + String configItemTemp = ""; + if(!libraryBaseList.isEmpty()){ + //配置项 + configItemTemp = libraryBaseList.get(0).getProjectNameId(); + } + //类别 + String categoryTemp = certificationInventoryEOS.get(i).getCategory(); + //检验项目 + String inspectionItemTemp = certificationInventoryEOS.get(i).getInspectionItem(); + //编号 + String serialNumberTemp = certificationInventoryEOS.get(i).getSerialNumber(); + //责任领域 + String dutyTerritoryTemp = certificationInventoryEOS.get(i).getDutyTerritory(); + + if(configItem.equals(configItemTemp) + && category.equals(categoryTemp) + && inspectionItem.equals(inspectionItemTemp) + && serialNumber.equals(serialNumberTemp) + && dutyTerritory.equals(dutyTerritoryTemp)){ + + projectCertificationInventoryEOS.add(certificationInventoryEOS.get(i)); + } + } + if(!projectCertificationInventoryEOS.isEmpty()){ + result = setData(projectCertificationInventoryEOS, projectCertificationInventoryEO); + } + } + if(!result.isEmpty()){ + this.saveOrUpdateBatch(result); + } } } } From 1cee376084a46466da36727dc4148e83ceb5e8a0 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 15:25:54 +0800 Subject: [PATCH 090/185] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ProjectCertificationInventoryEOServiceImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index e38cb5c4d..502bad66f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -6968,21 +6968,21 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl params) { // String cut = (String) params.get("cut");// From a463e4c4a5178898f316a4237f6e824520c38cf7 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 16:36:27 +0800 Subject: [PATCH 091/185] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctCertificationInventoryEOServiceImpl.java | 280 ++++++++++++------ 1 file changed, 187 insertions(+), 93 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 502bad66f..4a843a973 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -6855,95 +6855,95 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl params) { - String ids = (String) params.get("ids");//认证清单id - String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id - - //认证清单数据 - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(","))); - List certificationInventoryEOList = this.list(wrapper); - - //平台件项目对应的认证清单数据 - LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(projectLibraryIds.split(","))); - List certificationInventoryEOS = this.list(wrapper1); - - if(!certificationInventoryEOS.isEmpty()){ - //平台件项目信息 - List projectLibraryBaseList = new ArrayList<>(); - if(!certificationInventoryEOList.isEmpty()){ - List projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); - LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); - wrapper2.in(ProjectLibraryBase::getId,projectIdList); - projectLibraryBaseList = projectLibraryBaseService.list(wrapper2); - } - - List lawsInventoryPlatformEOS = new ArrayList<>(); - - List projectCertificationInventoryEOList = new ArrayList<>(); - for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { - //类别 - String category = projectCertificationInventoryEO.getCategory(); - //检验项目 - String inspectionItem = projectCertificationInventoryEO.getInspectionItem(); - //配置项 - String configItem = projectCertificationInventoryEO.getConfigItem(); - //编号 - String serialNumber = projectCertificationInventoryEO.getSerialNumber(); - //责任领域 - String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory(); - - List result = new ArrayList<>(); - //如果车型项目库中的配置项为空或为标配时,不去匹配直接关联 - if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ - if(!certificationInventoryEOS.isEmpty()){ - result = setData(certificationInventoryEOS, projectCertificationInventoryEO); - } - }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ - //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 - //如果一致,则用类别,检验项目,编号,责任领域去做匹配 - - List projectCertificationInventoryEOS = new ArrayList<>(); - for (int i = 0; i < certificationInventoryEOS.size(); i++) { - int finalI = i; - List libraryBaseList = projectLibraryBaseList.stream() - .filter(e -> certificationInventoryEOS.get(finalI).getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); - //平台件项目库中的认证清单的配置项为平台件项目名称 - String configItemTemp = ""; - if(!libraryBaseList.isEmpty()){ - //配置项 - configItemTemp = libraryBaseList.get(0).getProjectNameId(); - } - //类别 - String categoryTemp = certificationInventoryEOS.get(i).getCategory(); - //检验项目 - String inspectionItemTemp = certificationInventoryEOS.get(i).getInspectionItem(); - //编号 - String serialNumberTemp = certificationInventoryEOS.get(i).getSerialNumber(); - //责任领域 - String dutyTerritoryTemp = certificationInventoryEOS.get(i).getDutyTerritory(); - - if(configItem.equals(configItemTemp) - && category.equals(categoryTemp) - && inspectionItem.equals(inspectionItemTemp) - && serialNumber.equals(serialNumberTemp) - && dutyTerritory.equals(dutyTerritoryTemp)){ - - projectCertificationInventoryEOS.add(certificationInventoryEOS.get(i)); - } - } - if(!projectCertificationInventoryEOS.isEmpty()){ - result = setData(projectCertificationInventoryEOS, projectCertificationInventoryEO); - } - } - if(!result.isEmpty()){ - this.saveOrUpdateBatch(result); - } - } - } - } +// @Override +// public void listPlatform(Map params) { +// String ids = (String) params.get("ids");//认证清单id +// String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id +// +// //认证清单数据 +// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); +// wrapper.in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(","))); +// List certificationInventoryEOList = this.list(wrapper); +// +// //平台件项目对应的认证清单数据 +// LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); +// wrapper1.in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(projectLibraryIds.split(","))); +// List certificationInventoryEOS = this.list(wrapper1); +// +// if(!certificationInventoryEOS.isEmpty()){ +// //平台件项目信息 +// List projectLibraryBaseList = new ArrayList<>(); +// if(!certificationInventoryEOList.isEmpty()){ +// List projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); +// LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); +// wrapper2.in(ProjectLibraryBase::getId,projectIdList); +// projectLibraryBaseList = projectLibraryBaseService.list(wrapper2); +// } +// +// List lawsInventoryPlatformEOS = new ArrayList<>(); +// +// List projectCertificationInventoryEOList = new ArrayList<>(); +// for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { +// //类别 +// String category = projectCertificationInventoryEO.getCategory(); +// //检验项目 +// String inspectionItem = projectCertificationInventoryEO.getInspectionItem(); +// //配置项 +// String configItem = projectCertificationInventoryEO.getConfigItem(); +// //编号 +// String serialNumber = projectCertificationInventoryEO.getSerialNumber(); +// //责任领域 +// String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory(); +// +// List result = new ArrayList<>(); +// //如果车型项目库中的配置项为空或为标配时,不去匹配直接关联 +// if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ +// if(!certificationInventoryEOS.isEmpty()){ +// result = setData(certificationInventoryEOS, projectCertificationInventoryEO); +// } +// }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ +// //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 +// //如果一致,则用类别,检验项目,编号,责任领域去做匹配 +// +// List projectCertificationInventoryEOS = new ArrayList<>(); +// for (int i = 0; i < certificationInventoryEOS.size(); i++) { +// int finalI = i; +// List libraryBaseList = projectLibraryBaseList.stream() +// .filter(e -> certificationInventoryEOS.get(finalI).getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); +// //平台件项目库中的认证清单的配置项为平台件项目名称 +// String configItemTemp = ""; +// if(!libraryBaseList.isEmpty()){ +// //配置项 +// configItemTemp = libraryBaseList.get(0).getProjectNameId(); +// } +// //类别 +// String categoryTemp = certificationInventoryEOS.get(i).getCategory(); +// //检验项目 +// String inspectionItemTemp = certificationInventoryEOS.get(i).getInspectionItem(); +// //编号 +// String serialNumberTemp = certificationInventoryEOS.get(i).getSerialNumber(); +// //责任领域 +// String dutyTerritoryTemp = certificationInventoryEOS.get(i).getDutyTerritory(); +// +// if(configItem.equals(configItemTemp) +// && category.equals(categoryTemp) +// && inspectionItem.equals(inspectionItemTemp) +// && serialNumber.equals(serialNumberTemp) +// && dutyTerritory.equals(dutyTerritoryTemp)){ +// +// projectCertificationInventoryEOS.add(certificationInventoryEOS.get(i)); +// } +// } +// if(!projectCertificationInventoryEOS.isEmpty()){ +// result = setData(projectCertificationInventoryEOS, projectCertificationInventoryEO); +// } +// } +// if(!result.isEmpty()){ +// this.saveOrUpdateBatch(result); +// } +// } +// } +// } private List setData(List certificationInventoryEOS, ProjectCertificationInventoryEO projectCertificationInventoryEO) { @@ -6984,6 +6984,100 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl params) { + String cut = (String) params.get("cut");// + String ids = (String) params.get("ids");//认证清单id + String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id + + //认证清单数据 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(ProjectCertificationInventoryEO::getId,Arrays.asList(ids.split(","))); + List certificationInventoryEOList = this.list(wrapper); + + //平台件项目对应的认证清单数据 + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(projectLibraryIds.split(","))); + List certificationInventoryEOS = this.list(wrapper1); + + //平台件项目信息 + List projectLibraryBaseList = new ArrayList<>(); + if(!certificationInventoryEOList.isEmpty()){ + List projectIdList = certificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); + LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); + wrapper2.in(ProjectLibraryBase::getId,projectIdList); + projectLibraryBaseList = projectLibraryBaseService.list(wrapper2); + } + + List lawsInventoryPlatformEOS = new ArrayList<>(); + + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { + //类别 + String category = projectCertificationInventoryEO.getCategory(); + //检验项目 + String inspectionItem = projectCertificationInventoryEO.getInspectionItem(); + //配置项 + String configItem = projectCertificationInventoryEO.getConfigItem(); + //编号 + String serialNumber = projectCertificationInventoryEO.getSerialNumber(); + //责任领域 + String dutyTerritory = projectCertificationInventoryEO.getDutyTerritory(); + + for (ProjectCertificationInventoryEO certificationInventoryEO : certificationInventoryEOS) { + List libraryBaseList = projectLibraryBaseList.stream() + .filter(e -> certificationInventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); + //平台件项目库中的认证清单的配置项为平台件项目名称 + String configItemTemp = ""; + if(!libraryBaseList.isEmpty()){ + //配置项 + configItemTemp = libraryBaseList.get(0).getProjectNameId(); + } + //类别 + String categoryTemp = certificationInventoryEO.getCategory(); + //检验项目 + String inspectionItemTemp = certificationInventoryEO.getInspectionItem(); + //编号 + String serialNumberTemp = certificationInventoryEO.getSerialNumber(); + //责任领域 + String dutyTerritoryTemp = certificationInventoryEO.getDutyTerritory(); + + if(StringUtils.isBlank(configItem) || "标配".equals(configItem)){ + //如果车型项目库中的配置项为空或为标配时,直接将平台件信息添加到关联表 + setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO); + }else if(StringUtils.isNotBlank(configItem) && !"标配".equals(configItem)){ + //如果车型项目库中的配置项不为空且不为标配时,如果车型项目库认证清单的配置项与平台件认证清单的配置项不一致,则不再匹配 + //如果一致,则用类别,检验项目,编号,责任领域去做匹配 + if(configItem.equals(configItemTemp) + && category.equals(categoryTemp) + && inspectionItem.equals(inspectionItemTemp) + && serialNumber.equals(serialNumberTemp) + && dutyTerritory.equals(dutyTerritoryTemp)){ + setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEO, certificationInventoryEO); + } + } + } + } + if(!lawsInventoryPlatformEOS.isEmpty()){ + lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS); + } + } + + private void setDataTemp(List lawsInventoryPlatformEOS, + ProjectCertificationInventoryEO projectCertificationInventoryEO, + ProjectCertificationInventoryEO certificationInventoryEO) { + LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO(); + inventoryPlatformEO.setCreateTime(new Date()); + inventoryPlatformEO.setUpdateTime(new Date()); + inventoryPlatformEO.setLawsInventoryId(projectCertificationInventoryEO.getId()); + inventoryPlatformEO.setPlatformLawsInventoryId(certificationInventoryEO.getId()); + lawsInventoryPlatformEOS.add(inventoryPlatformEO); + } +// @Override // public void listPlatform(Map params) { // String cut = (String) params.get("cut");// // String ids = (String) params.get("ids");//认证清单id @@ -7011,8 +7105,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl lawsInventoryPlatformEOS = new ArrayList<>(); // // for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { -// Map map = new HashMap<>(); -// List projectLawsInventoryEOS = new ArrayList<>(); // //类别 // String category = projectCertificationInventoryEO.getCategory(); // //检验项目 @@ -7044,7 +7136,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl Date: Thu, 21 Sep 2023 17:02:45 +0800 Subject: [PATCH 092/185] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BA=93=20=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../certificationList/components/addModel.vue | 181 +++++++++--------- .../components/batSetting.vue | 104 +++++----- .../components/certificationList/index.vue | 12 +- 3 files changed, 148 insertions(+), 149 deletions(-) diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue index aeb1aa03b..bb67b377b 100644 --- a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/addModel.vue @@ -113,27 +113,48 @@
- * - {{$t('configurationItem')}} + * + {{$t('closingDate')}}
- - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + +
@@ -273,27 +294,7 @@
- -
-
- * - {{$t('closingDate')}} -
- - - -
-
+ @@ -358,24 +359,63 @@
- * - {{$t('configurationItem')}} + * + {{$t('personLiable')}}
- - - - - - - +
+ +
+
+ {{$t('taskConfirmEndTime')}} +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + +
@@ -528,28 +568,6 @@
- -
-
- * - {{$t('personLiable')}} -
- - - -
-
@@ -593,25 +611,6 @@
- - -
-
- {{$t('taskConfirmEndTime')}} -
- - - -
-
-
diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/batSetting.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/batSetting.vue index e50c44aad..f768e4616 100644 --- a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/batSetting.vue +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/components/batSetting.vue @@ -9,58 +9,6 @@ @cancel="handleCancel" > - - -
-
- {{$t('configurationItem')}} -
- - - - - - - - - -
-
- -
-
- {{$t('engineeringInterfacePerson')}} -
- - - - - - - - - - - - - - - - - - -
-
- -
@@ -179,6 +127,58 @@
+ + + + + + + + + + + + + + + + + + + + + +
+
+ {{$t('engineeringInterfacePerson')}} +
+ + + + + + + + + + + + + + + + + + +
+
+ +
diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue index 78e18618d..b66b269b0 100644 --- a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/certificationList/index.vue @@ -167,12 +167,12 @@ {{ $t('add') }}
-
- - {{ $t('addConfiguration') }} -
+ + + + + +
Date: Thu, 21 Sep 2023 17:29:02 +0800 Subject: [PATCH 093/185] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=88=86=E9=A1=B5-=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=BB=B6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctCertificationInventoryEOServiceImpl.java | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 4a843a973..1cc9b7208 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -1924,11 +1924,49 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl pageList = this.page(page, queryWrapper); + //平台件数据处理 + platformDispose(projectCertificationInventoryEO, pageList.getRecords()); + + + this.disposeData(pageList.getRecords(),cut); List records = this.hearSort(projectCertificationInventoryEO, pageList.getRecords()); pageList.setRecords(records); return pageList; } + private void platformDispose(ProjectCertificationInventoryEO projectCertificationInventoryEO, List result) { + List lawsInventoryPlatformEOList = new ArrayList<>(); + List projectCertificationInventoryEOS = new ArrayList<>(); + + if(!result.isEmpty()){ + //认证清单ID + List certificationInventoryIdList = result.stream().map(ProjectCertificationInventoryEO::getId).collect(Collectors.toList()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,certificationInventoryIdList); + lawsInventoryPlatformEOList = lawsInventoryPlatformEOService.list(wrapper); + if(!lawsInventoryPlatformEOList.isEmpty()){ + List collect = lawsInventoryPlatformEOList.stream().map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).distinct().collect(Collectors.toList()); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(ProjectCertificationInventoryEO::getId,collect); + projectCertificationInventoryEOS = this.list(lambdaQueryWrapper);//平台件清单 + } + } + for (ProjectCertificationInventoryEO certificationInventoryEO : result) { + if(!projectCertificationInventoryEOS.isEmpty()){ + List inventoryPlatformEOList = lawsInventoryPlatformEOList.stream() + .filter(e -> certificationInventoryEO.getId().equals(e.getLawsInventoryId())).collect(Collectors.toList()); + if(!inventoryPlatformEOList.isEmpty()){ + List idList = inventoryPlatformEOList.stream() + .map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).collect(Collectors.toList()); + List certificationInventoryEOS = projectCertificationInventoryEOS.stream() + .filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); + if(!certificationInventoryEOS.isEmpty()){ + setProjectCertificationInventoryEO(certificationInventoryEOS.get(0),certificationInventoryEO); + } + } + } + } + } /** * 表头排序 @@ -6966,7 +7004,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl Date: Thu, 21 Sep 2023 18:22:38 +0800 Subject: [PATCH 094/185] =?UTF-8?q?=E7=83=AD=E8=AE=A4=E8=AF=81=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E5=85=B3=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctCertificationInventoryEOServiceImpl.java | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 1cc9b7208..27ab0fb30 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -7055,6 +7055,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl lawsInventoryPlatformEOS = new ArrayList<>(); + List result = new ArrayList<>(); + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { //类别 String category = projectCertificationInventoryEO.getCategory(); @@ -7067,6 +7069,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl lawsInventoryPlatformEOList = new ArrayList<>(); + List projectCertificationInventoryEOList = new ArrayList<>(); + for (ProjectCertificationInventoryEO certificationInventoryEO : certificationInventoryEOS) { List libraryBaseList = projectLibraryBaseList.stream() .filter(e -> certificationInventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); @@ -7087,7 +7092,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl 1){ + //往认证清单表中添加projectCertificationInventoryEOList.size()-1条数据 + List list = new ArrayList<>(); + for (int i = 1; i < projectCertificationInventoryEOList.size(); i++) { + ProjectCertificationInventoryEO projectCertificationInventoryEOTemp = new ProjectCertificationInventoryEO(); + BeanUtils.copyProperties(projectCertificationInventoryEO,projectCertificationInventoryEOTemp); + projectCertificationInventoryEOTemp.setId(UUID.randomUUID().toString().replace("-", "")); + list.add(projectCertificationInventoryEOTemp); + + setDataTemp(lawsInventoryPlatformEOS, projectCertificationInventoryEOTemp, projectCertificationInventoryEOList.get(i)); + } + if(!list.isEmpty()){ + result.addAll(list); + } + } + } + } + if(!result.isEmpty()){ + this.saveBatch(result); } if(!lawsInventoryPlatformEOS.isEmpty()){ lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS); From 0852e87c23c244069866ed94fc87479548462f02 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 18:43:02 +0800 Subject: [PATCH 095/185] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/service/impl/ProjectLibraryBaseServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 4709f34b9..2f55167ee 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -1309,7 +1309,10 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl list = new LinkedList<>(); From d4c4f2305ad9178ebb205982583b2ca47305a855 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 19:25:27 +0800 Subject: [PATCH 096/185] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=85=B3=E8=81=94=E4=BA=86=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=BB=B6=E6=95=B0=E6=8D=AE=EF=BC=8C=E6=B5=81=E7=A8=8B=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=8C=89=E5=B9=B3=E5=8F=B0=E4=BB=B6=E4=B8=AD=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=9A=84=E9=A1=BA=E5=BA=8F=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/project/enums/FlowStateEnum.java | 66 +++++++++++++++++++ .../ProjectLawsInventoryEOServiceImpl.java | 31 +++++++-- 2 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/FlowStateEnum.java diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/FlowStateEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/FlowStateEnum.java new file mode 100644 index 000000000..2425ed44d --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/FlowStateEnum.java @@ -0,0 +1,66 @@ +package com.jero.modules.project.enums; + +import java.util.LinkedList; +import java.util.List; + +/** + * 消息类型枚举类 + */ +public enum FlowStateEnum { + INCONFORMITY("不符合","Non-Compliance","Non-Compliance"), + TO_TRACK("待追踪","To be tracked","To be tracked"), + CONFORMITY("符合","Compliance","Compliance"), + UNINVOLVED("不涉及","NA","NA"), + LIST_TO_BE_RELEASED("清单待发布","List to be released","List to be released"), + LIST_TO_BE_CHECKED("任务待发起","Task to be initiated","List to be checked"), + REGULATORY_ENGINEER_RETURNS("法规工程师退回","Regulatory engineer returns","Regulatory engineer returns"), + REFUSAL_OF_RESPONSIBLE_PERSON("责任人拒绝","Refusal of responsible person","Refusal of responsible person"), + TASK_TO_BE_CONFIRMED("任务待确认","Task to be confirmed","Task to be confirmed"), + RESULTS_TO_BE_SUBMITTED("结果待提交","Results to be submitted","Results to be submitted"), + RESULTS_TO_BE_REVIEWED("结果待审查","Results to be reviewed","Results to be reviewed"), + + ; + + String nameCn; + String nameEn; + String value; + + private FlowStateEnum(String nameCn, String nameEn, String value) { + this.nameCn = nameCn; + this.nameEn = nameEn; + this.value = value; + } + + public String getNameCn() { + return nameCn; + } + + public void setNameCn(String nameCn) { + this.nameCn = nameCn; + } + + public String getNameEn() { + return nameEn; + } + + public void setNameEn(String nameEn) { + this.nameEn = nameEn; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static List getValueInfo() { + List result = new LinkedList<>(); + FlowStateEnum[] values = values(); + for (FlowStateEnum flowStateEnum : values) { + result.add(flowStateEnum.getValue()); + } + return result; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index ca601940e..e07916a03 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -11735,6 +11735,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl result) { + List valueList = FlowStateEnum.getValueInfo(); List lawsInventoryPlatformEOList = new ArrayList<>(); List projectLawsInventoryEOS = new ArrayList<>(); @@ -11756,8 +11757,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl collect1 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDutyId).distinct().collect(Collectors.toList()); List collect2 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDutyId).distinct().collect(Collectors.toList()); - List collect3 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDeliverableTemplate).distinct().collect(Collectors.toList()); - List collect4 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDeliverableTemplate).distinct().collect(Collectors.toList()); + List collect3 = projectLawsInventoryEOS.stream().filter(e->StringUtils.isNotBlank(e.getDesignDeliverableTemplate())).map(ProjectLawsInventoryEO::getDesignDeliverableTemplate).distinct().collect(Collectors.toList()); + List collect4 = projectLawsInventoryEOS.stream().filter(e->StringUtils.isNotBlank(e.getVerifyDeliverableTemplate())).map(ProjectLawsInventoryEO::getVerifyDeliverableTemplate).distinct().collect(Collectors.toList()); if(!collect1.isEmpty()){ userIdList.addAll(collect1); } @@ -11798,6 +11799,24 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl lawsInventoryEOS = projectLawsInventoryEOS.stream() .filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(lawsInventoryEOS)){ + for (String value : valueList) { + List collect = lawsInventoryEOS.stream() + .filter(e -> value.equals(e.getDesignFlowStatus())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect)){ + lawsInventoryEO.setDesignFlowStatus(value); + break; + } + } + for (String value : valueList) { + List collect = lawsInventoryEOS.stream() + .filter(e -> value.equals(e.getVerifyFlowStatus())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect)){ + lawsInventoryEO.setVerifyFlowStatus(value); + break; + } + } + } lawsInventoryEO.setProjectLawsInventoryEOS(lawsInventoryEOS); if(!lawsInventoryEOS.isEmpty()){ projectLawsInventoryEOList.addAll(lawsInventoryEOS); @@ -11892,7 +11911,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl libraryBaseList = projectLibraryBaseService.list(wrapper); for (ProjectLawsInventoryEO lawsInventoryEO : result) { List lawsInventoryEOS = lawsInventoryEO.getProjectLawsInventoryEOS(); - if(!lawsInventoryEOS.isEmpty()){ + if(ObjectUtils.isNotEmpty(lawsInventoryEOS)){ for (ProjectLawsInventoryEO inventoryEO : lawsInventoryEOS) { List collect = libraryBaseList.stream().filter(e -> inventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList()); if(!collect.isEmpty()){ @@ -11904,11 +11923,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl nventoryEOList = lawsInventoryEO.getProjectLawsInventoryEOS(); - if(!nventoryEOList.isEmpty()){ + if(ObjectUtils.isNotEmpty(nventoryEOList)){ Collator comparator = Collator.getInstance(Locale.CHINESE); Collections.sort(nventoryEOList,(e1,e2)->{ - String e1ProjectName = StringUtils.isNotBlank(e1.getProjectName()) ? e1.getAttestationType() : ""; - String e2ProjectName = StringUtils.isNotBlank(e2.getProjectName()) ? e2.getAttestationType() : ""; + String e1ProjectName = StringUtils.isNotBlank(e1.getProjectName()) ? e1.getProjectName() : ""; + String e2ProjectName = StringUtils.isNotBlank(e2.getProjectName()) ? e2.getProjectName() : ""; return comparator.compare(e1ProjectName,e2ProjectName); }); lawsInventoryEO.setProjectLawsInventoryEOS(nventoryEOList); From f5eb3befc6114feca0917c5cbb3123b4f65e9677 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 20:37:48 +0800 Subject: [PATCH 097/185] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9F=A5=E7=9C=8B=E6=B5=81=E7=A8=8B=E8=AF=A6?= =?UTF-8?q?=E6=83=85=EF=BC=88=E5=B9=B3=E5=8F=B0=E4=BB=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...PhoneProjectLawsInventoryEOController.java | 13 ++ .../IProjectLawsInventoryEOService.java | 3 +- .../ProjectLawsInventoryEOServiceImpl.java | 128 ++++++++++++++++++ 3 files changed, 143 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java index 9ec966ed0..2f178b654 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java @@ -561,4 +561,17 @@ public class PhoneProjectLawsInventoryEOController extends JeroController finalizationVerify(@RequestParam Map params){ return this.projectLawsInventoryEOService.finalizationVerify(params); } + + /** + * 点击流程状态查看流程详情(平台件) + * + * @return + */ + @AutoLog(value = "点击流程状态查看流程详情(平台件)") + @ApiOperation(value="点击流程状态查看流程详情(平台件)", notes="点击流程状态查看流程详情(平台件)") + @GetMapping(value = "/queryPlatformList") + public Result> queryPlatformList(String lawsInventoryId,String flowFlag,String cut) { + List list = projectLawsInventoryEOService.queryPlatformList(lawsInventoryId,flowFlag,cut); + return Result.OK(list); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java index d6280ef2a..2f2687e23 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java @@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.itextpdf.text.DocumentException; import com.jero.common.api.vo.Result; import com.jero.common.constant.enums.MessageTypeEnum; -import com.jero.common.system.vo.DictModel; import com.jero.common.system.vo.LoginUser; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.project.entity.ProjectLawsInventoryEO; @@ -323,4 +322,6 @@ public interface IProjectLawsInventoryEOService extends IService queryPlatformList(String lawsInventoryId,String flowFlag,String cut); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index e07916a03..70d4fdedd 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -12176,4 +12176,132 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl queryPlatformList(String lawsInventoryId,String flowFlag,String cut){ + if(StringUtils.isBlank(lawsInventoryId) || StringUtils.isBlank(flowFlag)){ + return new ArrayList<>(); + } + List sysDictItems = this.sysDictItemServiceImpl.selectItemsAll(); + List categoryList = sysCategoryService.list(); + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(LawsInventoryPlatformEO::getLawsInventoryId,lawsInventoryId); + List lawsInventoryPlatformEOS = lawsInventoryPlatformEOService.list(wrapper); + List idList = new ArrayList<>(); + List projectLawsInventoryEOList = new ArrayList<>(); + if(ObjectUtils.isNotEmpty(lawsInventoryPlatformEOS)){ + idList = lawsInventoryPlatformEOS.stream().map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).collect(Collectors.toList()); + projectLawsInventoryEOList = this.listByIds(idList); + List userIdList = new ArrayList<>(); + List collect1 = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getDesignDutyId).distinct().collect(Collectors.toList()); + List collect2 = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getVerifyDutyId).distinct().collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect1)){ + userIdList.addAll(collect1); + } + if(ObjectUtils.isNotEmpty(collect2)){ + userIdList.addAll(collect2); + } + + List fileIdList = new ArrayList<>(); + List collect3 = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getDesignDeliverableTemplate).distinct().collect(Collectors.toList()); + List collect4 = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getVerifyDeliverableTemplate).distinct().collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect3)){ + fileIdList.addAll(collect3); + } + if(ObjectUtils.isNotEmpty(collect4)){ + fileIdList.addAll(collect4); + } + + List sysUsers = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(userIdList)) { + userIdList = userIdList.stream().distinct().collect(Collectors.toList()); + QueryWrapper sysUserQueryWrapper = new QueryWrapper<>(); + sysUserQueryWrapper.lambda().in(SysUser::getId, userIdList); + sysUsers = sysUserMapper.selectList(sysUserQueryWrapper); + } + + List fileInfos = new ArrayList<>(); + if (fileIdList.size() != 0) { + fileInfos = iOSSFileService.getFileInfos(StringUtils.join(fileIdList, ",")); + } + + for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOList) { + //流程状态 + String flowStatus = ""; + if("design".equals(flowFlag)){ + flowStatus = projectLawsInventoryEO.getDesignFlowStatus(); + }else{ + flowStatus = projectLawsInventoryEO.getVerifyFlowStatus(); + } + if (StringUtils.isNotEmpty(flowStatus)) { + String designFlowStatusName = ComplianceFlowStatusEnum.getTextByValue(flowStatus, cut); + projectLawsInventoryEO.setDesignFlowStatusName(designFlowStatusName); + } + + //发起人. +// if("design".equals(flowFlag)){ +// projectLawsInventoryEO.get +// }else{ +// +// } + //责任人 + String dutyId = ""; + if("design".equals(flowFlag)){ + dutyId = projectLawsInventoryEO.getDesignDutyId(); + }else{ + dutyId = projectLawsInventoryEO.getVerifyDutyId(); + } + if (StringUtils.isNotEmpty(dutyId)) { + String finalDutyId = dutyId; + String designDutyName = sysUsers.stream().filter(e -> finalDutyId.equals(e.getId())). + map(SysUser::getUsername).collect(Collectors.joining(",")); + projectLawsInventoryEO.setDesignDutyIdName(designDutyName); + } else { + projectLawsInventoryEO.setDesignDutyIdName(""); + } + + //交付物模板 + String deliverableTemplate = ""; + if("design".equals(flowFlag)){ + deliverableTemplate = projectLawsInventoryEO.getDesignDeliverableTemplate(); + }else{ + deliverableTemplate = projectLawsInventoryEO.getVerifyDeliverableTemplate(); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { + String fileName = this.editService.getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getDesignDeliverableTemplate()); + if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { + projectLawsInventoryEO.setDesignDeliverableTemplateName(fileName); + } + } + //交付物类型 + String deliverableType = ""; + if("design".equals(flowFlag)){ + deliverableType = projectLawsInventoryEO.getDesignDeliverableType(); + }else{ + deliverableType = projectLawsInventoryEO.getVerifyDeliverableType(); + } + if (StringUtils.isNotBlank(deliverableType)) { + List designDeliverableTypeList = Arrays.asList(deliverableType.split(",")); + String name = getTreeName(cut, categoryList, designDeliverableTypeList); + projectLawsInventoryEO.setDesignDeliverableTypeName(name); + } + + //责任领域 + String dutyTerritory = projectLawsInventoryEO.getDutyTerritory(); + if (StringUtils.isNotEmpty(dutyTerritory)) { + String dutyTerritory_dictText = disposeShowDictItemValue(sysDictItems, dutyTerritory, cut, ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue()); + projectLawsInventoryEO.setDutyTerritory_dictText(dutyTerritory_dictText); + } + //交付物说明 + String remark = ""; + if("design".equals(flowFlag)){ + remark = projectLawsInventoryEO.getDesignRemark(); + }else{ + remark = projectLawsInventoryEO.getVerifyRemark(); + } + } + } + return projectLawsInventoryEOList; + } + + } From df2101cdfd5d7b89a650e0ac9490fe7cace93f97 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 21 Sep 2023 20:44:37 +0800 Subject: [PATCH 098/185] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9F=A5=E7=9C=8B=E6=B5=81=E7=A8=8B=E8=AF=A6?= =?UTF-8?q?=E6=83=85=EF=BC=88=E5=B9=B3=E5=8F=B0=E4=BB=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...PhoneProjectLawsInventoryEOController.java | 13 +----- .../ProjectLawsInventoryEOController.java | 12 +++++ .../modules/project/enums/FlowFlagEnum.java | 45 +++++++++++++++++++ .../ProjectLawsInventoryEOServiceImpl.java | 4 +- 4 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/FlowFlagEnum.java diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java index 2f178b654..3506c9e7a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java @@ -562,16 +562,5 @@ public class PhoneProjectLawsInventoryEOController extends JeroController> queryPlatformList(String lawsInventoryId,String flowFlag,String cut) { - List list = projectLawsInventoryEOService.queryPlatformList(lawsInventoryId,flowFlag,cut); - return Result.OK(list); - } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java index 66ab3f348..e96cef2cc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java @@ -575,4 +575,16 @@ public class ProjectLawsInventoryEOController extends JeroController finalizationVerify(@RequestParam Map params){ return this.projectLawsInventoryEOService.finalizationVerify(params); } + /** + * 点击流程状态查看流程详情(平台件) + * + * @return + */ + @AutoLog(value = "点击流程状态查看流程详情(平台件)") + @ApiOperation(value="点击流程状态查看流程详情(平台件)", notes="点击流程状态查看流程详情(平台件)") + @GetMapping(value = "/queryPlatformList") + public Result> queryPlatformList(String lawsInventoryId,String flowFlag,String cut) { + List list = projectLawsInventoryEOService.queryPlatformList(lawsInventoryId,flowFlag,cut); + return Result.OK(list); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/FlowFlagEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/FlowFlagEnum.java new file mode 100644 index 000000000..06ffd9ad3 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/FlowFlagEnum.java @@ -0,0 +1,45 @@ +package com.jero.modules.project.enums; + +/** + * 任务状态枚举类 + */ +public enum FlowFlagEnum { + DESIGN("设计符合性流程状态","design"), + VERIFY("验证符合性流程状态","verify"), + ; + + + String name; + String value; + + private FlowFlagEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static String getTextByValue(String value) { + FlowFlagEnum[] values = values(); + for (FlowFlagEnum taskStatusEnum : values) { + if (taskStatusEnum.value.equals(value)) { + return taskStatusEnum.name; + } + } + return null; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index 70d4fdedd..ec500c9ff 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -12227,9 +12227,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl Date: Fri, 22 Sep 2023 09:36:05 +0800 Subject: [PATCH 099/185] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BA=93=20=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=85=B3=E8=81=94=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectManagement/components/listEditModel.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/listEditModel.vue b/jero-web/src/views/projectManagement/components/listEditModel.vue index 60de12437..1e6ea973c 100644 --- a/jero-web/src/views/projectManagement/components/listEditModel.vue +++ b/jero-web/src/views/projectManagement/components/listEditModel.vue @@ -1088,11 +1088,13 @@ this.$refs.ruleForm.validate(valid => { if (valid) { let formInline = JSON.parse(JSON.stringify(this.formInline)) - Object.keys(formInline).forEach(res => { - if (formInline[res] && formInline[res] instanceof Array) { - formInline[res] = formInline[res].join(',') - } - }) + if(!formInline.projectLawsInventoryEOS){ + Object.keys(formInline).forEach(res => { + if (formInline[res] && formInline[res] instanceof Array) { + formInline[res] = formInline[res].join(',') + } + }) + } if (!formInline.verifyDutyId) { formInline.verifyDutyId = '' } From 5d30fcc0e00ecc16917434c91b47c4d26ec4652c Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 22 Sep 2023 10:19:55 +0800 Subject: [PATCH 100/185] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95-?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 5 +++- .../components/listEditModel.vue | 27 ++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index ec500c9ff..7ac8b589b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -515,7 +515,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(LawsInventoryPlatformEO::getLawsInventoryId,projectLawsInventoryEO.getId()); + wrapper.in(LawsInventoryPlatformEO::getPlatformLawsInventoryId,Arrays.asList(projectLawsInventoryEO.getPlatformIds().split(","))); + lawsInventoryPlatformEOService.remove(wrapper); } } diff --git a/jero-web/src/views/projectManagement/components/listEditModel.vue b/jero-web/src/views/projectManagement/components/listEditModel.vue index 1e6ea973c..f3d71970a 100644 --- a/jero-web/src/views/projectManagement/components/listEditModel.vue +++ b/jero-web/src/views/projectManagement/components/listEditModel.vue @@ -1088,12 +1088,27 @@ this.$refs.ruleForm.validate(valid => { if (valid) { let formInline = JSON.parse(JSON.stringify(this.formInline)) - if(!formInline.projectLawsInventoryEOS){ - Object.keys(formInline).forEach(res => { - if (formInline[res] && formInline[res] instanceof Array) { - formInline[res] = formInline[res].join(',') - } - }) + // Object.keys(formInline).forEach(res => { + // if(!formInline.projectLawsInventoryEOS){ + // if (formInline[res] && formInline[res] instanceof Array) { + // formInline[res] = formInline[res].join(',') + // } + // } + // }) + if(formInline.designDeliverableType){ + formInline.designDeliverableType = formInline.designDeliverableType.join(',') + } + if(formInline.dutyDepart){ + formInline.dutyDepart = formInline.dutyDepart.join(',') + } + if(formInline.dutyTerritory){ + formInline.dutyTerritory = formInline.dutyTerritory.join(',') + } + if(formInline.verifyDeliverableType){ + formInline.verifyDeliverableType = formInline.verifyDeliverableType.join(',') + } + if(formInline.prehomoDeliverableType){ + formInline.prehomoDeliverableType = formInline.prehomoDeliverableType.join(',') } if (!formInline.verifyDutyId) { formInline.verifyDutyId = '' From 4ab41cab98e09c40358dc8c0c5161d6aa844e66a Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 22 Sep 2023 16:01:44 +0800 Subject: [PATCH 101/185] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=B5=81=E7=A8=8B=E7=8A=B6=E6=80=81=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/project/entity/ProjectLawsInventoryEO.java | 2 +- .../impl/ProjectLawsInventoryEOServiceImpl.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java index e551c2282..1092df44a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java @@ -545,5 +545,5 @@ public class ProjectLawsInventoryEO implements Serializable { private List projectLawsInventoryEOS; @TableField(exist = false) - private String platformIds;//项目名称 + private String platformIds;//平台件数据id } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index 7ac8b589b..b70756479 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -12191,9 +12191,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl lawsInventoryPlatformEOS = lawsInventoryPlatformEOService.list(wrapper); List idList = new ArrayList<>(); List projectLawsInventoryEOList = new ArrayList<>(); + List projectLibraryBaseList = new ArrayList<>(); if(ObjectUtils.isNotEmpty(lawsInventoryPlatformEOS)){ idList = lawsInventoryPlatformEOS.stream().map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).collect(Collectors.toList()); projectLawsInventoryEOList = this.listByIds(idList); + if(ObjectUtils.isNotEmpty(projectLawsInventoryEOList)){ + List projectIdList = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).collect(Collectors.toList()); + projectLibraryBaseList = projectLibraryBaseService.listByIds(projectIdList); + } List userIdList = new ArrayList<>(); List collect1 = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getDesignDutyId).distinct().collect(Collectors.toList()); List collect2 = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getVerifyDutyId).distinct().collect(Collectors.toList()); @@ -12228,6 +12233,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl libraryBaseList = projectLibraryBaseList.stream() + .filter(e -> e.getId().equals(projectLawsInventoryEO.getProjectLibraryId())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(libraryBaseList)){ + projectLawsInventoryEO.setProjectName(libraryBaseList.get(0).getProjectNameId()); + } //流程状态 String flowStatus = ""; if(FlowFlagEnum.DESIGN.getValue().equals(flowFlag)){//流程标识,点击设计符合性流程状态跳转 From fad1e2f8ec4b0bfe571d0dd60157af95590cf6c7 Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Fri, 22 Sep 2023 16:21:37 +0800 Subject: [PATCH 102/185] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BA=93=20=E6=B3=95?= =?UTF-8?q?=E8=A7=84=E6=B8=85=E5=8D=95=E7=BC=96=E8=BE=91=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/associatedplat.vue | 2 +- .../components/flowstatusdetial.vue | 118 +++++++----------- .../components/listOfRegulations.vue | 24 ++-- 3 files changed, 63 insertions(+), 81 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/associatedplat.vue b/jero-web/src/views/projectManagement/components/associatedplat.vue index ac007c0e1..e6c0466d5 100644 --- a/jero-web/src/views/projectManagement/components/associatedplat.vue +++ b/jero-web/src/views/projectManagement/components/associatedplat.vue @@ -18,7 +18,7 @@ {{$t('entryName')}}
+ v-model="queryParam.projectNameId">
diff --git a/jero-web/src/views/projectManagement/components/flowstatusdetial.vue b/jero-web/src/views/projectManagement/components/flowstatusdetial.vue index 714d9c6c5..a708b55dc 100644 --- a/jero-web/src/views/projectManagement/components/flowstatusdetial.vue +++ b/jero-web/src/views/projectManagement/components/flowstatusdetial.vue @@ -16,16 +16,16 @@
{{$t('regulationNo')}} - - {{form.vdr}} + + {{form.serialNumber}}
{{$t('title')}} - - {{form.summary}} + + {{form.title}}
@@ -34,8 +34,8 @@
{{$t('subtitle')}} - - {{form.homologationImpact}} + + {{form.subtitle}}
@@ -49,14 +49,14 @@
-
{{item.title}}
+
{{item.projectName}}
{{$t('ProcessStatus')}} - - {{item.ProcessStatus}} + + {{flag == 'design'?item.designFlowStatusName : item.verifyFlowStatusName}}
@@ -66,15 +66,15 @@
{{$t('Sponsor')}} - - {{item.Sponsor}} + + {{item.createBy}}
{{$t('personLiable')}} - - {{item.personLiable}} + + {{flag == 'design'?item.designDutyIdName : item.verifyDutyIdName}}
@@ -82,15 +82,15 @@
{{$t('statisticalNodes')}} - - {{item.statisticalNodes}} + + {{item.dutyDepart}}
{{$t('areaOfResponsibility')}} - - {{item.areaOfResponsibility}} + + {{item.dutyTerritory_dictText}}
@@ -98,15 +98,15 @@
{{$t('deliverableTemplate')}} - - {{item.deliverableTemplate}} + + {{flag == 'design'?item.designDeliverableTemplateName : item.verifyDeliverableTemplateName }}
{{$t('typeOfDeliverables')}} - - {{item.typeOfDeliverables}} + + {{flag == 'design'?item.designDeliverableTypeName : item.verifyDeliverableTypeName}}
@@ -114,8 +114,8 @@
{{$t('descriptionDeliverables')}} - - {{item.descriptionDeliverables}} + + {{flag == 'design'?item.designRemark : item.verifyRemark}}
@@ -134,7 +134,7 @@ diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index 3676fec0d..7c837d07c 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -273,12 +273,6 @@ {{ $t('Associatedplatform') }}
-
- - {{ $t('Associatedplatform1') }} -
@@ -1832,7 +1826,11 @@ primaryKeyId: row.primaryKeyId } } - this.$refs.designComplianceRef.getList(JSON.parse(JSON.stringify(query)), name) + if(row.projectLawsInventoryEOS && row.projectLawsInventoryEOS.length > 1){ + this.$refs.flowstatusdetialRef.addModel(row, name) + }else{ + this.$refs.designComplianceRef.getList(JSON.parse(JSON.stringify(query)), name) + } }, @@ -1963,6 +1961,7 @@ if(this.selectedRowKeys && this.selectedRowKeys.length > 0){ this.detailedWarningList = [] let dataSource = [] + let status = '' for (let i = 0; i < this.dataSource.length; i++) { for (let j = 0; j < this.selectedRowKeys.length; j++) { if (this.dataSource[i].id == this.selectedRowKeys[j]) { @@ -1974,12 +1973,17 @@ if (dataSource[i].verifyFlowStatus == 'List to be released' && dataSource[i].designFlowStatus == 'List to be released') { flag = '1' - this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) + status = '1' } else { - this.$message.warning(this.$t('unpublishedregulationsselected')) - return + status = '2' } } + console.log(status) + if(status == '1'){ + this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) + }else{ + this.$message.warning(this.$t('unpublishedregulationsselected')) + } }else{ flag = '2' this.selectedRowKeys = this.dataSource.map(val => val.id) From 79bc3c85441e0bce8c81699dd9b3c42ff565d5c9 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 22 Sep 2023 17:20:55 +0800 Subject: [PATCH 103/185] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E6=9C=AA=E5=8C=B9=E9=85=8D=E5=88=B0=E5=B9=B3=E5=8F=B0=E4=BB=B6?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLibraryBaseController.java | 4 +-- .../service/IProjectLibraryBaseService.java | 2 +- .../impl/ProjectLibraryBaseServiceImpl.java | 36 +++++++++++++++++-- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java index ba98706f0..bea4e4c85 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java @@ -71,8 +71,8 @@ public class ProjectLibraryBaseController extends JeroController listPlatform(@RequestBody Map params) { - List> mapList = projectLibraryBaseService.listPlatform(params); - return Result.OK(params.get("cut").toString(),mapList); + Map map = projectLibraryBaseService.listPlatform(params); + return Result.OK(params.get("cut").toString(),map); } /** * 不勾选法规清单进行关联平台件 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java index 4f9f6f60e..d6d57dbae 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java @@ -91,7 +91,7 @@ public interface IProjectLibraryBaseService extends IService * @param params * @return */ - List> listPlatform(Map params); + Map listPlatform(Map params); /** * 不勾选法规清单进行关联平台件 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 2f55167ee..6654e445d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -1274,7 +1274,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl> listPlatform(Map params) { + public Map listPlatform(Map params) { String cut = (String) params.get("cut");// String ids = (String) params.get("ids");//法规清单id String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id @@ -1303,6 +1303,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl categoryList = sysCategoryService.list(); List> mapList = new ArrayList<>(); List> mapListOne = new ArrayList<>(); + List emptyList = new ArrayList<>(); for (ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryEOList) { Map map = new HashMap<>(); List projectLawsInventoryEOS = new ArrayList<>(); @@ -1360,6 +1361,9 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl 1){ map.put("lawsInventoryId",projectLawsInventoryEO.getId()); @@ -1373,6 +1377,31 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl msgList = new ArrayList<>(); + //未匹配上法规清单 + if(ObjectUtils.isNotEmpty(emptyList)){ + for (ProjectLawsInventoryEO projectLawsInventoryEO : emptyList) { + List list = new LinkedList<>(); + if(StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())){ + for (String s : projectLawsInventoryEO.getDutyTerritory().split(",")) { + List collect = sysDictItemList.stream().filter(e -> e.getItemValue().equals(s)).collect(Collectors.toList()); + if(CutEnum.CN.getValue().equals(cut) && !collect.isEmpty()){ + list.add(collect.get(0).getItemText()); + }else if(CutEnum.EN.getValue().equals(cut) && !collect.isEmpty()){ + list.add(collect.get(0).getEnName()); + } + } + } + String serialNumber = projectLawsInventoryEO.getSerialNumber(); + String dutyTerritoryName = StringUtils.join(list,","); + String msg = serialNumber+" "+dutyTerritoryName+"未匹配到数据"; + msgList.add(msg); + } + } + String html = ""; + for (String s : msgList) { + html += s + "
"; + } if(!mapListOne.isEmpty()){ //匹配一条平台件时直接新增 List lawsInventoryPlatformEOS = new ArrayList<>(); @@ -1390,7 +1419,10 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl map = new HashMap<>(); + map.put("msg",html); + map.put("result",mapList); + return map; } /** * 不勾选法规清单进行关联平台件 From 8510a049e2478205b1c7763890e02791f8ac8d41 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 22 Sep 2023 17:27:30 +0800 Subject: [PATCH 104/185] =?UTF-8?q?=E8=BD=A6=E5=9E=8B=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=BA=93=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95=E5=85=B3=E8=81=94?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=E8=A1=A8-=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LawsInventoryPlatformEOController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java index 598c52bff..c05cd93be 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java @@ -14,6 +14,7 @@ import com.jero.modules.project.service.ILawsInventoryPlatformEOService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.DeleteMapping; @@ -113,7 +114,13 @@ public class LawsInventoryPlatformEOController extends JeroController Date: Fri, 22 Sep 2023 17:37:04 +0800 Subject: [PATCH 105/185] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E6=9C=AA=E5=8C=B9=E9=85=8D=E4=B8=8A=E5=B9=B3=E5=8F=B0=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLibraryBaseController.java | 2 +- .../service/IProjectLibraryBaseService.java | 2 +- .../impl/ProjectLibraryBaseServiceImpl.java | 67 ++++++++++++------- 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java index bea4e4c85..8eff66690 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java @@ -83,7 +83,7 @@ public class ProjectLibraryBaseController extends JeroController listPlatformAll(@RequestBody Map params) { - List> mapList = projectLibraryBaseService.listPlatformAll(params); + Map mapList = projectLibraryBaseService.listPlatformAll(params); return Result.OK(params.get("cut").toString(),mapList); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java index d6d57dbae..49fe9059a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java @@ -98,7 +98,7 @@ public interface IProjectLibraryBaseService extends IService * @param params * @return */ - List> listPlatformAll(Map params); + Map listPlatformAll(Map params); // IPage queryPageList(Map params); /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 6654e445d..ba55769c4 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -1377,6 +1377,35 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl lawsInventoryPlatformEOS = new ArrayList<>(); + for (Map map : mapListOne) { + LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO(); + inventoryPlatformEO.setCreateTime(new Date()); + inventoryPlatformEO.setUpdateTime(new Date()); + inventoryPlatformEO.setLawsInventoryId((String) map.get("lawsInventoryId")); + List projectLawsInventoryEOS = (List) map.get("result"); + inventoryPlatformEO.setPlatformLawsInventoryId(projectLawsInventoryEOS.get(0).getId()); + lawsInventoryPlatformEOS.add(inventoryPlatformEO); + } + + if (!lawsInventoryPlatformEOS.isEmpty()) { + lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS); + } + } + //法规清单未匹配上平台件的提示语 + String html = getMsg(cut, sysDictItemList, emptyList); + + Map map = new HashMap<>(); + map.put("msg",html); + map.put("result",mapList); + return map; + } + + @NotNull + private String getMsg(String cut, List sysDictItemList, List emptyList) { List msgList = new ArrayList<>(); //未匹配上法规清单 if(ObjectUtils.isNotEmpty(emptyList)){ @@ -1402,35 +1431,16 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl"; } - if(!mapListOne.isEmpty()){ - //匹配一条平台件时直接新增 - List lawsInventoryPlatformEOS = new ArrayList<>(); - for (Map map : mapListOne) { - LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO(); - inventoryPlatformEO.setCreateTime(new Date()); - inventoryPlatformEO.setUpdateTime(new Date()); - inventoryPlatformEO.setLawsInventoryId((String) map.get("lawsInventoryId")); - List projectLawsInventoryEOS = (List) map.get("result"); - inventoryPlatformEO.setPlatformLawsInventoryId(projectLawsInventoryEOS.get(0).getId()); - lawsInventoryPlatformEOS.add(inventoryPlatformEO); - } - - if (!lawsInventoryPlatformEOS.isEmpty()) { - lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS); - } - } - Map map = new HashMap<>(); - map.put("msg",html); - map.put("result",mapList); - return map; + return html; } + /** * 不勾选法规清单进行关联平台件 * * @return */ @Override - public List> listPlatformAll(Map params) { + public Map listPlatformAll(Map params) { String cut = (String) params.get("cut");// String projectLibraryIds = (String) params.get("projectLibraryIds");//法规清单id String platformProjectLibraryIds = (String) params.get("platformProjectLibraryIds");//平台件法规id @@ -1462,7 +1472,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl sysDictItemList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue()); List> mapList = new ArrayList<>(); List> mapListOne = new ArrayList<>(); - List projectLawsInventoryEOList = new ArrayList<>(); + List emptyList = new ArrayList<>(); for (ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryEOList) { Map map = new HashMap<>(); List projectLawsInventoryEOS = new ArrayList<>(); @@ -1502,6 +1512,9 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl 1){ @@ -1533,7 +1546,13 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl map = new HashMap<>(); + map.put("msg",html); + map.put("result",mapList); + return map; } private void hearSort(Map params, List resultLast) { From 44147c1ca16063ee197fe49bd021d59fd3ee3f7d Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Mon, 25 Sep 2023 11:07:02 +0800 Subject: [PATCH 106/185] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BA=93=20=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=B9=B3=E5=8F=B0=E4=BB=B6=E5=A4=B1=E8=B4=A5=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/common/lang/en-us.js | 1 + jero-web/src/common/lang/zh-cn.js | 1 + .../components/associatedplat.vue | 21 -------- .../components/associatedplatthree.vue | 33 +++++++----- .../certificationList/components/addModel.vue | 15 +++++- .../components/certificationList/index.vue | 53 ++++++++++++++++--- .../components/listOfRegulations.vue | 53 +++++++++++++++++-- 7 files changed, 130 insertions(+), 47 deletions(-) diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index dbccc4ddc..19f020dad 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1977,4 +1977,5 @@ module.exports = { unpublishedregulationsselected:'Only unpublished regulations can be selected', PlatformInformation:'Platform Information', Processdetails:'Process Details', + matchempty:'The match is empty' } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 888611cac..f3cb814c8 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -3933,4 +3933,5 @@ module.exports = { unpublishedregulationsselected:'仅能选择未发布的法规', PlatformInformation:'平台件信息', Processdetails:'流程详情', + matchempty:'匹配项为空' } \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/associatedplat.vue b/jero-web/src/views/projectManagement/components/associatedplat.vue index e6c0466d5..a9ab5ff37 100644 --- a/jero-web/src/views/projectManagement/components/associatedplat.vue +++ b/jero-web/src/views/projectManagement/components/associatedplat.vue @@ -226,27 +226,6 @@ this.confirmLoading = false this.$emit('associatedplatForm',selectedRowKeys.join(','),this.flag,this.type,this.ids) this.selectedRowKeys = [] - // postAction(this.url.addModel, { - // dummyInventoryBaseId: selectedRowKeys.join(','), - // projectLibraryId: this.$route.query.id, - // flag: flag - // }).then((res) => { - // if (res.success) { - // this.confirmLoading = false - // this.$message.success(this.$t('OperationSuccessful')) - // this.visible = false - // this.selectedRowKeys = [] - // this.$emit('transferListForm') - // } else { - // if (res.message == '该虚拟清单的维护清单中没有数据,是否需要添加') { - // this.confirmLoading = false - // this.getAdd() - // return - // } - // this.$message.warning(this.$t('operationFailed')) - // this.confirmLoading = false - // } - // }) } else { this.$message.warning(this.$t('selectLeastOne')) } diff --git a/jero-web/src/views/projectManagement/components/associatedplatthree.vue b/jero-web/src/views/projectManagement/components/associatedplatthree.vue index 96a610c85..f2e7dbe94 100644 --- a/jero-web/src/views/projectManagement/components/associatedplatthree.vue +++ b/jero-web/src/views/projectManagement/components/associatedplatthree.vue @@ -97,6 +97,7 @@ width: 130 }, ], + msg:'', data: [ // { // id:'1', @@ -191,20 +192,19 @@ this.loading = true postAction(this.flag == '2' ? '/project/projectLibraryBase/listPlatformAll' : 'project/projectLibraryBase/listPlatform', this.flag == '2' ? val : query).then((res) => { if (res.success) { - this.data = res.result || [] + this.data = res.result.result || [] + this.msg = res.result.msg || '' this.data.forEach((item,index) => { let name = 'selectedRowKeys'+index this.selectQuery[name] = item.result.map(val => val.id) - // for(var i in item.result.map(val => val.id)){ - // this.selectedRowKeys.push(item.result.map(val => val.id)[i]) - // } - // this.selectedRow.push(item.result) }) console.log(this.selectQuery) // console.log(this.selectedRow) this.loading = false if(this.data.length >= 1){ this.visible = true + }else { + this.$emit('associatedplatthreeFormHomo',this.msg) } } else { this.loading = false @@ -234,18 +234,25 @@ }) }) arr = arr - console.log(arr) let query = { - list : JSON.parse(JSON.stringify(arr)) + list : JSON.parse(JSON.stringify(arr)), + msg:this.msg } console.log(query) postAction('project/lawsInventoryPlatformEO/addBatch', query).then((res) => { if (res.success) { - this.confirmLoading = false - this.$message.success(this.$t('OperationSuccessful')) - this.visible = false - this.selectQuery = {} - this.$emit('associatedplatthreeForm') + if(res.result == ''){ + this.confirmLoading = false + this.$message.success(this.$t('OperationSuccessful')) + this.visible = false + this.selectQuery = {} + this.$emit('associatedplatthreeForm') + }else{ + this.confirmLoading = false + this.visible = false + this.selectQuery = {} + this.$emit('associatedplatthreeFormHomo',res.result) + } } else { this.$message.warning(this.$t('operationFailed')) this.confirmLoading = false @@ -253,7 +260,7 @@ }) } else { // this.$message.warning(this.$t('selectLeastOne')) - this.visible = false + this.$emit('associatedplatthreeForm') } }, getAdd() { diff --git a/jero-web/src/views/projectManagement/components/certificationList/components/addModel.vue b/jero-web/src/views/projectManagement/components/certificationList/components/addModel.vue index b47e38a8d..12c7ddba4 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/components/addModel.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/components/addModel.vue @@ -42,7 +42,7 @@ :placeholder="$t('PleaseSelect')+$t('regulationNo')" v-model="formInline.serialNumber"> @@ -504,6 +504,7 @@ optionFilterProp="label" @change="handleInput('sdt',formInline.sdt)" showSearch + :disabled="flowdisabled" v-model="formInline.sdt"> {{$t('deliverableTemplate')}}
+ {{ (formInline.deliverableTemplate === 'null' || formInline.deliverableTemplate === '' @@ -577,9 +580,9 @@ :query="{db_field_name:'dutyPerson',db_field_txt:$t('personLiable')}" :personneQuery="formInline" :isSingleChoice="true" + :disabled="flowdisabled" v-if="personnelVisible" @change="PersonnelSelectionChange" - :disabled="disabled" v-model="formInline.dutyPersonName"/>
@@ -598,6 +601,7 @@ message: $t('closingDate') + $t('cannotEmpty'), trigger: 'change'}]" > 0) { this.queryPersonByProject(value.dutyTerritory.join(',')) } + console.log(value) + if(value.projectCertificationInventoryEOS && value.projectCertificationInventoryEOS.length > 0){ + this.flowdisabled = true + this.$refs.uploadFile.disabled = true + } this.getRegulationNo() this.title = this.$t('edit') this.$nextTick(() => { diff --git a/jero-web/src/views/projectManagement/components/certificationList/index.vue b/jero-web/src/views/projectManagement/components/certificationList/index.vue index 645dbe1ea..f9b9692ff 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/index.vue @@ -464,6 +464,28 @@ />
+ + + + +
+ +
+
+
+ +
@@ -610,6 +632,8 @@ pageSize: 50, total: 0, JTextLoading: false, + visibleoperationFailed: false, + visibleoperation:'', CertificationColor: { 'Test passed': 'accordColor', 'Test failed': 'nonConformityColor', @@ -1278,6 +1302,7 @@ if(this.selectedRowKeys && this.selectedRowKeys.length > 0){ this.detailedWarningList = [] let dataSource = [] + let status = '' for (let i = 0; i < this.dataSource.length; i++) { for (let j = 0; j < this.selectedRowKeys.length; j++) { if (this.dataSource[i].id == this.selectedRowKeys[j]) { @@ -1288,12 +1313,16 @@ for (let i = 0; i < dataSource.length; i++) { if (dataSource[i].flowStatus == 'List to be released') { flag = '1' - this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) + status = '1' } else { - this.$message.warning(this.$t('unpublishedregulationsselected')) - return + status = '2' } } + if(status == '1'){ + this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) + }else{ + this.$message.warning(this.$t('unpublishedregulationsselected')) + } }else{ flag = '2' this.$message.warning(this.$t('selectLeastOne')) @@ -1308,9 +1337,15 @@ if(type == '认证'){ postAction('/project/projectCertificationInventoryEO/listPlatform', query).then((res) => { if (res.success) { - this.$refs.associatedplatRef.visible = false - this.$message.success(this.$t('OperationSuccessful')) - this.getList() + if(res.result == ''){ + this.$refs.associatedplatRef.visible = false + this.$message.success(this.$t('OperationSuccessful')) + this.selectedRowKeys = [] + this.getList() + }else{ + this.visibleoperation = res.result + this.visibleoperationFailed = true + } } }) } @@ -1320,6 +1355,12 @@ // this.$refs.associatedplattwoRef.transferModel(id,type,ids) // } }, + cancleoperationFailed(){ + this.visibleoperationFailed = false + this.$refs.associatedplatRef.handleCancel() + this.selectedRowKeys = [] + this.getList() + }, associatedplattwoForm(id,type,ids){ // this.$refs.associatedplatthreeRef.transferModel(id,type,ids) }, diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index 7c837d07c..f2290d886 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -435,7 +435,7 @@ - + @@ -688,6 +688,28 @@ + + + + +
+ +
+
+
+ +
{{ $t('dataLoading') }} {{ $t('Submitting') }} @@ -757,6 +779,7 @@ data() { return { toggleSearchStatus: false, + visibleoperationFailed: false, visibleQuestion: false, visibleReset: false, confirmLoadingReset: false, @@ -768,6 +791,7 @@ pageSize: 50, total: 0, long:'', + visibleoperation:'', roleSwitchingList: [], formInlineQuestion: {}, formInlineReset: {}, @@ -1955,7 +1979,7 @@ transferClick() { this.$refs.transferListRef.transferModel() }, - // 关联平台件 + // 关联平台件visibleoperation associatedplatformClick(type){ let flag = '' if(this.selectedRowKeys && this.selectedRowKeys.length > 0){ @@ -1978,7 +2002,6 @@ status = '2' } } - console.log(status) if(status == '1'){ this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) }else{ @@ -1986,8 +2009,6 @@ } }else{ flag = '2' - this.selectedRowKeys = this.dataSource.map(val => val.id) - console.log(this.selectedRowKeys) this.$refs.associatedplatRef.transferModel(flag,type,this.selectedRowKeys.join(',')) } }, @@ -2002,6 +2023,28 @@ this.$refs.associatedplatthreeRef.transferModel(id,flag,type,ids) }, associatedplatthreeForm(id){ + this.$refs.associatedplatRef.handleCancel() + this.$refs.associatedplattwoRef.handleCancel() + this.selectedRowKeys = [] + this.getList() + }, + associatedplatthreeFormHomo(msg){ + if(msg){ + this.visibleoperation = msg + this.visibleoperationFailed = true + }else{ + this.$message.warning(this.$t('matchempty')) + this.$refs.associatedplatRef.handleCancel() + this.$refs.associatedplattwoRef.handleCancel() + this.selectedRowKeys = [] + this.getList() + } + }, + cancleoperationFailed(){ + this.visibleoperationFailed = false + this.$refs.associatedplatRef.handleCancel() + this.$refs.associatedplattwoRef.handleCancel() + this.selectedRowKeys = [] this.getList() }, //批量设置 From 61c4471930f2af2658fc4876bad11f61baf28872 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Mon, 25 Sep 2023 14:43:41 +0800 Subject: [PATCH 107/185] =?UTF-8?q?=20=E5=B9=B3=E5=8F=B0=E4=BB=B6=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/mapper/xml/TodoCenterMapper.xml | 3 +- .../LawsInventoryPlatformEOController.java | 2 +- ...ectCertificationInventoryEOController.java | 4 +- .../ProjectCertificationInventoryEO.java | 20 ++--- ...rojectCertificationInventoryEOService.java | 2 +- ...ctCertificationInventoryEOServiceImpl.java | 78 +++++++++++++++++-- .../ProjectLawsInventoryEOServiceImpl.java | 4 + 7 files changed, 94 insertions(+), 19 deletions(-) diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/TodoCenterMapper.xml b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/TodoCenterMapper.xml index ff0405564..1a2deaf32 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/TodoCenterMapper.xml +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/TodoCenterMapper.xml @@ -23,7 +23,8 @@ SELECT pm.id FROM params_manifest pm JOIN ( SELECT id FROM - ( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id + ( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id, + a.platform FROM project_library_base a JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java index c05cd93be..0433e3699 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java @@ -118,7 +118,7 @@ public class LawsInventoryPlatformEOController extends JeroController listPlatform(@RequestBody Map params) { - projectCertificationInventoryEOService.listPlatform(params); - return Result.OK(); + String msg = projectCertificationInventoryEOService.listPlatform(params); + return Result.OK(msg); } /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java index 7f8c25293..e08add5f6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java @@ -1,24 +1,22 @@ package com.jero.modules.project.entity; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.math.BigDecimal; -import java.util.Date; - import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; import com.jero.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; /** @@ -261,4 +259,8 @@ public class ProjectCertificationInventoryEO implements Serializable { /**一级责任领域**/ @TableField(exist = false) private String firstLevelDutyTerritory; + + @ApiModelProperty(value = "关联平台件数据") + @TableField(exist = false) + private List projectCertificationInventoryEOS; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 472446bd3..f205301bb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -344,5 +344,5 @@ public interface IProjectCertificationInventoryEOService extends IService params); + String listPlatform(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 27ab0fb30..267c06211 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -73,6 +73,7 @@ import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.enums.ProjectRoleEnum; import com.jero.modules.system.enums.SysCategoryValueTypeEnum; import com.jero.modules.system.mapper.SysCategoryMapper; +import com.jero.modules.system.mapper.SysDictItemMapper; import com.jero.modules.system.mapper.SysRoleMapper; import com.jero.modules.system.mapper.SysUserMapper; import com.jero.modules.system.service.IProjectUserDutyTerritoryService; @@ -109,6 +110,7 @@ import org.aspectj.util.FileUtil; import org.jeecgframework.poi.excel.ExcelExportUtil; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.enmus.ExcelType; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -230,6 +232,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl collect = lawsInventoryPlatformEOList.stream() + .filter(e -> certificationInventoryEO.getId().equals(e.getLawsInventoryId())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect)){ + List platformLawsInventoryIdList = collect.stream() + .map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).distinct().collect(Collectors.toList()); + + List inventoryEOList = projectCertificationInventoryEOS.stream() + .filter(e -> platformLawsInventoryIdList.contains(e.getId())).collect(Collectors.toList()); + certificationInventoryEO.setProjectCertificationInventoryEOS(inventoryEOList); + } + + List inventoryPlatformEOList = lawsInventoryPlatformEOList.stream() .filter(e -> certificationInventoryEO.getId().equals(e.getLawsInventoryId())).collect(Collectors.toList()); if(!inventoryPlatformEOList.isEmpty()){ @@ -3593,8 +3609,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); - List certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + List certificationEngineerList = new ArrayList<>(); + List certificationEngineerIdList = new ArrayList<>(); + if(StringUtils.isNotBlank(projectLibraryBase.getCertificationEngineer())){ + certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); + certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + } + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 @@ -3717,6 +3738,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,Arrays.asList(ids.split(","))); + lawsInventoryPlatformEOService.remove(wrapper); return Result.OK("流程重置成功!"); } @@ -7029,7 +7054,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl params) { + public String listPlatform(Map params) { String cut = (String) params.get("cut");// String ids = (String) params.get("ids");//认证清单id String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id @@ -7052,11 +7077,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl sysDictItemList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue()); List lawsInventoryPlatformEOS = new ArrayList<>(); List result = new ArrayList<>(); + List emptyList = new ArrayList<>(); for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { //类别 String category = projectCertificationInventoryEO.getCategory(); @@ -7090,10 +7117,15 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl sysDictItemList, List emptyList) { + List msgList = new ArrayList<>(); + //未匹配上法规清单 + if(ObjectUtils.isNotEmpty(emptyList)){ + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : emptyList) { + List list = new LinkedList<>(); + if(com.jero.modules.system.util.StringUtils.isNotBlank(projectCertificationInventoryEO.getDutyTerritory())){ + for (String s : projectCertificationInventoryEO.getDutyTerritory().split(",")) { + List collect = sysDictItemList.stream().filter(e -> e.getItemValue().equals(s)).collect(Collectors.toList()); + if(CutEnum.CN.getValue().equals(cut) && !collect.isEmpty()){ + list.add(collect.get(0).getItemText()); + }else if(CutEnum.EN.getValue().equals(cut) && !collect.isEmpty()){ + list.add(collect.get(0).getEnName()); + } + } + } + String serialNumber = projectCertificationInventoryEO.getSerialNumber(); + String dutyTerritoryName = com.jero.modules.system.util.StringUtils.join(list,","); + String msg = serialNumber+" "+dutyTerritoryName+"未匹配到数据"; + msgList.add(msg); + } + } + String html = ""; + for (String s : msgList) { + html += s + "
"; + } + return html; } private void setDataTemp(List lawsInventoryPlatformEOS, diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index b70756479..582ccdfdd 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -4965,6 +4965,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,Arrays.asList(ids.split(","))); + lawsInventoryPlatformEOService.remove(wrapper); return Result.OK("变更成功!"); } From d3fd25c098dde0345e8a51003e93b32af5274a53 Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Mon, 25 Sep 2023 14:44:41 +0800 Subject: [PATCH 108/185] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BA=93=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/associatedplattwo.vue | 2 +- .../components/addModel.vue | 72 +++++++++---------- .../components/nonConformance.vue | 38 ++-------- .../components/settingList.vue | 3 + .../platformItemLibraryDetails/index.vue | 3 +- 5 files changed, 48 insertions(+), 70 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/associatedplattwo.vue b/jero-web/src/views/projectManagement/components/associatedplattwo.vue index 3ff14e24c..79c12a746 100644 --- a/jero-web/src/views/projectManagement/components/associatedplattwo.vue +++ b/jero-web/src/views/projectManagement/components/associatedplattwo.vue @@ -110,7 +110,7 @@ export default { }, { title: this.$t('NareaOfResponsibility'), - dataIndex: 'dutyTerritory', + dataIndex: 'dutyTerritory_dictText', align: 'left', ellipsis: true, width: 140 diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue index d30bae959..fd768320a 100644 --- a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue @@ -19,19 +19,8 @@ {{$t('entryName')}}
- - - - - - - - - - - -
@@ -45,6 +34,7 @@
@@ -57,8 +47,8 @@ {{$t('configurationItem')}} - - + @@ -66,12 +56,14 @@
- {{$t('explain')}} + {{$t('certificationProgram')}}
- - + +
@@ -86,6 +78,7 @@ @@ -94,13 +87,13 @@
- {{$t('certificationProgram')}} + {{$t('explain')}}
- - + +
@@ -278,8 +271,8 @@ message: this.$t('pleaseEnterTheCorrectWebAddress') }, { - max: 300, - message: this.$t('configurationInformation') + this.$t('cannotExceed') + 300 + this.$t('Characters'), + max: 200, + message: this.$t('configurationInformation') + this.$t('cannotExceed') + 200 + this.$t('Characters'), trigger: 'blur' } ], @@ -289,8 +282,8 @@ message: this.$t('pleaseEnterTheCorrectWebAddress') }, { - max: 300, - message: this.$t('dehicleDevelopmentPlan') + this.$t('cannotExceed') + 300 + this.$t('Characters'), + max: 200, + message: this.$t('dehicleDevelopmentPlan') + this.$t('cannotExceed') + 200 + this.$t('Characters'), trigger: 'blur' } ], @@ -307,15 +300,15 @@ message: this.$t('pleaseEnterTheCorrectWebAddress') }, { - max: 300, - message: this.$t('certificationProgram') + this.$t('cannotExceed') + 300 + this.$t('Characters'), + max: 200, + message: this.$t('certificationProgram') + this.$t('cannotExceed') + 200 + this.$t('Characters'), trigger: 'blur' } ], vehiclePlatform: [ { - max: 100, - message: this.$t('ModelPlatform') + this.$t('cannotExceed') + 100 + this.$t('Characters'), + max: 200, + message: this.$t('ModelPlatform') + this.$t('cannotExceed') + 200 + this.$t('Characters'), trigger: 'blur' } ], @@ -324,19 +317,24 @@ required: true, message: this.$t('entryName') + this.$t('cannotEmpty'), trigger: 'blur' + }, + { + max: 200, + message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 200 + this.$t('Characters'), + trigger: 'blur' } ], digitalPlatform: [ { - max: 100, - message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 100 + this.$t('Characters'), + max: 200, + message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 200 + this.$t('Characters'), trigger: 'blur' } ], softwareVersion: [ { - max: 300, - message: this.$t('softwareVersion') + this.$t('cannotExceed') + 300 + this.$t('Characters'), + max: 200, + message: this.$t('softwareVersion') + this.$t('cannotExceed') + 200 + this.$t('Characters'), trigger: 'blur' } ], diff --git a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/nonConformance.vue b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/nonConformance.vue index 73b821008..ce5c3daf8 100644 --- a/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/nonConformance.vue +++ b/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/nonConformance.vue @@ -24,41 +24,17 @@
-
- {{$t('RelatedItems')}} +
+ {{$t('problemType')}}
- - - - {{ item.projectName}} - - - +