| | |
| | | import com.zt.life.modules.baselineRelease.dto.BaselineDto; |
| | | import com.zt.life.modules.baselineRelease.model.BaselineRelease; |
| | | import com.zt.life.modules.baselineRelease.model.BaselineReleaseRemark; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem; |
| | | import com.zt.life.modules.mainPart.utils.GetFilesPath; |
| | | import com.zt.life.modules.mainPart.utils.GetShowDictList; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | | import com.zt.life.modules.testCheckOrder.dto.CheckOrderDto; |
| | | import com.zt.life.modules.testCheckOrder.model.TestCheckOrder; |
| | | import com.zt.life.modules.testCheckOrder.model.TestCheckOrderList; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import com.zt.life.sys.service.SysOssConfigService; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | | import com.zt.modules.oss.service.SysOssService; |
| | | import com.zt.modules.workflow.dto.FlowInfoDto; |
| | | import com.zt.modules.workflow.service.WorkflowService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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; |
| | |
| | | /** |
| | | * baseline_release |
| | | * |
| | | * @author zt generator |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-12-18 |
| | | */ |
| | | @Service |
| | | public class BaselineReleaseService extends BaseService<BaselineReleaseDao, BaselineRelease> { |
| | | public class BaselineReleaseService extends BaseService<BaselineReleaseDao, BaselineRelease> { |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private GetShowDictList getShowDictList; |
| | | |
| | | @Autowired |
| | | private SysOssConfigService sysOssConfigService; |
| | | |
| | | @Autowired |
| | | private SysCodeRuleService sysCodeRuleService; |
| | |
| | | @Autowired |
| | | private BaselineReleaseRemarkService remarkService; |
| | | |
| | | @Autowired |
| | | private SysOssService sysOssService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | |
| | | List<BaselineRelease> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | if (list.size() > 0) { |
| | | workflowService.getRunFlow(list, "jxfb"); |
| | | sysOssService.setListOsses(list, "baseline_release"); |
| | | } |
| | | return list; |
| | | } |
| | |
| | | baseline.setPageCode(pageCode); |
| | | data.setBaseline(baseline); |
| | | } |
| | | if ("demand".equals(pageCode)){ |
| | | data.getBaseline().setBaselineType("1"); |
| | | }else if("product".equals(pageCode)){ |
| | | data.getBaseline().setBaselineType("2"); |
| | | } |
| | | for (BaselineReleaseRemark remark : data.getRemarkList()) { |
| | | if (remark.getWarehouseDetailId() != null) { |
| | | Long configItemId = remark.getWarehouseDetailId(); |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(configItemId, "config_item_warehouse"); |
| | | if (ossDto != null) { |
| | | remark.setFiles(ossDto); |
| | | } |
| | | } |
| | | } |
| | | if (projectId != null) { |
| | | data.setProjectId(projectId); |
| | | data.setProject(projectService.get(projectId)); |
| | |
| | | |
| | | for (BaselineReleaseRemark remark : baselineDto.getRemarkList()) { |
| | | remark.setBaselineId(baselineId); |
| | | remark.setLibraryType(remark.getLibraryType()); |
| | | remark.setWarehouseDetailId(remark.getSelectId()); |
| | | if (remark.getId() != null) { |
| | | remarkService.update(remark); |
| | | } else { |
| | |
| | | return baselineId; |
| | | } |
| | | |
| | | /* public void exportCheckOrder(Long id, String pageCode, HttpServletRequest request, HttpServletResponse response) { |
| | | public void exportBaseline(Long id, String pageCode, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | CheckOrderDto dataObj = this.getDto(id, null, pageCode); |
| | | BaselineDto dataObj = this.getDto(id, null, pageCode); |
| | | |
| | | String processorPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getCheckOrder().getProcessorId())); |
| | | dataObj.getCheckOrder().setProcessor(processorPath); |
| | | String verifierPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getCheckOrder().getVerifierId())); |
| | | dataObj.getCheckOrder().setVerifier(verifierPath); |
| | | String publisherPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getBaseline().getPublisherId())); |
| | | dataObj.getBaseline().setPublisher(publisherPath); |
| | | String departSignPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getBaseline().getSignId())); |
| | | dataObj.getBaseline().setDepartSign(departSignPath); |
| | | //通用字典列表字符串生成 |
| | | for (TestCheckOrderList checkOrderList : dataObj.getCheckOrderList()) { |
| | | String value = checkOrderList.getCheckResult(); |
| | | String checkResultStr=""; |
| | | if ("plan".equals(pageCode) || "report".equals(pageCode) || "record".equals(pageCode) || "explain".equals(pageCode)) { |
| | | checkResultStr = getShowDictList.getShowDictList(value, "tristate1", false); |
| | | }else{ |
| | | checkResultStr = getShowDictList.getShowDictList(value, "tristate2", false); |
| | | } |
| | | checkOrderList.setCheckResult(checkResultStr); |
| | | } |
| | | String baselineTypeStr = getShowDictList.getShowDictList(dataObj.getBaseline().getBaselineType(), "baseline_type", false); |
| | | dataObj.getBaseline().setBaselineType(baselineTypeStr); |
| | | |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("plan", "计划"); |
| | | map.put("report", "报告"); |
| | | map.put("record", "记录"); |
| | | map.put("explain", "说明"); |
| | | map.put("contract", "合同评审"); |
| | | map.put("require", "测试需求分析与策划"); |
| | | map.put("execute", "测试设计、实现与执行"); |
| | | map.put("summary", "测试总结"); |
| | | String type = map.get(pageCode); |
| | | dataObj.setPageCode(type); |
| | | WordFile wordFile = new WordFile(); |
| | | |
| | | if ("plan".equals(pageCode) || "report".equals(pageCode) || "record".equals(pageCode) || "explain".equals(pageCode)) { |
| | | wordFile.setModulePath("软件测试检查单.docx"); |
| | | wordFile.setWordName(dataObj.getProject().getSoftwareName() + "_软件测试" + type + "检查单.docx"); |
| | | } else { |
| | | wordFile.setModulePath("质量保证检查单.docx"); |
| | | wordFile.setWordName(dataObj.getProject().getSoftwareName() + "_质量保证检查单(" + type + ").docx"); |
| | | } |
| | | 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(); |
| | | } |
| | | }*/ |
| | | } |
| | | } |