业务背景:
基于金蝶云星空提供的接口测试,交付之前或者联调之前开发者先自测,即使纠错,提高效率。
大致流程:
先请求登录接口,获得token后再请求标准webapi或者自定义接口,这样上下文才不会空。
说明:
金蝶的接口格式一般为:http://ServerIp/K3Cloud/接口命名空间.接口实现类名.方法,组件名.common.kdsvc
具体操作:
1、协同环境
2、登录postman请求
POST请求:http://localhost:1200/Kingdee.bos.webapi.ServicesStub.authservice.validateuser.common.kdsvc
请求json:
{ "acctid":"账套id", "userName":"账号", "password":"密码", "lcid":2052 }
lcid是多语言,2052代表是中文。
3、请求标准接口地址
标准保存接口:
post请求url:
http://localhost:1200/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc
请求json:
{ "formid":"BD_MATERIAL", "data":{ "NeedUpDateFields": [], "NeedReturnFields": [], "IsDeleteEntry": "true", "SubSystemId": "", "IsVerifyBaseDataField": "false", "IsEntryBatchFill": "true", "ValidateFlag": "true", "NumberSearch": "true", "IsAutoAdjustField": "false", "InterationFlags": "", "IgnoreInterationFlag": "", "IsControlPrecision": "false", "ValidateRepeatJson": "false", "Model": { "FName": " 202308mmm", "FNumber": "202308mmm", "FImgStorageType": "A", "FCreateOrgId": { "FNumber": "10" }, "FUseOrgId": { "FNumber": "10" }, "FSubHeadEntity": { "FTimeUnit": "H" }, "SubHeadEntity": { "FErpClsID": "1", "FFeatureItem": "1", "FCategoryID": { "FNumber": "CHLB01_SYS" }, "FTaxType": { "FNumber": "WLDSFL01_SYS" }, "FTaxRateId": { "FNUMBER": "SL02_SYS" }, "FBaseUnitId": { "FNumber": "Pcs" }, "FIsPurchase": true, "FIsInventory": true, "FIsSale": true, "FWEIGHTUNITID": { "FNUMBER": "kg" }, "FVOLUMEUNITID": { "FNUMBER": "m" } }, "SubHeadEntity1": { "FStoreUnitID": { "FNumber": "Pcs" }, "FUnitConvertDir": "1", "FIsLockStock": true, "FCountCycle": "1", "FCountDay": 1, "FCurrencyId": { "FNumber": "PRE001" }, "FSNManageType": "1", "FSNGenerateTime": "1" }, "SubHeadEntity2": { "FSaleUnitId": { "FNumber": "Pcs" }, "FSalePriceUnitId": { "FNumber": "Pcs" }, "FMaxQty": 100000, "FIsReturn": true, "FISAFTERSALE": true, "FISPRODUCTFILES": true, "FWARRANTYUNITID": "D", "FOutLmtUnit": "SAL" }, "SubHeadEntity3": { "FPurchaseUnitId": { "FNumber": "Pcs" }, "FPurchasePriceUnitId": { "FNumber": "Pcs" }, "FPurchaseOrgId": { "FNumber": "10" }, "FQuotaType": "1", "FIsReturnMaterial": true, "FPOBillTypeId": { "FNUMBER": "CGSQD01_SYS" }, "FPrintCount": 1, "FMinPackCount": 1 }, "SubHeadEntity4": { "FPlanningStrategy": "1", "FMfgPolicyId": { "FNumber": "ZZCL001_SYS" }, "FFixLeadTimeType": "1", "FVarLeadTimeType": "1", "FCheckLeadTimeType": "1", "FOrderIntervalTimeType": "3", "FMaxPOQty": 100000, "FEOQ": 1, "FVarLeadTimeLotSize": 1, "FIsMrpComBill": true, "FReserveType": "1", "FCanDelayDays": 999, "FAllowPartDelay": true, "FPlanOffsetTimeType": "1", "FWriteOffQty": 1 }, "SubHeadEntity5": { "FProduceUnitId": { "FNumber": "Pcs" }, "FProduceBillType": { "FNUMBER": "SCDD03_SYS" }, "FOrgTrustBillType": { "FNUMBER": "SCDD06_SYS" }, "FBOMUnitId": { "FNumber": "Pcs" }, "FIssueType": "1", "FOverControlMode": "1", "FMinIssueQty": 1, "FMinIssueUnitId": { "FNUMBER": "Pcs" }, "FStandHourUnitId": "3600", "FBackFlushType": "1" }, "SubHeadEntity7": { "FSubconUnitId": { "FNumber": "Pcs" }, "FSubconPriceUnitId": { "FNumber": "Pcs" }, "FSubBillType": { "FNUMBER": "WWDD01_SYS" } }, "FEntityInvPty": [{ "FInvPtyId": { "FNumber": "01" }, "FIsEnable": true }, { "FInvPtyId": { "FNumber": "02" }, "FIsEnable": true }, { "FInvPtyId": { "FNumber": "03" } }, { "FInvPtyId": { "FNumber": "04" } }, { "FInvPtyId": { "FNumber": "06" } }] } } }View Code
如果你需要直接拷贝这个请求数据,首先修改你的fnumber,其次是组织id,默认是100,我的是10.
返回:
{"Result":{"ResponseStatus":{"IsSuccess":true,"Errors":[],"SuccessEntitys":[{"Id":103933,"Number":"202308mmm","DIndex":0}],"SuccessMessages":[],"MsgCode":0},"Id":103933,"Number":"202308mmm","NeedReturnData":[{}]}}
标准查询接口:
post请求url:
http://localhost:1200/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View.common.kdsvc
请求json:
{ "formid":"BD_MATERIAL", "data":{ "CreateOrgId": 0, "Number": "202308mmm", "Id": "", "IsSortBySeq": "false" } }
返回:
特别说明:
其他接口:
4、请求自定义接口地址
4.1、post请求:http://localhost:1200/xxxx.K3.SCM.WebApi.ServicesStub.AfterOrder.GetAfterOrder.common.kdsvc
备注:拼接规则【http://localhost:1200/命名空间.类名.方法名..common.kdsvc】
4.2、请求头:Header: Content-Type:application/json
4.3、请求json:
{ "customer":"北京XXX电气有限公司" }
4.4、请求返回:
返回成功。
完美。
标签:Webapi,FNumber,Postman,Pcs,FNUMBER,SYS,云下,true,请求 From: https://www.cnblogs.com/lanrenka/p/17672797.html