@isTest
private class SBG203RestTest {
    public static Account acc0;
    public static Account acc1;
    public static Account acc2;
    public static Account acc3;
    public static Account acc4;

    public static Contact core;
    public static Dealer_Discount__c dealerDiscount;
    public static Dealer_Discount__c dealerDiscount1;
    public static Dealer_Discount__c dealerDiscount2;
    public static Dealer_Discount__c dealerDiscount3;
    @testSetup
    static void inittransfersData() {
        //add sushanhu for pipl 20220415
		//'SBG203'
		TestDataUtility.CreatePIPolicyConfiguration();

	//add sushanhu for pipl 20220415
        NFMUtil.EscapeSBG001TriggerHandler = true;
        List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Dealer'];
        Account acc0 = new Account(
            name = '*',
            RecordTypeId = rectIE[0].Id,
            OwnerId = UserInfo.getUserId(),
            DivisionName__c = 'Customer IE',
            FacilityName__c = 'abc',
            DivisionName_D__c = 'Customer IE',
            FacilityNameD__c = 'abc',
            PostCode__c = '123456',
            NationalEnterpriseUser__c = true
        );
        insert acc0;
        Account acc1 = new Account(
            name = '*',
            RecordTypeId = rectIE[0].Id,
            OwnerId = UserInfo.getUserId(),
            DivisionName__c = 'Customer IE',
            FacilityName__c = 'abc',
            DivisionName_D__c = 'Customer IE',
            FacilityNameD__c = 'abc',
            PostCode__c = '123456',
            ManagementCode_Ext__c = '30022',
            ParentId = acc0.Id,
            NationalEnterpriseUser__c = true
        );
        Account acc2 = new Account(
            name = '*',
            RecordTypeId = rectIE[0].Id,
            OwnerId = UserInfo.getUserId(),
            DivisionName__c = 'Customer IE',
            FacilityName__c = 'abc',
            DivisionName_D__c = 'Customer IE',
            FacilityNameD__c = 'abc',
            PostCode__c = '123456',
            ManagementCode_Ext__c = '30122',
            NationalEnterpriseUser__c = true
        );
        Account acc5 = new Account(
            name = '*',
            RecordTypeId = rectIE[0].Id,
            OwnerId = UserInfo.getUserId(),
            DivisionName__c = 'Customer IE',
            FacilityName__c = 'abc',
            DivisionName_D__c = 'Customer IE',
            FacilityNameD__c = 'abc',
            PostCode__c = '123456',
            ManagementCode_Ext__c = '30121',
            NationalEnterpriseUser__c = true
        );
        Account acc3 = new Account(
            name = '*',
            RecordTypeId = rectIE[0].Id,
            OwnerId = UserInfo.getUserId(),
            DivisionName__c = 'Customer IE',
            FacilityName__c = 'abc',
            DivisionName_D__c = 'Customer IE',
            FacilityNameD__c = 'abc',
            CancelReason__c = 'test',
            PostCode__c = '123456',
            ManagementCode_Ext__c = '30222',
            NationalEnterpriseUser__c = true
        );

        Account acc4 = new Account(
            name = '*',
            RecordTypeId = rectIE[0].Id,
            OwnerId = UserInfo.getUserId(),
            DivisionName__c = 'Customer IE',
            FacilityName__c = 'abc',
            DivisionName_D__c = 'Customer IE',
            FacilityNameD__c = 'abc',
            PostCode__c = '123456',
            ManagementCode_Ext__c = '300220',
            ParentId = acc0.Id,
            NationalEnterpriseUser__c = true
        );

        insert new List<Account> {acc1, acc2, acc3,acc4,acc5};


        List<BatchIF_Transfer__c> transfers = new List<BatchIF_Transfer__c>();
        BatchIF_Transfer__c transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'Account';
        transfer.Column__c         = 'Dealer_Type__c';
        transfer.External_Value__c = '22';
        transfer.Internal_Value__c = 'Authorize dealer';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'License_Information__c';
        transfer.Column__c         = 'LicenseType__c';
        transfer.External_Value__c = '01';
        transfer.Internal_Value__c = '营业执照';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'License_Information__c';
        transfer.Column__c         = 'LicenseType__c';
        transfer.External_Value__c = '04';
        transfer.Internal_Value__c = '第二类医疗器械经营备案凭证';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'License_Information__c';
        transfer.Column__c         = 'LicenseType__c';
        transfer.External_Value__c = '08';
        transfer.Internal_Value__c = '辐射安全许可证';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'Account';
        transfer.Column__c         = 'KeyAccount__c';
        transfer.External_Value__c = '全球客户';
        transfer.Internal_Value__c = 'Global Account';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'Account';
        transfer.Column__c         = 'Use__c';
        transfer.External_Value__c = 'BS11';
        transfer.Internal_Value__c = 'Cell Biology - Cancer Research';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'Account';
        transfer.Column__c         = 'MarketVerticals__c';
        transfer.External_Value__c = '临床';
        transfer.Internal_Value__c = 'Clinical';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'Account';
        transfer.Column__c         = 'IndustryC__c';
        transfer.External_Value__c = '生物工艺';
        transfer.Internal_Value__c = 'Biotech';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'CertificationDetails__c';
        transfer.Column__c         = 'ProductModel__c';
        transfer.External_Value__c = 'D';
        transfer.Internal_Value__c = 'Delta';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'CertificationDetails__c';
        transfer.Column__c         = 'ProductModel__c';
        transfer.External_Value__c = 'V';
        transfer.Internal_Value__c = 'Venta';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'CertificationDetails__c';
        transfer.Column__c         = 'ProductModel__c';
        transfer.External_Value__c = 'DV';
        transfer.Internal_Value__c = 'Delta+Venta';
        transfers.add(transfer);

        transfer = new BatchIF_Transfer__c();
        transfer.Table__c          = 'CertificationDetails__c';
        transfer.Column__c         = 'ProductModel__c';
        transfer.External_Value__c = 'F';
        transfer.Internal_Value__c = 'FOX-IQ';
        transfers.add(transfer);
        insert transfers;

        core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=acc1.id,ManagementCode_Ext__c = 'C100300X');
        insert core;

        dealerDiscount = new Dealer_Discount__c();
        dealerDiscount.DimensionValue1__c = '30022';
        dealerDiscount.DimensionValue2__c = '山西';
        dealerDiscount.DealerDiscountAccount__c = acc3.Id;
        dealerDiscount.DimensionField1__c = 'Dealer_Code__c';
        dealerDiscount.DimensionField2__c = 'Province__c';
        dealerDiscount.Dealer_Rank__c = 49;
        dealerDiscount.Valid_Date_From__c = Date.today().addDays(2);
        dealerDiscount.Valid_Date_To__c = Date.today().addDays(22);
        //dealerDiscount.Valid_Date_From2__c = Date.today().addDays(23);
        //dealerDiscount.Valid_Date_To2__c = Date.today().addDays(33);
        insert dealerDiscount;

        dealerDiscount1 = new Dealer_Discount__c();
        dealerDiscount1.DimensionValue1__c = '30022';
        dealerDiscount1.DimensionValue2__c = '山东';
        dealerDiscount1.DealerDiscountAccount__c = acc3.Id;
        dealerDiscount1.DimensionField1__c = 'Dealer_Code__c';
        dealerDiscount1.DimensionField2__c = 'Province__c';
        dealerDiscount1.Dealer_Rank__c = 49;
        dealerDiscount1.Valid_Date_From__c = Date.today().addDays(-22);
        dealerDiscount1.Valid_Date_To__c = Date.today().addDays(22);
        dealerDiscount.Valid_Date_From2__c = Date.today().addDays(23);
        dealerDiscount.Valid_Date_To2__c = Date.today().addDays(33);

        insert dealerDiscount1;

        dealerDiscount2 = new Dealer_Discount__c();
        dealerDiscount2.DimensionValue1__c = '300220';
        dealerDiscount2.DimensionValue2__c = '山西';
        dealerDiscount2.DealerDiscountAccount__c = acc4.Id;
        dealerDiscount2.DimensionField1__c = 'Dealer_Code__c';
        dealerDiscount2.DimensionField2__c = 'Province__c';
        dealerDiscount2.Dealer_Rank__c = 49;
        dealerDiscount2.Valid_Date_From__c = Date.today().addDays(-22);
        dealerDiscount2.Valid_Date_To__c = Date.today().addDays(22);
        dealerDiscount2.Valid_Date_From2__c = Date.today().addDays(23);
        dealerDiscount2.Valid_Date_To2__c = Date.today().addDays(33);

        insert dealerDiscount2;

        dealerDiscount3 = new Dealer_Discount__c();
        dealerDiscount3.DimensionValue1__c = '300220';
        dealerDiscount3.DimensionValue2__c = '山东';
        dealerDiscount3.DealerDiscountAccount__c = acc4.Id;
        dealerDiscount3.DimensionField1__c = 'Dealer_Code__c';
        dealerDiscount3.DimensionField2__c = 'Province__c';
        dealerDiscount3.Dealer_Rank__c = 49;
        dealerDiscount3.Valid_Date_From__c = Date.today().addDays(2);
        dealerDiscount3.Valid_Date_To__c = Date.today().addDays(22);
        dealerDiscount3.Valid_Date_From2__c = Date.today().addDays(23);
        dealerDiscount3.Valid_Date_To2__c = Date.today().addDays(33);

        insert dealerDiscount3;
    }

    //客户必填字段验证
    static testMethod void fieldcheck00() {
        // 24 -直销
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        String JsonMsg = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"","Postal":"","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"","License_Info":[{"WarehouseAddress":"","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":null,"ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"24","BPCodeforeign":"3000002109","BPCode":"","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"3","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23","VTWEG":"42","AccountSource":"","UserType":"","COMPOSubuse":"","TargetCustomer":null,"IsCOMPO":null}]}';
        
        req.requestURI = 'services/apexrest/SBG203/execute';
        req.httpMethod = 'POST';
        req.requestBody = Blob.valueof(JsonMsg);
        RestContext.request = req;
        RestContext.response= res;
        SBG203Rest.execute();
        // 24 - 分销
        RestRequest req01 = new RestRequest();
        RestResponse res01 = new RestResponse();
        String JsonMsg01 = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"","Postal":"","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"","License_Info":[{"WarehouseAddress":"","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":null,"ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"24","BPCodeforeign":"3000002109","BPCode":"","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"3","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23","VTWEG":"41","AccountSource":"","UserType":"","COMPOSubuse":"","TargetCustomer":null,"IsCOMPO":null}]}';
        
        req01.requestURI = 'services/apexrest/SBG203/execute';
        req01.httpMethod = 'POST';
        req01.requestBody = Blob.valueof(JsonMsg01);
        RestContext.request = req01;
        RestContext.response= res01;
        SBG203Rest.execute();

        // 23 - 分销
        RestRequest req00 = new RestRequest();
        RestResponse res00 = new RestResponse();
        String JsonMsg00 = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"LS","Postal":"","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"","License_Info":[{"WarehouseAddress":"","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":null,"ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"23","BPCodeforeign":"3000002107","BPCode":"","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"3","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"","VTWEG":"41","AccountSource":"","UserType":"","COMPOSubuse":"","TargetCustomer":null,"IsCOMPO":null}]}';
        req00.requestURI = 'services/apexrest/SBG203/execute';
        req00.httpMethod = 'POST';
        req00.requestBody = Blob.valueof(JsonMsg00);
        RestContext.request = req00;
        RestContext.response= res00;
        SBG203Rest.execute();
    }


    static testMethod void insertOrUpdate_BS_Account() {

        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        String JsonMsg = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"LS","Postal":"","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"","License_Info":[{"WarehouseAddress":"测试;","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":"山西","ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"23","BPCodeforeign":"3000002106","BPCode":"3000002105","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"3","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23"}]}';
        req.requestURI = 'services/apexrest/SBG203/execute';
        req.httpMethod = 'POST';
        req.requestBody = Blob.valueof(JsonMsg);
        RestContext.request = req;
        RestContext.response= res;
        SBG203Rest.execute();

        
    }

    static testMethod void insertOrUpdate_BS_Account00() {


        RestRequest req00 = new RestRequest();
        RestResponse res00 = new RestResponse();
        String JsonMsg00 = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"LS","Postal":"","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"","License_Info":[{"WarehouseAddress":"测试","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":"山西;山东","ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"23","BPCodeforeign":"30022","BPCode":"30022","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"1","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23"}]}';
        req00.requestURI = 'services/apexrest/SBG203/execute';
        req00.httpMethod = 'POST';
        req00.requestBody = Blob.valueof(JsonMsg00);
        RestContext.request = req00;
        RestContext.response= res00;
        SBG203Rest.execute();
        
    }

    static testMethod void insertOrUpdate_BS_Account01() {


        RestRequest req00 = new RestRequest();
        RestResponse res00 = new RestResponse();
        String JsonMsg00 = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"LS","Postal":"","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"","License_Info":[{"WarehouseAddress":"测试","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":"山西;山东","ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"23","BPCodeforeign":"30022","BPCode":"30022","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"2","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23"}]}';
        req00.requestURI = 'services/apexrest/SBG203/execute';
        req00.httpMethod = 'POST';
        req00.requestBody = Blob.valueof(JsonMsg00);
        RestContext.request = req00;
        RestContext.response= res00;
        SBG203Rest.execute();
        
    }

    //变更(协议变更(经销商折扣)、证照变更、收货人变更(联系人))(尚未开发)
    static testMethod void insertOrUpdate_RVI_Account() {
        // BPType=24 RVI
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        String JsonMsg = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"BS11","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"RVI","Postal":"100010","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"其他","License_Info":[{"WarehouseAddress":"测试；","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"大客户","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"教育","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"0","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation;其他","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":null,"ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"24","BPCodeforeign":"3000002108","BPCode":"3000002108","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"3","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23","AccountSource":"直销","TargetCustomer":true,"IsCOMPO":true,"UserType":"研究所","COMPOSubuse":"I073","VTWEG":"41"}]}';
        req.requestURI = 'services/apexrest/SBG203/execute';
        req.httpMethod = 'POST';
        req.requestBody = Blob.valueof(JsonMsg);
        RestContext.request = req;
        RestContext.response= res;
        SBG203Rest.execute();

        
    }
    //变更(协议变更(经销商折扣)、证照变更、收货人变更(联系人))(尚未开发)
    static testMethod void insertOrUpdate_RVI_Account01() {
        // BPType=24 RVI
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        String JsonMsg = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"BS11","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"RVI","Postal":"100010","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"其他","License_Info":[{"WarehouseAddress":"测试；","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"大客户","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"教育","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"0","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation;其他","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":null,"ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"24","BPCodeforeign":"3000002108","BPCode":"3000002108","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"3","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23","AccountSource":"分销","TargetCustomer":true,"IsCOMPO":true,"UserType":"研究所","COMPOSubuse":"I073","VTWEG":"42"}]}';
        req.requestURI = 'services/apexrest/SBG203/execute';
        req.httpMethod = 'POST';
        req.requestBody = Blob.valueof(JsonMsg);
        RestContext.request = req;
        RestContext.response= res;
        SBG203Rest.execute();

        
    }

    static testMethod void insertOrUpdate_RVI_Account00() {
    

        // BPType=23 RVI
        RestRequest req00 = new RestRequest();
        RestResponse res00 = new RestResponse();
        String JsonMsg00 = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"BS11","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"RVI","Postal":"","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"其他","License_Info":[{"WarehouseAddress":"测试;","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"},{"WarehouseAddress":"","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"04","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207257","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"},{"WarehouseAddress":"","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"08","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":[{"ProSerial":"Delta和Vanta","Quantity":"22","ProName":"DE2000/DPO2000","Category":"销售"}],"BusLicenseNo":"914401067299207258","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"大客户","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"教育","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"0","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation;其他","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":null,"ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"23","BPCodeforeign":"30121","BPCode":"30122","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"3","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23"}]}';
        req00.requestURI = 'services/apexrest/SBG203/execute';
        req00.httpMethod = 'POST';
        req00.requestBody = Blob.valueof(JsonMsg00);
        RestContext.request = req00;
        RestContext.response= res00;
        SBG203Rest.execute();
        
    }
    // ANI
    static testMethod void insertOrUpdate_ANI_Account() {
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        String JsonMsg = '{"Monitoring":{"Tag":"MSGH","Sender":"1330","Receiver":"1592","MessageType":"SBG203","MessageGroupNumber":"20200000334093","NumberOfRecord":"1","TransmissionDateTime":"202010160915"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","Use":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"914401067299207256","SubUseEnterprise":"","STR_SUPPL1":"广州市天河区天河北路689号光大银行大厦24层E2","ServiceType":"","Remark":"广州元升是IE的签约代理商，并且8月25日参加了FY2021 SSBG 经销商合规培训","RegisterAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2","RegionName":"","Region":"广东","QualityAgrNoVT":"","QualityAgrNoVF":"","ProductSegment":"ANI","Postal":"","Phone":"020-38730350","other3":null,"other2":null,"other1":null,"OperationProject":null,"Mobilephone":"","MarketVerticals":"","License_Info":[{"WarehouseAddress":"","ValidTo":"99991231","ValidFrom":"20151211","Principal":"刘智锋","other6":"","other5":"","other4":"","LicenseType":"01","ISSUEDATE1":"20151211","IssueAuthority":"","IfQuantityCtrl":false,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"Detail_Info":null,"BusLicenseNo":"914401067299207256","BusinessType":"研究和试验发展（具体经营项目请登录广州市商事主体信息公示平台查询。依法须经批准的项目，经相关部门批准后方可开展经营活动。）","BusinessScope1":"","BusinessScope":null,"BusinessAddress":"广东广州市天河区天河北路689号光大银行大厦24层E2"}],"KeyAccount":"","KATR2":"2A","Invoice_phone":"020-38730350","Industry":"","Incorporator":"刘智锋","Fax":"","ExportRegulatedCustomer":"","DealerTradeType":"","CustomerService":null,"Contract_Info":[{"TermContractNo":null,"SubUse":"Civil Aviation","SelableProduct":null,"SalesState":null,"SalesShopClass":null,"SalesSection":null,"DealerRate":"70","DealerRank":null,"DealerdiscountZF":null,"DealerdiscountURO":null,"DealerdiscountSP":null,"DealerdiscountOTH":null,"DealerdiscountGYN":null,"DealerdiscountGS":null,"DealerdiscountGI":null,"DealerdiscountET":null,"DealerdiscountENG":null,"DealerdiscountENF":null,"DealerdiscountBF":null,"DealerdiscountAH":null,"ContractStartDate":"20220522","ContractRegion":null,"ContractOwner":null,"ContractEndDate":null,"ContractDepartmentClass":null,"ContractDecideStartDate":null,"ContractDecideEndDate":null,"BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":null,"AgencyApplicationNo":null,"AgencyApplicationDay":null}],"Consignee_Info":[{"PostalCode":"","ContactPhone":"020-38730350","ContactName":"洪波","ContactMobilePhone":"","ContactId":"135281","ContactEnglishName":null,"ContactAddress":"广州市天河区天河北路689号光大银行大厦24层E2","CITY1":"广州市"}],"CompanyName":"广州元升科技有限公司","CompanyEnglishName":null,"CompanyCode":"5112","Comment":"同意","CNTag":"","City":"广州市","BPType":"23","BPCodeforeign":"30222","BPCode":"30222","BankName":"中国工商银行广州科技园支行","BankCode":"3602062719200061533","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":null,"Approver":"Zhou Fang (方舟) (OCSM)","ApproveDate":"20200910","ApplyType":"3","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"","AgentValidFrom":"","AgentType":"23"}]}';
        req.requestURI = 'services/apexrest/SBG203/execute';
        req.httpMethod = 'POST';
        req.requestBody = Blob.valueof(JsonMsg);
        RestContext.request = req;
        RestContext.response= res;
        SBG203Rest.execute();    
    }

}