jinlin
2024-01-31 9025b9cf7ec8610003d445a31d93e35e7bd73c2e
modules/mainPart/src/main/java/com/zt/life/modules/testCheckOrder/service/TestCheckOrderService.java
@@ -2,6 +2,8 @@
import cn.hutool.core.convert.Convert;
import com.zt.common.service.BaseService;
import com.zt.core.context.User;
import com.zt.core.context.UserContext;
import com.zt.life.export.dto.WordFile;
import com.zt.life.export.service.WordFileService;
import com.zt.life.modules.configItemWarehouse.dto.ConfigItemWarehouseDto;
@@ -75,8 +77,15 @@
     * @return
     */
    public List<TestCheckOrder> page(QueryFilter queryFilter) {
        User user = UserContext.getUser();
        Integer secretClass = user.getSecretClass();
        Long deptId = user.getDeptId();
        queryFilter.getQueryParams().put("secretClass",secretClass);
        queryFilter.getQueryParams().put("deptId",deptId);
        List<TestCheckOrder> list = baseDao.getList(queryFilter.getQueryParams());
        workflowService.getRunFlow(list, "csjcd");
        if (list.size() > 0) {
            workflowService.getRunFlow(list, "csjcd");
        }
        return list;
    }
@@ -157,15 +166,22 @@
    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);
            }
            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 = getShowDictList.getShowDictList(value, "tristate1", false);
                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);
            }
@@ -174,11 +190,21 @@
            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();
            wordFile.setModulePath("软件测试检查单.docx");
            wordFile.setWordName(dataObj.getProject().getSoftwareName() + "_软件测试"+type+"检查单.docx");
            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();