wujianwei
2025-12-24 d537057a0bac012bb6909b89586089a01b8d8a9e
service/src/main/java/com/ruoyi/cwgl/controller/ReceivableFeeManagementController.java
@@ -11,12 +11,14 @@
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.utils.file.DownloadExportUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cwgl.domain.ReceivableFeeManagement;
import com.ruoyi.cwgl.domain.vo.ReceivableBillCreateVo;
import com.ruoyi.cwgl.service.IReceivableFeeManagementService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -105,4 +107,62 @@
    {
        return toAjax(receivableFeeManagementService.deleteReceivableFeeManagementByIds(ids));
    }
}
    /**
     * 查询应收费用统计信息
     */
    @PreAuthorize("@ss.hasPermi('cwgl:receivableFeeManagement:statistics')")
    @GetMapping("/statistics/{ids}")
    public AjaxResult getStatistics(@PathVariable Integer[] ids)
    {
        return AjaxResult.success(receivableFeeManagementService.getReceivableFeeStatistics(ids));
    }
    /**
     * 创建应收账单
     */
    @PreAuthorize("@ss.hasPermi('cwgl:receivableFeeManagement:createBill')")
    @Log(title = "应收账单管理", businessType = BusinessType.INSERT)
    @PostMapping("/createBill")
    public AjaxResult createBill(@RequestBody ReceivableBillCreateVo billCreateVo)
    {
        return toAjax(receivableFeeManagementService.createReceivableBill(billCreateVo));
    }
    /**
     * 作废应收费用管理记录
     */
    @PreAuthorize("@ss.hasPermi('cwgl:receivableFeeManagement:void')")
    @Log(title = "应收费用管理", businessType = BusinessType.UPDATE)
    @PutMapping("/void/{id}")
    public AjaxResult voidReceivableFee(@PathVariable Integer id)
    {
        return toAjax(receivableFeeManagementService.voidReceivableFeeManagement(id));
    }
    /**
     * 导入应收费用管理数据
     */
    @Log(title = "应收费用管理", businessType = BusinessType.IMPORT)
    @PreAuthorize("@ss.hasPermi('cwgl:receivableFeeManagement:import')")
    @PostMapping("/importData")
    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
    {
        ExcelUtil<ReceivableFeeManagement> util = new ExcelUtil<ReceivableFeeManagement>(ReceivableFeeManagement.class);
        List<ReceivableFeeManagement> receivableFeeList = util.importExcel(file.getInputStream());
        String message = receivableFeeManagementService.importReceivableFee(receivableFeeList, getUsername());
        return success(message);
    }
    /**
     * 下载导入模板
     */
    @GetMapping("/importTemplate")
    public AjaxResult importTemplate(String exportKey)
    {
        receivableFeeManagementService.importTemplate(exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
}