| | |
| | | package com.zt.life.modules.configAuditReport.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.CommonUtils; |
| | | import com.zt.life.export.dto.WordFile; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.baselineRelease.dto.BaselineDto; |
| | | import com.zt.life.modules.baselineRelease.model.BaselineRelease; |
| | |
| | | import com.zt.life.modules.mainPart.utils.GetFilesPath; |
| | | import com.zt.life.modules.mainPart.utils.GetShowDictList; |
| | | import com.zt.life.modules.project.model.Project; |
| | | import com.zt.life.modules.project.model.SoftwareTestOrder; |
| | | import com.zt.life.modules.project.model.SoftwareTestOrderDeliverable; |
| | | import com.zt.life.modules.project.model.SoftwareTestOrderMeasured; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Autowired |
| | | private WordFileService wordFileService; |
| | | |
| | | @Autowired |
| | | private GetFilesPath getFilesPath; |
| | | /** |
| | | * 分页查询 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | public List<ConfigAuditReport> page(QueryFilter queryFilter) { |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | List<ConfigAuditReport> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | if (list != null && list.size() > 0) { |
| | | sysOssService.setListOsses(list, "config_audit_report"); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | } else { |
| | | ConfigAuditReport auditReport = new ConfigAuditReport(); |
| | | data.setAuditReport(auditReport); |
| | | List<?> contentResult = contentService.dictList("config_check_item"); |
| | | List<?> contentList = contentResult; |
| | | data.setContentList((List<ConfigAuditReportContent>) contentList); |
| | | List<ConfigAuditReportContent> contentList = contentService.dictList("config_check_item"); |
| | | data.setContentList( contentList); |
| | | } |
| | | if (projectId != null) { |
| | | data.setProjectId(projectId); |
| | |
| | | problemService.insert(problem); |
| | | } |
| | | } |
| | | sysOssConfigService.updateOss(configAuditDto.getId(), configAuditDto.getFiles());// 保存附件 |
| | | return true; |
| | | } |
| | | |
| | | public void exportConfigAudit(Long id, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | ConfigAuditDto dataObj = this.getDto(null, id); |
| | | //通用字典列表字符串生成 |
| | | for (ConfigAuditReportContent content : dataObj.getContentList()) { |
| | | String value = content.getAuditResult(); |
| | | String auditResult = getShowDictList.getShowDictList(value, "status_tag", false); |
| | | content.setAuditResult(auditResult); |
| | | } |
| | | for (ConfigAuditReportProblem problem : dataObj.getProblemList()) { |
| | | String value = problem.getIsNotTrue(); |
| | | String IsNotTrue = getShowDictList.getShowDictList(value, "is_or_not", false); |
| | | problem.setIsNotTrue(IsNotTrue); |
| | | } |
| | | WordFile wordFile = new WordFile(); |
| | | wordFile.setModulePath("配置审核报告.docx"); |
| | | wordFile.setWordName(dataObj.getProject().getSoftwareName() + "_配置审核报告.docx"); |
| | | wordFileService.exportWordFile(request, dataObj, wordFile, response); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |