提交操作接口
1 接口介绍
提交操作服务是指通过在请求url参数中按规范输入单据或基础资料的id或编码,再调用服务对数据执行提交操作。
2 注意事项
1 )提交操作API根据参数提交对应的单据,可以通过单据候选键参数ids或参数numbers提交指定的单据(若业务对象是存在业务数据组织隔离的单据如采购订单,可通过参数org+numbers组合,执行提交操作,其中org为组织内码);
2 )可以一次提交多条数据,中间用英文逗号隔开(推荐根据主键提交,性能更高)。成功的会正常提交,针对无法提交的单据,API会返回错误信息。
3 接口示例
采购订单提交
URL:{{host}}/kapi/sys/pm_purorderbill/submit?org=100000&numbers=CGDD-202107-151100,CGDD-202109-152203 请求方式:GET 请求Header参数: Content-Type=application/json accessToken: xxxxxxxxxxxxx |
请求结果: { "data": { "success": true, "needSign": false, "needWfAssignPersons": false, "cancelWriteLog": true, "showMessage": true, "billCount": 2, "successPkIds": [ 1224477674341159936, 1235479318616893440 ], "billNos": { "1224477674341159936": "CGDD-202107-151100", "1235479318616893440": "CGDD-202109-152203" }, "validateResult": { "validateErrors": [], "success": true, "message": "", "errorPkIds": [], "errorDataIndexs": [] }, "allErrorOrValidateInfo": [], "runSecond": 0, "allErrorInfo": [] }, "success": true, "errorCode": "success", "message": null } |
当批量提交的采购订单太多,用GET请求时,会受到请求URL最大长度限制,可以将单据id或number放在请求体中,并通过POST请求进行提交。
URL:{{host}}/kapi/sys/pm_purorderbill/submit 请求方式:POST 请求Header参数: Content-Type=application/json accessToken: xxxxxxxxxxxxx |
请求body 方式一: { "ids": [ "1367956131938305024", "1367956209809752064" ] } 方式二: { "numbers": [ "CGSQ-220228-000257", "CGSQ-220228-000256" ], "org": "100000" } |
请求结果: { "data": { "success": true, "needSign": false, "needWfAssignPersons": false, "cancelWriteLog": true, "showMessage": true, "billCount": 2, "successPkIds": [ 1367956131938305024, 1367956209809752064 ], "billNos": { "1367956209809752064": "CGSQ-220228-000257", "1367956131938305024": "CGSQ-220228-000256" }, "allErrorOrValidateInfo": [], "validateResult": { "validateErrors": [], "success": true, "message": "", "errorPkIds": [], "errorDataIndexs": [] }, "runSecond": 0, "allErrorInfo": [] }, "success": true, "errorCode": "success", "message": null } |
4 返回参数说明
序号 | 参数 | 解释 | 返回值实例 |
1 | success | 是否成功 | true/false |
2 | errorCode | 错误编码 | success/false |
3 | message | 提示信息 | 成功时为null,失败时会返回错误信息 |
4 | data | 业务对象数据 | {"successPkIds": [1224477674341159936,1235479318616893440 ],"billNos": { "1224477674341159936": "CGDD-202107-151100","1235479318616893440": "CGDD-202109-152203"},...} |
提交操作接口
本文2024-09-23 00:26:52发表“云苍穹知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-cangqiong-139522.html