| | |
| | | package com.zt.life.modules.testCheckOrder.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.export.dto.WordFile; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.configItemWarehouse.dto.ConfigItemWarehouseDto; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseCmAudit; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem; |
| | |
| | | import com.zt.life.modules.itemCirculatOrder.dto.ItemCirculatOrderDto; |
| | | import com.zt.life.modules.itemCirculatOrder.model.ItemCirculatOrder; |
| | | import com.zt.life.modules.itemCirculatOrder.model.ItemCirculatOrderTechnical; |
| | | 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.service.ProjectService; |
| | | import com.zt.life.modules.testCheckOrder.dao.TestCheckOrderDao; |
| | |
| | | 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; |
| | |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private GetShowDictList getShowDictList; |
| | | |
| | | @Autowired |
| | | private SysCodeRuleService sysCodeRuleService; |
| | | |
| | | @Autowired |
| | | private WorkflowService workflowService; |
| | | |
| | | @Autowired |
| | | private GetFilesPath getFilesPath; |
| | | |
| | | @Autowired |
| | | private WordFileService wordFileService; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public List<TestCheckOrder> page(QueryFilter queryFilter) { |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | List<TestCheckOrder> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | if (list.size() > 0) { |
| | | workflowService.getRunFlow(list, "csjcd"); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | if (projectId == null) { |
| | | projectId = checkOrder.getProjectId(); |
| | | } |
| | | |
| | | List<TestCheckOrderList> checkOrderList = checkOrderListService.getList(checkId); |
| | | data.setCheckOrderList(checkOrderList); |
| | | |
| | |
| | | } |
| | | return checkId; |
| | | } |
| | | |
| | | public void exportCheckOrder(Long id, String pageCode, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | CheckOrderDto dataObj = this.getDto(id, null, pageCode); |
| | | if (dataObj.getCheckOrder().getProcessorId() != null && dataObj.getCheckOrder().getVerifierId() != null) { |
| | | 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); |
| | | } |
| | | |
| | | //通用字典列表字符串生成 |
| | | 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); |
| | | } |
| | | |
| | | 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"); |
| | | } |
| | | wordFileService.exportWordFile(request, dataObj, wordFile, response); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |