package com.sunxung.factoring.web.cashflowmanage;

import com.sunxung.factoring.component.annotation.OperationLog;
import com.sunxung.factoring.component.enums.OperationTypeEnum;
import com.sunxung.factoring.entity.ResponseJson;
import com.sunxung.factoring.service.cashflowmanage.CashFlowManageBasicInfoService;
import com.sunxung.factoring.web.cashflowmanage.vo.LoanRecordToTradeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description : 现金流数据同步Controller
 * @Author : L.Jia
 * @Date: 2022-04-29 13:52
 */
@Controller
@RequestMapping("/api/cashFlow")
public class CashFlowDataSyncController {

    @Autowired
    private CashFlowManageBasicInfoService cashFlowManageBasicInfoService;

    /**
     * sop现金流-保理出账数据同步
     *
     * @return
     */
    @ResponseBody
    @PostMapping("/loanRecord/add")
    @OperationLog(operationModule = "现金流数据同步", operationType = OperationTypeEnum.OTHER, description = "sop现金流-保理出账数据同步")
    private Object loanRecordSyncFromSop(@RequestBody LoanRecordToTradeVo loanRecordToTradeVo) {
        cashFlowManageBasicInfoService.syncFromSop(loanRecordToTradeVo);
        return new ResponseJson("数据同步成功!");
    }
}
