修改UAT问题

This commit is contained in:
gaosong
2023-10-22 16:52:36 +08:00
parent 0c5cbb19d5
commit f048ac4238
15 changed files with 949 additions and 47 deletions
@@ -1335,6 +1335,9 @@ ADD COLUMN `is_del` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_c
DROP PRIMARY KEY,
ADD PRIMARY KEY (`vdr_id`);
ALTER TABLE `params_report`
ADD COLUMN `project_version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '相关项目版本' AFTER `target_market`;
@@ -10,6 +10,7 @@ import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
import com.jero.modules.cert.collect.service.IParamsCollectManifestHistoryEOService;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
@@ -43,6 +44,8 @@ import java.util.stream.Collectors;
public class ParamsCollectManifestEOController extends JeroController<ParamsCollectManifestEO, IParamsCollectManifestEOService> {
@Autowired
private IParamsCollectManifestEOService paramsCollectManifestEOService;
@Autowired
private IParamsCollectManifestHistoryEOService paramsCollectManifestHistoryEOService;
@Autowired
private ISysUserService sysUserService;
@@ -531,7 +534,12 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
public void exportAll(ParamsCollectManifestVO paramsCollectManifestVO,
HttpServletResponse response,
HttpServletRequest request) {
paramsCollectManifestEOService.exportAll(paramsCollectManifestVO, response, request);
if(StringUtils.isNotBlank(paramsCollectManifestVO.getIsHistory())&&paramsCollectManifestVO.getIsHistory().equals("1")){
paramsCollectManifestHistoryEOService.exportAll(paramsCollectManifestVO, response, request);
}else{
paramsCollectManifestEOService.exportAll(paramsCollectManifestVO, response, request);
}
}
@ApiOperation(value = "参数项收集清单-填写人角色下导出")
@@ -84,7 +84,7 @@
#{item}
</foreach>
</if>
and control_type != '11'
order by nio_number asc
</select>
</mapper>
@@ -3,8 +3,10 @@ package com.jero.modules.cert.collect.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestHistoryEO;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@@ -42,4 +44,7 @@ public interface IParamsCollectManifestHistoryEOService extends IService<ParamsC
*/
boolean deleteByIds(List<String> ids);
void exportAll(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request);
}
@@ -3525,6 +3525,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
addReportEO.setId(reportId);
addReportEO.setOldParamsManifestId(paramsManifestId);
addReportEO.setVersion(paramsManifestEO.getVersion());
addReportEO.setProjectVersion(paramsManifestEO.getProjectVersion());
addReportEO.setParamsTemplatePublishVersion(paramsManifestEO.getParamsTemplatePublishVersion());
paramsReportEOService.add(addReportEO);
}
@@ -3607,7 +3608,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
@Override
public void exportAll(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
// OutputStream os = null;
OutputStream excelOS = null;
XSSFWorkbook workbook = new XSSFWorkbook();
String fileOriName = "参数项清单导出信息";
@@ -3721,7 +3722,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
"attachment; filename=\"" + ReadExcel.encodeFileName(fileOriName + ".zip", request) + "\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
// os = response.getOutputStream();
workbook.write(excelOS);
excelOS.flush();
excelOS.close();
@@ -3766,8 +3767,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
// webSocket.sendMessage(obj.toJSONString());
//
// uploadFileio.close();
os.flush();
os.close(); // 后开先关
// os.flush();
// os.close(); // 后开先关
// fis.close(); // 先开后关
pce.setState(ExportStateEnum.SUCCESSFULLY.getValue());
pce.setFileId(ossFile.getId());
@@ -3786,7 +3787,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
}
} finally {
IOUtils.closeQuietly(os);
// IOUtils.closeQuietly(os);
IOUtils.closeQuietly(excelOS);
File tempZipFile = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(tempZipFile);
@@ -2,36 +2,62 @@ package com.jero.modules.cert.collect.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.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.oss.CosBootUtil;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.cert.collect.entity.*;
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.CollectManifestUserTypeEnum;
import com.jero.modules.cert.collect.enums.ConfigDataTypeEnum;
import com.jero.modules.cert.collect.enums.ExportStateEnum;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestHistoryEOMapper;
import com.jero.modules.cert.collect.service.IParamsCollectExportService;
import com.jero.modules.cert.collect.service.IParamsCollectManifestHistoryEOService;
import com.jero.modules.cert.collect.service.IParamsConfigDataHistoryEOService;
import com.jero.modules.cert.collect.service.IParamsConfigHistoryEOService;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import com.jero.modules.cert.collect.vo.ParamsConfigDataVO;
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoPublishEO;
import com.jero.modules.cert.template.enums.ControlTypeEnum;
import com.jero.modules.cert.template.service.ICertCategoryParamsInfoPublishEOService;
import com.jero.modules.ocr.util.LineHumpUtil;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.split.common.ReadExcel;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.service.ISysDictItemService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.usermodel.*;
import org.apache.shiro.SecurityUtils;
import org.aspectj.util.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.lang.reflect.Field;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -62,6 +88,12 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
@Autowired
private IOSSFileService ossFileService;
@Autowired
private IParamsCollectExportService paramsCollectExportService;
@Autowired
private ICertCategoryParamsInfoPublishEOService certCategoryParamsInfoPublishEOService;
@Value(value = "${jero.path.upload}")
private String uploadpath;
private ParamsConfigDataHistoryEO getConfigDataEOByConfigIdAndCollectManifestId(String configId, String collectManifestId, List<ParamsConfigDataHistoryEO> paramsConfigDataEOList) {
@@ -606,4 +638,524 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
// }
// return map;
// }
@Override
public void exportAll(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
OutputStream excelOS = null;
XSSFWorkbook workbook = new XSSFWorkbook();
String fileOriName = "参数项清单导出信息";
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
fileOriName = "Params info export data";
}
if (StringUtils.isNotEmpty(paramsCollectManifestVO.getExportName())) {
fileOriName = paramsCollectManifestVO.getExportName();
}
//创建导出记录
ParamsCollectExport pce = new ParamsCollectExport();
String pceId = UUID.randomUUID().toString().replace("-", "");
pce.setId(pceId);
pce.setParamsManifestId(paramsCollectManifestVO.getParamsManifestId());
pce.setState(ExportStateEnum.EXPORTING.getValue());
pce.setFileName(fileOriName+ ".zip");
Thread thread1 = new Thread(new Runnable() {
@Override
public void run() {
paramsCollectExportService.add(pce);
}
});
thread1.start();
//创建临时文件夹
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-", "") + File.separator + fileOriName;
File nowFile = new File(fileNowPath);
if (nowFile.exists()) {
nowFile.delete();
}
nowFile.mkdirs();
try {
String fileName = fileOriName + ".xlsx";
// 设置表格相关属性
String sheetName = "参数项清单信息";
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
sheetName = "Params data";
}
XSSFSheet sheetItems = workbook.createSheet(sheetName);
String[] titles = getWorkbookTitleForExport(paramsCollectManifestVO); // 获取表头
String[] headers = titles[1].split(",");
XSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setWrapText(true);
// cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
XSSFCellStyle cellStyle1 = workbook.createCellStyle();
cellStyle1.setAlignment(XSSFCellStyle.ALIGN_CENTER);
XSSFCellStyle cellStyleLink = workbook.createCellStyle();
XSSFFont font = workbook.createFont();
font.setColor(HSSFColor.LIGHT_BLUE.index);
cellStyleLink.setFont(font);
cellStyleLink.setWrapText(true);
// 查询需要导出的字段
String field = titles[0]; // 字符串形式
List<String> fieldList = Arrays.asList(field.split(",")); // list形式
// 查询导出数据
List<Map<String, Object>> allParamsInfoList = queryForExportAll(paramsCollectManifestVO); // id记得去掉
// 开始处理工作表
List<OSSFile> allRelevFileList = new ArrayList<>();
// 在excel表中添加表头
XSSFRow row = sheetItems.createRow(0);
for (int i = 0; i < headers.length; i++) {
XSSFCell cell = row.createCell(i);
XSSFRichTextString text = new XSSFRichTextString(headers[i]);
cell.setCellValue(text);
cell.setCellStyle(cellStyle1);
sheetItems.setColumnWidth(i, 20 * 256); // 设置单元格宽度
}
Map<String, String> fileNowPathMap = new HashMap<>();
//放文字内容
int allRow = 0;
for (int rowNum = 0; rowNum < allParamsInfoList.size(); rowNum++) {
Map<String, Object> exportDto = allParamsInfoList.get(rowNum);
// 处理文件
List<OSSFile> fileList = (List<OSSFile>) exportDto.get("fileList");
if (CollectionUtil.isNotEmpty(fileList)) {
allRelevFileList.addAll(fileList);
fileList.forEach(file -> {
fileNowPathMap.put(file.getId(), fileNowPath + File.separator + exportDto.get("nio_number"));
});
}
allRow++;
XSSFRow row1 = sheetItems.createRow(allRow);
for (int cellNum = 0; cellNum < fieldList.size(); cellNum++) {
if (ObjectUtils.isNotEmpty(exportDto.get(fieldList.get(cellNum)))) {
row1.createCell(cellNum).setCellValue(exportDto.get(fieldList.get(cellNum)).toString());
row1.getCell(cellNum).setCellStyle(cellStyle);
}
}
}
//下载关联文件内容
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
downLoadFileList(allRelevFileList, fileNowPathMap);
}
String repFileName = fileName.replaceAll("/", "_");
excelOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
response.setHeader("Content-Disposition",
"attachment; filename=\"" + ReadExcel.encodeFileName(fileOriName + ".zip", request) + "\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
workbook.write(excelOS);
excelOS.flush();
excelOS.close();
ZipUtil.zip(fileNowPath, fileNowPath + ".zip");
// FileInputStream fis = new FileInputStream(fileNowPath + ".zip");
// int len = 0;
// while ((len = fis.read()) != -1) {
// os.write(len);
// }
// 将导出文件上传到cos上
String uploadFileName = fileOriName + ".zip";
InputStream uploadFileio = new FileInputStream(new File(fileNowPath+".zip"));
MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, "text/plain", uploadFileio); // 用于上传
OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/manifest", "", CutEnum.CN.getValue()); // 上传导出的压缩包
//
// // 系统向用户发消息
// LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录人
// String msgTitle = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated.";
// String content = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated, please click download.";
//
// String href = "<a href='/jero-boot/sys/common/downLoadFile?id=" + ossFile.getId() + "'" + " target='_blank'>download</a>.";
// String contentInfo = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated, please click " + href;
//
// SysAnnouncement sysAnnouncement = new SysAnnouncement();
// sysAnnouncement.setDelFlag("0");
// sysAnnouncement.setSendStatus("0");
// sysAnnouncement.setSendTime(new Date());
// sysAnnouncement.setMsgCategory(MessageTypeEnum.PUSH.getValue()); //消息类型:转发推送
// sysAnnouncement.setInitiator(MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); // 发起人:系统
// sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
// sysAnnouncement.setTitile(msgTitle);
// sysAnnouncement.setMsgContent(content);
// sysAnnouncement.setMsgContentInfo(contentInfo);
// sysAnnouncement.setUserIds(currentUser.getId()); // 发送给当前导出人
// sysAnnouncementService.saveAnnouncement(sysAnnouncement);
//
// JSONObject obj = new JSONObject();
// obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
// obj.put(WebsocketConst.MSG_ID, currentUser.getId());
// obj.put(WebsocketConst.MSG_TXT, contentInfo);
// webSocket.sendMessage(obj.toJSONString());
//
// uploadFileio.close();
os.flush();
os.close(); // 后开先关
// fis.close(); // 先开后关
pce.setState(ExportStateEnum.SUCCESSFULLY.getValue());
pce.setFileId(ossFile.getId());
paramsCollectExportService.updateById(pce);
} catch (Exception e) {
pce.setState(ExportStateEnum.FAILURE.getValue());
paramsCollectExportService.updateById(pce);
if (e instanceof JeroBootException) {
throw new JeroBootException(e.getMessage());
} else {
log.error(e.getMessage(), e);
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
throw new JeroBootException("Failed to download file, please try again");
} else {
throw new JeroBootException("下载文件失败,请重试");
}
}
} finally {
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(excelOS);
File tempZipFile = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(tempZipFile);
}
}
private String[] getWorkbookTitleForExport(ParamsCollectManifestVO paramsCollectManifestVO) {
String cut = paramsCollectManifestVO.getCut();
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.PARAMS_COLLECT_MANIFEST.getValue());
List<String> dbFieldNameList = new LinkedList<>();
List<String> dbFieldList = new LinkedList<>();
if (fieldList.size() != 0) {
//过滤列表字段(is_show_list-->列表是否显示0否 1是)
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowList()))).collect(Collectors.toList());
}
// 固定列
int indexOfDescription = 1; // 参数名称的位置
for (int i = 0; i < fieldList.size(); i++) {
OnlCgformField onlCgformField = fieldList.get(i);
String dbFieldName = onlCgformField.getDbFieldName();
if (!"deadline".equals(dbFieldName) && !"cert_category".equals(dbFieldName)) {
dbFieldList.add(dbFieldName);
if (CutEnum.CN.getValue().equals(cut)) {
dbFieldNameList.add(onlCgformField.getDbFieldTxt()); // 字段中文名
} else {
dbFieldNameList.add(onlCgformField.getDbFieldEnName()); // 字段英文名
}
if ("params_name".equals(dbFieldName)) {
indexOfDescription = i;
}
}
}
// 认证类别列
List<String> dbFieldNameListCC = new LinkedList<>();
List<String> dbFieldListCC = new LinkedList<>();
// 查询所有认证类别
List<SysDictItem> sysDictItemList = sysDictItemService.selectItemsByDictCode("cert_category");
if (CutEnum.EN.getValue().equals(cut)) {
sysDictItemList.forEach(sysDictItem -> {
dbFieldListCC.add(sysDictItem.getItemValue());
dbFieldNameListCC.add(sysDictItem.getEnName() + " Number");
});
} else {
sysDictItemList.forEach(sysDictItem -> {
dbFieldListCC.add(sysDictItem.getItemValue());
dbFieldNameListCC.add(sysDictItem.getItemText() + "编号");
});
}
// 配置列
List<String> dbFieldNameListConfig = new LinkedList<>();
List<String> dbFieldListConfig = new LinkedList<>();
List<ParamsConfigHistoryEO> paramsConfigEOList = paramsConfigHistoryEOService.queryList(paramsManifestId);
for (ParamsConfigHistoryEO paramsConfigEO : paramsConfigEOList) {
dbFieldListConfig.add(paramsConfigEO.getId());
dbFieldNameListConfig.add(paramsConfigEO.getConfigName());
}
// 插入认证类别列
dbFieldList.addAll(indexOfDescription, dbFieldListCC);
dbFieldNameList.addAll(indexOfDescription, dbFieldNameListCC);
// 插入配置列
dbFieldList.addAll(dbFieldListConfig);
dbFieldNameList.addAll(dbFieldNameListConfig);
String[] title = new String[2];
String dbFieldStr = StringUtils.join(dbFieldList, ",");
String dbFieldNameStr = StringUtils.join(dbFieldNameList, ",");
title[0] = dbFieldStr;
title[1] = dbFieldNameStr;
return title;
}
private List<Map<String, Object>> queryForExportAll(ParamsCollectManifestVO paramsCollectManifestVO) {
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
String paramsTemplateId = paramsCollectManifestVO.getParamsTemplateId();
Integer paramsTemplatePublishVersion = paramsCollectManifestVO.getParamsTemplatePublishVersion();
String cut = paramsCollectManifestVO.getCut();
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ParamsCollectManifestEO queryEO = new ParamsCollectManifestEO();
queryEO.setParamsManifestId(paramsManifestId);
String userTypes = paramsCollectManifestVO.getUserTypes();
if (userTypes != null && CollectManifestUserTypeEnum.SDT.getValue().equals(userTypes)) {
queryEO.setUserTypes(CollectManifestUserTypeEnum.SDT.getValue());
queryEO.setSdt(loginUser.getUsername());
}
List<Map<String, Object>> dataList = paramsCollectManifestHistoryEOMapper.listInfoForExport(queryEO, null); // 查询导出数据
if (dataList == null || dataList.isEmpty()) {
// 没有查到数据,进行提示
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
throw new JeroBootException("No data, unable to export");
} else {
throw new JeroBootException("无数据,无法导出");
}
}
List<ParamsConfigHistoryEO> paramsConfigEOList = paramsConfigHistoryEOService.queryList(paramsManifestId); // 查询所有配置列
List<String> paramsConfigIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList());
List<ParamsConfigDataHistoryEO> paramsConfigDataEOList = paramsConfigDataHistoryEOService.queryListByConfigIdList(paramsConfigIdList); // 查询所有配置数据
List<Map<String,Object>> exportDataList = new ArrayList<>();
// 配置列多行数据处理
for (Map<String, Object> data : dataList) {
String controlType = (String)data.get("control_type");
if("0".equals(paramsCollectManifestVO.getExportOption()) && "11".equals(controlType)){
//不要标题
continue;
}
String id = (String) data.get("id");
Map<String, List<ParamsConfigDataEO>> 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<Map<String, Object>> paramsConfigDataCountList = new ArrayList<>();
for (Map.Entry<String, List<ParamsConfigDataEO>> map : paramsConfigDataMap.entrySet()) {
Map<String, Object> 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<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
return o2.get("paramsConfigDataCount").toString().compareTo(o1.get("paramsConfigDataCount").toString());
}
});
// 获取出最多行的配置列。
if (!paramsConfigDataCountList.isEmpty()) {
Map<String, Object> paramsConfigDataMaxCountMap = paramsConfigDataCountList.get(0);
String key = (String) paramsConfigDataMaxCountMap.get("key");
List<ParamsConfigDataEO> paramsConfigDataEOs = paramsConfigDataMap.get(key);
for (ParamsConfigDataEO paramsConfigDataEO : paramsConfigDataEOs) {
Map<String, Object> dataTemp = new HashMap<>();
data.entrySet().forEach(o -> dataTemp.put(o.getKey(), o.getValue()));
exportDataList.add(dataTemp);
}
} else {
exportDataList.add(data);
}
}
List<String> nioNumberList = dataList.stream().map(m -> (String) m.get("nio_number")).collect(Collectors.toList());
List<CertCategoryParamsInfoPublishEO> certCategoryParamsInfoPublishEOList = certCategoryParamsInfoPublishEOService.queryListByVersionAndNio(paramsTemplateId, paramsTemplatePublishVersion, nioNumberList); //查询所有认证类别参数项
// 查询责任领域数据字典
List<SysDictItem> sysDictItemList = sysDictItemService.selectItemsByDictCode("duty_territory");
Map<String, String> dutyTerritoryMap = new HashMap<>();
if (CutEnum.EN.getValue().equals(cut)) {
dutyTerritoryMap = sysDictItemList.stream().collect(Collectors.toMap(c -> c.getItemValue(), c -> c.getEnName()));
} else {
dutyTerritoryMap = sysDictItemList.stream().collect(Collectors.toMap(c -> c.getItemValue(), c -> c.getItemText()));
}
// 状态
Map<String, String> stateMap = CollectManifestStateEnum.toMap(cut);
// 插入配置列和认证类别列数据
for (Map<String, Object> record1 : exportDataList) {
String paramsCollectManifestId = (String) record1.get("id");
String nioNumber = (String) record1.get("nio_number");
String dutyTerritory = (String) record1.get("duty_territory");
String state = (String) record1.get("state");
String control_type = record1.get("control_type").toString();
//references_col -> #a# #
if (!Objects.isNull(record1.get("references_col"))) {
String references_col = record1.get("references_col").toString();
if (StringUtils.isNotEmpty(references_col)) {
String[] references_colArr = references_col.split("#");
if (StringUtils.equals(control_type, ControlTypeEnum.FILE.getValue())) {
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#" + references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
} else if (StringUtils.equals(control_type, ControlTypeEnum.TEXT_FILE.getValue())
|| StringUtils.equals(control_type, ControlTypeEnum.PULL_SINGLE_FILE.getValue())
|| StringUtils.equals(control_type, ControlTypeEnum.PULL_MORE_FILE.getValue())) {
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#" + references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
} else if (StringUtils.equals(control_type, ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue())) {
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#" + references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
}
StringBuilder references_colSb = new StringBuilder();
for (String col : references_col.split("#")) {
if (StringUtils.isNotEmpty(col) && !StringUtils.equals(col, " ")) {
references_colSb.append(col).append("#");
}
}
if (StringUtils.isNotEmpty(references_colSb)) {
references_col = references_colSb.substring(0, references_colSb.length() - 1);
} else {
references_col = references_colSb.toString();
}
record1.put("references_col", references_col);
}
}
// 处理负责领域
record1.put("duty_territory", dutyTerritoryMap.get(dutyTerritory));
// 处理状态
record1.put("state", stateMap.get(state));
// 认证类别列
List<CertCategoryParamsInfoPublishEO> certCategoryParamsInfoPublishEOS = certCategoryParamsInfoPublishEOList.stream().filter(e -> nioNumber.equals(e.getNioNumber())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(certCategoryParamsInfoPublishEOS)) {
certCategoryParamsInfoPublishEOS.forEach(certCategoryParamsInfoPublishEO -> {
record1.put(certCategoryParamsInfoPublishEO.getCertCategory(), certCategoryParamsInfoPublishEO.getParamsNumber());
});
}
// 配置列
if (CollectionUtil.isNotEmpty(paramsConfigEOList)) {
List<OSSFile> fileList = new ArrayList<>();
paramsConfigEOList.forEach(paramsConfigEO -> { // 参数配置
String paramsConfigId = paramsConfigEO.getId();
List<ParamsConfigDataEO> paramsConfigDataEOS = paramsConfigDataEOList.stream().filter(e -> {
boolean flag = false;
if(StringUtils.equals(paramsConfigId,e.getParamsConfigId()) && StringUtils.equals(paramsCollectManifestId,e.getParamsCollectManifestId())){
flag = true;
}
return flag;
}).collect(Collectors.toList()); // 参数配置数据
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
if (CollectionUtil.isNotEmpty(paramsConfigDataEOS)) {
ParamsConfigDataEO paramsConfigDataEO = paramsConfigDataEOS.get(0);
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData()).append("#");
}
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData()).append("#");
}
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName()).append("#");
fileList.addAll(ossFileList);
}
}
paramsConfigDataEOList.remove(paramsConfigDataEO);
}
String configData = configDataBuilder.toString();
if (configData.contains("#")) {
configData = configData.substring(0, configData.lastIndexOf("#"));
}
record1.put(paramsConfigEO.getId(), configData);
});
record1.put("fileList", fileList);
}
}
return exportDataList;
}
private void downLoadFileList(List<OSSFile> fileTemplateList, Map<String, String> fileNowPathMap) {
for (OSSFile fileExportDto : fileTemplateList) {
String fileNowPath = fileNowPathMap.get(fileExportDto.getId());
File nowFile = new File(fileNowPath);
if (nowFile.exists()) {
nowFile.delete();
}
nowFile.mkdirs();
String oldPath = fileExportDto.getUrl();
String newPath = fileNowPath + File.separator + fileExportDto.getFileName();
if (CosBootUtil.doesObjectExist(oldPath)) {
try (InputStream in = CosBootUtil.download(oldPath);) {
copyFile(in, newPath);
} catch (IOException e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
}
}
}
private void copyFile(InputStream in, String destPath) throws IOException {
BufferedInputStream bis = new BufferedInputStream(in);
BufferedOutputStream bos =
new BufferedOutputStream(Files.newOutputStream(Paths.get(destPath),
StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING,
StandardOpenOption.WRITE));
// 打开输入流
// FileInputStream fis = new FileInputStream(srcPath);
// 打开输出流
// FileOutputStream fos = new FileOutputStream(destPath);
// 读取和写入信息
byte[] bytes = new byte[1024 * 1024];
int len;
while ((len = bis.read(bytes)) > 0) {
bos.write(bytes, 0, len);
}
// 关闭流 先开后关 后开先关
bos.close(); // 后开先关
bis.close(); // 先开后关
}
}
@@ -110,4 +110,8 @@ public class ParamsCollectManifestVO {
//是否导出标题 ”1“ 是 ”0“否
@TableField(exist = false)
private String exportOption;
//是否是历史版本 ”1“ 是 ”0“否
@TableField(exist = false)
private String isHistory;
}
@@ -123,14 +123,20 @@ public class ParamsReportEOController extends JeroController<ParamsReportEO, IPa
String market = getMarket(paramsReportEO, targetMarketList, row);
if(StringUtils.isNotBlank(row.getProjectName())){
if(StringUtils.isBlank(market)){
row.setProjectName(row.getProjectName()+ "-00");
row.setProjectName(row.getProjectName());
}else{
row.setProjectName(row.getProjectName()+"-" +market+ "-00");
row.setProjectName(row.getProjectName()+"-" +market);
}
row.setPageName(row.getProjectName());
}else{
row.setPageName("");
}
String projectVersion = row.getProjectVersion();
if(StringUtils.isNotBlank(row.getProjectVersion())){
row.setProjectName(row.getProjectName() + "-" + row.getProjectVersion());
}else{
row.setProjectName(row.getProjectName()+"-00");
}
}
String orderBy = paramsReportEO.getOrderBy();
String orderByField = paramsReportEO.getOrderByField();
@@ -81,6 +81,9 @@ public class ParamsReportEO implements Serializable {
@ApiModelProperty(value = "目标市场")
private String targetMarket;
@ApiModelProperty(value = "相关项目版本")
private String projectVersion;
@TableField(exist = false)
private String cut;
@@ -22,6 +22,7 @@
pr.id as id,
pr.old_params_manifest_id as old_params_manifest_id,
pr.version as version,
pr.project_version,
pr.params_template_publish_version as params_template_publish_version,
pr.create_by as create_by,
pr.create_time as create_time,
@@ -17,10 +17,13 @@ import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.oss.CosBootUtil;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.cert.collect.entity.ParamsCollectExport;
import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigEO;
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.ConfigDataTypeEnum;
import com.jero.modules.cert.collect.enums.ExportStateEnum;
import com.jero.modules.cert.collect.service.IParamsCollectExportService;
import com.jero.modules.cert.collect.vo.ParamsConfigDataVO;
import com.jero.modules.cert.report.entity.*;
import com.jero.modules.cert.report.enums.ExportTemplateStateEnum;
@@ -116,6 +119,8 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
@Autowired
private IReportCertCategoryParamsInfoEOService reportCertCategoryParamsInfoEOService;
@Autowired
private IParamsCollectExportService paramsCollectExportService;
@Value(value = "${jero.path.upload}")
private String uploadpath;
@@ -2381,7 +2386,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
@Override
public void exportGeneral(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
// OutputStream os = null;
OutputStream excelOS = null;
XSSFWorkbook workbook = new XSSFWorkbook();
String fileOriName = "一般导出";
@@ -2391,6 +2396,20 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
if (StringUtils.isNotEmpty(paramsReportDetailVO.getExportName())) {
fileOriName = paramsReportDetailVO.getExportName();
}
//创建导出记录
ParamsCollectExport pce = new ParamsCollectExport();
String pceId = UUID.randomUUID().toString().replace("-", "");
pce.setId(pceId);
pce.setParamsManifestId(paramsReportDetailVO.getParamsManifestId());
pce.setState(ExportStateEnum.EXPORTING.getValue());
pce.setFileName(fileOriName+ ".zip");
Thread thread1 = new Thread(new Runnable() {
@Override
public void run() {
paramsCollectExportService.add(pce);
}
});
thread1.start();
//创建临时文件夹
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-", "") + File.separator + fileOriName;
File nowFile = new File(fileNowPath);
@@ -2485,16 +2504,16 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
"attachment; filename=\"" + ReadExcel.encodeFileName(fileOriName + ".zip", request) + "\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
// os = response.getOutputStream();
workbook.write(excelOS);
excelOS.flush();
excelOS.close();
ZipUtil.zip(fileNowPath, fileNowPath + ".zip");
FileInputStream fis = new FileInputStream(fileNowPath + ".zip");
int len = 0;
while ((len = fis.read()) != -1) {
os.write(len);
}
// FileInputStream fis = new FileInputStream(fileNowPath + ".zip");
// int len = 0;
// while ((len = fis.read()) != -1) {
// os.write(len);
// }
// 添加导出历史
String uploadFileName = fileOriName + ".zip";
@@ -2508,11 +2527,16 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
paramsReportExportHistoryEO.setExportTime(new Date());
paramsReportExportHistoryEOService.add(paramsReportExportHistoryEO);
uploadFileio.close();
os.flush();
os.close(); // 后开先关
fis.close(); // 先开后关
// uploadFileio.close();
// os.flush();
// os.close(); // 后开先关
// fis.close(); // 先开后关
pce.setState(ExportStateEnum.SUCCESSFULLY.getValue());
pce.setFileId(ossFile.getId());
paramsCollectExportService.updateById(pce);
} catch (Exception e) {
pce.setState(ExportStateEnum.FAILURE.getValue());
paramsCollectExportService.updateById(pce);
e.printStackTrace();
log.error(e.getMessage(), e);
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
@@ -2520,8 +2544,9 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
} else {
throw new JeroBootException("下载文件失败,请重试");
}
} finally {
IOUtils.closeQuietly(os);
// IOUtils.closeQuietly(os);
IOUtils.closeQuietly(excelOS);
File tempZipFile = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(tempZipFile);
+1
View File
@@ -757,6 +757,7 @@ module.exports = {
// 参数收集开始
MaintainConfigureInfo: 'Maintain Configuration Information',
ParameteItemCollectionList: 'Parameter Collection List',
ParameteItemReportList: 'Parameter Report List',
ParameterViewPage: 'Parameter View Page',
Areyousureparameteritems: 'Are you sure to submit the selected parameter items?',
Theselectedconfiguration: 'The configuration can only be added when the parameter items in the parameter list are to be collected or changed',
+1
View File
@@ -775,6 +775,7 @@ module.exports = {
// 参数收集
MaintainConfigureInfo: '维护配置信息',
ParameteItemCollectionList: '参数项收集清单',
ParameteItemReportList:'参数上报库清单',
ParameterViewPage: '参数项查看页',
Areyousureparameteritems: '确认提交所选参数项嘛?',
Theselectedconfiguration: '参数清单中参数项均为待发起收集或变更时才能添加配置',
@@ -5,7 +5,7 @@
<div class="Virtual-detail-header" style="top: 0">
<div class="Virtual-detail-title">
<span>
{{this.$route.query.pageName ? this.$route.query.pageName : $t('ParameterViewPage')}}
{{this.$route.query.pageName ? this.$t('ParameteItemReportList')+'('+this.$route.query.pageName+')' + ' '+this.$route.query.title +' '+ this.$route.query.version: $t('ParameterViewPage')}}
</span>
</div>
</div>
@@ -129,6 +129,13 @@
<a-icon type="export"/>
{{$t('dataExport')}}
</div>
<!-- 导出-->
<div @click="Derivedlist" class="operator-text" v-has="'report:detail:export:general'">
<a-icon type="export"/>
{{$t('Derivedlist')}}
</div>
<div @click="ConventionalExport" class="operator-text" v-has="'report:detail:export:normal'">
<a-icon type="export" :rotate="-90"/>
{{$t('ConventionalExport')}}
@@ -215,21 +222,131 @@
<conventionalModel :url="url" ref="conventionalModel"/>
<customelModel :url="url" ref="customelModel"/>
<JLoading :loading="textLoading">{{this.$t('pleaseWaitWhileRunning')}}</JLoading>
<!-- 数据导出弹框-->
<a-modal
:title="$t('dataExport')"
:width="500"
:visible="dataExportFailed"
:maskClosable="false"
@ok="handleExportSubmit"
@cancel="handleCancel"
>
<a-form-model
class='formAdd'
ref='dataExportruleForm'
:model='dataExportformInline'
:rules='dataExportrules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text" :title="$t('exportOption')" style='margin-top: -17px;'>
<span class="Required">*</span>
<span class="title-text-text" :title="$t('exportOption')">
{{$t('exportOption')}}</span>
</div>
<a-form-model-item class="itemModel" prop="exportOption">
<a-select class="box-input" allowClear v-model="dataExportformInline.exportOption"
:placeholder="$t('PleaseSelect')+$t('exportOption')">
<a-select-option :value="'1'">
{{$t('includeTitle')}}
</a-select-option>
<a-select-option :value="'0'">
{{$t('Notitleincluded')}}
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<!-- 数据导出异步弹窗-->
<a-modal
:title="$t('dataExport')"
:width="500"
:visible="ExportFailed"
:maskClosable="false"
@ok="exportsubmit"
@cancel="exportcancel"
>
<a-row :gutter="24">
<a-col :span="24">
<div style='font-size: 18px;margin-bottom: 20px;display: flex;justify-content: center'
class="box-title-text-index">
<span>{{$t('Exportsuccessexportlist')}}</span>
<!-- <div>{{$t('NiOnumberis')}}{{ item.nioNumber }},{{$t('Statusis')}}-->
<!-- <span style='color: red'>{{ item.state }}</span>,{{$t('NoOperationPermissionForthisbutton')}}-->
<!-- </div>-->
</div>
</a-col>
</a-row>
</a-modal>
<!-- 导出列表-->
<a-modal
:title="$t('Derivedlist')"
:width="900"
:visible="exportvisible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="exportok"
@cancel="exportvisiblecancel"
>
<!-- <historyTable :columnshistory='columnshistory' :dataSourcehistory='dataSourcehistory'></historyTable>-->
<a-table
class="table"
:components="drag(columnsexport,'columnsexport')"
:columns="columnsexport"
:pagination="false"
rowKey="id"
:scroll="{x: '100%',y: 400}"
:data-source="dataSourceexport"
:loading="loading"
>
<span slot="operation" slot-scope="text,record">
<a @click="exportdata(record)" v-if="record.state == '1'">{{$t('download')}}</a>
<a style="margin-left: 5px;" @click="exportdelete(record)">{{$t('delete')}}</a>
</span>
<!-- <span slot="detailText" slot-scope="text,record">-->
<!-- <span class="text" :title="text">-->
<!-- {{text && text.length > 40?text.slice(0,39)+'...':text}}-->
<!-- </span>-->
<!-- </span>-->
</a-table>
<div class="page" v-if="dataSourceexport.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSizehistory"
:total="total"
:current="pageNohistory"
@change="onChangehistory"
@showSizeChange="SizeChangehistory"
/>
</div>
</a-modal>
</a-card>
</template>
<script>
import { downloadFile, getAction, postAction } from '../../../api/manage'
import { deleteAction, downloadFile, getAction, postAction } from '../../../api/manage'
import axios from 'axios'
import TableCollection from '@/components/tableCollection/index1'
import conventionalModel from './commponts/conventionalmodle'
import customelModel from './commponts/customexportmodle'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
import Vue from 'vue'
export default {
name: 'managementdetails',
mixins:[ResizeHeader, ResizeColumnProvide],
components: {
conventionalModel,
customelModel,
@@ -238,6 +355,48 @@ import { downloadFile, getAction, postAction } from '../../../api/manage'
},
data() {
return {
pageNohistory: 1,
pageSizehistory: 10,
columnsexport: [
{
title: this.$t('fileName'),
align: 'left',
dataIndex: 'fileName',
width: 300,
ellipsis: true,
scopedSlots: { customRender: 'detailText' }
},
{
title: this.$t('status'),
align: 'left',
dataIndex: 'stateText',
width: 120,
},
{
title: this.$t('Exporttime'),
align: 'left',
dataIndex: 'createTime',
width: 200
},
{
title: this.$t('operation'),
align: 'left',
fixed: 'right',
width: 100,
scopedSlots: { customRender: 'operation' }
}
],
dataSourceexport:[],
exportvisible: false,
confirmLoading:false,
ExportFailed:false,
dataExportFailed: false, // 数据失败的弹框
dataExportformInline: {},
dataExportrules: {
exportOption: [
{ required: true, message: this.$t('PleaseSelect') + this.$t('exportOption'), trigger: 'change' }
]
},
toggleSearchStatus: false,
columns: [],
selectedRowKeys: [],
@@ -418,6 +577,70 @@ import { downloadFile, getAction, postAction } from '../../../api/manage'
document.title = this.$t('ParameterViewPage')
},
methods: {
// 导出列表
Derivedlist(){
this.pageNohistory = 1
this.exportvisible = true
this.expoteList()
},
exportdata(item){
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.fileId })
},
exportdelete(item){
this.$confirm({
title: this.$t('confirmDeletion'),
content: '',
onOk:
async () => {
deleteAction(`params/paramsCollectExport/delete`, { id: item.id }).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.expoteList()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
},
onChangehistory(page, pageSize) {
this.pageNohistory = page
this.expoteList()
},
SizeChangehistory(page, pageSize) {
this.pageNohistory = 1
this.pageSizehistory = pageSize
this.expoteList()
},
expoteList(val) {
let query = {
pageNo: this.pageNohistory,
pageSize: this.pageSizehistory,
paramsManifestId: this.$route.query.id,
paramsCollectManifestId: this.paramsReportDetailId
}
this.loading = true
getAction('params/paramsCollectExport/page', query).then((res) => {
if (res.success) {
this.dataSourceexport = res.result.records
// if (this.dataSourcehistory && this.dataSourcehistory.length > 0) {
// this.dataSourcehistory.forEach(val => {
// val.logContent = val.logContent.replace(/\"/g, '<span class=\'textData\'>"</span>')
// })
// }
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
},
exportok(){
this.exportvisible = false
},
exportvisiblecancel(){
this.exportvisible = false
},
onCheckAllChange(e) {
let selectedValue = ['nio_number', 'params_name', 'operation']
this.checkedList = e.target.checked ? this.customizeList.map(item => item.field) : selectedValue
@@ -705,27 +928,75 @@ import { downloadFile, getAction, postAction } from '../../../api/manage'
listReset() {
this.formInline = {}
},
// 导出确定
handleExportSubmit() {
this.$refs.dataExportruleForm.validate(valid => {
if (valid) {
this.$message.success(this.$t('Intheexport'))
let long = localStorage.getItem('language')
this.cut = ''
if (long && long === 'zh-cn') {
this.cut = 'cn'
} else if (long && long === 'en-us') {
this.cut = 'en'
}
let query = {
paramsManifestId: this.$route.query.id,
cut: this.cut,
// userTypes: this.currentPersonRole,
ids:this.selectedRowKeys.join(','),
...this.formInline,
exportOption: this.dataExportformInline.exportOption,
exportName: this.$route.query.projectName + '(' + this.$route.query.title + this.$route.query.version + ')'
}
// let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
// downloadFile('/report/detail/exportGeneral', name, query, this.selectClear)
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
getAction('/report/detail/exportGeneral', query).then((res) => {
// if (res.success) {
// }
})
this.dataExportFailed = false
this.ExportFailed = true
// downloadFile('/params/collectManifest/exportAll', name, query, this.selectClear)
}
})
},
exportsubmit(){
this.ExportFailed = false
},
exportcancel(){
this.ExportFailed = false
},
handleCancel() {
this.dataExportformInline = {}
this.$refs.dataExportruleForm.clearValidate()
this.dataExportFailed = false
},
//导出
handleExport() {
this.$message.success(this.$t('Intheexport'))
let long = localStorage.getItem('language')
this.cut = ''
if (long && long === 'zh-cn') {
this.cut = 'cn'
} else if (long && long === 'en-us') {
this.cut = 'en'
}
console.log(this.selectedRowKeys)
let query = {
paramsManifestId: this.$route.query.id,
cut: this.cut,
// userTypes: this.currentPersonRole,
ids:this.selectedRowKeys.join(','),
...this.formInline,
exportName: this.$route.query.projectName + '(' + this.$route.query.title + ')'
}
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
downloadFile('/report/detail/exportGeneral', name, query, this.selectClear)
this.dataExportFailed = true
// this.$message.success(this.$t('Intheexport'))
// let long = localStorage.getItem('language')
// this.cut = ''
// if (long && long === 'zh-cn') {
// this.cut = 'cn'
// } else if (long && long === 'en-us') {
// this.cut = 'en'
// }
// console.log(this.selectedRowKeys)
// let query = {
// paramsManifestId: this.$route.query.id,
// cut: this.cut,
// // userTypes: this.currentPersonRole,
// ids:this.selectedRowKeys.join(','),
// ...this.formInline,
// exportName: this.$route.query.projectName + '(' + this.$route.query.title + ')'
// }
// let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
// downloadFile('/report/detail/exportGeneral', name, query, this.selectClear)
},
ConventionalExport() {
this.$refs.conventionalModel.addModel()
@@ -989,6 +1260,12 @@ popconfirmmize {
::v-deep .ant-popover-buttons {
display: none !important;
}
.itemModel {
width: 100%;
display: inline-block;
margin-top: 2px;
}
</style>
<style lang='less'>
.popconfirmClassName .ant-popover-message-title {
@@ -3,7 +3,7 @@
<div class="Virtual-detail-header" style="position: fixed;top: 0">
<div class="Virtual-detail-title">
<span>
{{$t('ParameteItemCollectionList')}}({{this.$route.query.type == '1' ? $t(this.$route.query.projectName) : $t(this.$route.query.projectName.slice(0,-3)) + '-' + $t(this.$route.query.projectVersion)}}) {{$t(this.$route.query.title)}}
{{$t('ParameteItemCollectionList')}}({{this.$route.query.type == '1' ? $t(this.$route.query.projectName) : $t(this.$route.query.projectName.slice(0,-3)) + '-' + $t(this.$route.query.projectVersion)}}) {{$t(this.$route.query.title)}} {{$t(this.$route.query.version)}}
</span>
</div>
<div class="Virtual-detail-title-right">
@@ -181,7 +181,7 @@
<!-- {{$t('distributionAndCollection')}}-->
<!-- </div>-->
<!-- 导出-->
<div @click="handleExport" class="operator-text-title" v-if='currentPersonRole == "homo"'>
<div @click="handleExport('0')" class="operator-text-title" v-if='currentPersonRole == "homo"'>
<a-icon type="export" :rotate="-90"/>
{{$t('dataExport')}}
</div>
@@ -266,7 +266,7 @@
{{$t('Assignedby')}}
</div>
<!-- 导出-->
<div @click="handleExport" class="operator-text"
<div @click="handleExport('0')" class="operator-text"
v-if='currentPersonRole == "sdt" || currentPersonRole == "admin" || currentPersonRole == "studio"'>
<a-icon type="export"/>
{{$t('dataExport')}}
@@ -356,6 +356,19 @@
<!-- </div>-->
</div>
<div class="table-operator" v-if="this.$route.query.it">
<!-- 导出-->
<div @click="handleExport('1')" class="operator-text" v-if='currentPersonRole == "homo" || currentPersonRole == "admin" || currentPersonRole == "viewer"'>
<a-icon type="export" :rotate="-90"/>
{{$t('dataExport')}}
</div>
<!-- 导出列表-->
<div @click="Derivedlist" class="operator-text" v-if='currentPersonRole == "homo" || currentPersonRole == "admin" || currentPersonRole == "viewer"'>
<a-icon type="export" :rotate="-90"/>
{{$t('Derivedlist')}}
</div>
</div>
<div style="width: 100%">
<!-- 表格-10控件-->
<!-- :queryParamQuery='queryParamQuery'-->
@@ -1538,7 +1551,8 @@
}
},
//导出
handleExport() {
handleExport(num) {
this.isHistroy = num || 0
this.dataExportFailed = true
// this.$message.success(this.$t('Intheexport'))
// let long = localStorage.getItem('language')
@@ -1647,7 +1661,8 @@
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 + this.$route.query.version + ')',
isHistory:this.isHistroy
}
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
getAction('/params/collectManifest/exportAll', query).then((res) => {