diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index 08b8f007e..3a32c5b11 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -22,3 +22,8 @@ ADD COLUMN `explanation` varchar(2000) NULL COMMENT '说明' AFTER `project_vers ALTER TABLE `laws_weilai`.`project_library_base` MODIFY COLUMN `software_version` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '软件版本' AFTER `explanation`; +-- 认证参数历史列表添加字段--------2022-11-02 未同步生产环境 +ALTER TABLE `laws_weilai`.`params_manifest_history` +ADD COLUMN `project_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '相关项目版本' AFTER `params_template_name`, +ADD COLUMN `explanation` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明' AFTER `project_version`; + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index ab69cbfe9..5b39498e7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -41,7 +41,6 @@ import com.jero.modules.cert.template.service.ICertCategoryParamsInfoPublishEOSe import com.jero.modules.cert.template.service.IParamsInfoPublishEOService; import com.jero.modules.feishu.service.IFeishuService; import com.jero.modules.feishu.vo.FeishuMsg2Vo; -import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.message.websocket.WebSocket; import com.jero.modules.ocr.service.WebSocketServer; import com.jero.modules.ocr.util.LineHumpUtil; @@ -1892,13 +1891,20 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl").append(nioNumber).append("").append("工程接口人没有填写,请填写完工程接口人再进行下发收集。"); } - } else { + } else if ("2".equals(type)) { if (CutEnum.EN.getValue().equals(cut)) { stringBuilder.append("NIO number is ").append(nioNumber).append(",state is ").append("").append(stateName).append("").append(",no operation permission for this button."); } else { stringBuilder.append("NIO编号为").append(nioNumber).append(",状态为").append("").append(stateName).append("").append(",没有此按钮的操作权限。"); } + } else if ("3".equals(type)) { + if (CutEnum.EN.getValue().equals(cut)) { + stringBuilder.append("NIO number is ").append(nioNumber).append(",state is ").append("").append(stateName).append("").append(", fail to import."); + } else { + stringBuilder.append("NIO编号为").append(nioNumber).append(",状态为").append("").append(stateName).append("").append(",导入失败。"); + } + } msgList.add(stringBuilder.toString()); @@ -2447,6 +2453,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl allRelevFileList = new ArrayList<>(); + Map fileNowPathMap = new HashMap<>(); + //放文字内容 int allRow = 2; for(int rowNum = 0;rowNum < allParamsInfoList.size(); rowNum++){ Map exportDto = allParamsInfoList.get(rowNum); + // 处理文件 + List fileList = (List) exportDto.get("fileList"); + if (CollectionUtil.isNotEmpty(fileList)) { + allRelevFileList.addAll(fileList); + fileList.forEach(file -> { + fileNowPathMap.put(file.getId(), fileNowPath + File.separator + exportDto.get("nio_number")); + }); + + } + allRow++; XSSFRow row1 = sheetItems.createRow(allRow); for(int cellNum = 0; cellNum < fieldList.size(); cellNum++){ @@ -2552,13 +2579,29 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl> datas = result; if(datas!=null &&!datas.isEmpty()){ try { - int i = 0 ; - List> datasUpdate = new ArrayList<>(); +// int i = 0 ; +// List> datasUpdate = new ArrayList<>(); //处理空行数据,当读取exceL出现空行过多时,空行数为20以上时中断读取,将数据清洗为新的list - for(Map importDto :datas){ - if(i>20){ - break; - } - //判断此行数据是否全部为空 - if(checkObjAllFieldsIsNull(importDto)){ - i++; - //是则不读取 - continue; - } - i = 0; - datasUpdate.add(importDto); - } +// for(Map importDto :datas){ +// if(i>20){ +// break; +// } +// //判断此行数据是否全部为空 +// if(checkObjAllFieldsIsNull(importDto)){ +// i++; +// //是则不读取 +// continue; +// } +// i = 0; +// datasUpdate.add(importDto); +// } String unzipfilepath = zipEntryName; - Result message = importData(datasUpdate,unzipfilepath,cut,paramsManifestId); + Result message = importData(datas,unzipfilepath,cut,paramsManifestId); //删除原上传文件 FileUnZip.deleteDir(saveDirectory); return message; + } catch (NullPointerException e) { + //删除原上传文件 + FileUnZip.deleteDir(saveDirectory); + if(CutEnum.CN.getValue().equals(cut)){ + resultMsg = "读取失败,请严格按照模板文件导入数据"; + }else{ + resultMsg = "The data fails to be read. Import data strictly according to the template file"; + } + return Result.error(1, resultMsg); } catch (Exception e) { //删除原上传文件 FileUnZip.deleteDir(saveDirectory); @@ -2738,6 +2791,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl configDataList = (List) map.get("configDataList"); + List> notImportNioNumberList = (List>) map.get("notImportNioNumberList"); for (ParamsConfigDataEO importDto : configDataList) { //判断此行数据是否全部为空,是则不读取 @@ -2776,13 +2830,19 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl msgList = getMsgOfIssueCollection(notImportNioNumberList, cut, "3"); + return Result.OK(null, msgList); + } else { - msg = "import " + countSuccess + " datas successfully"; + int countSuccess = configDataList.size(); + if (CutEnum.CN.getValue().equals(cut)) { + msg = "成功导入" + countSuccess + "条"; + } else { + msg = "import " + countSuccess + " datas successfully"; + } + return Result.OK(msg, null); } - return Result.OK(msg, null); } else { if (CutEnum.CN.getValue().equals(cut)) { msg = "导入失败"; @@ -3172,6 +3232,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigEOList = paramsConfigEOService.queryList(paramsManifestId); // 查询所有配置列 + + List paramsConfigIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList()); + List paramsConfigDataEOList = paramsConfigDataEOService.queryListByConfigIdList(paramsConfigIdList); // 查询所有配置数据 + Map isMustMap = ParamsIsMustEnum.toMapForExport(cut); Map controlVerifyMap = ControlVerifyEnum.toMapForExport(cut); Map controlTypeMap = ControlTypeEnum.toMapForExport(cut); @@ -3182,11 +3247,53 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl fileList = new ArrayList<>(); + + paramsConfigEOList.forEach(paramsConfigEO -> { // 参数配置 + + String paramsConfigId = paramsConfigEO.getId(); + List paramsConfigDataEOS = paramsConfigDataEOList.stream().filter(e-> paramsConfigId.equals(e.getParamsConfigId()) && paramsCollectManifestId.equals(e.getParamsCollectManifestId())).collect(Collectors.toList()); // 参数配置数据 + StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据 + if (CollectionUtil.isNotEmpty(paramsConfigDataEOS)) { + ParamsConfigDataEO paramsConfigDataEO = paramsConfigDataEOS.get(0); + if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) { + configDataBuilder.append(paramsConfigDataEO.getTextData()).append("#"); + } + if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) { + configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", "!")).append("#"); + } + if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) { + List ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId()); + if (CollectionUtil.isNotEmpty(ossFileList)) { + configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName()).append("#"); + + fileList.addAll(ossFileList); + } + } + + } + + String configData = configDataBuilder.toString(); + if (configData.contains("#")) { + configData = configData.substring(0, configData.lastIndexOf("#")); + } + + record1.put(paramsConfigEO.getId(), configData); + }); + + record1.put("fileList", fileList); + } + + result.add(record1); } return result; @@ -3574,9 +3681,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl configIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList()); List paramsConfigDataEOList = paramsConfigDataEOService.queryListByConfigIdList(configIdList); - Map controlTypeMap = ControlTypeEnum.toMapForImport(cut); - Map controlVerifyMap = ControlVerifyEnum.toMapForImport(cut); - Map paramsIsMustMap = ParamsIsMustEnum.toMapForImport(cut); - //存放数据验证结果信息 List configDataList = new ArrayList<>(); + List verifyNioNumber = new ArrayList<>(); + List> notImportNioNumberList = new ArrayList<>(); List stringMessage = new ArrayList<>(); int i = 3; //记录行号 //循环验证数据 @@ -3618,10 +3723,50 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl resultMap = new HashMap<>(); String nioNumber = (String) dto.get("nio_number"); - String controlType = controlTypeMap.get((String) dto.get("control_type")); - String controlVerify = controlVerifyMap.get((String) dto.get("control_verify")); - String controlValues = (String) dto.get("control_values"); - String isMust = paramsIsMustMap.get((String) dto.get("is_must")); + if (StringUtils.isBlank(nioNumber)) { + continue; + } + + List listPCM = paramsCollectManifestEOList.stream().filter(e-> nioNumber.equals(e.getNioNumber())).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(listPCM)) { + if (CutEnum.EN.getValue().equals(cut)) { + errorMsg += "NIO Number can not find; "; + } else{ + errorMsg += "NIO编号不存在;"; + } + countError++; + stringMessage.add(errorMsg); + continue; + } + + if (!verifyNioNumber.contains(nioNumber)) { + verifyNioNumber.add(nioNumber); + } else{ + if (CutEnum.EN.getValue().equals(cut)) { + errorMsg += "NIO Number is repeat; "; + } else{ + errorMsg += "NIO编号重复;"; + } + countError ++; + stringMessage.add(errorMsg); + continue; + } + + ParamsCollectManifestEO paramsCollectManifestEO = listPCM.get(0); + String state = paramsCollectManifestEO.getState(); + if (!CollectManifestStateEnum.WAIT_FILL.getValue().equals(state) && !CollectManifestStateEnum.CERT_BACK.getValue().equals(state)) { + Map msgMap = new HashMap<>(); + msgMap.put("nioNumber", nioNumber); + msgMap.put("state", state); + msgMap.put("type", "3"); + notImportNioNumberList.add(msgMap); + continue; + } + + String controlType = paramsCollectManifestEO.getControlType(); + String controlVerify = paramsCollectManifestEO.getControlVerify(); + String controlValues = paramsCollectManifestEO.getControlValues(); + String isMust = paramsCollectManifestEO.getIsMust(); for (Map.Entry entry : dto.entrySet()) { String key = entry.getKey(); String value = (String) entry.getValue(); @@ -3855,6 +4000,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl +
+ + + {{$t('import')}} + +
+
+ +
+ {{this.$t('Importing')}}... +
+
+
+ + + + +
+ + + +
+
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue index 88b5dc8a0..fa67d111c 100644 --- a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue +++ b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue @@ -463,7 +463,7 @@ import AdjustareaSofrespon from '@/components/AdjustareaSofrespon/index' import ReferenceParameter from '@/components/ReferenceParameter/index' import AssignedBy from '@/components/AssignedBy/index' - import ImportFileOnlyList from '@/components/ImportFileOnlyList/index' + import ImportFileOnlyList from '@/components/ImportFileOnlyListtag/index' import axios from 'axios' import { ACCESS_TOKEN } from '@/store/mutation-types' import Vue from 'vue' @@ -935,7 +935,7 @@ ids: this.selectedRowKeys.join(','), exportName:this.$route.query.projectName + '(' + this.$route.query.title + ')' } - let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.xlsx' + let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip' downloadFile('/params/collectManifest/exportDre', name , query , this.selectClear) }, getList(){