中扬CRM客户关系管理系统
#
LSH
2023-11-03 1e9fe530b299f9bf1004a983be6fea266b4e8ddc
src/main/java/com/zy/crm/manager/controller/ContractController.java
@@ -105,7 +105,13 @@
            }
        }
        if (!signUserId && !signDeptId){
            wrapper.eq("user_id", getUserId());
            if (getRole().getId()==1){
                wrapper.or().eq("host_id",1);
            }else if (getRole().getId()==2){
                wrapper.eq("dept_id",getDeptId());
            }else {
                wrapper.eq("user_id", getUserId());
            }
        }
        if (signHostId){
            wrapper.or().eq("host_id",1);
@@ -240,7 +246,11 @@
            /////////////////////////生成Tab表格数据/////////////////////////
            String fileName = this.getClass().getClassLoader().getResource("contractTemplate/" + contractTemplate + ".docx").getPath();//获取文件路径
            return WordUtils.generate(fileName, map, tabParam);
//            String outPdfPath = fileName.split("\\.")[0]+".pdf";
            ResponseEntity<InputStreamResource> generate = WordUtils.generate(fileName, map, tabParam);
//            WordUtils.documents4jWordToPdf(fileName,outPdfPath);
            return generate;
        } catch (Exception e) {
            return null;
        }