package com.jwipc.finance.controller;

import com.jwipc.api.dto.ApiResult;
import com.jwipc.finance.dto.ReceiptVoucherApiDTO;
import com.jwipc.finance.dto.ReceiptVoucherBaseApiDTO;
import com.jwipc.finance.logic.ReceiptVoucherApiLogic;
import com.jwipc.log.annotation.ApiOperateLog;
import com.jwipc.log.constant.ApiDirection;
import com.jwipc.log.constant.ThirdSysType;
import lombok.RequiredArgsConstructor;
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.RestController;

import java.util.List;

import static com.jwipc.finance.constant.ModuleConst.MODULE_ROOT;

/**
 * @author shenyang.ou
 * @date 2024/3/20 9:42
 * @desc
 */
@RestController
@RequestMapping( "/sap/api/receipt/voucher")
@RequiredArgsConstructor
public class ReceiptVoucherApiController {
    private final ReceiptVoucherApiLogic receiptVoucherApiLogic;
    /**
     * 物料凭证同步
     * @param param 参数
     */
    @PostMapping("/sync")
    @ApiOperateLog(code = "receiptVoucherSync",name = "物料凭证同步", direction = ApiDirection.OTHER_TO_SRM, thirdSysType = ThirdSysType.SAP)
    public ApiResult sync(@RequestBody ReceiptVoucherBaseApiDTO param){
        return receiptVoucherApiLogic.sync(param);
    }
}
