diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index 47a5df17f..a02c58a71 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -398,4 +398,11 @@ INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `create_by`, `create_ti -- 法规清单表 增加字段 设计、验证符合性确认-流程状态 2023-03-17 未同步生产环境 ALTER TABLE `project_laws_inventory` ADD COLUMN `design_flow_status` varchar(255) NULL COMMENT '设计符合性确认-流程状态' AFTER `design_due_date`, - ADD COLUMN `verify_flow_status` varchar(255) NULL COMMENT '验证符合性确认-流程状态' AFTER `verify_due_date`; \ No newline at end of file + ADD COLUMN `verify_flow_status` varchar(255) NULL COMMENT '验证符合性确认-流程状态' AFTER `verify_due_date`; +-- 参数配置数据表,增加排序号字段sql 2023-1-31 未同步生产环境 +ALTER TABLE `laws_weilai`.`params_config_data` + ADD COLUMN `order_num` int(10) NULL COMMENT '排序号' AFTER `params_collect_manifest_id`; + +-- 上报库参数配置数据表,增加排序号字段sql 2023-2-1 未同步生产环境 +ALTER TABLE `laws_weilai`.`params_report_config_data` + ADD COLUMN `order_num` int(10) NULL COMMENT '排序号' AFTER `params_collect_manifest_id`; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsConfigDataEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsConfigDataEO.java index 7754c385d..43f9a7ea9 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsConfigDataEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsConfigDataEO.java @@ -88,4 +88,6 @@ public class ParamsConfigDataEO implements Serializable { @ApiModelProperty(value = "参数收集清单id") private String paramsCollectManifestId; + /**排序号**/ + private Integer orderNum; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsConfigDataEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsConfigDataEOService.java index ed9ffbd67..1a5ac490f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsConfigDataEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsConfigDataEOService.java @@ -56,6 +56,15 @@ public interface IParamsConfigDataEOService extends IService */ ParamsConfigDataEO queryByConfigIdAndCollectManifestId(String paramsConfigId, String paramsCollectManifestId); + /** + * 通过id查询 + * + * @param paramsConfigId + * @param paramsCollectManifestId + * @return + */ + List queryListByConfigIdAndCollectManifestId(String paramsConfigId, String paramsCollectManifestId); + /** * 列表查询 * 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 4f27f21e2..8174a1084 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 @@ -95,6 +95,7 @@ import java.lang.reflect.Modifier; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; +import java.text.Collator; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -328,6 +329,14 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl getConfigDataEOListByConfigIdAndCollectManifestId(String configId, String collectManifestId, List paramsConfigDataEOList) { + List configDataEOList = paramsConfigDataEOList.stream().filter(e-> configId.equals(e.getParamsConfigId()) && collectManifestId.equals(e.getParamsCollectManifestId())).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(configDataEOList)) { + return configDataEOList; + } + return null; + } + /** * 列表查询 * @@ -482,29 +491,74 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl referencesColMap = new HashMap<>(); + referencesColMap.put("referencesColFlag",true); + Map referencesColConfigDataVOMap = new HashMap<>(); String referencesCol = collectManifestEO.getReferencesCol(); if (StringUtils.isNotBlank(referencesCol)) { - List referencesColVOList = getReferencesColList(controlType, referencesCol, collectManifestEO, userTypes); // 重新组合配置数据 + String[] referencesColArr = referencesCol.split("
"); + for (String col : referencesColArr) { + List referencesColVOList = getReferencesColList(controlType, col, collectManifestEO, userTypes); // 重新组合配置数据 + String key = UUID.randomUUID().toString().replaceAll("-",""); + referencesColConfigDataVOMap.put(key,referencesColVOList); + } + + referencesColMap.put("controlType", controlType); - referencesColMap.put("list", referencesColVOList); + referencesColMap.put("paramsConfigData", referencesColConfigDataVOMap); + + //referencesColMap.put("list", referencesColVOList); manifestMap.put("referencesCol", referencesColMap); } else { List referencesColVOList = getReferencesColList(controlType, " # # #", collectManifestEO, userTypes); // 重新组合配置数据 referencesColMap.put("controlType", controlType); - referencesColMap.put("list", referencesColVOList); + + String key = UUID.randomUUID().toString().replaceAll("-",""); + referencesColConfigDataVOMap.put(key,referencesColVOList); + referencesColMap.put("paramsConfigData", referencesColConfigDataVOMap); + + //referencesColMap.put("list", referencesColVOList); manifestMap.put("referencesCol", referencesColMap); } } if (CollectionUtil.isNotEmpty(paramsConfigEOList)) { paramsConfigEOList.forEach(paramsConfigEO -> { // 参数配置 - Map configMap = new HashMap<>(); + /*Map configMap = new HashMap<>(); String paramsConfigId = paramsConfigEO.getId(); -// ParamsConfigDataEO paramsConfigDataEO = paramsConfigDataEOService.queryByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId); // 参数配置数据 ParamsConfigDataEO paramsConfigDataEO = getConfigDataEOByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId, paramsConfigDataEOList); // 参数配置数据 List paramsConfigDataVOList = getConfigDataVOList(controlType, paramsConfigEO, paramsConfigDataEO, collectManifestEO); // 重新组合配置数据 configMap.put("controlType", controlType); configMap.put("list", paramsConfigDataVOList); + manifestMap.put(paramsConfigEO.getId(), configMap);*/ + + Map paramsConfigDataVO = new HashMap<>(); + Map configMap = new HashMap<>(); + String paramsConfigId = paramsConfigEO.getId(); + List paramsConfigDatas = this.getConfigDataEOListByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId, paramsConfigDataEOList); // 参数配置数据 + if(CollectionUtils.isNotEmpty(paramsConfigDatas)){ + // 匿名比较器排序 + Collections.sort(paramsConfigDatas, new Comparator() { + @Override + public int compare(ParamsConfigDataEO p1, ParamsConfigDataEO p2) { + if(p2.getOrderNum() == null || p1.getOrderNum() == null){ + return 0; + } + return p1.getOrderNum().compareTo(p2.getOrderNum()); + } + }); + for (ParamsConfigDataEO paramsConfigDataEO : paramsConfigDatas) { + List paramsConfigDataVOList = this.getConfigDataVOList(controlType, paramsConfigEO, paramsConfigDataEO, collectManifestEO); // 重新组合配置数据 + paramsConfigDataVO.put(paramsConfigDataEO.getId(),paramsConfigDataVOList); + } + }else { + ParamsConfigDataEO paramsConfigDataEO = this.getConfigDataEOByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId, paramsConfigDataEOList); // 参数配置数据 + List paramsConfigDataVOList = this.getConfigDataVOList(controlType, paramsConfigEO, paramsConfigDataEO, collectManifestEO); // 重新组合配置数据 + String key = UUID.randomUUID().toString().replaceAll("-",""); + paramsConfigDataVO.put(key,paramsConfigDataVOList); + } + configMap.put("controlType", controlType); + configMap.put("paramsConfigData", paramsConfigDataVO); + configMap.put("configId",paramsConfigEO.getId()); manifestMap.put(paramsConfigEO.getId(), configMap); configIdList.add(paramsConfigEO.getId()); @@ -1476,7 +1530,6 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl entry : map.entrySet()) { - ParamsConfigDataEO paramsConfigDataEO = new ParamsConfigDataEO(); if ("id".equals(entry.getKey())) { continue; } @@ -1485,100 +1538,122 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigDataMap = (Map) entry.getValue(); // 无法转ParamsConfigDataVO(遍历会出现该异常 : LinkedHashMap cannot be cast to ParamsConfigDataVO) - List> paramsConfigDataVOList = (List>) paramsConfigDataMap.get("list"); +// List> paramsConfigDataVOList = (List>) paramsConfigDataMap.get("list"); + Map paramsConfigDataVOMap = (Map) paramsConfigDataMap.get("paramsConfigData"); // 判断是新增还是修改 - ParamsConfigDataEO oldConfigDataEO = paramsConfigDataEOService.queryByConfigIdAndCollectManifestId(paramsConfigEOId, paramsCollectManifestId); - if (ObjectUtil.isNotEmpty(oldConfigDataEO)) { - paramsConfigDataEO.setId(oldConfigDataEO.getId()); + // ParamsConfigDataEO oldConfigDataEO = paramsConfigDataEOService.queryByConfigIdAndCollectManifestId(paramsConfigEOId, paramsCollectManifestId); + List oldConfigDataEOList = this.paramsConfigDataEOService.queryListByConfigIdAndCollectManifestId(paramsConfigEOId, paramsCollectManifestId); - } - paramsConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId); - paramsConfigDataEO.setParamsConfigId(paramsConfigEOId); ParamsConfigEO paramsConfigEO = this.paramsConfigEOService.queryById(paramsConfigEOId); if(Objects.isNull(paramsConfigEO)){ continue; } - if (CollectionUtil.isNotEmpty(paramsConfigDataVOList)) { - boolean appendFlag = false; // 拼接标识 - for (Map paramsConfigDataVO : paramsConfigDataVOList) { - String dataValue = (String) paramsConfigDataVO.get("dataValue"); - // 只要其中有一个值就可以进行拼接 - if(StringUtils.isNotEmpty(dataValue)){ - appendFlag = true; - break; - } - } - if(appendFlag){ - logCnContentSb.append(paramsConfigEO.getConfigName()).append("为"); - logEnContentSb.append(" configuration ").append(paramsConfigEO.getConfigName()).append(" as "); - } - for (Map paramsConfigDataVO : paramsConfigDataVOList) { - String type = (String) paramsConfigDataVO.get("type"); - String dataValue = (String) paramsConfigDataVO.get("dataValue"); - if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { - paramsConfigDataEO.setTextData(dataValue); - if (StringUtils.isNotEmpty(dataValue)) { - logCnContentSb.append("\"").append(dataValue).append("\""); - logEnContentSb.append("\"").append(dataValue).append("\""); - } + // 拼接历史记录信息 + for (Map.Entry configDataMap : paramsConfigDataVOMap.entrySet()) { + List> paramsConfigDataVOList = (List>)configDataMap.getValue(); - } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) - || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { - paramsConfigDataEO.setPullData(dataValue); - if (StringUtils.isNotEmpty(dataValue)) { - logCnContentSb.append("\"").append(dataValue).append("\""); - logEnContentSb.append("\"").append(dataValue).append("\""); - } + if (CollectionUtil.isNotEmpty(paramsConfigDataVOList)) { - } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { - if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件 - // 处理文件connectId - String[] fileIdList = dataValue.split(","); - String connectId = UUID.randomUUID().toString().replace("-", ""); - List updateFileList = new ArrayList<>(); - for (int i = 0; i < fileIdList.length; i++) { - OSSFile ossFile = new OSSFile(); - ossFile.setId(fileIdList[i]); - ossFile.setConnectId(connectId); - updateFileList.add(ossFile); + ParamsConfigDataEO paramsConfigDataEO = new ParamsConfigDataEO(); + if(CollectionUtils.isNotEmpty(oldConfigDataEOList)){ + List oldConfigDataEOs = oldConfigDataEOList.stream().filter(configData -> { + boolean flag = false; + if (StringUtils.equals(configDataMap.getKey(), configData.getId())) { + flag = true; } - ossFileService.updateBatchById(updateFileList); - dataValue = connectId; - } else if (StringUtils.isNotEmpty(dataValue) && !dataValue.contains(",")) { - List ossFiles = ossFileService.getFileInfosByConnectId(dataValue); - if(CollectionUtil.isEmpty(ossFiles)){ // 新加了一个文件 + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(oldConfigDataEOs)){ + paramsConfigDataEO.setId(oldConfigDataEOs.get(0).getId()); + } + } + + paramsConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId); + paramsConfigDataEO.setParamsConfigId(paramsConfigEOId); + + boolean appendFlag = false; // 拼接标识 + for (Map paramsConfigDataVO : paramsConfigDataVOList) { + String dataValue = (String) paramsConfigDataVO.get("dataValue"); + // 只要其中有一个值就可以进行拼接 + if(StringUtils.isNotEmpty(dataValue)){ + appendFlag = true; + break; + } + } + if(appendFlag){ + logCnContentSb.append(paramsConfigEO.getConfigName()).append("为"); + logEnContentSb.append(" configuration ").append(paramsConfigEO.getConfigName()).append(" as "); + } + for (Map paramsConfigDataVO : paramsConfigDataVOList) { + String type = (String) paramsConfigDataVO.get("type"); + String dataValue = (String) paramsConfigDataVO.get("dataValue"); + + if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { + paramsConfigDataEO.setTextData(dataValue); + if (StringUtils.isNotEmpty(dataValue)) { + logCnContentSb.append("\"").append(dataValue).append("\""); + logEnContentSb.append("\"").append(dataValue).append("\""); + } + + } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) + || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { + paramsConfigDataEO.setPullData(dataValue); + if (StringUtils.isNotEmpty(dataValue)) { + logCnContentSb.append("\"").append(dataValue).append("\""); + logEnContentSb.append("\"").append(dataValue).append("\""); + } + + } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { + if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件 + // 处理文件connectId + String[] fileIdList = dataValue.split(","); String connectId = UUID.randomUUID().toString().replace("-", ""); - //修改文件表关联信息connect_id - List oSSFileList = new ArrayList<>(); - for (String fileId : dataValue.split(",")) { + List updateFileList = new ArrayList<>(); + for (int i = 0; i < fileIdList.length; i++) { OSSFile ossFile = new OSSFile(); - ossFile.setId(fileId); + ossFile.setId(fileIdList[i]); ossFile.setConnectId(connectId); - oSSFileList.add(ossFile); + updateFileList.add(ossFile); } - ossFileService.updateFileInfo(oSSFileList); + ossFileService.updateBatchById(updateFileList); dataValue = connectId; + } else if (StringUtils.isNotEmpty(dataValue) && !dataValue.contains(",")) { + List ossFiles = ossFileService.getFileInfosByConnectId(dataValue); + if(CollectionUtil.isEmpty(ossFiles)){ // 新加了一个文件 + String connectId = UUID.randomUUID().toString().replace("-", ""); + //修改文件表关联信息connect_id + List oSSFileList = new ArrayList<>(); + for (String fileId : dataValue.split(",")) { + OSSFile ossFile = new OSSFile(); + ossFile.setId(fileId); + ossFile.setConnectId(connectId); + oSSFileList.add(ossFile); + } + ossFileService.updateFileInfo(oSSFileList); + dataValue = connectId; + } + } + paramsConfigDataEO.setFileConnectId(dataValue); + + List fileInfos = ossFileService.getFileInfos(dataValue); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"").append(fileNames).append("\""); + logEnContentSb.append("\"").append(fileNames).append("\""); } } - paramsConfigDataEO.setFileConnectId(dataValue); - - List fileInfos = ossFileService.getFileInfos(dataValue); - String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); - if (StringUtils.isNotEmpty(fileNames)) { - logCnContentSb.append("\"").append(fileNames).append("\""); - logEnContentSb.append("\"").append(fileNames).append("\""); - } + newConfigDataEOList.add(paramsConfigDataEO); } - } - if(appendFlag){ - logCnContentSb.append(","); - logEnContentSb.append(" and "); + if(appendFlag){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } } } - newConfigDataEOList.add(paramsConfigDataEO); } ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); @@ -1601,9 +1676,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl> configDataList, String paramsManifestId) { List newConfigDataEOList = new ArrayList<>(); - List paramsConfigEOList = paramsConfigEOService.queryList(paramsManifestId); // 查询配置列 - List paramsConfigIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList()); - List paramsConfigDataEOList = paramsConfigDataEOService.queryListByConfigIdList(paramsConfigIdList); // 查询所有配置数据 + List paramsCollectManifestIdList = new ArrayList<>(); // 处理数据 for (Map map : configDataList) { @@ -1611,7 +1684,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl entry : map.entrySet()) { - ParamsConfigDataEO paramsConfigDataEO = new ParamsConfigDataEO(); + if ("id".equals(entry.getKey())) { continue; } @@ -1620,70 +1693,82 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigDataMap = (Map) entry.getValue(); // 无法转ParamsConfigDataVO(遍历会出现该异常 : LinkedHashMap cannot be cast to ParamsConfigDataVO) - List> paramsConfigDataVOList = (List>) paramsConfigDataMap.get("list"); + // List> paramsConfigDataVOList = (List>) paramsConfigDataMap.get("list"); + Map paramsConfigDataVOMap = (Map) paramsConfigDataMap.get("paramsConfigData"); - // 判断是新增还是修改 -// ParamsConfigDataEO oldConfigDataEO = paramsConfigDataEOService.queryByConfigIdAndCollectManifestId(paramsConfigEOId, paramsCollectManifestId); - ParamsConfigDataEO oldConfigDataEO = getConfigDataEOByConfigIdAndCollectManifestId(paramsConfigEOId, paramsCollectManifestId,paramsConfigDataEOList); - if (ObjectUtil.isNotEmpty(oldConfigDataEO)) { - paramsConfigDataEO.setId(oldConfigDataEO.getId()); + for (Map.Entry configDataMap : paramsConfigDataVOMap.entrySet()) { + List> paramsConfigDataVOList = (List>)configDataMap.getValue(); + Integer orderNum = (Integer) paramsConfigDataVOList.get(0).get("orderNum"); + if (CollectionUtil.isNotEmpty(paramsConfigDataVOList)) { + ParamsConfigDataEO paramsConfigDataEO = new ParamsConfigDataEO(); - } - paramsConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId); - paramsConfigDataEO.setParamsConfigId(paramsConfigEOId); - if (CollectionUtil.isNotEmpty(paramsConfigDataVOList)) { - for (Map paramsConfigDataVO : paramsConfigDataVOList) { - String type = (String) paramsConfigDataVO.get("type"); - String dataValue = (String) paramsConfigDataVO.get("dataValue"); + for (Map paramsConfigDataVO : paramsConfigDataVOList) { - if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { - paramsConfigDataEO.setTextData(dataValue); + String type = (String) paramsConfigDataVO.get("type"); + String dataValue = (String) paramsConfigDataVO.get("dataValue"); - } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) - || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { - paramsConfigDataEO.setPullData(dataValue); + if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { + paramsConfigDataEO.setTextData(dataValue); - } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { - if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件 - // 处理文件connectId - String[] fileIdList = dataValue.split(","); - String connectId = UUID.randomUUID().toString().replace("-", ""); - List updateFileList = new ArrayList<>(); - for (int i = 0; i < fileIdList.length; i++) { - OSSFile ossFile = new OSSFile(); - ossFile.setId(fileIdList[i]); - ossFile.setConnectId(connectId); - updateFileList.add(ossFile); - } - ossFileService.updateBatchById(updateFileList); - dataValue = connectId; - } else if (StringUtils.isNotEmpty(dataValue) && !dataValue.contains(",")) { - List ossFiles = ossFileService.getFileInfosByConnectId(dataValue); - if(CollectionUtil.isEmpty(ossFiles)){ // 新加了一个文件 + } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) + || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { + paramsConfigDataEO.setPullData(dataValue); + + } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { + if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件 + // 处理文件connectId + String[] fileIdList = dataValue.split(","); String connectId = UUID.randomUUID().toString().replace("-", ""); - //修改文件表关联信息connect_id - List oSSFileList = new ArrayList<>(); - for (String fileId : dataValue.split(",")) { + List updateFileList = new ArrayList<>(); + for (int i = 0; i < fileIdList.length; i++) { OSSFile ossFile = new OSSFile(); - ossFile.setId(fileId); + ossFile.setId(fileIdList[i]); ossFile.setConnectId(connectId); - oSSFileList.add(ossFile); + updateFileList.add(ossFile); } - ossFileService.updateFileInfo(oSSFileList); + ossFileService.updateBatchById(updateFileList); dataValue = connectId; + } else if (StringUtils.isNotEmpty(dataValue) && !dataValue.contains(",")) { + List ossFiles = ossFileService.getFileInfosByConnectId(dataValue); + if(CollectionUtil.isEmpty(ossFiles)){ // 新加了一个文件 + String connectId = UUID.randomUUID().toString().replace("-", ""); + //修改文件表关联信息connect_id + List oSSFileList = new ArrayList<>(); + for (String fileId : dataValue.split(",")) { + OSSFile ossFile = new OSSFile(); + ossFile.setId(fileId); + ossFile.setConnectId(connectId); + oSSFileList.add(ossFile); + } + ossFileService.updateFileInfo(oSSFileList); + dataValue = connectId; + } } - } - paramsConfigDataEO.setFileConnectId(dataValue); + paramsConfigDataEO.setFileConnectId(dataValue); + } } + + paramsConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId); + paramsConfigDataEO.setParamsConfigId(paramsConfigEOId); + paramsConfigDataEO.setOrderNum(orderNum); + + newConfigDataEOList.add(paramsConfigDataEO); } } - newConfigDataEOList.add(paramsConfigDataEO); } + + paramsCollectManifestIdList.add(paramsCollectManifestId); + } + + if(CollectionUtils.isNotEmpty(paramsCollectManifestIdList)){ + QueryWrapper configDataRemoveWrap = new QueryWrapper<>(); + configDataRemoveWrap.lambda().in(ParamsConfigDataEO::getParamsCollectManifestId,paramsCollectManifestIdList); + this.paramsConfigDataEOService.remove(configDataRemoveWrap); } // 批量更新 - return paramsConfigDataEOService.saveOrUpdateBatch(newConfigDataEOList); + return paramsConfigDataEOService.saveBatch(newConfigDataEOList); } /** @@ -2034,35 +2119,37 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl configDataEOList = this.paramsConfigDataEOService.queryListByConfigIdAndCollectManifestId(configEO.getId(), paramsCollectManifestEO.getId()); + for (ParamsConfigDataEO configDataEO : configDataEOList) { + if(StringUtils.isNotEmpty(configDataEO.getPullData()) || StringUtils.isNotEmpty(configDataEO.getTextData()) || StringUtils.isNotEmpty(configDataEO.getFileConnectId())){ + logCnContentSb.append(configEO.getConfigName()); + logCnContentSb.append(" 的"); - if(StringUtils.isNotEmpty(configDataEO.getPullData()) || StringUtils.isNotEmpty(configDataEO.getTextData()) || StringUtils.isNotEmpty(configDataEO.getFileConnectId())){ - logCnContentSb.append(configEO.getConfigName()); - logCnContentSb.append(" 的"); - - if(StringUtils.isNotEmpty(configDataEO.getPullData())){ - logCnContentSb.append("\"" +configDataEO.getPullData()+ "\""); - logEnContentSb.append("\"" +configDataEO.getPullData()+ "\""); - } - if(StringUtils.isNotEmpty(configDataEO.getTextData())){ - logCnContentSb.append("\"" +configDataEO.getTextData()+ "\""); - logEnContentSb.append("\"" +configDataEO.getTextData()+ "\""); - } - if(StringUtils.isNotEmpty(configDataEO.getFileConnectId())){ - List fileInfos = ossFileService.getFileInfos(configDataEO.getFileConnectId()); - String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); - if (StringUtils.isNotEmpty(fileNames)) { - logCnContentSb.append("\"" +fileNames+ "\""); - logEnContentSb.append("\"" +fileNames+ "\""); + if(StringUtils.isNotEmpty(configDataEO.getPullData())){ + logCnContentSb.append("\"" +configDataEO.getPullData()+ "\""); + logEnContentSb.append("\"" +configDataEO.getPullData()+ "\""); + } + if(StringUtils.isNotEmpty(configDataEO.getTextData())){ + logCnContentSb.append("\"" +configDataEO.getTextData()+ "\""); + logEnContentSb.append("\"" +configDataEO.getTextData()+ "\""); + } + if(StringUtils.isNotEmpty(configDataEO.getFileConnectId())){ + List fileInfos = ossFileService.getFileInfos(configDataEO.getFileConnectId()); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"" +fileNames+ "\""); + logEnContentSb.append("\"" +fileNames+ "\""); + } } - } - logEnContentSb.append(" of configuration " +configEO.getConfigName()+ ""); + logEnContentSb.append(" of configuration " +configEO.getConfigName()+ ""); - // 如果配置有两条或两条以上,并且不是最后一次循环 - if(paramsConfigEOList.size() > 1 && paramsConfigLenth != paramsConfigEOList.size()){ - logCnContentSb.append(","); - logEnContentSb.append(" and "); + // 如果配置有两条或两条以上,并且不是最后一次循环 + if(paramsConfigEOList.size() > 1 && paramsConfigLenth != paramsConfigEOList.size()){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } } } @@ -2970,45 +3057,89 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl updateConfigDataEOList = new ArrayList<>(); List addConfigDataEOList = new ArrayList<>(); for (int i=0; i sourceConfigDataEOList = this.paramsConfigDataEOService.queryListByConfigIdAndCollectManifestId(sourceConfigId, paramsCollectManifestIdStr[i]); + if(CollectionUtils.isNotEmpty(sourceConfigDataEOList)){ + for (ParamsConfigDataEO sourceConfigDataEO : sourceConfigDataEOList) { + if (ObjectUtil.isNotEmpty(sourceConfigDataEO)) { + for (int j = 0; j < targetConfigIdStr.length; j++) { + // 根据配置id、参数清单id,将被引用参数列的数据删掉,重新加 + QueryWrapper targetConfigDataRemoveWrap = new QueryWrapper<>(); + targetConfigDataRemoveWrap.lambda().eq(ParamsConfigDataEO::getParamsConfigId,targetConfigIdStr[j]); + targetConfigDataRemoveWrap.lambda().eq(ParamsConfigDataEO::getParamsCollectManifestId,paramsCollectManifestIdStr[i]); + this.paramsConfigDataEOService.remove(targetConfigDataRemoveWrap); + + ParamsConfigDataEO targetConfigDataEO = new ParamsConfigDataEO(); + BeanUtils.copyProperties(sourceConfigDataEO,targetConfigDataEO); + targetConfigDataEO.setId(null); + targetConfigDataEO.setParamsConfigId(targetConfigIdStr[j]); + targetConfigDataEO.setParamsCollectManifestId(paramsCollectManifestIdStr[i]); + addConfigDataEOList.add(targetConfigDataEO); + + /* ParamsConfigDataEO targetConfigDataEO = paramsConfigDataEOService.queryByConfigIdAndCollectManifestId(targetConfigIdStr[j], paramsCollectManifestIdStr[i]); + List targetConfigDataEOList = this.paramsConfigDataEOService.queryListByConfigIdAndCollectManifestId(targetConfigIdStr[j], paramsCollectManifestIdStr[i]); + if(CollectionUtils.isNotEmpty(targetConfigDataEOList)){ + for (ParamsConfigDataEO targetConfigDataEO : targetConfigDataEOList) { + if (ObjectUtil.isNotEmpty(targetConfigDataEO)) { + ParamsConfigDataEO updateConfigDataEO = new ParamsConfigDataEO(); + updateConfigDataEO.setId(targetConfigDataEO.getId()); + updateConfigDataEO.setTextData(sourceConfigDataEO.getTextData()); + updateConfigDataEO.setPullData(sourceConfigDataEO.getPullData()); + updateConfigDataEO.setFileConnectId(sourceConfigDataEO.getFileConnectId()); + updateConfigDataEOList.add(updateConfigDataEO); + } else { + ParamsConfigDataEO addConfigDataEO = new ParamsConfigDataEO(); + addConfigDataEO.setParamsConfigId(targetConfigIdStr[j]); + addConfigDataEO.setParamsCollectManifestId(paramsCollectManifestIdStr[i]); + addConfigDataEO.setTextData(sourceConfigDataEO.getTextData()); + addConfigDataEO.setPullData(sourceConfigDataEO.getPullData()); + addConfigDataEO.setFileConnectId(sourceConfigDataEO.getFileConnectId()); + addConfigDataEOList.add(addConfigDataEO); + } + } + } + if (ObjectUtil.isNotEmpty(targetConfigDataEO)) { + ParamsConfigDataEO updateConfigDataEO = new ParamsConfigDataEO(); + updateConfigDataEO.setId(targetConfigDataEO.getId()); + updateConfigDataEO.setTextData(sourceConfigDataEO.getTextData()); + updateConfigDataEO.setPullData(sourceConfigDataEO.getPullData()); + updateConfigDataEO.setFileConnectId(sourceConfigDataEO.getFileConnectId()); + updateConfigDataEOList.add(updateConfigDataEO); + } else { + ParamsConfigDataEO addConfigDataEO = new ParamsConfigDataEO(); + addConfigDataEO.setParamsConfigId(targetConfigIdStr[j]); + addConfigDataEO.setParamsCollectManifestId(paramsCollectManifestIdStr[i]); + addConfigDataEO.setTextData(sourceConfigDataEO.getTextData()); + addConfigDataEO.setPullData(sourceConfigDataEO.getPullData()); + addConfigDataEO.setFileConnectId(sourceConfigDataEO.getFileConnectId()); + addConfigDataEOList.add(addConfigDataEO); + }*/ + } } } } else { // 清空引用到的配置的数据 for (int j = 0; j < targetConfigIdStr.length; j++) { - ParamsConfigDataEO targetConfigDataEO = paramsConfigDataEOService.queryByConfigIdAndCollectManifestId(targetConfigIdStr[j], paramsCollectManifestIdStr[i]); - if (ObjectUtil.isNotEmpty(targetConfigDataEO)) { - ParamsConfigDataEO updateConfigDataEO = new ParamsConfigDataEO(); - updateConfigDataEO.setId(targetConfigDataEO.getId()); - updateConfigDataEO.setTextData(null); - updateConfigDataEO.setPullData(null); - updateConfigDataEO.setFileConnectId(null); - updateConfigDataEOList.add(updateConfigDataEO); + // ParamsConfigDataEO targetConfigDataEO = paramsConfigDataEOService.queryByConfigIdAndCollectManifestId(targetConfigIdStr[j], paramsCollectManifestIdStr[i]); + List targetConfigDataEOList = this.paramsConfigDataEOService.queryListByConfigIdAndCollectManifestId(targetConfigIdStr[j], paramsCollectManifestIdStr[i]); + if(CollectionUtils.isNotEmpty(targetConfigDataEOList)){ + for (ParamsConfigDataEO targetConfigDataEO : targetConfigDataEOList) { + if (ObjectUtil.isNotEmpty(targetConfigDataEO)) { + ParamsConfigDataEO updateConfigDataEO = new ParamsConfigDataEO(); + updateConfigDataEO.setId(targetConfigDataEO.getId()); + updateConfigDataEO.setTextData(null); + updateConfigDataEO.setPullData(null); + updateConfigDataEO.setFileConnectId(null); + updateConfigDataEOList.add(updateConfigDataEO); + } + } } } } } paramsConfigDataEOService.saveBatch(addConfigDataEOList); - paramsConfigDataEOService.updateBatchById(updateConfigDataEOList); +// paramsConfigDataEOService.updateBatchById(updateConfigDataEOList); return true; } @@ -3081,42 +3212,44 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl configDataEOList = this.paramsConfigDataEOService.queryListByConfigIdAndCollectManifestId(configEO.getId(), collectManifestEO.getId()); + for (ParamsConfigDataEO configDataEO : configDataEOList) { + ParamsReportConfigDataEO addReportConfigDataEO = new ParamsReportConfigDataEO(); + BeanUtils.copyProperties(configDataEO, addReportConfigDataEO); + addReportConfigDataEO.setId(UUID.randomUUID().toString().replace("-","")); + addReportConfigDataEO.setParamsConfigId(configIdMap.get(configEO.getId())); + addReportConfigDataEO.setParamsCollectManifestId(reportDetailId); + addReportConfigDataEOList.add(addReportConfigDataEO); - ParamsReportConfigDataEO addReportConfigDataEO = new ParamsReportConfigDataEO(); - BeanUtils.copyProperties(configDataEO, addReportConfigDataEO); - addReportConfigDataEO.setId(UUID.randomUUID().toString().replace("-","")); - addReportConfigDataEO.setParamsConfigId(configIdMap.get(configEO.getId())); - addReportConfigDataEO.setParamsCollectManifestId(reportDetailId); - addReportConfigDataEOList.add(addReportConfigDataEO); + if(StringUtils.isNotEmpty(configDataEO.getPullData()) || StringUtils.isNotEmpty(configDataEO.getTextData()) || StringUtils.isNotEmpty(configDataEO.getFileConnectId())){ + logCnContentSb.append(configEO.getConfigName()); + logCnContentSb.append(" 的"); - if(StringUtils.isNotEmpty(configDataEO.getPullData()) || StringUtils.isNotEmpty(configDataEO.getTextData()) || StringUtils.isNotEmpty(configDataEO.getFileConnectId())){ - logCnContentSb.append(configEO.getConfigName()); - logCnContentSb.append(" 的"); - - if(StringUtils.isNotEmpty(configDataEO.getPullData())){ - logCnContentSb.append("\"" +configDataEO.getPullData()+ "\""); - logEnContentSb.append("\"" +configDataEO.getPullData()+ "\""); - } - if(StringUtils.isNotEmpty(configDataEO.getTextData())){ - logCnContentSb.append("\"" +configDataEO.getTextData()+ "\""); - logEnContentSb.append("\"" +configDataEO.getTextData()+ "\""); - } - if(StringUtils.isNotEmpty(configDataEO.getFileConnectId())){ - List fileInfos = ossFileService.getFileInfos(configDataEO.getFileConnectId()); - String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); - if (StringUtils.isNotEmpty(fileNames)) { - logCnContentSb.append("\"" +fileNames+ "\""); - logEnContentSb.append("\"" +fileNames+ "\""); + if(StringUtils.isNotEmpty(configDataEO.getPullData())){ + logCnContentSb.append("\"" +configDataEO.getPullData()+ "\""); + logEnContentSb.append("\"" +configDataEO.getPullData()+ "\""); + } + if(StringUtils.isNotEmpty(configDataEO.getTextData())){ + logCnContentSb.append("\"" +configDataEO.getTextData()+ "\""); + logEnContentSb.append("\"" +configDataEO.getTextData()+ "\""); + } + if(StringUtils.isNotEmpty(configDataEO.getFileConnectId())){ + List fileInfos = ossFileService.getFileInfos(configDataEO.getFileConnectId()); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"" +fileNames+ "\""); + logEnContentSb.append("\"" +fileNames+ "\""); + } } - } - logEnContentSb.append("of configuration " +configEO.getConfigName()+ ""); + logEnContentSb.append("of configuration " +configEO.getConfigName()+ ""); - // 如果配置有两条或两条以上,并且不是最后一次循环 - if(paramsConfigEOList.size() > 1 && paramsConfigLenth != paramsConfigEOList.size()){ - logCnContentSb.append(","); - logEnContentSb.append(" and "); + // 如果配置有两条或两条以上,并且不是最后一次循环 + if(paramsConfigEOList.size() > 1 && paramsConfigLenth != paramsConfigEOList.size()){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } } } @@ -3797,6 +3930,12 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl nowFileList = FileUnZip.readFileByFilename(unzipfilepath, importDto.getFileConnectId(), null, null, null, null, null); @@ -4338,12 +4477,58 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList()); List paramsConfigDataEOList = paramsConfigDataEOService.queryListByConfigIdList(paramsConfigIdList); // 查询所有配置数据 + List exportDataList = new ArrayList<>(); + // 配置列多行数据处理 + for (ParamsCollectManifestEO collectManifestEO : dataList) { + String id = collectManifestEO.getId(); + + Map> paramsConfigDataMap = paramsConfigDataEOList.stream().filter(configDataEO -> { + boolean flag = false; + if (StringUtils.equals(configDataEO.getParamsCollectManifestId(), id)) { + flag = true; + } + return flag; + }).collect(Collectors.groupingBy(configDataEO -> configDataEO.getParamsConfigId())); + + List> paramsConfigDataCountList = new ArrayList<>(); + + for (Map.Entry> map : paramsConfigDataMap.entrySet()) { + Map paramsConfigDataCountMap = new HashMap<>(); + paramsConfigDataCountMap.put("key",map.getKey()); + paramsConfigDataCountMap.put("paramsConfigDataCount",map.getValue().size()); + paramsConfigDataCountMap.put("value",map.getValue()); + paramsConfigDataCountList.add(paramsConfigDataCountMap); + } + + // 排序 配置数据总数倒序排序 + Collections.sort(paramsConfigDataCountList, new Comparator>() { + @Override + public int compare(Map o1, Map o2) { + return o2.get("paramsConfigDataCount").toString().compareTo(o1.get("paramsConfigDataCount").toString()); + } + }); + + // 获取出最多行的配置列。 + if(!paramsConfigDataCountList.isEmpty()){ + Map paramsConfigDataMaxCountMap = paramsConfigDataCountList.get(0); + String key = (String) paramsConfigDataMaxCountMap.get("key"); + List paramsConfigDataEOs = paramsConfigDataMap.get(key); + for (ParamsConfigDataEO paramsConfigDataEO : paramsConfigDataEOs) { + ParamsCollectManifestEO paramsCollectManifestEOTemp = new ParamsCollectManifestEO(); + BeanUtils.copyProperties(collectManifestEO,paramsCollectManifestEOTemp); + exportDataList.add(paramsCollectManifestEOTemp); + } + } else { + exportDataList.add(collectManifestEO); + } + } + Map isMustMap = ParamsIsMustEnum.toMapForExport(cut); Map controlVerifyMap = ControlVerifyEnum.toMapForExport(cut); Map controlTypeMap = ControlTypeEnum.toMapForExport(cut); // 插入配置列和认证类别列数据 List> result = new ArrayList<>(); - for (ParamsCollectManifestEO collectManifestEO: dataList) { + /*for (ParamsCollectManifestEO collectManifestEO: exportDataList) { Map record1 = objectToMapDre(collectManifestEO); String controlType = (String) record1.get("control_type"); String controlVerify = (String) record1.get("control_verify"); @@ -4496,6 +4681,169 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl record1 = objectToMapDre(collectManifestEO); + String controlType = (String) record1.get("control_type"); + String controlVerify = (String) record1.get("control_verify"); + String isMust = (String) record1.get("is_must"); + String paramsCollectManifestId = (String) record1.get("id"); + String nioNumber = (String) record1.get("nio_number"); + + record1.put("is_must", isMustMap.get(isMust)); + record1.put("control_type", controlTypeMap.get(controlType)); + record1.put("control_verify", controlVerifyMap.get(controlVerify)); + + // 处理参考列,没引用过则不显示该列 + if (StringUtils.isNotEmpty(paramsManifestEO.getReferencesColName()) && StringUtils.isNotEmpty(collectManifestEO.getReferencesCol())) { + List referencesColList = Arrays.asList(collectManifestEO.getReferencesCol().split("#")); + StringBuilder referencesColBuilder = new StringBuilder(); + if (!" ".equals(referencesColList.get(0))) { + referencesColBuilder.append(referencesColList.get(0)).append("#"); + } + if (!" ".equals(referencesColList.get(1))) { + referencesColBuilder.append(referencesColList.get(1).replaceAll(",", "!")).append("#"); + } + if (!" ".equals(referencesColList.get(2))) { + List ossFileList = ossFileService.getFileInfosByConnectId(referencesColList.get(2)); + if (CollectionUtil.isNotEmpty(ossFileList)) { + referencesColBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName()).append("#"); + } + } + + String referencesCol = referencesColBuilder.toString(); + if (referencesCol.endsWith("#")) { + referencesCol = referencesCol.substring(0, referencesCol.lastIndexOf("#")); + } + record1.put("references_col", referencesCol); + + } else { + record1.remove("references_col"); + } + // 配置列 + if (CollectionUtil.isNotEmpty(paramsConfigEOList)) { + List fileList = new ArrayList<>(); + + paramsConfigEOList.forEach(paramsConfigEO -> { // 参数配置 + + String paramsConfigId = paramsConfigEO.getId(); + // 参数配置数据 + List paramsConfigDataEOS = paramsConfigDataEOList.stream().filter(e-> { + boolean flag = false; + // && StringUtils.equals(e.getId(),paramsConfigDataId) + if(paramsConfigId.equals(e.getParamsConfigId()) && paramsCollectManifestId.equals(e.getParamsCollectManifestId())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据 + if (CollectionUtil.isNotEmpty(paramsConfigDataEOS)) { + ParamsConfigDataEO paramsConfigDataEO = paramsConfigDataEOS.get(0); + + if (ControlTypeEnum.TEXT.getValue().equals(controlType)) { + if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) { + configDataBuilder.append(paramsConfigDataEO.getTextData()); + } + + } else if (ControlTypeEnum.PULL_SINGLE.getValue().equals(controlType) + || ControlTypeEnum.PULL_MORE.getValue().equals(controlType)) { + if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) { + configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", "!")); + } + + } else if (ControlTypeEnum.FILE.getValue().equals(controlType)) { + if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) { + List ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId()); + if (CollectionUtil.isNotEmpty(ossFileList)) { + configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName()); + + fileList.addAll(ossFileList); + } + + } + + } else if (ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType) + || ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)) { + + if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) { + configDataBuilder.append(paramsConfigDataEO.getTextData()); + } + + configDataBuilder.append("#"); + + if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) { + configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", "!")); + } + + } else if (ControlTypeEnum.TEXT_FILE.getValue().equals(controlType)) { + if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) { + configDataBuilder.append(paramsConfigDataEO.getTextData()); + } + + configDataBuilder.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()); + + fileList.addAll(ossFileList); + } + + } + + } else if (ControlTypeEnum.PULL_SINGLE_FILE.getValue().equals(controlType) + || ControlTypeEnum.PULL_MORE_FILE.getValue().equals(controlType)) { + if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) { + configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", "!")); + } + + configDataBuilder.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()); + + fileList.addAll(ossFileList); + } + + } + + } else if (ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) { + if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) { + configDataBuilder.append(paramsConfigDataEO.getTextData()); + } + configDataBuilder.append("#"); + if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) { + configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", "!")); + } + configDataBuilder.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()); + + fileList.addAll(ossFileList); + } + + } + + } + paramsConfigDataEOList.remove(paramsConfigDataEO); + } + + String configData = configDataBuilder.toString(); + if (StringUtils.isNotEmpty(configData) && "".equals(configData.replace("#", ""))) { + configData = configData.replace("#", ""); + } + + record1.put(paramsConfigEO.getId(), configData); + }); + + record1.put("fileList", fileList); + } + result.add(record1); } return result; @@ -4941,7 +5289,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl 0) { @@ -5743,14 +6094,18 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl + if(StringUtils.isNotEmpty(referencesColBuilder.toString())){ + referencesColBuilder.append("
"); + } if (StringUtils.isNotEmpty(paramsReportConfigDataEO.getTextData())) { referencesColBuilder.append(paramsReportConfigDataEO.getTextData()).append("#"); } else { @@ -5769,19 +6124,20 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl manifestUpdateWrap = new LambdaUpdateWrapper<>(); @@ -5817,19 +6173,27 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl map : configDataList) { String paramsCollectManifestId = (String) map.get("id"); + StringBuilder referncesColBuilder = new StringBuilder(); + // 添加配置数据 for (Map.Entry entry : map.entrySet()) { - StringBuilder referncesColBuilder = new StringBuilder(); + if ("id".equals(entry.getKey())) { continue; } // 取值 - Map paramsConfigDataMap = (Map) entry.getValue(); - String controlType = (String) paramsConfigDataMap.get("controlType"); +// Map paramsConfigDataMap = (Map) entry.getValue(); +// String controlType = (String) paramsConfigDataMap.get("controlType"); // 无法转ParamsConfigDataVO(遍历会出现该异常 : LinkedHashMap cannot be cast to ParamsConfigDataVO) - List> paramsConfigDataVOList = (List>) paramsConfigDataMap.get("list"); + List> paramsConfigDataVOList = (List>) entry.getValue(); if (CollectionUtil.isNotEmpty(paramsConfigDataVOList)) { + + // 如果拼接不为空 则是匹配到了多个 拼接换行符
+ if(StringUtils.isNotEmpty(referncesColBuilder.toString())){ + referncesColBuilder.append("
"); + } + // TEXT List> textList = paramsConfigDataVOList.stream() .filter(e->e.get("type").equals(ConfigDataTypeEnum.TEXT.getValue())).collect(Collectors.toList()); @@ -5904,16 +6268,15 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl queryListByConfigIdAndCollectManifestId(String paramsConfigId, String paramsCollectManifestId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ParamsConfigDataEO::getParamsConfigId, paramsConfigId); + queryWrapper.eq(ParamsConfigDataEO::getParamsCollectManifestId, paramsCollectManifestId); + return this.list(queryWrapper); + } + /** * 列表查询 * diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java index 49f65e2d7..f50b53ad1 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java @@ -43,6 +43,7 @@ import com.jero.modules.system.enums.DicCodeEnum; import com.jero.modules.system.mapper.SysDictMapper; import com.jero.modules.system.service.ISysDictService; import com.jero.modules.system.service.ISysUserService; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -700,23 +701,27 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl configDataEOList = this.paramsConfigDataEOService.queryListByConfigIdAndCollectManifestId(configEO.getId(), collectManifestEO.getId()); + if(CollectionUtils.isNotEmpty(configDataEOList)){ + for (ParamsConfigDataEO configDataEO : configDataEOList) { + ParamsConfigDataEO addConfigDataEO = new ParamsConfigDataEO(); + if (ObjectUtil.isNotEmpty(configDataEO)) { + BeanUtils.copyProperties(configDataEO, addConfigDataEO); - addConfigDataEO.setId(null); - addConfigDataEO.setCreateBy(null); - addConfigDataEO.setCreateTime(null); - addConfigDataEO.setUpdateBy(null); - addConfigDataEO.setUpdateTime(null); - addConfigDataEO.setSysOrgCode(null); - addConfigDataEO.setParamsConfigId(configIdMap.get(configEO.getId())); - addConfigDataEO.setParamsCollectManifestId(addCollectManifestId); - addConfigDataEOList.add(addConfigDataEO); + addConfigDataEO.setId(null); + addConfigDataEO.setCreateBy(null); + addConfigDataEO.setCreateTime(null); + addConfigDataEO.setUpdateBy(null); + addConfigDataEO.setUpdateTime(null); + addConfigDataEO.setSysOrgCode(null); + addConfigDataEO.setParamsConfigId(configIdMap.get(configEO.getId())); + addConfigDataEO.setParamsCollectManifestId(addCollectManifestId); + addConfigDataEOList.add(addConfigDataEO); + } + } } - } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/IParamsReportConfigDataEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/IParamsReportConfigDataEOService.java index e4b308c54..94b9c8c6c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/IParamsReportConfigDataEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/IParamsReportConfigDataEOService.java @@ -22,6 +22,8 @@ public interface IParamsReportConfigDataEOService extends IService queryListByConfigIdAndCollectManifestId(String paramsConfigId, String paramsCollectManifestId); + List queryByConfigIdListAndCollectManifestId(List paramsConfigIdList, String paramsCollectManifestId); /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportConfigDataEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportConfigDataEOServiceImpl.java index 5396e71ab..7168c6649 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportConfigDataEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportConfigDataEOServiceImpl.java @@ -35,6 +35,22 @@ public class ParamsReportConfigDataEOServiceImpl extends ServiceImpl queryListByConfigIdAndCollectManifestId(String paramsConfigId, String paramsCollectManifestId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ParamsReportConfigDataEO::getParamsConfigId, paramsConfigId); + queryWrapper.eq(ParamsReportConfigDataEO::getParamsCollectManifestId, paramsCollectManifestId); + queryWrapper.orderByDesc(ParamsReportConfigDataEO::getOrderNum); + return this.list(queryWrapper); + } + @Override public List queryByConfigIdListAndCollectManifestId(List paramsConfigIdList, String paramsCollectManifestId) { return baseMapper.selectByConfigIdListAndCollectManifestId(paramsConfigIdList, paramsCollectManifestId); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportDetailEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportDetailEOServiceImpl.java index ef6bee45a..5917edce8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportDetailEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportDetailEOServiceImpl.java @@ -210,12 +210,38 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl { // 参数配置 - Map configMap = new HashMap<>(); + /*Map configMap = new HashMap<>(); String paramsConfigId = paramsConfigEO.getId(); ParamsReportConfigDataEO paramsConfigDataEO = paramsReportConfigDataEOService.queryByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId); // 参数配置数据 List paramsConfigDataVOList = getConfigDataVOList(controlType, paramsConfigEO, paramsConfigDataEO, collectManifestEO); // 重新组合配置数据 configMap.put("controlType", controlType); configMap.put("list", paramsConfigDataVOList); + manifestMap.put(paramsConfigEO.getId(), configMap);*/ + + Map paramsConfigDataVO = new HashMap<>(); + Map configMap = new HashMap<>(); + + String paramsConfigId = paramsConfigEO.getId(); + List paramsConfigDataEOList = this.paramsReportConfigDataEOService.queryListByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId); // 参数配置数据 + if(CollectionUtils.isNotEmpty(paramsConfigDataEOList)){ + // 匿名比较器排序 + Collections.sort(paramsConfigDataEOList, new Comparator() { + @Override + public int compare(ParamsReportConfigDataEO p1, ParamsReportConfigDataEO p2) { + if(p2.getOrderNum() == null || p1.getOrderNum() == null){ + return 0; + } + return p1.getOrderNum().compareTo(p2.getOrderNum()); + } + }); + for (ParamsReportConfigDataEO paramsConfigDataEO : paramsConfigDataEOList) { + List paramsConfigDataVOList = this.getConfigDataVOList(controlType, paramsConfigEO, paramsConfigDataEO, collectManifestEO); // 重新组合配置数据 + paramsConfigDataVO.put(paramsConfigDataEO.getId(),paramsConfigDataVOList); + } + } + + configMap.put("paramsConfigData", paramsConfigDataVO); + configMap.put("controlType", controlType); manifestMap.put(paramsConfigEO.getId(), configMap); configIdList.add(paramsConfigEO.getId()); @@ -1319,42 +1345,57 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId()); - if (CollectionUtil.isNotEmpty(ossFileList)) { - // 不合并导出时 验证文件名是否相同,相同进一步验证文件内容是否相同,不同时重命名文件 - String fileName = ossFileList.get(0).getFileName(); - String newFileName = isRepeat(fileListAll, ossFileList.get(0)); - if (!"".equals(newFileName) && !"old".equals(newFileName)) { // 文件名称重复 且文件内容不同 - configDataBuilder.append(newFileName).append("#"); - ossFileList.get(0).setFileName(newFileName); - fileList.addAll(ossFileList); - fileListAll.addAll(ossFileList); - } else if ("old".equals(newFileName)) { // 文件名称重复 且文件内容相同 - configDataBuilder.append(fileName).append("#"); - fileList.addAll(ossFileList); - }else { - configDataBuilder.append(fileName).append("#"); - fileList.addAll(ossFileList); - fileListAll.addAll(ossFileList); + String paramsConfigId = paramsConfigEO.getId(); + List paramsConfigDataEOList = this.paramsReportConfigDataEOService.queryListByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId); // 参数配置数据 + StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据 + if(CollectionUtils.isNotEmpty(paramsConfigDataEOList)){ + for (ParamsReportConfigDataEO paramsConfigDataEO : paramsConfigDataEOList) { + + StringBuilder configDataBuilderTemp = new StringBuilder(); // 重新组合配置数据 + + if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) { + configDataBuilderTemp.append(paramsConfigDataEO.getPullData()).append("#"); + } + if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) { + configDataBuilderTemp.append(paramsConfigDataEO.getTextData()).append("#"); + } + if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) { + List ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId()); + if (CollectionUtil.isNotEmpty(ossFileList)) { + // 不合并导出时 验证文件名是否相同,相同进一步验证文件内容是否相同,不同时重命名文件 + String fileName = ossFileList.get(0).getFileName(); + String newFileName = isRepeat(fileListAll, ossFileList.get(0)); + if (!"".equals(newFileName) && !"old".equals(newFileName)) { // 文件名称重复 且文件内容不同 + configDataBuilderTemp.append(newFileName).append("#"); + ossFileList.get(0).setFileName(newFileName); + fileList.addAll(ossFileList); + fileListAll.addAll(ossFileList); + + } else if ("old".equals(newFileName)) { // 文件名称重复 且文件内容相同 + configDataBuilderTemp.append(fileName).append("#"); + fileList.addAll(ossFileList); + } else { + configDataBuilderTemp.append(fileName).append("#"); + fileList.addAll(ossFileList); + fileListAll.addAll(ossFileList); + } + } } + String configData = configDataBuilderTemp.toString(); + if (configData.contains("#")) { + configData = configData.substring(0, configData.lastIndexOf("#")); + } + + configDataBuilder.append(configData).append(paramsReportDetailVO.getSeparator()); } } + String configData = configDataBuilder.toString(); - if (configData.contains("#")) { - configData = configData.substring(0, configData.lastIndexOf("#")); + if (configData.contains(paramsReportDetailVO.getSeparator())) { + configData = configData.substring(0, configData.lastIndexOf(paramsReportDetailVO.getSeparator())); } record1.put(paramsConfigEO.getId(), configData); @@ -1368,66 +1409,53 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl paramsReportConfigDataEOS = paramsReportConfigDataEOService.queryByConfigIdListAndCollectManifestId(configIdList, paramsCollectManifestId); - String textDatas = paramsReportConfigDataEOS.stream().filter(e -> StringUtils.isNotEmpty(e.getTextData())) - .map(ParamsReportConfigDataEO::getTextData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator())); + StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据 - String pullDatas = paramsReportConfigDataEOS.stream().filter(e -> StringUtils.isNotEmpty(e.getPullData())) - .map(ParamsReportConfigDataEO::getPullData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator())); + for (ParamsReportConfigDataEO paramsConfigDataEO : paramsReportConfigDataEOS) { + StringBuilder configDataBuilderTemp = new StringBuilder(); // 重新组合配置数据 - List fileNameList = new ArrayList<>(); - for(ParamsReportConfigDataEO paramsReportConfigDataEO : paramsReportConfigDataEOS) { - if (StringUtils.isNotEmpty(paramsReportConfigDataEO.getFileConnectId())) { - List ossFileList = ossFileService.getFileInfosByConnectId(paramsReportConfigDataEO.getFileConnectId()); + if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) { + configDataBuilderTemp.append(paramsConfigDataEO.getPullData()).append("#"); + } + if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) { + configDataBuilderTemp.append(paramsConfigDataEO.getTextData()).append("#"); + } + if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) { + List ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId()); if (CollectionUtil.isNotEmpty(ossFileList)) { - // 合并导出时 验证文件名是否相同,相同进一步验证文件内容是否形同,不同时重命名文件 + // 不合并导出时 验证文件名是否相同,相同进一步验证文件内容是否相同,不同时重命名文件 String fileName = ossFileList.get(0).getFileName(); String newFileName = isRepeat(fileListAll, ossFileList.get(0)); if (!"".equals(newFileName) && !"old".equals(newFileName)) { // 文件名称重复 且文件内容不同 - // 判断 新文件名是不是当前参数下 配置间的 重复 - int count = (int) fileList.stream().filter(e->newFileName.equals(e.getFileName())).count(); - if (count <= 0) { // 不是 (如果是,不做任何操作) - fileNameList.add(newFileName); - ossFileList.get(0).setFileName(newFileName); - fileList.addAll(ossFileList); - fileListAll.addAll(ossFileList); - } + configDataBuilderTemp.append(newFileName).append("#"); + ossFileList.get(0).setFileName(newFileName); + fileList.addAll(ossFileList); + fileListAll.addAll(ossFileList); } else if ("old".equals(newFileName)) { // 文件名称重复 且文件内容相同 - - // 判断这种重复是不是当前参数下 配置间的 - int count = (int) fileList.stream().filter(e->fileName.equals(e.getFileName())).count(); - if (count <= 0) { // 不是 (如果是,不做任何操作) - fileNameList.add(fileName); - fileList.addAll(ossFileList); - fileListAll.addAll(ossFileList); - } - - }else { // 文件名称不重复 - fileNameList.add(fileName); + configDataBuilderTemp.append(fileName).append("#"); + fileList.addAll(ossFileList); + } else { + configDataBuilderTemp.append(fileName).append("#"); fileList.addAll(ossFileList); fileListAll.addAll(ossFileList); } - } } + + configData = configDataBuilderTemp.toString(); + if (configData.contains("#")) { + configData = configData.substring(0, configData.lastIndexOf("#")); + } + + configDataBuilder.append(configData).append(paramsReportDetailVO.getSeparator()); } - StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据 - if (StringUtils.isNotEmpty(pullDatas)) { - configDataBuilder.append(pullDatas).append("#"); + String configDataStr = configDataBuilder.toString(); + if (configDataStr.contains(paramsReportDetailVO.getSeparator())) { + configDataStr = configDataStr.substring(0, configDataStr.lastIndexOf(paramsReportDetailVO.getSeparator())); } - if (StringUtils.isNotEmpty(textDatas)) { - configDataBuilder.append(textDatas).append("#"); - } - if (CollectionUtil.isNotEmpty(fileNameList)) { -// fileNameList = fileNameList.stream().distinct().collect(Collectors.toList()); - configDataBuilder.append(StringUtils.join(fileNameList, paramsReportDetailVO.getSeparator())).append("#"); - } - configData = configDataBuilder.toString(); - if (configData.contains("#")) { - configData = configData.substring(0, configData.lastIndexOf("#")); - } - record1.put("params_value", configData); + record1.put("params_value", configDataStr); } } @@ -1473,6 +1501,18 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl paramsReportConfigDataEOS = paramsReportConfigDataEOService.queryByConfigIdListAndCollectManifestId(configIdList, paramsCollectManifestId); + // 匿名比较器排序 + Collections.sort(paramsReportConfigDataEOS, new Comparator() { + @Override + public int compare(ParamsReportConfigDataEO p1, ParamsReportConfigDataEO p2) { + if(p2.getOrderNum() == null || p1.getOrderNum() == null){ + return 0; + } + // 倒序 + return p2.getOrderNum().compareTo(p1.getOrderNum()); + } + }); + String textDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getTextData())) .map(ParamsReportConfigDataEO::getTextData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator())); // 整合文本数据 @@ -1777,13 +1817,12 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl paramsReportConfigDataMap = (Map) entry.getValue(); // 无法转ParamsConfigDataVO(遍历会出现该异常 : LinkedHashMap cannot be cast to ParamsConfigDataVO) - List> configDataVOList = (List>) paramsReportConfigDataMap.get("list"); + // List> configDataVOList = (List>) paramsReportConfigDataMap.get("list"); // 判断是新增还是修改 ParamsConfigDataEO oldConfigDataEO = getConfigDataEOByConfigIdAndCollectManifestId(paramsReportConfigEOId, paramsCollectManifestId, paramsReportConfigDataEOList); @@ -1795,117 +1834,193 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl paramsConfigDataVOMap = (Map) paramsReportConfigDataMap.get("paramsConfigData"); - paramsReportConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId); - paramsReportConfigDataEO.setParamsConfigId(paramsReportConfigEOId); - if (CollectionUtil.isNotEmpty(configDataVOList)) { - for (Map paramsConfigDataVO : configDataVOList) { - String type = (String) paramsConfigDataVO.get("type"); - String dataValue = (String) paramsConfigDataVO.get("dataValue"); + for (Map.Entry paramsConfigDataMap : paramsConfigDataVOMap.entrySet()) { + String configDataId = paramsConfigDataMap.getKey(); + List> configDataVOList = (List>) paramsConfigDataMap.getValue(); - if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { - paramsReportConfigDataEO.setTextData(dataValue); - if (StringUtils.isEmpty(oldConfigDataEO.getTextData()) && StringUtils.isNotEmpty(dataValue)) { - logCnContent.append("\"").append("空").append("\"").append("改为").append("\"").append(dataValue).append("\"").append(","); - logEnContent.append(" from ").append("\"").append("Null").append("\"").append(" to ").append("\"").append(dataValue).append("\"").append(", "); + if (CollectionUtil.isNotEmpty(configDataVOList)) { + Integer orderNum = (Integer) configDataVOList.get(0).get("orderNum"); - changeFlag = true; - } else if (StringUtils.isNotEmpty(oldConfigDataEO.getTextData()) && StringUtils.isEmpty(dataValue)) { - logCnContent.append("\"").append(oldConfigDataEO.getTextData()).append("\"").append("改为").append("\"").append("空").append("\"").append(","); - logEnContent.append(" from ").append("\"").append(oldConfigDataEO.getTextData()).append("\"").append(" to ").append("\"").append("Null").append("\"").append(", "); + ParamsReportConfigDataEO paramsReportConfigDataEO = new ParamsReportConfigDataEO(); + paramsReportConfigDataEO.setOrderNum(orderNum); + for (Map paramsConfigDataVO : configDataVOList) { + String type = (String) paramsConfigDataVO.get("type"); + String dataValue = (String) paramsConfigDataVO.get("dataValue"); - changeFlag = true; - } else if (StringUtils.isNotEmpty(oldConfigDataEO.getTextData()) && StringUtils.isNotEmpty(dataValue) && !oldConfigDataEO.getTextData().equals(dataValue)) { - logCnContent.append("\"").append(oldConfigDataEO.getTextData()).append("\"").append("改为").append("\"").append(dataValue).append("\"").append(","); - logEnContent.append(" from ").append("\"").append(oldConfigDataEO.getTextData()).append("\"").append(" to ").append("\"").append(dataValue).append("\"").append(", "); + // 判断是新增还是修改 + ParamsConfigDataEO oldConfigDataEO = getConfigDataEOByConfigIdAndCollectManifestId(paramsReportConfigEOId, paramsCollectManifestId, paramsReportConfigDataEOList,configDataId); + if (ObjectUtil.isNotEmpty(oldConfigDataEO)) { + paramsReportConfigDataEO.setId(oldConfigDataEO.getId()); - changeFlag = true; - } + if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { + // paramsReportConfigDataEO.setTextData(dataValue); + if (StringUtils.isEmpty(oldConfigDataEO.getTextData()) && StringUtils.isNotEmpty(dataValue)) { + logCnContent.append("\"").append("空").append("\"").append("改为").append("\"").append(dataValue).append("\"").append(","); + logEnContent.append(" from ").append("\"").append("Null").append("\"").append(" to ").append("\"").append(dataValue).append("\"").append(", "); - } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) - || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { - paramsReportConfigDataEO.setPullData(dataValue); + changeFlag = true; + } else if (StringUtils.isNotEmpty(oldConfigDataEO.getTextData()) && StringUtils.isEmpty(dataValue)) { + logCnContent.append("\"").append(oldConfigDataEO.getTextData()).append("\"").append("改为").append("\"").append("空").append("\"").append(","); + logEnContent.append(" from ").append("\"").append(oldConfigDataEO.getTextData()).append("\"").append(" to ").append("\"").append("Null").append("\"").append(", "); - if (StringUtils.isEmpty(oldConfigDataEO.getPullData()) && StringUtils.isNotEmpty(dataValue)) { - logCnContent.append("\"").append("空").append("\"").append("改为").append("\"").append(dataValue).append("\"").append(","); - logEnContent.append(" from ").append("\"").append("Null").append("\"").append(" to ").append("\"").append(dataValue).append("\"").append(", "); + changeFlag = true; + } else if (StringUtils.isNotEmpty(oldConfigDataEO.getTextData()) && StringUtils.isNotEmpty(dataValue) && !oldConfigDataEO.getTextData().equals(dataValue)) { + logCnContent.append("\"").append(oldConfigDataEO.getTextData()).append("\"").append("改为").append("\"").append(dataValue).append("\"").append(","); + logEnContent.append(" from ").append("\"").append(oldConfigDataEO.getTextData()).append("\"").append(" to ").append("\"").append(dataValue).append("\"").append(", "); - changeFlag = true; - } else if (StringUtils.isNotEmpty(oldConfigDataEO.getPullData()) && StringUtils.isEmpty(dataValue)) { - logCnContent.append("\"").append(oldConfigDataEO.getPullData()).append("\"").append("改为").append("\"").append("空").append("\"").append(","); - logEnContent.append(" from ").append("\"").append(oldConfigDataEO.getPullData()).append("\"").append(" to ").append("\"").append("Null").append("\"").append(", "); - - changeFlag = true; - } else if (StringUtils.isNotEmpty(oldConfigDataEO.getPullData()) && StringUtils.isNotEmpty(dataValue) && !oldConfigDataEO.getPullData().equals(dataValue)) { - logCnContent.append("\"").append(oldConfigDataEO.getPullData()).append("\"").append("改为").append("\"").append(dataValue).append("\"").append(","); - logEnContent.append(" from ").append("\"").append(oldConfigDataEO.getPullData()).append("\"").append(" to ").append("\"").append(dataValue).append("\"").append(", "); - - changeFlag = true; - } - - } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { - String newFileNames = ""; - if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件. 目前没用到这段代码 - // 处理文件connectId - String[] fileIdList = dataValue.split(","); - List ossFiles = ossFileService.getFileInfosByConnectId(fileIdList[0]); - if(CollectionUtil.isEmpty(ossFiles)) { // 新加了一个文件 - String connectId = UUID.randomUUID().toString().replace("-", ""); - List updateFileList = new ArrayList<>(); - for (int i = 0; i < fileIdList.length; i++) { - OSSFile ossFile = new OSSFile(); - ossFile.setId(fileIdList[i]); - ossFile.setConnectId(connectId); - updateFileList.add(ossFile); + changeFlag = true; } - ossFileService.updateBatchById(updateFileList); - dataValue = connectId; - newFileNames = ossFileService.getFileInfosByConnectId(connectId).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); - } - } else if (StringUtils.isNotEmpty(dataValue) && !dataValue.contains(",")) { - List ossFiles = ossFileService.getFileInfosByConnectId(dataValue); - if(CollectionUtil.isEmpty(ossFiles)){ // 新加了一个文件 - String connectId = UUID.randomUUID().toString().replace("-", ""); - //修改文件表关联信息connect_id - List oSSFileList = new ArrayList<>(); - for (String fileId : dataValue.split(",")) { - OSSFile ossFile = new OSSFile(); - ossFile.setId(fileId); - ossFile.setConnectId(connectId); - oSSFileList.add(ossFile); + + } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) + || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { + // paramsReportConfigDataEO.setPullData(dataValue); + + if (StringUtils.isEmpty(oldConfigDataEO.getPullData()) && StringUtils.isNotEmpty(dataValue)) { + logCnContent.append("\"").append("空").append("\"").append("改为").append("\"").append(dataValue).append("\"").append(","); + logEnContent.append(" from ").append("\"").append("Null").append("\"").append(" to ").append("\"").append(dataValue).append("\"").append(", "); + + changeFlag = true; + } else if (StringUtils.isNotEmpty(oldConfigDataEO.getPullData()) && StringUtils.isEmpty(dataValue)) { + logCnContent.append("\"").append(oldConfigDataEO.getPullData()).append("\"").append("改为").append("\"").append("空").append("\"").append(","); + logEnContent.append(" from ").append("\"").append(oldConfigDataEO.getPullData()).append("\"").append(" to ").append("\"").append("Null").append("\"").append(", "); + + changeFlag = true; + } else if (StringUtils.isNotEmpty(oldConfigDataEO.getPullData()) && StringUtils.isNotEmpty(dataValue) && !oldConfigDataEO.getPullData().equals(dataValue)) { + logCnContent.append("\"").append(oldConfigDataEO.getPullData()).append("\"").append("改为").append("\"").append(dataValue).append("\"").append(","); + logEnContent.append(" from ").append("\"").append(oldConfigDataEO.getPullData()).append("\"").append(" to ").append("\"").append(dataValue).append("\"").append(", "); + + changeFlag = true; } - ossFileService.updateFileInfo(oSSFileList); - dataValue = connectId; - newFileNames = ossFileService.getFileInfosByConnectId(connectId).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); + + } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { + String newFileNames = ""; + if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件. 目前没用到这段代码 + // 处理文件connectId + String[] fileIdList = dataValue.split(","); + List ossFiles = ossFileService.getFileInfosByConnectId(fileIdList[0]); + if(CollectionUtil.isEmpty(ossFiles)) { // 新加了一个文件 + String connectId = UUID.randomUUID().toString().replace("-", ""); + List updateFileList = new ArrayList<>(); + for (int i = 0; i < fileIdList.length; i++) { + OSSFile ossFile = new OSSFile(); + ossFile.setId(fileIdList[i]); + ossFile.setConnectId(connectId); + updateFileList.add(ossFile); + } + ossFileService.updateBatchById(updateFileList); + dataValue = connectId; + newFileNames = ossFileService.getFileInfosByConnectId(connectId).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); + } + } else if (StringUtils.isNotEmpty(dataValue) && !dataValue.contains(",")) { + List ossFiles = ossFileService.getFileInfosByConnectId(dataValue); + if(CollectionUtil.isEmpty(ossFiles)){ // 新加了一个文件 + String connectId = UUID.randomUUID().toString().replace("-", ""); + //修改文件表关联信息connect_id + List oSSFileList = new ArrayList<>(); + for (String fileId : dataValue.split(",")) { + OSSFile ossFile = new OSSFile(); + ossFile.setId(fileId); + ossFile.setConnectId(connectId); + oSSFileList.add(ossFile); + } + ossFileService.updateFileInfo(oSSFileList); + dataValue = connectId; + newFileNames = ossFileService.getFileInfosByConnectId(connectId).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); + } + } + // paramsReportConfigDataEO.setFileConnectId(dataValue); + if (StringUtils.isEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isNotEmpty(dataValue)) { + logCnContent.append("\"").append("空").append("\"").append("改为").append("\"").append(newFileNames).append("\"").append(","); + logEnContent.append(" from ").append("\"").append("Null").append("\"").append(" to ").append("\"").append(newFileNames).append("\"").append(", "); + + changeFlag = true; + } else if (StringUtils.isNotEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isEmpty(dataValue)) { + String oldFileNames = ossFileService.getFileInfosByConnectId(oldConfigDataEO.getFileConnectId()).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); + logCnContent.append("\"").append(oldFileNames).append("\"").append("改为").append("\"").append("空").append("\"").append(","); + logEnContent.append(" from ").append("\"").append(oldFileNames).append("\"").append(" to ").append("\"").append("Null").append("\"").append(", "); + + changeFlag = true; + } else if (StringUtils.isNotEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isNotEmpty(dataValue)) { + String oldFileNames = ossFileService.getFileInfosByConnectId(oldConfigDataEO.getFileConnectId()).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); + if (!oldConfigDataEO.getFileConnectId().equals(dataValue)) { + logCnContent.append("\"").append(oldFileNames).append("\"").append("改为").append("\"").append(newFileNames).append("\"").append(","); + logEnContent.append(" from ").append("\"").append(oldFileNames).append("\"").append(" to ").append("\"").append(newFileNames).append("\"").append(", "); + + changeFlag = true; + } + + } + } } - paramsReportConfigDataEO.setFileConnectId(dataValue); - if (StringUtils.isEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isNotEmpty(dataValue)) { - logCnContent.append("\"").append("空").append("\"").append("改为").append("\"").append(newFileNames).append("\"").append(","); - logEnContent.append(" from ").append("\"").append("Null").append("\"").append(" to ").append("\"").append(newFileNames).append("\"").append(", "); - changeFlag = true; - } else if (StringUtils.isNotEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isEmpty(dataValue)) { - String oldFileNames = ossFileService.getFileInfosByConnectId(oldConfigDataEO.getFileConnectId()).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); - logCnContent.append("\"").append(oldFileNames).append("\"").append("改为").append("\"").append("空").append("\"").append(","); - logEnContent.append(" from ").append("\"").append(oldFileNames).append("\"").append(" to ").append("\"").append("Null").append("\"").append(", "); - changeFlag = true; - } else if (StringUtils.isNotEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isNotEmpty(dataValue)) { - String oldFileNames = ossFileService.getFileInfosByConnectId(oldConfigDataEO.getFileConnectId()).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); - if (!oldConfigDataEO.getFileConnectId().equals(dataValue)) { - logCnContent.append("\"").append(oldFileNames).append("\"").append("改为").append("\"").append(newFileNames).append("\"").append(","); - logEnContent.append(" from ").append("\"").append(oldFileNames).append("\"").append(" to ").append("\"").append(newFileNames).append("\"").append(", "); - changeFlag = true; + if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { + + paramsReportConfigDataEO.setTextData(dataValue); + } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) + || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { + + paramsReportConfigDataEO.setPullData(dataValue); + } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { + String newFileNames = ""; + if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件. 目前没用到这段代码 + // 处理文件connectId + String[] fileIdList = dataValue.split(","); + List ossFiles = ossFileService.getFileInfosByConnectId(fileIdList[0]); + if(CollectionUtil.isEmpty(ossFiles)) { // 新加了一个文件 + String connectId = UUID.randomUUID().toString().replace("-", ""); + List updateFileList = new ArrayList<>(); + for (int i = 0; i < fileIdList.length; i++) { + OSSFile ossFile = new OSSFile(); + ossFile.setId(fileIdList[i]); + ossFile.setConnectId(connectId); + updateFileList.add(ossFile); + } + ossFileService.updateBatchById(updateFileList); + dataValue = connectId; + newFileNames = ossFileService.getFileInfosByConnectId(connectId).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); + } + } else if (StringUtils.isNotEmpty(dataValue) && !dataValue.contains(",")) { + List ossFiles = ossFileService.getFileInfosByConnectId(dataValue); + if(CollectionUtil.isEmpty(ossFiles)){ // 新加了一个文件 + String connectId = UUID.randomUUID().toString().replace("-", ""); + //修改文件表关联信息connect_id + List oSSFileList = new ArrayList<>(); + for (String fileId : dataValue.split(",")) { + OSSFile ossFile = new OSSFile(); + ossFile.setId(fileId); + ossFile.setConnectId(connectId); + oSSFileList.add(ossFile); + } + ossFileService.updateFileInfo(oSSFileList); + dataValue = connectId; + newFileNames = ossFileService.getFileInfosByConnectId(connectId).stream().map(OSSFile::getFileName).collect(Collectors.joining(",")); + } } - + paramsReportConfigDataEO.setFileConnectId(dataValue); } - } + + QueryWrapper removeConfigDataWrap = new QueryWrapper<>(); + removeConfigDataWrap.lambda().eq(ParamsReportConfigDataEO::getParamsConfigId,paramsReportConfigEOId); + removeConfigDataWrap.lambda().eq(ParamsReportConfigDataEO::getParamsCollectManifestId,paramsCollectManifestId); + this.paramsReportConfigDataEOService.remove(removeConfigDataWrap); + + paramsReportConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId); + paramsReportConfigDataEO.setParamsConfigId(paramsReportConfigEOId); + + newConfigDataEOList.add(paramsReportConfigDataEO); } + } - newConfigDataEOList.add(paramsReportConfigDataEO); + + + logCnContent.append(paramsReportConfigEO.getConfigName()).append("的"); + logEnContent.append(paramsReportConfigEO.getConfigName()); //******************这里是当前配置的循环结束了****************** //判断结尾是不是该配置的名字--如果是(说明该配置没有被改变)需要从logCnContent中删除该配置名字 @@ -1966,14 +2081,13 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl paramsReportConfigDataEOList) { + private ParamsReportConfigDataEO getConfigDataEOByConfigIdAndCollectManifestId(String configId, String collectManifestId, List paramsReportConfigDataEOList,String configDataId) { List configDataEOList = paramsReportConfigDataEOList.stream() - .filter(e-> configId.equals(e.getParamsConfigId()) && collectManifestId.equals(e.getParamsCollectManifestId())) + .filter(e-> configId.equals(e.getParamsConfigId()) && collectManifestId.equals(e.getParamsCollectManifestId()) && StringUtils.equals(configDataId,e.getId())) .collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(configDataEOList)) { return configDataEOList.get(0); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java index a56a83db2..460fef68c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java @@ -29,6 +29,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -55,6 +56,7 @@ public class ParamsInfoEOController extends JeroController autoAddTestData(@RequestBody JSONObject json) { + //TODO 测试接口 + String certCategory = json.getString("certCategory"); + String certCategoryType = json.getString("certCategoryType"); // gg、3c、yy、hb + String controlType = json.getString("controlType"); + String controlVerify = json.getString("controlVerify"); + String cut = json.getString("cut"); + String dutyTerritory = json.getString("dutyTerritory"); + String isMust = json.getString("isMust"); + String nioNumber = json.getString("nioNumber"); + String paramsBatch = json.getString("paramsBatch"); + String paramsName = json.getString("paramsName"); + String paramsTemplateId = json.getString("paramsTemplateId"); + if (StringUtils.isEmpty(certCategory)) { + return Result.error("认证类别不能为空!"); + } + boolean isSuccess = false; + + Integer startIndex = json.getInteger("startIndex"); + Integer endIndex = json.getInteger("endIndex"); + for (Integer i = 0; i < endIndex; i++) { + ParamsInfoEO paramsInfoEO = new ParamsInfoEO(); + paramsInfoEO.setNioNumber(nioNumber + "-" + String.format("%04d",startIndex + i)); + paramsInfoEO.setParamsName(paramsName + "-" + String.format("%04d",startIndex + i) + "名称"); + paramsInfoEO.setCertCategory(certCategory); + paramsInfoEO.setControlType(controlType); + paramsInfoEO.setControlVerify(controlVerify); + paramsInfoEO.setCut(cut); + paramsInfoEO.setDutyTerritory(dutyTerritory); + paramsInfoEO.setIsMust(isMust); + paramsInfoEO.setParamsBatch(paramsBatch); + paramsInfoEO.setParamsTemplateId(paramsTemplateId); + + List certCategoryParamsInfoEOList = new ArrayList<>(); + CertCategoryParamsInfoEO certCategoryParamsInfoEO = new CertCategoryParamsInfoEO(); + certCategoryParamsInfoEO.setCertCategory(certCategory); + certCategoryParamsInfoEO.setParamsName(paramsName + "-" + String.format("%04d",startIndex + i) + "-" + certCategoryType + "-" + "name"); + certCategoryParamsInfoEO.setParamsNumber(nioNumber + "-" + String.format("%04d",startIndex + i) + "-" + certCategoryType); + certCategoryParamsInfoEOList.add(certCategoryParamsInfoEO); + paramsInfoEO.setCertCategoryParamsInfoEOList(certCategoryParamsInfoEOList); + + isSuccess = paramsInfoEOService.add(paramsInfoEO); + + if(!isSuccess){ + break; + } + } + + + + if (isSuccess) { + return Result.OK("添加成功!"); + } else { + return Result.error("添加失败!"); + } + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java index 1df1f9a2e..a185ae58e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java @@ -106,7 +106,7 @@ public class ParamsInfoEO implements Serializable { private String certCategory; /**控件类型*/ - @Excel(name = "*控件类型", width = 15, replace = {"文本_1","下拉单选_2","下拉多选_3","附件_4","文本+下拉单选_5","文本+下拉多选_6","文本+附件_7","下拉单选+附件_8","下拉多选+附件_9","文本+下拉单选+附件_10","标题_11"}) + @Excel(name = "*控件类型", width = 15, replace = {"文本_1","下拉单选_2","下拉多选_3","附件_4","下拉单选+文本_5","下拉多选+文本_6","文本+附件_7","下拉单选+附件_8","下拉多选+附件_9","下拉单选+文本+附件_10","标题_11"}) @ApiModelProperty(value = "控件类型") private String controlType; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/enums/ControlTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/enums/ControlTypeEnum.java index a6948d07d..ea56ae250 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/enums/ControlTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/template/enums/ControlTypeEnum.java @@ -15,12 +15,12 @@ public enum ControlTypeEnum { PULL_SINGLE("下拉单选","Pull single","2"), PULL_MORE("下拉多选","Pull more","3"), FILE("附件","File","4"), - TEXT_PULL_SINGLE("文本+下拉单选","Text+Pull single","5"), - TEXT_PULL_MORE("文本+下拉多选","Text+Pull more","6"), + TEXT_PULL_SINGLE("下拉单选+文本","Pull single+Text","5"), + TEXT_PULL_MORE("下拉多选+文本","Pull more+Text","6"), TEXT_FILE("文本+附件","Text+File","7"), PULL_SINGLE_FILE("下拉单选+附件","Pull single+File","8"), PULL_MORE_FILE("下拉多选+附件","Pull more+File","9"), - TEXT_PULL_SINGLE_FILE("文本+下拉单选+附件","Text+Pull single+File","10"), + TEXT_PULL_SINGLE_FILE("下拉单选+文本+附件","Pull single+Text+File","10"), Title("标题","Title","11"); String name; diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index d58817f63..1a96f85be 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1088,12 +1088,12 @@ module.exports = { NDropdownradio: 'Pull single', NDropdownmultipleselection: 'Pull more', Nenclosure: 'File', - Atext: 'Text+Pull single', - Btext: 'Text+Pull more', + Atext: 'Pull single+Text', + Btext: 'Pull more+Text', Ctext: 'Text+File', Dtext: 'Pull single+File', Etext: 'Pull more+File', - Ftext: 'Text+Pull single+File', + Ftext: 'Pull single+Text+File', Gtext: 'Title', Nnothing: 'Null', Nchinese: 'Chinese', diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 843fb1395..b47f1853d 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1100,12 +1100,12 @@ module.exports = { NDropdownradio: '下拉单选', NDropdownmultipleselection: '下拉多选', Nenclosure: '附件', - Atext: '文本+下拉单选', - Btext: '文本+下拉多选', + Atext: '下拉单选+文本', + Btext: '下拉多选+文本', Ctext: '文本+附件', Dtext: '下拉单选+附件', Etext: '下拉多选+附件', - Ftext: '文本+下拉单选+附件', + Ftext: '下拉单选+文本+附件', Gtext: '标题', Nnothing: '无', Nchinese: '中文', diff --git a/jero-web/src/components/CollectionType/index.vue b/jero-web/src/components/CollectionType/index.vue index da604f3ea..5bf3d620c 100644 --- a/jero-web/src/components/CollectionType/index.vue +++ b/jero-web/src/components/CollectionType/index.vue @@ -2,655 +2,823 @@
-
-
-
- - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- +
+
+
+
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+
-
-
-
- - - - - - - - - - - -
- +
+
+
+
+ + + + + + + + + + + +
+ +
+ +
+ +
+
+ +
+
-
-
-
- - +
+
+
+
+ + {{ item.label }} - - + + +
+ +
+ +
+
+ +
+
-
-
-
- - +
+
+
+
+ + {{ item.label }} - - + + +
+ +
+ +
+
+ +
+
-
-
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - +
+
+
+
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} + +
+ +
+ +
+
+ +
+
-
-
-
- - +
+
+
+
+ + {{ itemin.label }} - - -
-
- - - - - - - - - - - -
- + +
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+
-
-
-
- - +
+
+
+
+ + {{ item.label }} - - -
-
- - - - - - - - - - - -
- + +
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
- + +
+ +
+
+ +
+
-
-
-
- - - - - - - - - - - -
- +
+
+
+
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- +
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} +
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - + +
+
+
+ +
+
-
-
-
- - +
+
+
+ +
+ + {{ itemin.label }} - - + + +
+
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} + +
+
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - + +
+
+
+ +
+
-
-
-
- - +
+
+
+ +
+ + {{ item.label }} - - + + +
+
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} + +
+
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - + +
+
+
+ +
+
-
-
-
- - +
+
+ +
+ +
+ + {{ itemin.label }} - - -
-
- - - - - - - - - - - -
- + +
- -
- +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- +
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} +
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - + +
+
+
+ +
+
+
+
@@ -669,9 +837,23 @@ default: {}, require: true }, + recordList: { + type: Object, + default: {}, + require: true + }, watermark: { type: String, default: '' + }, + columName: { + type: Array, + default: [], + require: true + }, + currentPersonRole: { + type: String, + default: '' } }, data() { @@ -679,37 +861,65 @@ isLock: '0', formInline: {}, visible: false, - detailDatetransformation: [] + detailDatetransformation: [], + detailDateList: [], + paramsConfigData: {}, + fileNameOne: '', + fileNameTwo: '', + fileIndex: '' } }, components: { uploadFileChangeDown }, mounted() { + this.detailDateList = [] + this.paramsConfigData = this.detailDate.paramsConfigData + let name = [] console.log(this.detailDate) - this.detailDate.list.forEach((item) => { - if (item.type === 'pull_more' && !item.dataValue) { - item.dataValue = [] - } + console.log(this.currentPersonRole) + // this.columName.forEach(item => { + // if (item.db_field_name && item.db_field_name != '') { + // name.push(item.db_field_name) + // } + // }) + // for (let key in this.recordList) { + // if (name.toString().indexOf(key) > -1) { + // if (this.recordList[key].paramsConfigData) { + // console.log(this.recordList[key].paramsConfigData) + // this.detailDateList = this.recordList[key].paramsConfigData + // } + // } + // } + // this.detailDateList = this.detailDate.paramsConfigData + // this.detailDateList.forEach((item) => { + Object.keys(this.detailDate.paramsConfigData).forEach(res => { + this.detailDate.paramsConfigData[res].forEach(val => { + if (val.type === 'pull_more' && !val.dataValue) { + val.dataValue = [] + } + }) + // }) // this.detailDatetransformation.push(item) }) + console.log(this.detailDateList, 'oooooo') }, methods: { - selectChange(val){ + selectChange(val) { this.$nextTick(() => { let element = document.querySelectorAll( - ".tableclassname .ant-table-expanded-row" - ); - let len = element.length / 2; + '.tableclassname .ant-table-expanded-row' + ) + let len = element.length / 2 for (let i = 0; i < len; i++) { - element[i + len].style.height = element[i].offsetHeight + "px"; + element[i + len].style.height = element[i].offsetHeight + 'px' } - }); + }) }, onInput(r) { let value = r.target.value r.target.value = value.replace(/[^\u4e00-\u9fa5]/g, '') - this.detailDate.list.forEach((item) => { + this.detailDateList.forEach((item) => { if (item.controlVerify == '2') { item.dataValue = r.target.value } @@ -731,14 +941,17 @@ // console.log('form',this.formInline) } - this.detailDate.list.forEach((item, index) => { - if (item.type === 'file') { - item.dataValue = attIdList.join(',') - } - }) + this.detailDate.paramsConfigData[this.fileNameOne][this.fileIndex].dataValue = attIdList.join(',') + // this.detailDateList.forEach((item, index) => { + // if (item.type === 'file') { + // item.dataValue = attIdList.join(',') + // } + // }) }, - clickButtonToUpload(item) { - if (item.isLock == '1') { + clickButtonToUpload(name, item, index) { + this.fileNameOne = name + this.fileIndex = index + if (item.isLock && item.isLock == '1') { this.$refs.uploadFile.disabled = true } else { this.$refs.uploadFile.disabled = false @@ -751,6 +964,50 @@ this.$refs.uploadFile.perentHandleFunc() } }) + }, + generateRandom() { + return Math.random().toString(32) + }, + addconfig() { + let paramsConfigData = Object.keys(this.detailDate.paramsConfigData) + for (let i = 0; i < paramsConfigData.length; i++) { + if (i == paramsConfigData.length - 1) { + let name = paramsConfigData[i] + let generateRandom = this.generateRandom() + this.detailDate.paramsConfigData[generateRandom] = JSON.parse(JSON.stringify(this.detailDate.paramsConfigData[name])) + this.detailDate.paramsConfigData[generateRandom].forEach(res => { + if (res.type === 'pull_more') { + res.dataValue = [] + } else { + res.dataValue = '' + } + }) + } + } + this.detailDate.paramsConfigData = { ...this.detailDate.paramsConfigData } + this.$emit('consolidateData') + // postAction('params/configData/add', { + // paramsCollectManifestId: this.recordList.id, + // paramsConfigId: this.detailDate.configId + // }).then((res) => { + // if (res.success) { + // this.$emit('collectionForm') + // } else { + // } + // }) + }, + delconfig(item) { + delete this.detailDate.paramsConfigData[item] + this.detailDate.paramsConfigData = { ...this.detailDate.paramsConfigData } + this.$emit('consolidateData') + // for (const key in this.detailDate.paramsConfigData) { + // deleteAction('params/configData/delete', { id: key }).then((res) => { + // if (res.success) { + // this.$emit('collectionForm') + // } else { + // } + // }) + // } } }, watch: { @@ -786,25 +1043,33 @@ height: 38px !important; line-height: 38px !important; } - .ant-select-selection-selected-value{ - height:100%; + + .ant-select-selection-selected-value { + height: 100%; } + .selectWid .ant-select-selection__rendered { line-height: 36px !important; } diff --git a/jero-web/src/components/CollectionTypeDisabled/index.vue b/jero-web/src/components/CollectionTypeDisabled/index.vue index f0317ce15..5e34d66c8 100644 --- a/jero-web/src/components/CollectionTypeDisabled/index.vue +++ b/jero-web/src/components/CollectionTypeDisabled/index.vue @@ -2,604 +2,739 @@
-
-
-
- - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- +
+
+
+
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+
+ +
-
-
-
- - - - - - - - - - - -
- +
+
+
+
+ + + + + + + + + + + +
+ +
+
+ +
+
+ +
-
-
-
- - +
+
+
+
+ + {{ item.label }} - - + + +
+
+
+ +
+
+
-
-
-
- - +
+
+
+
+ + {{ item.label }} - - + + +
+
+
+ +
+
+
-
-
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - +
+
+
+
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} + +
+
+
+ +
+
+
-
-
-
- - +
+
+
+
+ + {{ itemin.label }} - - + + +
+
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
-
- - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
+
+ +
+
+
-
-
-
- - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
-
- - +
+
+
+
+ + {{ item.label }} - - + + +
+
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
+ +
+
+
-
-
-
- - - - - - - - - - - -
- +
+
+
+
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- +
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} +
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - +
+ +
+
+
-
-
-
- - +
+
+
+ +
+ + {{ itemin.label }} - - + + +
+
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} + +
+
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - +
+ +
+
+
-
-
-
- - +
+
+
+ +
+ + {{ item.label }} - - + + +
+
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} + +
+
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - +
+ +
+
+
-
-
-
- - +
+
+ +
+ +
+ + {{ itemin.label }} - - -
-
- - - - - - - - - - - -
- + +
- -
- +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- +
+ + {{ (itemval.dataValue === 'null' || itemval.dataValue === '' || + itemval.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} +
-
- - {{ (item.dataValue === 'null' || item.dataValue === '' || - item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} - +
+ +
+
+
@@ -627,17 +762,30 @@ isLock: '0', formInline: {}, visible: false, - detailDatetransformation: [] + detailDatetransformation: [], + fileNameOne: '', + fileNameTwo: '', + fileIndex: '' } }, components: { uploadFileChangeDown }, mounted() { - this.detailDate.list.forEach((item) => { - if (item.type === 'pull_more') { - console.log(item.dataValue) - } + // this.detailDate.list.forEach((item) => { + // if (item.type === 'pull_more') { + // console.log(item.dataValue) + // } + // // this.detailDatetransformation.push(item) + // }) + this.paramsConfigData = this.detailDate.paramsConfigData + Object.keys(this.detailDate.paramsConfigData).forEach(res => { + this.detailDate.paramsConfigData[res].forEach(val => { + if (val.type === 'pull_more' && !val.dataValue) { + val.dataValue = [] + } + }) + // }) // this.detailDatetransformation.push(item) }) }, @@ -668,14 +816,16 @@ // console.log('form',this.formInline) } - this.detailDate.list.forEach((item, index) => { - if (item.type === 'file') { - item.dataValue = attIdList.join(',') - } - }) - this.$emit('update:detailDate', this.detailDate); + this.detailDate.paramsConfigData[this.fileNameOne][this.fileIndex].dataValue = attIdList.join(',') + // this.detailDateList.forEach((item, index) => { + // if (item.type === 'file') { + // item.dataValue = attIdList.join(',') + // } + // }) }, - clickButtonToUpload(item) { + clickButtonToUpload(name, item, index) { + this.fileNameOne = name + this.fileIndex = index // if (item.isLock == '1') { // this.$refs.uploadFile.disabled = true // } else { @@ -689,6 +839,50 @@ this.$refs.uploadFile.perentHandleFunc() } }) + }, + generateRandom() { + return Math.random().toString(32) + }, + addconfig() { + let paramsConfigData = Object.keys(this.detailDate.paramsConfigData) + for (let i = 0; i < paramsConfigData.length; i++) { + if (i == paramsConfigData.length - 1) { + let name = paramsConfigData[i] + let generateRandom = this.generateRandom() + this.detailDate.paramsConfigData[generateRandom] = JSON.parse(JSON.stringify(this.detailDate.paramsConfigData[name])) + this.detailDate.paramsConfigData[generateRandom].forEach(res => { + if (res.type === 'pull_more') { + res.dataValue = [] + } else { + res.dataValue = '' + } + }) + } + } + this.detailDate.paramsConfigData = { ...this.detailDate.paramsConfigData } + this.$emit('consolidateData') + // postAction('params/configData/add', { + // paramsCollectManifestId: this.recordList.id, + // paramsConfigId: this.detailDate.configId + // }).then((res) => { + // if (res.success) { + // this.$emit('collectionForm') + // } else { + // } + // }) + }, + delconfig(item) { + delete this.detailDate.paramsConfigData[item] + this.detailDate.paramsConfigData = { ...this.detailDate.paramsConfigData } + this.$emit('consolidateData') + // for (const key in this.detailDate.paramsConfigData) { + // deleteAction('params/configData/delete', { id: key }).then((res) => { + // if (res.success) { + // this.$emit('collectionForm') + // } else { + // } + // }) + // } } }, watch: { @@ -725,17 +919,32 @@ line-height: 38px !important; } + .ant-select-selection-selected-value { + height: 100%; + } + .selectWid .ant-select-selection__rendered { line-height: 36px !important; } + diff --git a/jero-web/src/components/tableCollection/index.vue b/jero-web/src/components/tableCollection/index.vue index 369799408..948ab4a67 100644 --- a/jero-web/src/components/tableCollection/index.vue +++ b/jero-web/src/components/tableCollection/index.vue @@ -75,7 +75,10 @@ - +
@@ -725,6 +728,13 @@ this.pageNohistory = 1 this.visible = false }, + collectionForm(){ + this.getTableList() + }, + consolidateData(){ + this.dataSource = [...this.dataSource] + console.log(this.dataSource) + }, getAndUserId(result) { let query = { paramsManifestId: this.$route.query.id, @@ -785,7 +795,7 @@ align: 'left', ellipsis: true, sorter: res.sort, - width: 500 + width: 600 }) num++ this.content.push(res) @@ -793,6 +803,7 @@ customRender: 'detailClick', title: 'titleName' + num } + console.log( this.content," this.content this.content this.content this.content this.content") // 非配置列 } else { this.columns.push({ @@ -857,6 +868,7 @@ }) }, getTableListReset() { + this.formInline = {} this.queryParamQuery = {} let params = { @@ -888,13 +900,24 @@ if (this.currentPersonRole !== 'dre') { res.result.records.forEach((Obj) => { Object.keys(Obj).forEach((item) => { + if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { - Obj[item].list.forEach((itemLi) => { - itemLi.isLock = 1 - if (itemLi.type === 'pull_more') { - itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') - } - }) + for (const key in Obj[item].paramsConfigData){ + Obj[item].paramsConfigData[key].forEach((itemLi) => + { + + itemLi.isLock = 1 + if (itemLi.type === 'pull_more') { + itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') + } + }) + } + // Obj[item].list.forEach((itemLi) => { + // itemLi.isLock = 1 + // if (itemLi.type === 'pull_more') { + // itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') + // } + // }) } }) tt.push(Obj) @@ -903,11 +926,18 @@ res.result.records.forEach((Obj) => { Object.keys(Obj).forEach((item) => { if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { - Obj[item].list.forEach((itemLi) => { - if (itemLi.type === 'pull_more') { - itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') - } - }) + for (const key in Obj[item].paramsConfigData){ + Obj[item].paramsConfigData[key].forEach((itemLi) => { + if (itemLi.type === 'pull_more') { + itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') + } + }) + } + // Obj[item].list.forEach((itemLi) => { + // if (itemLi.type === 'pull_more') { + // itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') + // } + // }) } }) tt.push(Obj) @@ -987,34 +1017,56 @@ // }) let tt = [] if (this.currentPersonRole !== 'dre') { + console.log(res.result.records, 'res.result.records') res.result.records.forEach((Obj) => { Object.keys(Obj).forEach((item) => { if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { - Obj[item].list.forEach((itemLi) => { - // console.log(item) - if((this.currentPersonRole == 'homo' || this.currentPersonRole == 'admin') && item == 'referencesCol'){ - itemLi.isLock = 0 - }else{ - itemLi.isLock = 1 - } - if (itemLi.type === 'pull_more') { - itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') - } - }) + for (const key in Obj[item].paramsConfigData){ + Obj[item].paramsConfigData[key].forEach((itemLi) => { + console.log(item) + if((this.currentPersonRole == 'homo' || this.currentPersonRole == 'admin') && item == 'referencesCol'){ + itemLi.isLock = 0 + }else{ + itemLi.isLock = 1 + } + if (itemLi.type === 'pull_more') { + itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') + } + }) + } + // Obj[item].list.forEach((itemLi) => { + // console.log(item) + // if((this.currentPersonRole == 'homo' || this.currentPersonRole == 'admin') && item == 'referencesCol'){ + // itemLi.isLock = 0 + // }else{ + // itemLi.isLock = 1 + // } + // if (itemLi.type === 'pull_more') { + // itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') + // } + // }) } }) tt.push(Obj) }) } else { + res.result.records.forEach((Obj) => { Object.keys(Obj).forEach((item) => { if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { - Obj[item].list.forEach((itemLi) => { - if (itemLi.type === 'pull_more') { - itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') - } - }) + for (const key in Obj[item].paramsConfigData){ + Obj[item].paramsConfigData[key].forEach((itemLi) => { + if (itemLi.type === 'pull_more') { + itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') + } + }) + } + // Obj[item].list.forEach((itemLi) => { + // if (itemLi.type === 'pull_more') { + // itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') + // } + // }) } }) tt.push(Obj) diff --git a/jero-web/src/components/tableCollection/index1.vue b/jero-web/src/components/tableCollection/index1.vue index 2c22d47aa..1a2c3d641 100644 --- a/jero-web/src/components/tableCollection/index1.vue +++ b/jero-web/src/components/tableCollection/index1.vue @@ -58,7 +58,7 @@ - +
@@ -301,6 +301,7 @@ detailDateList: [], selectedRowKeys: [], selectedRowrowValue: [], + description:'', dataSource: [], pageNo: 1, pageSize: 100, @@ -683,13 +684,24 @@ if (this.currentPersonRole !== 'dre') { res.result.records.forEach((Obj) => { Object.keys(Obj).forEach((item) => { + if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { - Obj[item].list.forEach((itemLi) => { - itemLi.isLock = 1 - if (itemLi.type === 'pull_more') { - itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') - } - }) + for (const key in Obj[item].paramsConfigData){ + Obj[item].paramsConfigData[key].forEach((itemLi) => + { + + itemLi.isLock = 1 + if (itemLi.type === 'pull_more') { + itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') + } + }) + } + // Obj[item].list.forEach((itemLi) => { + // itemLi.isLock = 1 + // if (itemLi.type === 'pull_more') { + // itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') + // } + // }) } }) tt.push(Obj) @@ -698,11 +710,18 @@ res.result.records.forEach((Obj) => { Object.keys(Obj).forEach((item) => { if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { - Obj[item].list.forEach((itemLi) => { - if (itemLi.type === 'pull_more') { - itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') - } - }) + for (const key in Obj[item].paramsConfigData){ + Obj[item].paramsConfigData[key].forEach((itemLi) => { + if (itemLi.type === 'pull_more') { + itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') + } + }) + } + // Obj[item].list.forEach((itemLi) => { + // if (itemLi.type === 'pull_more') { + // itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') + // } + // }) } }) tt.push(Obj) @@ -723,6 +742,9 @@ cancleoperationFailed() { this.selectedRowKeys = [] }, + consolidateData(){ + this.dataSource = [...this.dataSource] + }, getTableList(currentPersonRole) { console.log(this.url.tableList) let paramsManifestid @@ -766,28 +788,56 @@ // }) let tt = [] if (this.currentPersonRole !== 'dre') { + + console.log(res.result.records, 'res.result.records') res.result.records.forEach((Obj) => { Object.keys(Obj).forEach((item) => { if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { - Obj[item].list.forEach((itemLi) => { - itemLi.isLock = 1 - if (itemLi.type === 'pull_more') { - itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') - } - }) + for (const key in Obj[item].paramsConfigData){ + Obj[item].paramsConfigData[key].forEach((itemLi) => { + console.log(item) + if((this.currentPersonRole == 'homo' || this.currentPersonRole == 'admin') && item == 'referencesCol'){ + itemLi.isLock = 0 + }else{ + itemLi.isLock = 1 + } + if (itemLi.type === 'pull_more') { + itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') + } + }) + } + // Obj[item].list.forEach((itemLi) => { + // console.log(item) + // if((this.currentPersonRole == 'homo' || this.currentPersonRole == 'admin') && item == 'referencesCol'){ + // itemLi.isLock = 0 + // }else{ + // itemLi.isLock = 1 + // } + // if (itemLi.type === 'pull_more') { + // itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') + // } + // }) } }) tt.push(Obj) }) } else { + res.result.records.forEach((Obj) => { Object.keys(Obj).forEach((item) => { if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { - Obj[item].list.forEach((itemLi) => { - if (itemLi.type === 'pull_more') { - itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',') - } - }) + for (const key in Obj[item].paramsConfigData){ + Obj[item].paramsConfigData[key].forEach((itemLi) => { + if (itemLi.type === 'pull_more') { + itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') + } + }) + } + // Obj[item].list.forEach((itemLi) => { + // if (itemLi.type === 'pull_more') { + // itemLi.dataValue = !itemLi.dataValue ? [] : itemLi.dataValue.split(',') + // } + // }) } }) tt.push(Obj) diff --git a/jero-web/src/components/uploadFileChangeDown/file.vue b/jero-web/src/components/uploadFileChangeDown/file.vue index 19b236668..a8f328bc0 100644 --- a/jero-web/src/components/uploadFileChangeDown/file.vue +++ b/jero-web/src/components/uploadFileChangeDown/file.vue @@ -73,12 +73,20 @@ import { mapGetters } from 'vuex' this.containerId = 'container-ty-' + new Date().getTime() }, mounted() { - this.detailDate.list.forEach((item) => { - if (item.type === 'file') { - this.template.templateId = item.templateId - this.template.templateName = item.templateName - } - }) + for (const key in this.detailDate.paramsConfigData){ + this.detailDate.paramsConfigData[key].forEach((item) => { + if (item.type === 'file') { + this.template.templateId = item.templateId + this.template.templateName = item.templateName + } + }) + } + // this.detailDate.list.forEach((item) => { + // if (item.type === 'file') { + // this.template.templateId = item.templateId + // this.template.templateName = item.templateName + // } + // }) let long = localStorage.getItem('language') this.cut = '' if (long && long == 'zh-cn') { diff --git a/jero-web/src/views/parameter/managementdetails/commponts/conventionalmodle.vue b/jero-web/src/views/parameter/managementdetails/commponts/conventionalmodle.vue index d6adc03d0..af8c5105a 100644 --- a/jero-web/src/views/parameter/managementdetails/commponts/conventionalmodle.vue +++ b/jero-web/src/views/parameter/managementdetails/commponts/conventionalmodle.vue @@ -78,7 +78,8 @@
- + +
diff --git a/jero-web/src/views/parameter/managementdetails/index.vue b/jero-web/src/views/parameter/managementdetails/index.vue index f9b4518ec..66d960461 100644 --- a/jero-web/src/views/parameter/managementdetails/index.vue +++ b/jero-web/src/views/parameter/managementdetails/index.vue @@ -316,34 +316,69 @@ data.forEach(res => { selectedRowKeysValue.push(res) }) - console.log(selectedRowKeysValue) - for (let i = 0; i < selectedRowKeysValue.length; i++) { - let postDateobj = {} - let itemIn = Object.keys(selectedRowKeysValue[i]) - for (let j = 0; j < itemIn.length; j++) { - if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) { - if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) { - postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]] - for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) { - if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue instanceof Array) { - selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',') - } - if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) { - selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString() + // console.log(selectedRowKeysValue) + // for (let i = 0; i < selectedRowKeysValue.length; i++) { + // let postDateobj = {} + // let itemIn = Object.keys(selectedRowKeysValue[i]) + // for (let j = 0; j < itemIn.length; j++) { + // if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) { + // if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) { + // postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]] + // for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) { + // if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue instanceof Array) { + // selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',') + // } + // if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) { + // selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString() + // } + // } + // } + // } + // } + // postDateobj.id = selectedRowKeysValue[i].id + // postDateobj.remarks = selectedRowKeysValue[i].remarks + // postDate.push(postDateobj) + // } + // let configDataList = { configDataList: postDate } + if (selectedRowKeysValue && selectedRowKeysValue.length > 0) { + let configDataList = [] + for (let i = 0; i < selectedRowKeysValue.length; i++) { + configDataList.push({ + id: selectedRowKeysValue[i].id + }) + if (selectedRowKeysValue[i].configIds && selectedRowKeysValue[i].configIds.length > 0) { + for (let j = 0; j < selectedRowKeysValue[i].configIds.length; j++) { + let keyIndex = Object.keys(selectedRowKeysValue[i]) + for (let k = 0; k < keyIndex.length; k++) { + if (keyIndex[k] == selectedRowKeysValue[i].configIds[j]) { + let keyName = keyIndex[k] + configDataList[i][keyName] = selectedRowKeysValue[i][keyName] } } } } } - postDateobj.id = selectedRowKeysValue[i].id - postDateobj.remarks = selectedRowKeysValue[i].remarks - postDate.push(postDateobj) - } - let configDataList = { configDataList: postDate } - if (selectedRowKeysValue && selectedRowKeysValue.length > 0) { + // return + if (configDataList && configDataList.length > 0) { + configDataList.forEach(res => { + Object.keys(res).forEach(val => { + if (res[val] && res[val].paramsConfigData) { + let paramsConfigData = res[val].paramsConfigData + Object.keys(paramsConfigData).forEach((ol, index) => { + paramsConfigData[ol][0].orderNum = index + paramsConfigData[ol].forEach(item => { + if (item.type == 'pull_more') { + item.dataValue = item.dataValue.join(',') + } + }) + }) + } + }) + }) + } this.textLoading = true let query = { - ...configDataList, + configDataList: configDataList, paramsManifestId: this.$route.query.id } postAction('/report/detail/save', query).then((res) => { diff --git a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue index 7377522cc..a5a30de55 100644 --- a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue +++ b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue @@ -56,45 +56,56 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -130,11 +141,11 @@ {{$t('addTo')}}
- - - - - + + + + +
@@ -161,25 +172,28 @@ {{$t('Updateparametercolumn')}}
-
+
{{$t('SynchronousReportLibrary')}}
- - - - + + + +
{{$t('BatchDelete')}}
-
+
{{$t('bringInTheProjectInterface')}}
-
+
{{$t('Adjustareasofresponsibility')}}
@@ -189,13 +203,15 @@ {{$t('Assignedby')}}
- -
+ +
...{{ $t('more') }}
-
+
{{$t('distributionAndCollection')}}
@@ -233,7 +249,8 @@
- +
- + {{$t('CompulsoryWithdrawal')}}
@@ -258,9 +275,9 @@
- + + @GetgetTableList='GetgetTableList' + @GetgetLoginUserType='GetgetLoginUserType' + @areaVisibleAssignedbyflaghomo='areaVisibleAssignedbyflaghomo' + @areaVisible='areaVisibleAssignedbyhomo = false'/> - - - + + + - - - - + + + + + @GetgetTableList='GetgetTableList' + @AdjustareasofresponAll='AdjustareasofresponAll'/> @@ -373,9 +391,9 @@ + :templateTitle='templatetitle' + :selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version' :url='url' + :projectId='this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id'> @@ -444,7 +462,8 @@
{{ currentPersonRole =='homo'? $t('certifiedEngineer'): (currentPersonRole =='sdt'? - $t('engineeringInterfacePerson'): $t('completedBy')) }}{{jurisdiction === "homoQZTH"? $t('Datastateexcept') : $t('Datastatusis')}} + $t('engineeringInterfacePerson'): $t('completedBy')) }}{{jurisdiction === 'homoQZTH'? $t('Datastateexcept') + : $t('Datastatusis')}} '{{$t('CollectionInitiated')}}'、'{{$t('ReturnedPerson')}}'{{$t('or')}}'{{$t('alteration')}}' @@ -484,7 +503,7 @@

'{{$t('ReturnedEngineer')}}'

- +

'{{$t('SynchronizedLibrary')}}'

{{$t('or')}}

'{{$t('CollectionInitiated')}}'

@@ -550,47 +569,47 @@ { value: '1', title: this.$t('CollectionInitiated'), - key:'1', + key: '1' }, { value: '2', title: this.$t('handledInterface'), - key:'2', + key: '2' }, { value: '3', title: this.$t('ReturnedPerson'), - key:'3', + key: '3' }, { value: '4', title: this.$t('completed'), - key:'4', + key: '4' }, { value: '5', title: this.$t('Filledreturn'), - key:'5', + key: '5' }, { value: '6', title: this.$t('Submitted'), - key:'6', + key: '6' }, { value: '7', title: this.$t('ReturnedEngineer'), - key:'7', + key: '7' }, { value: '8', title: this.$t('SynchronizedLibrary'), - key:'8', + key: '8' }, { value: '9', title: this.$t('alteration'), - key:'9', + key: '9' } ] return { @@ -682,12 +701,12 @@ value: 'dre', text: this.$t('dre'), dictCode: 'dre'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框 - }, + } ], selectedRowKeys: [], textLoading: false, formInline: {}, - queryParamQuery:{}, + queryParamQuery: {}, url: { tableHeader: 'params/collectManifest/getHeader', tableList: 'params/collectManifest/list', @@ -704,7 +723,7 @@ configureareaVisible: false, // 配置的彈框 pageNo: 1, pageSize: 10, - rolename:'', + rolename: '', total: 0, selectedRowKeysArray: '', templatetitle: '', @@ -721,9 +740,9 @@ areaVisibleAssignedby: false, // 分配填写人弹框 areaVisibleAssignedbyhomo: false, // 认证分配填写人弹框 areaVisibleTaskCutOffTime: false, // 截至时间弹框 - OneclickCollection:false, - parametercolumn:false, - Adjustareasofrespon:false, + OneclickCollection: false, + parametercolumn: false, + Adjustareasofrespon: false, areaVisiblereferenceparameter: false, // 引用参数弹框 areaVisibsynchronous: false, // 同步上报库弹框 visibleoperationFailed: false, // 数据失败的弹框 @@ -772,7 +791,8 @@ window.addEventListener('keyup',this.handleKeyup) window.addEventListener('click',this.handleClick) this.GetgetLoginUserType() - if(this.$route.query.type == '1'){ + console.log(this.currentPersonRole) + if (this.$route.query.type == '1') { this.handleOkRoleSwitching() } // clearTimeout(this.timeBatch) @@ -867,9 +887,9 @@ }) }, handleOkRoleSwitching() { - if(this.$route.query.type == '1'){ + if (this.$route.query.type == '1') { let query = { - userType:this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType, + userType: this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType, paramsManifestId: this.$route.query.id, projectId: this.$route.query.projectId, userId: this.userInfo().id @@ -881,8 +901,8 @@ this.visibleRoleSwitching = false this.confirmLoadingRoleSwitching = false localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType)) - this.RoleType.forEach((item,index) => { - if(item.value == this.currentPersonRole){ + this.RoleType.forEach((item, index) => { + if (item.value == this.currentPersonRole) { this.rolename = item.label } }) @@ -892,7 +912,7 @@ this.$message.warning(this.$t('operationFailed')) } }) - }else { + } else { this.$refs.ruleFormRoleSwitching.validate(valid => { if (valid) { let query = { @@ -909,8 +929,8 @@ this.visibleRoleSwitching = false this.confirmLoadingRoleSwitching = false localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode)) - this.RoleType.forEach((item,index) => { - if(item.value == this.currentPersonRole){ + this.RoleType.forEach((item, index) => { + if (item.value == this.currentPersonRole) { this.rolename = item.label } }) @@ -926,7 +946,7 @@ }, roleSwitchingClick() { this.visibleRoleSwitching = true - this.$nextTick(()=>{ + this.$nextTick(() => { this.formInlineRoleSwitching.roleSwitchingCode = this.currentPersonRole this.$refs.ruleFormRoleSwitching.clearValidate() clearTimeout(this.timeBatch) @@ -966,7 +986,7 @@ GetgetTableList() { this.$refs.CollectionTabel.getTableList(this.queryParamQuery) }, - GetgetHeader(){ + GetgetHeader() { this.$refs.CollectionTabel.getHeader() }, // 错误数据的弹框 @@ -1065,7 +1085,7 @@ } }, //导出 - handleExport(){ + handleExport() { this.$message.success(this.$t('Intheexport')) let long = localStorage.getItem('language') this.cut = '' @@ -1077,16 +1097,16 @@ let query = { paramsManifestId: this.paramsManifest.id, paramsTemplateId: this.$route.query.paramsTemplateId, - paramsTemplatePublishVersion:1, + paramsTemplatePublishVersion: 1, cut: this.cut, userTypes: this.currentPersonRole, - exportName:this.$route.query.projectName + '(' + this.$route.query.title + ')' + exportName: this.$route.query.projectName + '(' + this.$route.query.title + ')' } let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip' - downloadFile('/params/collectManifest/exportAll', name , query , this.selectClear) + downloadFile('/params/collectManifest/exportAll', name, query, this.selectClear) }, //填写人导出 - handleExportDre(){ + handleExportDre() { let long = localStorage.getItem('language') this.cut = '' if (long && long === 'zh-cn') { @@ -1101,17 +1121,17 @@ ...this.formInline, ...this.queryParamQuery, ids: this.selectedRowKeys.join(','), - exportName:this.$route.query.projectName + '(' + this.$route.query.title + ')' + exportName: this.$route.query.projectName + '(' + this.$route.query.title + ')' } let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip' - downloadFile('/params/collectManifest/exportDre', name , query , this.selectClear) + downloadFile('/params/collectManifest/exportDre', name, query, this.selectClear) }, - getList(){ + getList() { this.$refs.CollectionTabel.getTableList(this.queryParamQuery) }, - iVisible(val,num) { + iVisible(val, num) { this.importsVisible = val - if (num == 1){ + if (num == 1) { eventBUs.$emit('searchGetData') } }, @@ -1134,7 +1154,7 @@ this.queryParamQuery = sqp this.$refs.CollectionTabel.pageNo = 1 // this.$refs.CollectionTabel.getTableList(this.queryParamQuery) - eventBUs.$emit('getTableList',this.queryParamQuery) + eventBUs.$emit('getTableList', this.queryParamQuery) }, // 认证工程师 批量删除 权限 // 仅仅状态为 待发起收集 工程接口人退回 变更 可以批量删除 @@ -1337,8 +1357,8 @@ this.currentPersonRole = currentPersonRole || userType || val[0].value } this.RoleType = val - this.RoleType.forEach((item,index) => { - if(item.value == this.currentPersonRole){ + this.RoleType.forEach((item, index) => { + if (item.value == this.currentPersonRole) { this.rolename = item.label } }) @@ -1453,18 +1473,18 @@ }) }, // 调整责任领域 - AdjustareasofresponsibilityClick(){ - if(this.selectedRowKeysValue.length == 0){ + AdjustareasofresponsibilityClick() { + if (this.selectedRowKeysValue.length == 0) { this.$message.warning(this.$t('selectLeastOne')) - }else{ + } else { this.Adjustareasofrespon = true } }, // 下发收集的权限 distributionAndCollectionJurisdiction() { - if(this.selectedRowKeysValue.length == 0){ + if (this.selectedRowKeysValue.length == 0) { this.$message.warning(this.$t('selectLeastOne')) - }else{ + } else { this.$refs.areaVisibleTaskCutOffTime.searchData() } // let homodistributionAndCollection = this.homodistributionAndCollection() @@ -1482,7 +1502,7 @@ // 一键下发收集 defOneclickCollection() { this.$refs.OneclickCollection.searchData() - // this.OneclickCollection = true + // this.OneclickCollection = true }, // 引用参数列 Referenceparametercolumn() { @@ -1490,12 +1510,12 @@ }, Updateparametercolumn() { let data = JSON.parse(JSON.stringify(this.$refs.CollectionTabel.dataSource)) - console.log(data) let referencesCol = [] let postDate = [] let colunmnFlag = '' - data.forEach((item,index) => { - if(!item.referencesCol){ + this.colunmnFlag = false + data.forEach((item, index) => { + if (!item.referencesCol) { this.colunmnFlag = true } referencesCol.push({ @@ -1503,42 +1523,59 @@ id: item.id }) }) - if(this.colunmnFlag){ + if (this.colunmnFlag) { this.$message.warning(this.$t('columnfirst')) return } + console.log(referencesCol) + // for (let i = 0; i < referencesCol.length; i++) { + // let postDateobj = {} + // let itemIn = Object.keys(referencesCol[i]) + // for (let j = 0; j < itemIn.length; j++) { + // if (itemIn[j] !== 'sdt' && referencesCol[i][itemIn[j]].list) { + // if (referencesCol[i][itemIn[j]] instanceof Object && !(referencesCol[i][itemIn[j]] instanceof Array)) { + // postDateobj[itemIn[j]] = referencesCol[i][itemIn[j]] + // for (let k = 0; k < referencesCol[i][itemIn[j]].list.length; k++) { + // if (referencesCol[i][itemIn[j]].list[k].type == 'pull_more' && referencesCol[i][itemIn[j]].list[k].dataValue instanceof Array) { + // referencesCol[i][itemIn[j]].list[k].dataValue = referencesCol[i][itemIn[j]].list[k].dataValue.join(',') + // } + // if (referencesCol[i][itemIn[j]].list[k].type == 'text' && referencesCol[i][itemIn[j]].list[k].dataValue !== null) { + // referencesCol[i][itemIn[j]].list[k].dataValue = referencesCol[i][itemIn[j]].list[k].dataValue.toString() + // } + // } + // } + // } + // } + // postDateobj.id = referencesCol[i].id + // postDate.push(postDateobj) + // } + let configDataList = [] for (let i = 0; i < referencesCol.length; i++) { - let postDateobj = {} - let itemIn = Object.keys(referencesCol[i]) - for (let j = 0; j < itemIn.length; j++) { - if (itemIn[j] !== 'sdt' && referencesCol[i][itemIn[j]].list) { - if (referencesCol[i][itemIn[j]] instanceof Object && !(referencesCol[i][itemIn[j]] instanceof Array)) { - postDateobj[itemIn[j]] = referencesCol[i][itemIn[j]] - for (let k = 0; k < referencesCol[i][itemIn[j]].list.length; k++) { - if (referencesCol[i][itemIn[j]].list[k].type == 'pull_more') { - referencesCol[i][itemIn[j]].list[k].dataValue = referencesCol[i][itemIn[j]].list[k].dataValue.join(',') - } - if (referencesCol[i][itemIn[j]].list[k].type == 'text' && referencesCol[i][itemIn[j]].list[k].dataValue !== null) { - referencesCol[i][itemIn[j]].list[k].dataValue = referencesCol[i][itemIn[j]].list[k].dataValue.toString() - } - } + configDataList.push({ + id: referencesCol[i].id + }) + let key = Object.keys(referencesCol[i].referencesCol.paramsConfigData) + let value = referencesCol[i].referencesCol.paramsConfigData + for (let j = 0; j < key.length; j++) { + let keyName = key[j] + for (let k = 0; k < value[keyName].length; k++) { + if (value[keyName][k].type == 'pull_more') { + value[keyName][k].dataValue = value[keyName][k].dataValue.join(',') } } + configDataList[i][keyName] = value[keyName] } - postDateobj.id = referencesCol[i].id - postDate.push(postDateobj) } - let configDataList = { configDataList: postDate } let query = { - ...configDataList, + configDataList: configDataList, paramsManifestId: this.paramsManifest.id } postAction('/params/collectManifest/updateReferencesCol', query).then((res) => { if (res.success) { this.GetgetTableList() - this.$message.success(this.$t('OperationSuccessful')) - } else { - this.$message.warning(this.$t('operationFailed')) + this.$message.success(this.$t('OperationSuccessful')) + } else { + this.$message.warning(this.$t('operationFailed')) } }) }, @@ -1630,41 +1667,75 @@ let selectedRowKeysValue = [] data.forEach(res => { if (res.state == 'To be filled' || res.state == '待填写' || res.state == '认证工程师退回' || - res.state == 'Rejected by homo engineer') { + res.state == 'Rejected by homo engineer') { selectedRowKeysValue.push(res) } }) - console.log(selectedRowKeysValue) - for (let i = 0; i < selectedRowKeysValue.length; i++) { - let postDateobj = {} - let itemIn = Object.keys(selectedRowKeysValue[i]) - for (let j = 0; j < itemIn.length; j++) { - if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) { - if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) { - postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]] - for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) { - if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') { - selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',') - } - if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) { - selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString() + // for (let i = 0; i < selectedRowKeysValue.length; i++) { + // let postDateobj = {} + // let itemIn = Object.keys(selectedRowKeysValue[i]) + // for (let j = 0; j < itemIn.length; j++) { + // if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) { + // if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) { + // postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]] + // for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) { + // if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') { + // selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',') + // } + // if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) { + // selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString() + // } + // } + // } + // } + // } + // postDateobj.id = selectedRowKeysValue[i].id + // delete postDateobj.referencesCol + // postDate.push(postDateobj) + // } + // console.log(postDate) + if (selectedRowKeysValue && selectedRowKeysValue.length > 0) { + if (num && num == 1) { + this.textLoading = true + } + let configDataList = [] + for (let i = 0; i < selectedRowKeysValue.length; i++) { + configDataList.push({ + id: selectedRowKeysValue[i].id + }) + if (selectedRowKeysValue[i].configIds && selectedRowKeysValue[i].configIds.length > 0) { + for (let j = 0; j < selectedRowKeysValue[i].configIds.length; j++) { + let keyIndex = Object.keys(selectedRowKeysValue[i]) + for (let k = 0; k < keyIndex.length; k++) { + if (keyIndex[k] == selectedRowKeysValue[i].configIds[j]) { + let keyName = keyIndex[k] + configDataList[i][keyName] = selectedRowKeysValue[i][keyName] } } } } } - postDateobj.id = selectedRowKeysValue[i].id - delete postDateobj.referencesCol - postDate.push(postDateobj) - } - console.log(postDate) - let configDataList = { configDataList: postDate } - if (selectedRowKeysValue && selectedRowKeysValue.length > 0) { - if (num && num == 1) { - this.textLoading = true + // return + if (configDataList && configDataList.length > 0) { + configDataList.forEach(res => { + Object.keys(res).forEach(val => { + if (res[val] && res[val].paramsConfigData) { + let paramsConfigData = res[val].paramsConfigData + Object.keys(paramsConfigData).forEach((ol, index) => { + paramsConfigData[ol][0].orderNum = index + paramsConfigData[ol].forEach(item => { + if (item.type == 'pull_more') { + item.dataValue = item.dataValue.join(',') + } + }) + }) + } + }) + }) } let query = { - ...configDataList, + // ...configDataList, + configDataList: configDataList, paramsManifestId: this.paramsManifest.id } postAction('/params/collectManifest/save', query).then((res) => { @@ -1720,34 +1791,92 @@ let _this = this let postDate = [] let selectedRowKeysValue = JSON.parse(JSON.stringify(this.selectedRowKeysValue)) + // for (let i = 0; i < selectedRowKeysValue.length; i++) { + // let postDateobj = {} + // let itemIn = Object.keys(selectedRowKeysValue[i]) + // for (let j = 0; j < itemIn.length; j++) { + // if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) { + // if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) { + // postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]] + // for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) { + // if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') { + // selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',') + // } + // if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) { + // selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString() + // } + // if (!selectedRowKeysValue[i][itemIn[j]].list[k].dataValue && selectedRowKeysValue[i][itemIn[j]].list[k].isMust == '1' + // && selectedRowKeysValue[i][itemIn[j]].list[k].isLock == '0') { + // this.$message.warning(selectedRowKeysValue[i].nioNumber + ',' + this.$t('requiredParametersEmpty')) + // return + // } + // } + // } + // } + // } + // postDateobj.id = selectedRowKeysValue[i].id + // postDate.push(postDateobj) + // } + let configDataList = [] for (let i = 0; i < selectedRowKeysValue.length; i++) { - let postDateobj = {} - let itemIn = Object.keys(selectedRowKeysValue[i]) - for (let j = 0; j < itemIn.length; j++) { - if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) { - if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) { - postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]] - for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) { - if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') { - selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',') - } - if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) { - selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString() - } - if (!selectedRowKeysValue[i][itemIn[j]].list[k].dataValue && selectedRowKeysValue[i][itemIn[j]].list[k].isMust == '1' - && selectedRowKeysValue[i][itemIn[j]].list[k].isLock == '0') { - this.$message.warning(selectedRowKeysValue[i].nioNumber + ',' + this.$t('requiredParametersEmpty')) - return + configDataList.push({ + id: selectedRowKeysValue[i].id + }) + if (selectedRowKeysValue[i].configIds && selectedRowKeysValue[i].configIds.length > 0) { + for (let j = 0; j < selectedRowKeysValue[i].configIds.length; j++) { + let keyIndex = Object.keys(selectedRowKeysValue[i]) + for (let k = 0; k < keyIndex.length; k++) { + if (keyIndex[k] == selectedRowKeysValue[i].configIds[j]) { + let keyName = keyIndex[k] + configDataList[i][keyName] = selectedRowKeysValue[i][keyName] + } + } + } + } + } + // return + if (configDataList && configDataList.length > 0) { + for (let i = 0; i < configDataList.length; i++) { + let res = Object.keys(configDataList[i]) + for (let j = 0; j < res.length; j++) { + let key = res[j] + if (configDataList[i][key] && configDataList[i][key].paramsConfigData) { + let paramsConfigData = configDataList[i][key].paramsConfigData + let paramsConfigDataQuery = Object.keys(paramsConfigData) + for (let k = 0; k < paramsConfigDataQuery.length; k++) { + let keyName = paramsConfigDataQuery[k] + paramsConfigData[keyName][0].orderNum = k + let keyNameOne = paramsConfigData[keyName] + for (let l = 0; l < keyNameOne.length; l++) { + if (keyNameOne[l].type == 'pull_more') { + keyNameOne[l].dataValue = keyNameOne[l].dataValue.join(',') + } + if (!keyNameOne[l].dataValue && keyNameOne[l].isMust == '1' && keyNameOne[l].isLock == '0') { + this.$message.warning(selectedRowKeysValue[i].nioNumber + ',' + this.$t('requiredParametersEmpty')) + return + } } } } } } - postDateobj.id = selectedRowKeysValue[i].id - postDate.push(postDateobj) + // configDataList.forEach(res => { + // Object.keys(res).forEach(val => { + // if (res[val] && res[val].paramsConfigData) { + // let paramsConfigData = res[val].paramsConfigData + // Object.keys(paramsConfigData).forEach((ol, index) => { + // paramsConfigData[ol][0].orderNum = index + // paramsConfigData[ol].forEach(item => { + // if (item.type == 'pull_more') { + // item.dataValue = item.dataValue.join(',') + // } + // }) + // }) + // } + // }) + // }) } - - let configDataList = { configDataList: postDate } + // let configDataList = { configDataList: postDate } if (this.selectedRowKeys.length == 0) { this.$message.warning(this.$t('selectLeastOne')) } else { @@ -1755,7 +1884,11 @@ this.$confirm({ content: _this.$t('Areyousureparameteritems'), onOk() { - postAction(_this.url.add, configDataList).then((res) => { + let query = { + configDataList: configDataList, + paramsManifestId: _this.paramsManifest.id + } + postAction(_this.url.add, query).then((res) => { if (res.success) { _this.$message.success(_this.$t('OperationSuccessful')) _this.GetgetTableList() @@ -1789,7 +1922,8 @@ return } let _this = this - let param = { ids: _array.join(','), + let param = { + ids: _array.join(','), currentPersonRole: this.currentPersonRole, paramsManifestId: this.$route.query.id } @@ -1847,9 +1981,9 @@ let _this = this let param = { ids: _array.join(',') } let url = '' - if(this.currentPersonRole == 'homo'){ + if (this.currentPersonRole == 'homo') { url = '/jero-boot/params/collectManifest/mandatoryWithdraw' - }else{ + } else { url = '/jero-boot/params/collectManifest/withdraw' } this.$confirm({ @@ -1893,8 +2027,8 @@ }, // 分配填写人 assignedBy() { - let sdtJurisdictionAssigned = this.sdtJurisdictionAssigned() - // 工程接口人 + let sdtJurisdictionAssigned = this.sdtJurisdictionAssigned() + // 工程接口人 if (sdtJurisdictionAssigned == 1) { this.areaVisibleAssignedby = true } else if (sdtJurisdictionAssigned == 0) { @@ -1936,10 +2070,10 @@ areaVisibleTaskCutOffTimeflag(val) { this.$refs.CollectionTabel.getTableList(this.queryParamQuery) }, - areaVisibleTaskCutOffTimeAll(val){ + areaVisibleTaskCutOffTimeAll(val) { this.$refs.CollectionTabel.getTableList(this.queryParamQuery) }, - AdjustareasofresponAll(val){ + AdjustareasofresponAll(val) { console.log(val) this.Adjustareasofrespon = val this.$refs.CollectionTabel.getTableList(this.queryParamQuery) @@ -1987,7 +2121,7 @@ handleDel() { let param = { ids: this.selectedRowKeysArray, - paramsManifestId:this.$route.query.id + paramsManifestId: this.$route.query.id } if (this.selectedRowKeys.length > 0) { let _this = this @@ -2100,6 +2234,7 @@ cursor: pointer; border-radius: 4px; } + .operator-text-title { cursor: pointer; margin-right: 22px; @@ -2245,12 +2380,13 @@ } } } - .text-wraning{ + + .text-wraning { word-break: break-word; } \ No newline at end of file