wujianwei
14 小时以前 2cf82c1c1959701fe7d31b3d891434575ed6b58f
service/src/main/java/com/ruoyi/cwgl/controller/FundFlowController.java
@@ -18,7 +18,9 @@
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cwgl.domain.FundFlow;
import com.ruoyi.cwgl.service.IFundFlowService;
import com.ruoyi.cwgl.service.ICmbsBankSyncService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.core.page.TableDataInfo;
/**
@@ -34,8 +36,30 @@
    @Autowired
    private IFundFlowService fundFlowService;
    @Autowired
    private ICmbsBankSyncService cmbsBankSyncService;
    /**
     * 从CMBS同步银行流水到资金流水表
     *
     * @param acctNum 账号
     * @param startDate 开始日期 yyyy-MM-dd
     * @param endDate 结束日期 yyyy-MM-dd
     */
    @PreAuthorize("@ss.hasPermi('cwgl:fundFlow:sync')")
    @Log(title = "CMBS银行流水同步", businessType = BusinessType.OTHER)
    @PostMapping("/syncFromCmbs")
    public AjaxResult syncFromCmbs(String acctNum, String startDate, String endDate)
    {
        try {
            String result = cmbsBankSyncService.syncFromCmbs(acctNum, startDate, endDate);
            return AjaxResult.success(result);
        } catch (Exception e) {
            return AjaxResult.error("同步失败: " + e.getMessage());
        }
    }
    /**
     * 查询资金流水列表
     */
@@ -105,4 +129,40 @@
    {
        return toAjax(fundFlowService.deleteFundFlowByIds(ids));
    }
    /**
     * 确认资金流水(将状态改为待认领)
     */
    @PreAuthorize("@ss.hasPermi('cwgl:fundFlow:edit')")
    @Log(title = "资金流水", businessType = BusinessType.UPDATE)
    @PutMapping("/confirm/{id}")
    public AjaxResult confirm(@PathVariable("id") Integer id)
    {
        return toAjax(fundFlowService.confirmFundFlow(id));
    }
    /**
     * 导入资金流水Excel
     */
    @PreAuthorize("@ss.hasPermi('cwgl:fundFlow:import')")
    @Log(title = "资金流水", businessType = BusinessType.IMPORT)
    @PostMapping("/importData")
    public AjaxResult importData(MultipartFile file ) throws Exception
    {
        ExcelUtil<FundFlow> util = new ExcelUtil<FundFlow>(FundFlow.class);
        List<FundFlow> fundFlowList = util.importExcel(file.getInputStream());
        String message = fundFlowService.importFundFlow(fundFlowList);
        return AjaxResult.success(message);
    }
    /**
     * 下载导入资金流水模板
     */
    @PreAuthorize("@ss.hasPermi('cwgl:fundFlow:import')")
    @GetMapping("/importTemplate")
    public AjaxResult importTemplate(String exportKey)
    {
        fundFlowService.importTemplate(exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
}