liusheng
2023-09-12 00e066b1b6c1f2c5e94adfcf50b49cf2a3d682d0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -156,10 +156,15 @@
        }
        //startPage();
        List<SpFinancialExpensesReimbursementOut> list = serviceReimbursementService.getListBypower(loginUser.getUsername(), 1, APPLICANT, APPLICATIONBEGTIME, APPLICATIONENDTIME, loginUser.getDeptId().toString(), CHECKFLAG, APPLYTYPE);
        //根据经办人筛选
        if (StringUtils.isNotBlank(spFinancialExpensesIn.getUsername())) {
            list = list.stream().filter(reimbursementOut -> reimbursementOut.getUsername().contains(spFinancialExpensesIn.getUsername())).collect(Collectors.toList()); // 按name字段过滤
        }
        //根据金额筛选
        if (spFinancialExpensesIn.getMoney() != null) {
            list = list.stream().filter(reimbursementOut -> new BigDecimal(reimbursementOut.getAmountrequested()) == new BigDecimal(spFinancialExpensesIn.getMoney())).collect(Collectors.toList());
        }
        //根据创建时间排序
        Collections.sort(list, new Comparator<SpFinancialExpensesReimbursementOut>() {
            @Override
            public int compare(SpFinancialExpensesReimbursementOut o1, SpFinancialExpensesReimbursementOut o2) {
@@ -711,6 +716,7 @@
        Map dataMap = new HashMap();
        getData(dataMap, id);
        String filePath = getClass().getResource("/template/").getPath();
        log.info("下载地址是啥???{}", filePath);
        System.out.println(filePath);
        //设置模本装置方法和路径,FreeMarker支持多种模板装载方法。可以重servlet,classpath,数据库教程装载,
        configuration.setDirectoryForTemplateLoading(new File(filePath));
@@ -723,7 +729,7 @@
            e.printStackTrace();
        }
        String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis());
        String name = "差旅费报销申请单_" + dataMap.get("XM") + "_" + newTime;
        String name = "差旅费报销申请单_" + dataMap.get("JSR") + "_" + newTime;
        //输出文档路径及名称
        File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");