package com.jwipc.finance.constant;


import com.dtflys.forest.annotation.Header;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.converter.json.GsonEncoder;
import com.jwipc.api.dto.ApiResult;
import com.jwipc.api.dto.ErpApiResult;
import com.jwipc.api.dto.ErpApiResult1;
import com.jwipc.api.interceptor.OAInterceptor;
import com.jwipc.finance.dto.*;
import com.jwipc.log.annotation.ApiOperateLog;
import com.jwipc.log.constant.ApiDirection;
import com.jwipc.log.constant.ThirdSysType;

/**
 * @author shenyang.ou
 * @date 2024/3/29 10:03
 * @desc
 */
public interface PaymentOaClient {
    @GsonEncoder
    @Post(value = "#{sys.oa-host}/api/srm/supplierPay/import", interceptor = OAInterceptor.class)
    @ApiOperateLog(code = "supplierPayImport", name = "SRM供应商付款信息OA审批", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.OA)
    ApiResult<String> supplierPayImport(@JSONBody SupplierPayImportDTO supplierPayImportDTO);

    @GsonEncoder
    @Post(value = "#{sys.kingdee.financial-share.host}/kapi/v2/m4p4/ap/ap_payapply/ap_payapply_save")
    @ApiOperateLog(code = "payImportToOpen", name = "SRM供应商付款信息提交共享系统", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.ERP)
    ErpApiResult<PayImportToOpenResultDTO> payImportToOpen(@Header("accessToken") String accessToken, @JSONBody PayImportToOpenDTO supplierPayImportDTO);

    @GsonEncoder
    @Post(value = "#{sys.kingdee.financial-share.host}/kapi/v2/m4p4/ap/ap_payapplychange/ap_payapplychange_save")
    @ApiOperateLog(code = "payChangeToOpen", name = "付款信息变更单提交共享系统", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.ERP)
    ErpApiResult<PayImportToOpenResultDTO> payChangeToOpen(@Header("accessToken") String accessToken, @JSONBody PayChangeToOpenDTO supplierPayImportDTO);

    @GsonEncoder
    @Post(value = "#{sys.kingdee.financial-share.host}/kapi/v2/m4p4/ap/ap_finapbill/ap_finapbill_save")
    @ApiOperateLog(code = "payableToOpen", name = "财务应付单提交共享系统", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.ERP)
    ErpApiResult<PayImportToOpenResultDTO> payableToOpen(@Header("accessToken") String accessToken, @JSONBody PayableToOpenDTO supplierPayImportDTO);

    // /v2/m4p4/ap/api/finapbillDelete
    @GsonEncoder
    @Post(value = "#{sys.kingdee.financial-share.host}/kapi/v2/m4p4/ap/api/finapbillDelete")
    @ApiOperateLog(code = "payableDelete", name = "财务应付单删除", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.ERP)
    ErpApiResult1<PayImportToOpenResultDTO> payableDelete(@Header("accessToken") String accessToken, @JSONBody PayableDeleteDTO payableDeleteDTO);

    @GsonEncoder
    @Post(value = "#{sys.kingdee.financial-share.host}/kapi/v2/m4p4/ar/api/payApplyDelete")
    @ApiOperateLog(code = "payApplyDelete", name = "付款申请单删除", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.ERP)
    ErpApiResult1<PayImportToOpenResultDTO> payApplyDelete(@Header("accessToken") String accessToken, @JSONBody PayApplyDeleteDTO payApplyDeleteDTO);
}
