| | |
| | | @isTest |
| | | static void test_method_one() { |
| | | inittransfersData(); |
| | | |
| | | NFM203Rest.GeDatas GeDatas = new NFM203Rest.GeDatas(); |
| | | NFM203Rest.GeData GeData = new NFM203Rest.GeData(); |
| | | NFM203Rest.License_Info License_Info = new NFM203Rest.License_Info(); |
| | |
| | | Contract_Info.AimDivision = '金额' ; |
| | | Contract_Info.AgencyApplicationNo = 'MSHTYXQHD201812005' ; |
| | | Contract_Info.AgencyApplicationDay = '20181207' ; |
| | | |
| | | |
| | | System.Test.startTest(); |
| | | NFMUtil.Monitoring Monitoring = GeDatas.Monitoring; |
| | | BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM203', GeDatas.Partners); |
| | | Oly_TriggerHandler.bypass('NFM702ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('ContactTriggerHandler'); |
| | | StaticParameter.EscapeContactToUser = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | ControllerUtil.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | NFM203Rest.main(rowData.Id); |
| | | GeData.BPType = '03'; |
| | | rowData = NFMUtil.saveRowData(Monitoring, 'NFM203', GeDatas.Partners); |
| | |
| | | License_Info.LicenseType = ''; |
| | | rowData = NFMUtil.saveRowData(Monitoring, 'NFM203', GeDatas.Partners); |
| | | NFM203Rest.main(rowData.Id); |
| | | //GeData.ApplyType = '5'; |
| | | //rowData = NFMUtil.saveRowData(Monitoring, 'NFM203', GeDatas.Partners); |
| | | //NFM203Rest.main(rowData.Id); |
| | | //System.Test.stopTest(); |
| | | |
| | | |
| | | GeData.ApplyType = '5'; |
| | | rowData = NFMUtil.saveRowData(Monitoring, 'NFM203', GeDatas.Partners); |
| | | NFM203Rest.main(rowData.Id); |
| | | System.Test.stopTest(); |
| | | } |
| | | @isTest |
| | | static void test_method_Three() { |
| | | |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | inittransfersData(); |
| | | NFM203Rest.GeDatas GeDatas = new NFM203Rest.GeDatas(); |
| | |
| | | Contract_Info.AimDivision = '金额' ; |
| | | Contract_Info.AgencyApplicationNo = 'MSHTYXQHD201812005' ; |
| | | Contract_Info.AgencyApplicationDay = '20181207' ; |
| | | |
| | | |
| | | System.Test.startTest(); |
| | | NFMUtil.Monitoring Monitoring = GeDatas.Monitoring; |
| | | BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM203', GeDatas.Partners); |
| | | Oly_TriggerHandler.bypass('NFM702ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('ContactTriggerHandler'); |
| | | StaticParameter.EscapeContactToUser = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | ControllerUtil.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | NFM203Rest.main(rowData.Id); |
| | | //Contract_Info.DealerdiscountET = null ; |
| | | //Contract_Info.DealerdiscountENG = 10.0 ; |
| | |
| | | RestResponse res = new RestResponse(); |
| | | |
| | | String JsonMsg = '{"Monitoring":{"TransmissionDateTime":"201812201320","Text":"","Tag":"MSGH","Sender":"SFDC","Receiver":"SPO","NumberOfRecord":"1","MessageType":"NFM203","MessageGroupNumber":"20180001722190"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"12345678909855","ServiceType":null,"Remark":"","RegisterAddress":"1号","RegionName":"北京市","Region":"10","QualityAgrNoVT":null,"QualityAgrNoVF":null,"Postal":"111100","Phone":"15611778799","other3":null,"other2":null,"other1":null,"OperationProject":null,"License_Info":[{"WarehouseAddress":null,"ValidTo":"20210731","ValidFrom":"20210601","Principal":"张三","other6":null,"other5":null,"other4":null,"LicenseType":"01","IssueAuthority":null,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"BusLicenseNo":"code123456","BusinessType":null,"BusinessScope1":"医疗器械","BusinessScope":null,"BusinessAddress":"北京市昌平区1号"},{"WarehouseAddress":"","ValidTo":"20210701","ValidFrom":"20210531","Principal":"张三","other6":null,"other5":null,"other4":null,"LicenseType":"09","IssueAuthority":"测试","Exclusive1":"","Exclusive":"","DiagnosisScope":"","BusLicenseNo":"code123456","BusinessType":"不带有存储设施的经营","BusinessScope1":"","BusinessScope":"过乙酸[含量≤16%,含水≥39%,含乙酸≥15%,含过氧化氢≤24%,含稳定剂]","BusinessAddress":"北京市昌平区1号"}],"Incorporator":"张三","Fax":"","CustomerService":null,"Contract_Info":[{"TermContractNo":"154P-HD062","SelableProduct":"阿西赛多","SalesState":"上海市","SalesShopClass":"产品","SalesSection":"统括本部","SalesCity":"上海市","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":"20210401","ContractOwner":"comlan_ctec_zhangbo","ContractEndDate":"20220331","ContractDepartmentClass":null,"ContractDecideStartDate":"20210401","ContractDecideEndDate":"20220331","BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":"金额","AgencyApplicationNo":"MSHTYXGHD202106005","AgencyApplicationDay":"20210616"}],"Consignee_Info":[{"PostalCode":"111101","ContactPhone":"15611778700","ContactName":"码图测试收货人信息变更","ContactCity":"北京","ContactAddress":"北京市朝阳区亮马桥"}],"CompanyName":"阿西赛多复测0616","CompanyCode":"5112","Comment":"同意","CNTag":"","City":"昌平区","BPType":"02","BPCode":"31416","BillingType":"2B","BillingTelephone":"15611778796","BillingAddress":"北京市昌平区2号","BankName":"工商银行","BankCode":"12345678909876","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":[],"Approver":"李岳洋","ApproveDate":"20210616","ApplyType":"1","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"20210701","AgentValidFrom":"20210601","AgentType":"02"}]}'; |
| | | //String JsonMsg = '{"Monitoring":{"TransmissionDateTime":"201812201320","Text":"","Tag":"MSGH","Sender":"SFDC","Receiver":"SPO","NumberOfRecord":"1","MessageType":"NFM203","MessageGroupNumber":"20180001722190"},"Partners":[{"Z3PLTransAgrNo":"","Z3PLQualityAgrNo":"","Z3PLAuthorizedNo":"","TransAgrVT":null,"TransAgrVF":null,"TaxNo":"12345678909855","ServiceType":null,"Remark":"","RegisterAddress":"1号","RegionName":"北京市","Region":"10","QualityAgrNoVT":null,"QualityAgrNoVF":null,"Postal":"111100","Phone":"15611778799","other3":null,"other2":null,"other1":null,"OperationProject":null,"License_Info":[{"WarehouseAddress":null,"ValidTo":"20210731","ValidFrom":"20210601","Principal":"张三","other6":null,"other5":null,"other4":null,"LicenseType":"01","IssueAuthority":null,"Exclusive1":null,"Exclusive":null,"DiagnosisScope":null,"BusLicenseNo":"code123456","BusinessType":null,"BusinessScope1":"医疗器械","BusinessScope":null,"BusinessAddress":"北京市昌平区1号"},{"WarehouseAddress":"","ValidTo":"20210701","ValidFrom":"20210531","Principal":"张三","other6":null,"other5":null,"other4":null,"LicenseType":"09","IssueAuthority":"测试","Exclusive1":"","Exclusive":"","DiagnosisScope":"","BusLicenseNo":"code123456","BusinessType":"不带有存储设施的经营","BusinessScope1":"","BusinessScope":"过乙酸[含量≤16%,含水≥39%,含乙酸≥15%,含过氧化氢≤24%,含稳定剂]","BusinessAddress":"北京市昌平区1号"}],"Incorporator":"张三","Fax":"","CustomerService":null,"Contract_Info":[{"TermContractNo":"154P-HD062","SelableProduct":"阿西赛多","SalesState":"上海市","SalesShopClass":"产品","SalesSection":"统括本部","SalesCity":"上海市","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":"20210401","ContractOwner":"comlan_ctec_zhangbo","ContractEndDate":"20220331","ContractDepartmentClass":null,"ContractDecideStartDate":"20210401","ContractDecideEndDate":"20220331","BusinessAssistant":null,"AimPriceSP":null,"AimPriceGIR":null,"AimPriceAreaSP":null,"AimPriceAreaET":null,"AimPriceAreaENG":null,"AimPriceAH":null,"AimPrice":null,"AimDivision":"金额","AgencyApplicationNo":"MSHTYXGHD202106005","AgencyApplicationDay":"20210616"}],"CompanyName":"阿西赛多复测0616","CompanyCode":"5112","Comment":"同意","CNTag":"","City":"昌平区","BPType":"02","BPCode":"31416","BillingType":"2B","BillingTelephone":"15611778796","BillingAddress":"北京市昌平区2号","BankName":"工商银行","BankCode":"12345678909876","AuthorizedVT":null,"AuthorizedVF":null,"AuthorizedScope":"","Authorized_Info":[],"Approver":"李岳洋","ApproveDate":"20210616","ApplyType":"1","Agreement4":null,"Agreement3":null,"Agreement2":null,"Agreement1":null,"AgentValidTo":"20210701","AgentValidFrom":"20210601","AgentType":"02"}]}'; |
| | | |
| | | req.requestURI = 'services/apexrest/NFM203/execute'; |
| | | req.httpMethod = 'POST'; |
| | | req.requestBody = Blob.valueof(JsonMsg); |