package com.weaver.seconddev.interfaces.srmoa;

import java.lang.*;

import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.weaver.verupgrade.general.BaseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 供应商新货源扩充接口
 */
@Component
public class CallSrmVenMatExtsSevices extends BaseBean {
    @Autowired
    private ConfigProp configProp;
    private static final org.slf4j.Logger logger_8da144ad = LoggerFactory.getLogger(CallSrmVenMatExtsSevices.class);

    public String[] call(VenMatExtsHandlerServiceServiceStub.VenMatExtsRusultIn param, String requestid) throws Exception {
        logger_8da144ad.error(String.valueOf(requestid + " 调用接口------------------------开始"));
        logger_8da144ad.error(String.valueOf(requestid + " param == "  + param.toString()));
//                    this(configurationContext, Prop.getPropValue("htsrmoasync","htsrm_oa_venmatsextnew") );
        String url = configProp.getHtsrm_oa_venmatsextnew();
        VenMatExtsHandlerServiceServiceStub stub = new VenMatExtsHandlerServiceServiceStub(url);
        VenMatExtsHandlerServiceServiceStub.SRM_OA_VENMATEXTS_RESULTE res = new VenMatExtsHandlerServiceServiceStub.SRM_OA_VENMATEXTS_RESULTE();
        VenMatExtsHandlerServiceServiceStub.SRM_OA_VENMATEXTS_RESULT sovr = new VenMatExtsHandlerServiceServiceStub.SRM_OA_VENMATEXTS_RESULT();
        sovr.setInputTab(param);
        res.setSRM_OA_VENMATEXTS_RESULT(sovr);
//        VenMatExtsHandlerServiceServiceStub.SRM_OA_VENMATEXTS_RESULTResponseE resp = stub.SRM_OA_VENMATEXTS_RESULT(res);
        VenMatExtsHandlerServiceServiceStub.SRM_OA_VENMATEXTS_RESULTResponseE resp = stub.sRM_OA_VENMATEXTS_RESULT(res);
        logger_8da144ad.error(String.valueOf(requestid + " 调用接口------------------------完成"));
        VenMatExtsHandlerServiceServiceStub.VenMatExtsResultOut resultout = resp.getSRM_OA_VENMATEXTS_RESULTResponse().getOutputTab();
        // 封装返回
        String[] rtInfo = new String[3];
        rtInfo[0] = resultout.getRequestId();
        rtInfo[1] = resultout.getIstat();
        rtInfo[2] = resultout.getMsg();
        logger_8da144ad.error(String.valueOf(requestid + " RequestId:" + rtInfo[0] + " Istat:" + rtInfo[1] + " Msg:" + rtInfo[2]));
        return rtInfo;
    }
}
