liusheng
2024-04-24 a894bc6373154d5cfd28b7f46df3c4cfa01a7b9b
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
@@ -102,7 +102,7 @@
     * 查询费用申请主列表
     */
    @ApiOperation("查询费用申请主列表")
    //@PreAuthorize("@ss.hasPermi('project:fund:list')")
    //// @PreAuthorize("@ss.hasPermi('project:fund:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceFund serviceFund) {
        startPage();
@@ -178,7 +178,7 @@
        Collections.sort(list, new Comparator<SpFinancialExpensesFundOut>() {
            @Override
            public int compare(SpFinancialExpensesFundOut o1, SpFinancialExpensesFundOut o2) {
                return o1.getCreateTime().compareTo(o2.getCreateTime());
                return o1.getApplyTime().compareTo(o2.getApplyTime());
            }
        });
        return getCustomDataTable(list, pageNum, pageSize);
@@ -196,7 +196,7 @@
    }
    @ApiOperation("查询费用申请主列表")
    //@PreAuthorize("@ss.hasPermi('project:fund:list')")
    //// @PreAuthorize("@ss.hasPermi('project:fund:list')")
    @GetMapping(value = "/getInfo/{infoid}")
    public AjaxResult getInfoByInfoId(@PathVariable("infoid") Long infoid) {
        return AjaxResult.success(serviceFundService.getInfoByInfoId(infoid));
@@ -218,7 +218,7 @@
     * 导出费用申请主列表
     */
    @ApiOperation("导出费用申请主列表")
    //@PreAuthorize("@ss.hasPermi('project:fund:export')")
    //// @PreAuthorize("@ss.hasPermi('project:fund:export')")
    @Log(title = "费用申请主", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceFund serviceFund) {
@@ -232,7 +232,7 @@
     * 获取费用申请主详细信息
     */
    @ApiOperation("获取费用申请主详细信息")
    //@PreAuthorize("@ss.hasPermi('project:fund:query')")
    //// @PreAuthorize("@ss.hasPermi('project:fund:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceFundService.getById(id));
@@ -242,7 +242,7 @@
     * 新增费用申请主
     */
    @ApiOperation("新增费用申请主")
    //@PreAuthorize("@ss.hasPermi('project:fund:add')")
    //// @PreAuthorize("@ss.hasPermi('project:fund:add')")
    @Log(title = "费用申请主", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @RepeatSubmit
@@ -571,7 +571,7 @@
     * 删除费用申请主
     */
    @ApiOperation("删除费用申请主")
    //@PreAuthorize("@ss.hasPermi('project:fund:remove')")
    //// @PreAuthorize("@ss.hasPermi('project:fund:remove')")
    @Log(title = "费用申请主", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
@@ -585,7 +585,7 @@
    @GetMapping(value = "/downloadLW/{id}")
    public Map downloadInfoLW(@PathVariable("id") Long id) throws IOException {
        Map dataMap = new HashMap();
        getDataLW(dataMap, id);
        String dataLW = getDataLW(dataMap, id);
        String filePath = getClass().getResource("/template/").getPath();
        System.out.println(filePath);
        //设置模本装置方法和路径,FreeMarker支持多种模板装载方法。可以重servlet,classpath,数据库教程装载,
@@ -599,7 +599,11 @@
            e.printStackTrace();
        }
        String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis());
        String name = "专家劳务费发放申请单_" + dataMap.get("XM") + "_" + newTime;
        if (dataLW.equals("4")) {
            name = "办公费用申请单_" + dataMap.get("XM") + "_" + newTime;
        }
        //输出文档路径及名称
        File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
@@ -622,7 +626,7 @@
        return map;
    }
    private void getDataLW(Map dataMap, Long id) {
    private String getDataLW(Map dataMap, Long id) {
        ServiceFund serviceFund = serviceFundService.getById(id);
        if (serviceFund == null) {
            throw new ServiceException("下载失败,用户信息出错", HttpStatus.NO_CONTENT);
@@ -754,6 +758,7 @@
        dataMap.put("KSLJ", kslj);
        dataMap.put("SHLJ", shlj);
        return serviceFund.getApplytype();
    }