diff --git a/jero-boot/db/蔚来标准sql/dev_third_record.sql b/jero-boot/db/蔚来标准sql/dev_third_record.sql index f5f06e242..2a7c9ddab 100644 --- a/jero-boot/db/蔚来标准sql/dev_third_record.sql +++ b/jero-boot/db/蔚来标准sql/dev_third_record.sql @@ -74,4 +74,7 @@ ALTER TABLE `laws_weilai`.`params_config_data_history` -- 上报库参数配置数据表 修改字段长度 ALTER TABLE `laws_weilai`.`params_report_config_data` MODIFY COLUMN `text_data` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文本类型数据' AFTER `sys_org_code`, - MODIFY COLUMN `pull_data` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '下拉类型数据' AFTER `text_data`; \ No newline at end of file + MODIFY COLUMN `pull_data` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '下拉类型数据' AFTER `text_data`; +-- 上报库表 添加字段 +ALTER TABLE `laws_weilai`.`params_report` + ADD COLUMN `params_template_publish_version` int(11) NULL DEFAULT NULL COMMENT '对应参数模板发布版本' AFTER `old_params_manifest_id`; \ No newline at end of file diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 2fa3dc9e3..11947cd09 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -1477,7 +1477,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl getConfigLableList(ParamsReportDetailVO paramsReportDetailVO) { + List> configLabelList = paramsReportDetailEOService.getConfigLabelList(paramsReportDetailVO); + return Result.OK(configLabelList); + } + } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/entity/ParamsReportEO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/entity/ParamsReportEO.java index 90003a7f1..e8d81dd1a 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/entity/ParamsReportEO.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/entity/ParamsReportEO.java @@ -67,6 +67,9 @@ public class ParamsReportEO implements Serializable { @ApiModelProperty(value = "版本") private Integer version; + @ApiModelProperty(value = "对应参数模板发布版本") + private Integer paramsTemplatePublishVersion; + @TableField(exist = false) @ApiModelProperty(value = "项目名称") private String projectName; diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/entity/ReportCertCategoryParamsInfoEO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/entity/ReportCertCategoryParamsInfoEO.java index a7c4a33dd..8ca30076c 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/entity/ReportCertCategoryParamsInfoEO.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/entity/ReportCertCategoryParamsInfoEO.java @@ -3,6 +3,7 @@ package com.jero.modules.cert.report.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -24,4 +25,8 @@ import java.io.Serializable; public class ReportCertCategoryParamsInfoEO extends CertCategoryParamsInfoEO implements Serializable { private static final long serialVersionUID = 1L; + /**发布时版本*/ + @ApiModelProperty(value = "发布时版本") + private Integer version; + } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/mapper/xml/ParamsReportDetailEOMapper.xml b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/mapper/xml/ParamsReportDetailEOMapper.xml index b575d920c..92ba7dddd 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/mapper/xml/ParamsReportDetailEOMapper.xml +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/mapper/xml/ParamsReportDetailEOMapper.xml @@ -65,7 +65,10 @@ AND prd.params_name LIKE CONCAT(CONCAT('%',#{paramsReportDetailVO.paramsName}),'%') - AND prd.cert_category LIKE CONCAT(CONCAT('%',#{paramsReportDetailVO.certCategory}),'%') + AND rccpi.cert_category = #{paramsReportDetailVO.certCategory} + + + AND rccpi.version = #{paramsReportDetailVO.paramsTemplatePublishVersion} AND prd.sdt LIKE CONCAT(CONCAT('%',#{paramsReportDetailVO.sdt}),'%') @@ -98,7 +101,7 @@ from params_report_detail prd left join report_cert_category_params_info rccpi on prd.nio_number = rccpi.nio_number - + and prd.id in #{item} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/mapper/xml/ParamsReportEOMapper.xml b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/mapper/xml/ParamsReportEOMapper.xml index c00f9aec4..4426e029a 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/mapper/xml/ParamsReportEOMapper.xml +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/mapper/xml/ParamsReportEOMapper.xml @@ -12,12 +12,18 @@ + pr.id as id, pr.old_params_manifest_id as old_params_manifest_id, pr.version as version, + pr.params_template_publish_version as params_template_publish_version, + pr.create_by as create_by, + pr.create_time as create_time, + pr.update_by as update_by, + pr.update_time as update_time, pm.title as title, pni.project_name as project_name @@ -44,6 +50,7 @@ left join project_name_info as pni on plb.project_name_id = pni.id ) tmp_tb + order by create_time desc \ No newline at end of file diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/service/IParamsReportDetailEOService.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/service/IParamsReportDetailEOService.java index e9378b330..45931c5c2 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/service/IParamsReportDetailEOService.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/service/IParamsReportDetailEOService.java @@ -1,7 +1,6 @@ package com.jero.modules.cert.report.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO; import com.jero.modules.cert.report.entity.ParamsReportDetailEO; import com.jero.modules.cert.report.vo.ParamsReportDetailVO; @@ -36,4 +35,7 @@ public interface IParamsReportDetailEOService extends IService> getHeader(String paramsManifestId, String flag, String cut); void exportNormal(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request); + + // 配置-下拉选项 + List> getConfigLabelList(ParamsReportDetailVO paramsReportDetailVO); } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportDetailEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportDetailEOServiceImpl.java index 97a9c0be6..8ba990cfa 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportDetailEOServiceImpl.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/service/impl/ParamsReportDetailEOServiceImpl.java @@ -3,6 +3,7 @@ package com.jero.modules.cert.report.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ZipUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Lists; import com.jero.common.constant.enums.CutEnum; @@ -47,7 +48,9 @@ import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.ss.usermodel.Hyperlink; import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.*; +import org.aspectj.util.FileUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -480,17 +483,17 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl> getConfigLabelList(ParamsReportDetailVO paramsReportDetailVO) { + String paramsManifestId = paramsReportDetailVO.getParamsManifestId(); + + // 查询配置列 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ParamsReportConfigEO::getParamsManifestId, paramsManifestId); + + queryWrapper.orderByAsc(ParamsConfigEO::getDisplaySeq); + List paramsConfigEOList = paramsReportConfigEOService.list(queryWrapper); + + List> configLabelList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(paramsConfigEOList)) { + for (ParamsConfigEO paramsConfigEO : paramsConfigEOList) { + Map map = new HashMap<>(); + map.put("label", paramsConfigEO.getConfigName()); + map.put("value", paramsConfigEO.getId()); + configLabelList.add(map); + } + } + + return configLabelList; + } + private void downLoadFileList(List allRelevFileList,String fileNowPath) { + File nowFile = new File(fileNowPath); + if (nowFile.exists()){ + nowFile.delete(); + } + nowFile.mkdirs(); + for(OSSFile fileExportDto : allRelevFileList){ String oldPath = fileExportDto.getUrl(); String newPath = fileNowPath + File.separator + fileExportDto.getFileName(); @@ -631,18 +666,22 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl> queryForExport(ParamsReportDetailVO paramsReportDetailVO) { - List idList = Arrays.asList(paramsReportDetailVO.getIds()); - List configIdList = Arrays.asList(paramsReportDetailVO.getConfigIds()); + List idList = new ArrayList<>(); + if (StringUtils.isNotEmpty(paramsReportDetailVO.getIds())) { + idList = Arrays.asList(paramsReportDetailVO.getIds().split(",")); + } + List configIdList = Arrays.asList(paramsReportDetailVO.getConfigIds().split(",")); List> dataList = paramsReportDetailEOMapper.listInfoForExport(idList, paramsReportDetailVO); List paramsConfigEOList = paramsReportConfigEOService.queryList(paramsReportDetailVO.getParamsManifestId()); // 查询所有配置列 - List fileList = new ArrayList<>(); + // 查询配置列数据 for (Map record1 : dataList) { String paramsCollectManifestId = (String) record1.get("id"); if (CollectionUtil.isNotEmpty(paramsConfigEOList)) { + List fileList = new ArrayList<>(); //不合并 if ("1".equals(paramsReportDetailVO.getCombineFlag())) { paramsConfigEOList = paramsConfigEOList.stream().filter(e->configIdList.contains(e.getId())).collect(Collectors.toList()); // 过滤出要导出的配置列 @@ -678,10 +717,10 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl paramsReportConfigDataEOS = paramsReportConfigDataEOService.queryByConfigIdListAndCollectManifestId(configIdList, paramsCollectManifestId); - String textDatas = paramsReportConfigDataEOS.stream() + String textDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getTextData())) .map(ParamsReportConfigDataEO::getTextData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator())); - String pullDatas = paramsReportConfigDataEOS.stream() + String pullDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getPullData())) .map(ParamsReportConfigDataEO::getPullData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator())); List fileNameList = new ArrayList<>(); @@ -713,8 +752,8 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl> list = new LinkedList<>(); for (int i = 0; i < fieldList.size(); i++) { OnlCgformField onlCgformField = fieldList.get(i); Map map = new HashMap<>(); @@ -769,11 +807,15 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl paramsConfigEOList = paramsReportConfigEOService.queryList(paramsManifestId); - List> listConfig = new LinkedList<>(); - for (ParamsConfigEO paramsConfigEO : paramsConfigEOList) { - dbFieldList.add(paramsConfigEO.getId()); - dbFieldNameList.add(paramsConfigEO.getConfigName()); + List configIdList = Arrays.asList(paramsReportDetailVO.getConfigIds().split(",")); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(ParamsReportConfigEO::getId, configIdList).orderByAsc(ParamsReportConfigEO::getDisplaySeq); + List paramsReportConfigEOList = paramsReportConfigEOService.list(wrapper); + if (CollectionUtil.isNotEmpty(paramsReportConfigEOList)) { + for (ParamsReportConfigEO paramsReportConfigEO : paramsReportConfigEOList) { + dbFieldList.add(paramsReportConfigEO.getId()); + dbFieldNameList.add(paramsReportConfigEO.getConfigName()); + } } } else if ("2".equals(combineFlag)) { dbFieldList.add("params_value"); diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/vo/ParamsReportDetailVO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/vo/ParamsReportDetailVO.java index 83d6c61ad..84ec1e32b 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/vo/ParamsReportDetailVO.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/report/vo/ParamsReportDetailVO.java @@ -40,6 +40,9 @@ public class ParamsReportDetailVO { @ApiModelProperty(value = "认证类别名称") private String certCategoryName; + @ApiModelProperty(value = "对应参数模板发布版本") + private Integer paramsTemplatePublishVersion; + private String ids; // 勾选导出 private String configIds; // 导出的配置列 private String combineFlag; // 合并标识 1-不合并,2-合并 diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java index c535ba5d4..c7a2324f2 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java @@ -38,6 +38,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.aspectj.util.FileUtil; import org.checkerframework.checker.units.qual.C; import org.jeecgframework.poi.excel.ExcelExportUtil; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -499,6 +500,8 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl