package com.crm.globex.controller;

import com.crm.globex.service.FinanceTransferService;
import com.crm.rely.backend.core.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/finance/transfer")
public class FinanceTransferController {
    @Autowired
    private FinanceTransferService financeTransferService;

    /**
     * 修改内装操作人
     *
     * @throws Exception
     */
    @Scheduled(fixedDelay = 5000)
    public void scheduleUpdateTransfer() throws Exception {
        financeTransferService.scheduleUpdateTransfer();
    }

    /**
     * 内转入金
     *
     * @throws ServiceException
     */
    @Scheduled(fixedDelay = 5000)
    public void scheduleAutomaticTransferDeposit() throws Exception {
        financeTransferService.scheduleAutomaticTransferDeposit();
    }

    /**
     * 内转出金
     *
     * @throws ServiceException
     */
    @Scheduled(fixedDelay = 5000)
    public void scheduleAutomaticTransferWithdraw() throws Exception {
        financeTransferService.scheduleAutomaticTransferWithdraw();
    }

}
