贸易和财务
# 基础 Web Services
# 获取模块的业务规则
获取特定企业法人下模块的业务规则键。
HTTP 请求
GET http://[server]/jsf/rfws/erp/bsrule/getBsRules/{module}/{beId}
参数
名字 | 类型 | 说明 |
---|---|---|
module | string (Path) | 必填. 模块类型。可以在数据字典中找到。 |
beId | int (Path) | 必填. 企业法人 ID |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
mess | string | 业务规则的 描述编号 |
key | string | 业务规则的键 |
请求示例:
OkHttpClient client = new OkHttpClient();
String module = "oldso";
int beId = "1";
String url = "http://" + server + "/jsf/rfws/erp/bsrule/getBsRules/"
+ module + "/" + beId;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
[
{"mess":"ce01_core.bsrule_blcus","key":"core_blCus_0"},
{"mess":"ce01_core.bsrule_blven","key":"core_blVen_0"},
{"mess":"ce01_core.bsrule_overship(sosi)","key":"oldso_overShip(si)_0"},
{"mess":"ce01_core.bsrule_underPrice","key":"oldso_underPrice_0"},
{"mess":"ce01_core.bsrule_overship(so)","key":"oldso_overShip_0"}
]
# 按业务规则检查交易
检查交易单据是否符合所有已配置的业务规则。
HTTP 请求
GET http://[server]/jsf/rfws/erp/bsrule/chkBsRules/{module}/{id}
参数
名字 | 类型 | 说明 |
---|---|---|
module | string (Path) | 必填. 模块类型 |
id | int (Path) | 必填. 单据 ID |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
key | string | 业务规则的键 |
canSave | boolean | 如果 aiM18 允许保存,则为 true |
status | boolean | 如果业务检查通过,则为 true |
请求示例:
OkHttpClient client = new OkHttpClient();
String module = "oldso";
int id = "4"; // SO id , get by getIdByCode
String url = "http://" + server + "/jsf/rfws/erp/bsrule/chkBsRules/"
+ module + "/" + id;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
[
{"canSave":false,"key":"oldso_overShip(si)_0","status":false},
{"canSave":false,"key":"oldso_underPrice_0","status":false},
{"canSave":false,"key":"oldso_overShip_0","status":false}
]
# 按指定业务规则检查交易
检查指定业务规则的交易单据。业务规则的键可通过获取业务规则web service检索。
HTTP 请求
GET http://[server]/jsf/rfws/erp/bsrule/chkBsRules/{module}/{id}/{key}
参数
名字 | 类型 | 说明 |
---|---|---|
module | string (Path) | 必填. 模块类型 |
id | int (Path) | 必填. 单据 ID |
key | string (Path) | 必填. 业务规则的键 |
结果
名字 | 类型 | 说明 |
---|---|---|
canSave | boolean | 如果 aiM18 允许保存,则为 true |
status | boolean | 如果业务检查通过,则为 true |
请求示例:
OkHttpClient client = new OkHttpClient();
String module = "oldso";
int id = "4"; // SO id , get by getIdByCode
String key = "oldso_overShip(si)_0"; // key of business rule
String url = "http://" + server + "/jsf/rfws/erp/bsrule/chkBsRules/"
+ module + "/"
+ id + "/"
+ key;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{"canSave":false,"status":false}
# 获取客户/供应商的黑名单状态
确定客户/供应商是否被列入黑名单。
HTTP 请求
GET http://[server]/jsf/rfws/erp/query/blackstatus/{searchName}
参数
名字 | 类型 | 说明 |
---|---|---|
searchName | string (Path) | 必填. cus 代表客户 , ven 代表供应商 |
id | int (Query) | 必填. 客户或供应商 ID |
结果
名字 | 类型 | 说明 |
---|---|---|
blacklisted | boolean | 如果列入黑名单,则为true |
请求示例:
OkHttpClient client = new OkHttpClient();
String searchName = "cus";
int id = "28"; // customer id
String url = "http://" + server + "/jsf/rfws/erp/query/blackstatus/"
+ searchName + "?id=" + id;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{blacklisted: true}
# 获取货币汇率
获取指定日期某种货币相对于本位币的汇率。
HTTP 请求
GET http://[server]/jsf/rfws/erp/query/getRate
参数
名字 | 类型 | 说明 |
---|---|---|
curId | int (Header) | 必填. 货币 ID |
domCurId | int (Header) | 必填. 本位币 ID |
tDate | date (Header) | 必填. 交易日期 |
结果 (JSON 数组: "values")
名字 | 类型 | 说明 |
---|---|---|
openRate | decimal | 平均汇率 |
closeRate | decimal | 期末汇率 |
请求示例:
OkHttpClient client = new OkHttpClient();
String url = "http://" + server + "/jsf/rfws/erp/query/getRate/";
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("curId", "1")
.addHeader("domCurId", "2")
.addHeader("tDate", "2017-03-01")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":1,
"values":[{"openRate":1.1,"closeRate":1.1}],
"name":"",
"fields":[{"fieldClassName":"Double","name":"openRate","fieldClass":"java.lang.Double","classType":10},{"fieldClassName":"Double","name":"closeRate","fieldClass":"java.lang.Double","classType":10}]
}
# 获取客户/供应商集团的子公司
从客户/供应商集团中获取所有子公司的客户/供应商 ID 列表。
HTTP 请求
GET http://[server]/jsf/rfws/erp/query/getGroupCli
参数
名字 | 类型 | 说明 |
---|---|---|
cliType | string (Header) | 必填. cus 代表客户,ven 代表供应商 |
cliId | int (Header) | 必填. 客户或供应商 ID |
loadGpCoData | int (Header) | 必填. 请始终输入 1 |
结果 (JSON 数组:"values")
名字 | 类型 | 说明 |
---|---|---|
cliId | string | , 分隔的子公司(客户/供应商)ID 列表 |
请求示例:
OkHttpClient client = new OkHttpClient();
String url = "http://" + server + "/jsf/rfws/erp/query/getGroupCli/";
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("cliType", "cus")
.addHeader("cliId", "119")
.addHeader("loadGpCoData", "1")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":1,
"values":[{"cliId":"119,120"}],
"name":"",
"fields":[{"fieldClassName":"String","name":"cliId","fieldClass":"java.lang.String","classType":0}]
}
# 更新交易冻结期日期
更新指定交易冻结期类型的冻结日期。
HTTP 请求
PUT http://[server]/jsf/rfws/erp/frozen/saveDate/{beId}/{frozenTypeId}/{frozenDate}
参数
名字 | 类型 | 说明 |
---|---|---|
beId | int (Path) | 必填. 企业法人 ID |
frozenTypeId | int (Path) | 必填. 交易冻结期类型 ID |
frozenDate | date (Path) | 必填. 冻结日期 |
结果
名字 | 类型 | 说明 |
---|---|---|
status | string | 字段仅在更新失败时存在。 |
message | string | 字段仅在更新失败时存在。 |
请求示例:
OkHttpClient client = new OkHttpClient();
int beId = 1;
int frozenTypeId = 18;
String frozenDate = "2017-10-23";
String url = "http://" + server + "/jsf/rfws/erp/frozen/saveDate/"
+ beId + "/"
+ frozenTypeId + "/"
+ frozenDate;
Request request = new Request.Builder()
.url(url)
.put(reqruestBody)
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":0,
"values":[],
"name":"",
"fields":[{"fieldClassName":"String","name":"status","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"message","fieldClass":"java.lang.String","classType":0}]
}
# 获取模块的最新交易冻结期
获取企业法人某个模块的最新交易冻结期及其日期。
HTTP 请求
GET http://[server]/jsf/rfws/erp/frozen/getLatestFrozenPeriod/{beId}/{menuCode}
参数
名字 | 类型 | 说明 |
---|---|---|
beId | int (Path) | 必填. 企业法人 ID |
menuCode | string (Path) | 必填. 模块的菜单编号,可以在数据字典中找到。 |
结果 (JSON 数组: "values")
名字 | 类型 | 说明 |
---|---|---|
frozenDate | date | 冻结日期 |
frozenTypeId | int | 交易冻结期类型 ID |
modifyUid | int | 修改用户 ID |
modifyDate | date | 修改日期 |
请求示例:
OkHttpClient client = new OkHttpClient();
int beId = 3;
String menuCode = "k";
String url = "http://" + server + "/jsf/rfws/erp/frozen/getLatestFrozenPeriod/"
+ beId + "/"
+ menuCode;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":1,
"values":[{"beId":3,"frozenDate":"2017-06-12 00:00:00","modifyUid":8,"modifyDate":"2017-10-12 09:10:47","frozenTypeId":19,"id":40}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"frozenTypeId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Date","name":"frozenDate","fieldClass":"java.util.Date","classType":21},{"fieldClassName":"Date","name":"modifyDate","fieldClass":"java.util.Date","classType":21},{"fieldClassName":"Long","name":"modifyUid","fieldClass":"java.lang.Long","classType":10}]
}
# 搜索查询数据
使用数据筛选的条件搜索查询数据。
HTTP 请求
GET http://[server]/jsf/rfws/erp/search/searchData/{beId}/{searchName}
参数
名字 | 类型 | 说明 |
---|---|---|
beId | int (Path) | 必填. 企业法人 ID |
searchName | string (Path) | 必填. 查询编号。可以在数据字典中找到。 |
conds | string (Header) | 数据筛选的条件,如果不输入,将选择所有数据。格式请参阅请求示例 |
field | string (Header) | 额外需要的字段。格式请参考请求示例 |
params | string (Header) | 控制返回行数的参数 |
结果
名字 | 类型 | 说明 |
---|---|---|
size | int | 返回的记录数 |
values | array | 返回数据 JSON 数组 |
fields | array | 返回字段详情 JSON 数组 |
请求示例:
OkHttpClient client = new OkHttpClient();
String beId = "24";
String searchName = "cusbank";
String fields = "[\"iRev\"]";
String conds = "[{\"leftField\":\"bkopAc\",\"operator\":\"=\",\"rightField\":\"135791011\"}]";
String params = "{\"startRow\":0,\"endRow\":0}";
String url = "http://" + server + "/jsf/rfws/erp/search/searchData/"
+ beId + "/"
+ searchName;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("field", fields)
.addHeader("conds", conds)
.addHeader("params", params)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":3,
"values":[{"bkopName":"Hang Seng Bank","bkopNo":"HS","iRev":92,"id":4,"bkopAc":"135791011"},{"bkopName":"Hang Seng Bank","bkopNo":"HS","iRev":1,"id":9,"bkopAc":"135791011"},{"bkopName":"Hang Seng Bank","bkopNo":"HS","iRev":4,"id":11,"bkopAc":"135791011"}],
"name":"",
"fields":[{"fieldClassName":"String","name":"bkopNo","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"bkopAc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"bkopName","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10}]
}
# 通过编号搜索表数据
通过编号搜索表中的数据。
HTTP 请求
GET http://[server]/jsf/rfws/erp/search/code/{tableName}/{code}
参数
名字 | 类型 | 说明 |
---|---|---|
tableName | string (Path) | 必填. 表名,可以在数据字典中找到。 |
code | string (Path) | 必填. 编号 |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
size | int | 返回的记录数 |
values | string | 返回数据 JSON 数组 |
fields | string | 返回字段详情 JSON 数组 |
请求示例:
OkHttpClient client = new OkHttpClient();
String tableName = "cus";
String code = "C0001";
String url = "http://" + server + "/jsf/rfws/erp/search/code/"
+ tableName + "/"
+ code;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":1,
"values":[{"cDate":"2016-08-05 17:10:44","lastModifyUid":4,"code":"C0001","expiredDate":"1900-01-01 00:00:00","iRev":14,"i18nField":"{\"desc_en\": \"Test Customer\"}","regionId":1,"udfPJPtestDate":"1900-01-01 00:00:00","id":1,"statusModifyDate":"2016-08-05 17:10:44","lastModifyDate":"2016-08-17 16:44:44","createUid":7,"createDate":"2016-08-05 17:10:44","status":"Y","desc":"Test Customer"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},
... {"fieldClassName":"String","name":"udfPJPstring1","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"i18nField","fieldClass":"java.lang.String","classType":0}]
}
# 通过 ID 搜索表数据
通过 ID 搜索表中的数据。
HTTP 请求
GET http://[server]/jsf/rfws/erp/search/id/{tableName}/{id}
参数
名字 | 类型 | 说明 |
---|---|---|
tableName | string (Path) | 必填. 表名,可以在数据字典中找到。 |
id | int (Path) | 必填. 记录 ID |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
size | int | 返回的记录数 |
values | string | 返回数据 JSON 数组 |
fields | string | 返回字段详情 JSON 数组 |
请求示例:
OkHttpClient client = new OkHttpClient();
String tableName = "cus";
int id = 12;
String url = "http://" + server + "/jsf/rfws/erp/search/id/"
+ tableName + "/"
+ id;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":1,
"values":[{"cDate":"2016-10-04 15:34:59","lastModifyUid":12,"code":"WL-001CUS","expiredDate":"1900-01-01 00:00:00","iRev":17,"ad2":"5678","telCountry":"852","ad1":"1234","i18nField":"{\"ad1_en\": \"1234\", \"ad2_en\": \"5678\", \"desc_en\": \"Wilson Lau\", \"country_en\": \"\"}","regionId":2,"udfPJPtestDate":"1900-01-01 00:00:00","id":12,"statusModifyDate":"2016-10-04 15:34:59","lastModifyDate":"2017-04-20 15:21:33","createUid":12,"createDate":"2016-10-04 15:34:59","status":"Y","desc":"Wilson Lau"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},
... {"fieldClassName":"String","name":"udfPJPstring1","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"i18nField","fieldClass":"java.lang.String","classType":0}]
}
# 通过 SQL 条件搜索表数据
通过 SQL 的 WHERE 条件搜索表数据
HTTP 请求
GET http://[server]/jsf/rfws/erp/search/cond/{tableName}
参数
名字 | 类型 | 说明 |
---|---|---|
tableName | string (Path) | 必填. 表名,可以在数据字典中找到。 |
cond | string (Header) | SQL 的 WHERE 条件。如果为空,将会选择所有数据。 |
rowLimit | int (Header) | 返回结果的行数限制 |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
size | int | 返回的记录数 |
values | string | 返回数据 JSON 数组 |
fields | string | 返回字段详情 JSON 数组 |
请求示例:
OkHttpClient client = new OkHttpClient();
String tableName = "cus";
String cond = "iRev=14";
String url = "http://" + server + "/jsf/rfws/erp/search/cond/"
+ tableName;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("cond", cond)
.addHeader("rowLimit", "5").build();
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":3,
"values":[{"cDate":"2016-08-05 17:10:44","lastModifyUid":4,"code":"C0001","expiredDate":"1900-01-01 00:00:00","iRev":14,"i18nField":"{\"desc_en\": \"Test Customer\"}","regionId":1,"udfPJPtestDate":"1900-01-01 00:00:00","id":1,"statusModifyDate":"2016-08-05 17:10:44","lastModifyDate":"2016-08-17 16:44:44","createUid":7,"createDate":"2016-08-05 17:10:44","status":"Y","desc":"Test Customer"},{"cDate":"2016-08-05 17:30:55","lastModifyUid":20,"code":"P001-1","expiredDate":"1900-01-01 00:00:00","iRev":14,"i18nField":"{\"desc_en\": \"Doduo 1\"}","groupCoId":2,"regionId":1,"udfPJPtestDate":"1900-01-01 00:00:00","id":3,"statusModifyDate":"2016-08-05 17:30:55","lastModifyDate":"2017-07-12 18:03:37","createUid":4,"createDate":"2016-08-05 17:30:55","status":"Y","desc":"Doduo 1"},{"cDate":"2016-10-13 00:00:00","lastModifyUid":17,"code":"cus-021","expiredDate":"1900-01-01 00:00:00","iRev":14,"ad2":"地址第二行","ad1":"地址第一行","ad4":"地址第四行","webSite":"wwww.multiable.com","ad3":"地址第三行","i18nField":"{\"ad1_en\": \"地址第一行\", \"ad2_en\": \"地址第二行\", \"ad3_en\": \"地址第三行\", \"ad4_en\": \"地址第四行\", \"desc_en\": \"Phone Test Customer\", \"ad1_zh-CN\": \"地址第一行\", \"ad2_zh-CN\": \"地址第二行\", \"ad3_zh-CN\": \"地址第三行\", \"ad4_zh-CN\": \"地址第四行\", \"country_en\": \"\", \"desc_zh-CN\": \"手机测试客户\"}","regionId":10,"udfPJPtestDate":"1900-01-01 00:00:00","id":34,"statusModifyDate":"2016-10-13 10:37:23","lastModifyDate":"2017-09-13 11:17:58","createUid":12,"email":"multiable@mac.sz","createDate":"2016-10-13 11:31:29","status":"Y","desc":"Phone Test Customer"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},
...]
}
# 上传产品图片
为现有产品更新单张产品照片。
HTTP 请求
POST http://[server]/jsf/rfws/erp/pro/proPhoto/{id}
参数
名字 | 类型 | 说明 |
---|---|---|
id | int (Path) | 必填. 产品 ID |
img | file (Entity) | 必填. 照片文件。请参考请求示例。 |
photoInfo | string (Query) | 必填. 照片信息 JSON 字符串 |
photoInfo (JSON 对象)
名字 | 类型 | 说明 |
---|---|---|
photoCode | string | 照片编号。如果为空,则表示添加新照片,否则表示更新照片。 |
photoDesc | string | 照片说明 |
int | 打印。1 表示true。0 表示false。默认为 0 。 | |
expired | int | 失效。1 表示true。0 表示false。默认为 0 。 |
结果
名字 | 类型 | 说明 |
---|---|---|
message | string | 成功 |
请求示例:
OkHttpClient client = new OkHttpClient();
String path = "C:\\Users\\Public\\Pictures\\Sample Pictures\\Sample.jpg";
File file = new File(path);
int id = 3920; // product id
JsonObject photoInfo = new JsonObject();
photoInfo.addProperty("photoCode", "003");
photoInfo.addProperty("photoDesc", "003 photo");
photoInfo.addProperty("print", 0);
photoInfo.addProperty("expired", 0);
String url = "http://" + server + "/jsf/rfws/erp/pro/proPhoto/"
+ id + "?photoInfo="
+ URLEncoder.encode(photoInfo.toString(), "UTF-8");
RequestBody requestBody = new MultipartBody
.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("img", null,
RequestBody.create(MediaType.parse("application/jpg"), file))
.build();
Request request = new Request.Builder()
.post(requestBody)
.url(url)
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{"message":"success"}
# 关闭/取消关闭交易
交易 关闭
状态管理。
HTTP 请求
GET http://[server]/jsf/rfws/erp/closedSetting/updateData
参数
名字 | 类型 | 说明 |
---|---|---|
module | String (Query) | 必填. 模块类型。可以在数据字典中找到。 |
beCode | int (Query) | 必填. 企业法人编号 |
isClosing | boolean (Query) | 必填. 如果交易需要关闭,则为 true 。 |
tranInfo | json (Query) | 必填. 交易信息 JSON 字符串 |
tranInfo (JSON 数组) (贸易 App)
名字 | 类型 | 说明 |
---|---|---|
tranCode | String | 必填. 交易编号 |
proCode | String | 必填. 产品编号 |
lot | string | 必填. 行次 |
tranInfo (JSON 数组) (财务 App)
名字 | 类型 | 说明 |
---|---|---|
tranCode | String | 必填. 交易编号 |
结果
名字 | 类型 | 说明 |
---|---|---|
message | String | 成功 |
请求示例:
OkHttpClient client = new OkHttpClient();
JSONArray array = new JSONArray();
JSONObject obj = new JSONObject();
obj.put("tranCode", "SO0170356");
obj.put("proCode", "NOTE1");
obj.put("lot", "A");
array.put(obj);
obj = new JSONObject();
obj.put("tranCode", "SO0170356");
obj.put("proCode", "NOTE1");
obj.put("lot", "B");
array.put(obj);
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/closedSetting/updateData");
url = url.newBuilder()
.addQueryParameter("module", "oldso")
.addQueryParameter("beCode", "SM")
.addQueryParameter("isclosing", "true")
.addQueryParameter("tranInfo", URLEncoder.encode(array.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{"message":"success"}
# 更新模块头 UDF 字段
模块头 UDF 字段管理。
HTTP 请求
POST http://[server]/jsf/rfws/erp/dataSync/updateHeaderUdfFields/[menuCode]
参数
名字 | 类型 | 说明 |
---|---|---|
menuCode | String (Path) | 必填. navmenu.xml 中的菜单编号 |
tranInfo | json (Entity) | 必填. 交易信息 JSON 字符串 |
tranInfo (JSON 对象)
名字 | 类型 | 说明 |
---|---|---|
updateTableName | String | 必填. 需要更新的表名 |
code | String | 必填. 交易编号 |
beId | long | 必填. BE (或者你可以输入 'beCode') |
udfxxxx | Object | 更新的字段名 (如果是查询字段,你也可以输入 'xxxxCode') |
结果
名字 | 类型 | 说明 |
---|---|---|
status | Boolean | 显示更新成功或失败 |
message | String | 显示更新信息 |
请求示例:
OkHttpClient client = new OkHttpClient();
JSONObject obj = new JSONObject();
obj.put("updateTableName", "mainup");
obj.put("code", "UPL180011");
obj.put("beId", "142");// or obj.put("beCode", "MX3");
obj.put("udfmxstr", "aaaa");
obj.put("udfmxnum", "1");
obj.put("udfmxdate", "2021-07-21 00:00:00");
obj.put("udfmxlookup", "17"); // or obj.put("udfmxlookupCode", "040");
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj.toString());
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/dataSync/updateHeaderUdfFields/uplist");
url = url.newBuilder()
.addQueryParameter("tranInfo", URLEncoder.encode(array.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.post(requestBody)
.build();
Response response = client.newCall(request).execute();
响应示例:
{"message":"success"}
#
# 贸易 Web Services
# 获取交易备注数据
获取交易备注数据。
HTTP 请求
GET http://[server]/jsf/rfws/erp/trdg/common/getRemTable/{mainTable}/{remTable}
参数
名字 | 类型 | 说明 |
---|---|---|
mainTable | string (Path) | 必填. 主表名字 |
remTable | string (Path) | 必填. 备注表名 |
tranIds | string (Header) | 必填. 事务 ID 列表。, 分隔。 |
结果 (JSON 数组:"values")
名字 | 类型 | 说明 |
---|---|---|
serialNo | string | 交易编号 |
remarks | string | 备注 |
ce01Module | string | 模块类型 |
i18nField | string | 包含不同语言备注的 JSON 数组 |
请求示例:
OkHttpClient client = new OkHttpClient();
String mainTable = "maink";
String remTable = "remk";
String url = "http://" + server + "/jsf/rfws/erp/trdg/common/getRemTable/"
+ mainTable + "/"
+ remTable;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("tranIds", "71")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":1,
"values":[{"hId":71,"i18nField":"{\"remarks_en\": \"\"}","iRev":1,"id":71,"serialNo":"K00160089","ce01Module":"st"}],
"name":"",
"fields":[{"fieldClassName":"String","name":"serialNo","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"hId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"remarks","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"ce01Module","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Integer","name":"iRev","fieldClass":"java.lang.Integer","classType":10},{"fieldClassName":"String","name":"i18nField","fieldClass":"java.lang.String","classType":0}]
}
# 获取产品包装信息
通过产品ID,单位ID和包装单位ID获取产品包装信息。
HTTP 请求
GET http://[server]/jsf/rfws/erp/trdg/price/propack/
参数
名字 | 类型 | 说明 |
---|---|---|
proInfo | string (Header) | 必填. 产品信息。格式请参考请求示例 |
结果 (JSON 数组:"values")
名字 | 类型 | 说明 |
---|---|---|
hId | int | 产品 / 物料 ID |
innerQty | decimal | 内包装数量 |
perCtn | decimal | 数量 / 包装单位 |
packingUnitCode | string | 包装单位编号 |
heightCm | decimal | 高度 (厘米) |
bmctn | decimal | CBM / CTN |
innerUnitCode | string | 内包装单位编号 |
packingUnitId | int | 包装单位 ID |
nwkg | decimal | N.W. / CTN (kg) |
proId | int | 产品 ID |
outQty | decimal | 数量 / 包装单位 |
innerUnitId | int | 内包装单位 ID |
widthCm | decimal | 宽度 (厘米) |
unitId | int | 基本单位 ID |
lengthCm | decimal | 长度 (厘米) |
gwkg | decimal | G.W. / CTN (kg) |
outUnitId | int | 单位 ID |
请求示例:
OkHttpClient client = new OkHttpClient();
String url = "http://" + server + "/jsf/rfws/erp/trdg/price/propack"
String proInfo = "(proId, unitId, packingUnitId) values (3,2,4)";
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("authorization", "Bearer " + access_token)
.addHeader("cache-control", "no-cache")
.addHeader("proInfo", proInfo)
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":2,
"values":[{"hId":3,"innerQty":3.0,"perCtn":5.0,"packingUnitCode":"BOX","heightCm":12.0,"bmctn":0.001,"iRev":22,"itemNo":" 1","innerUnitCode":"个","packingUnitId":4,"nwkg":4.0,"proId":3,"outQty":5.0,"innerUnitId":1,"widthCm":11.0,"unitId":2,"id":1,"lengthCm":10.0,"gwkg":5.0,"outUnitId":1},{"hId":3,"innerQty":6.0,"perCtn":10.0,"packingUnitCode":"BOX","heightCm":24.0,"bmctn":0.011,"iRev":22,"itemNo":" 2","innerUnitCode":"个","packingUnitId":4,"nwkg":8.0,"proId":3,"outQty":10.0,"innerUnitId":1,"widthCm":22.0,"unitId":2,"id":2,"lengthCm":20.0,"gwkg":10.0,"outUnitId":1}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Double","name":"lengthIn","fieldClass":"java.lang.Double","classType":10},
... {"fieldClassName":"String","name":"innerUnitCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Double","name":"perCtn","fieldClass":"java.lang.Double","classType":10}]
}
# 获取每个产品的库存量
获取企业法人不同地点的产品库存量,结果可按批号和地点分组。
HTTP 请求
GET http://[server]/jsf/rfws/erp/trdg/stock/viewLocLvl/{beId}/{proId}
参数
名字 | 类型 | 说明 |
---|---|---|
beId | int (Path) | 必填. 企业法人 ID |
proId | int (Path) | 必填. 产品 ID (0 代表全部) |
unitId | int (Query) | 单位 ID (在产品单位表中)。如果提供,结果将以该单位返回数量。默认情况下,结果将以基本单位返回。 |
tranId | int (Query) | 跳过交易 ID。如果提供,计算结果时将不包括该交易。 |
tranType | string (Query) | tranId 的交易类型 |
locTypeId | int (Query) | 地点类别ID。如果提供,结果将根据该地点类别进行筛选。 |
asAt | date (Query) | 截至日期。计算库存量的日期。 |
showLoc | boolean (Query) | 如果为 true ,结果将以地点分组。 |
showLotno | boolean (Query) | 如果为 true ,结果将以批号分组。 |
includeNonApv | boolean (Query) | 如果为 true ,结果将包括未批核的记录。 |
excludeExpiredLoc | boolean (Query) | 如果为 true ,结果将排除失效地点。 |
locId | int (Query) | 地点 ID。如果提供,结果将根据该地点进行筛选。 |
includeUc | boolean (Query) | 如果为 true ,结果将包括 AVG uc (本位币) |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
proId | int | 产品 ID |
locId | int | 地点 ID |
locCode | string | 地点编号 |
locType | int | 地点类别 ID |
lotNoId | int | 批号 ID |
lotno | string | 批号编号 |
lotnoLot | string | 批号行次 |
qty | decimal | 数量 |
unitId | int | 单位 ID (在产品单位表中) |
unitCode | string | 单位编号 |
basicQty | decimal | 数量 (基本单位) |
basicUnitId | int | 基本单位 ID |
basicCode | string | 基本单位编号 |
uc | decimal | 单位成本 (本位币) |
请求示例:
OkHttpClient client = new OkHttpClient();
String beId = "14";
String proId = "3081";
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/stock/viewLocLvl/"
+ beId + "/"
+ proId);
url = url.newBuilder()
.addQueryParameter("showLoc", "true")
.addQueryParameter("showLotno", "true")
.addQueryParameter("includeNonApv", "true")
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应的结构如下:
[
{"basicUnitId":52,"basicQty":7000.0,"basicCode":"RTUNIT","locCode":"L0001-A","lotno":"RT01_OPENINGS-002","proId":3081,"qty":7000.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":31,"locId":40.0,"lotNoId":1681.0},
{"basicUnitId":52,"basicQty":1640.0,"basicCode":"RTUNIT","locCode":"RT01_LOC","lotno":"RT01_OPENINGS-002","proId":3081,"qty":1640.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":33,"locId":42.0,"lotNoId":1681.0},
{"basicUnitId":52,"basicQty":98948.0,"basicCode":"RTUNIT","locCode":"RT01_LOC","lotno":"RT01_OPENINGS-003","proId":3081,"qty":98948.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":33,"locId":42.0,"lotNoId":1696.0},
{"basicUnitId":52,"basicQty":10020.0,"basicCode":"RTUNIT","locCode":"RT01_LOC_B","lotno":"RT01_OPENINGS-001","proId":3081,"qty":10020.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":33,"locId":43.0,"lotNoId":1680.0},
{"basicUnitId":52,"basicQty":150.0,"basicCode":"RTUNIT","locCode":"RT01_LOC_B","lotno":"RT01_OPENINGS-002","proId":3081,"qty":150.0,"unitCode":"RTUNIT","unitId":3791,"lotnoLot":"A","locType":33,"locId":43.0,"lotNoId":1681.0}
]
# 获取多种产品的可用量
获取多个企业法人中多个产品的不同可用量类型的数量。
HTTP 请求
GET http://[server]/jsf/rfws/erp/trdg/stock/jviewLvl/{asAt}
参数
名字 | 类型 | 说明 |
---|---|---|
asAt | date (Path) | 必填. 截止日期 |
beList | string (Query) | 必填. 企业法人 ID 列表。, 分隔。 |
proList | string (Query) | 必填. 产品 ID 列表。, 分隔。 |
seriesList | string (Query) | 系列 ID 列表。如果提供,结果将根据这些系列进行筛选。 |
apv | int (Query) | 1 表示加载所有数据,2 表示只加载已批核的数据,3 表示只加载未批核的数据。默认值:1 。 |
结果集 1 JSON
名字 | 类型 | 说明 |
---|---|---|
beId | int | 企业法人 ID |
proId | int | 产品 ID |
locTypeId | int | 地点类别 ID |
locId | int | 地点 ID |
qty | decimal | 可用量 |
locCode | string | 地点编号 |
locTypeCode | string | 地点类别编号 |
结果集 2 JSON
名字 | 类型 | 说明 |
---|---|---|
beId | int | 企业法人 ID |
proId | int | 产品 ID |
qtyTypeId | int | 可用量类型 ID |
qty | decimal | 可用量 |
结果集 3 JSON
名字 | 类型 | 说明 |
---|---|---|
proId | int | 产品 ID |
proCode | string | 产品编号 |
proBDesc | string | 摘要 |
proDDesc | string | 详细说明 |
seriesId | int | 系列 ID |
seriesCode | string | 系列编号 |
seriesDesc | string | 系列说明 |
unitId | int | 单位 ID (在产品单位表中) |
unitCode | string | 单位编号 |
maxAvail | decimal | 最大可用量 |
rol | decimal | 安全库存量 |
结果集 4 JSON
名字 | 类型 | 说明 |
---|---|---|
id | int | Key ID |
code | string | 编号 |
desc | string | 说明 |
qtyDeci | int | 数量 (销售/采购) |
结果集 5 JSON
名字 | 类型 | 说明 |
---|---|---|
beId | int | 企业法人 ID |
proId | int | 产品 ID |
availTypeId | int | 可用量类型 ID |
请求示例:
OkHttpClient client = new OkHttpClient();
String uId = "4";
String asAt = "2016-01-01";
String beList = "28,33";
String proList = "1,2";
String seriesList = "";
String link = "http://" + server + "/jsf/rfws/erp/trdg/stock/jviewLvl/" + asAt;
HttpUrl url = HttpUrl.parse(link).newBuilder()
.addQueryParameter("beList", beList)
.addQueryParameter("proList", proList)
.addQueryParameter("seriesList", seriesList)
.build();
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":0,
"values":[],
"name":"",
"fields":[{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"proId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"locTypeId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"locId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Double","name":"qty","fieldClass":"java.lang.Double","classType":10},{"fieldClassName":"String","name":"locCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"locTypeCode","fieldClass":"java.lang.String","classType":0}]
},{
"size":0,
"values":[],
"name":"",
"fields":[{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"proId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"qtyTypeId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Double","name":"qty","fieldClass":"java.lang.Double","classType":10}]
},{
"size":2,
"values":[{"proBDesc":"SM-BOM-PROA","proCode":"SM-BOM-PROA","seriesCode":"SM-SERIES","proId":1,"unitCode":"个","seriesDesc":"电脑","unitId":1,"seriesId":1},{"proBDesc":"SM-BOM-PROB","proCode":"SM-BOM-PROB","seriesCode":"SM-SERIES","proId":2,"unitCode":"个","seriesDesc":"电脑","unitId":2,"seriesId":1}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"proId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"proCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"proBDesc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"proDDesc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Long","name":"seriesId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"seriesCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"seriesDesc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Long","name":"unitId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"unitCode","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Double","name":"maxAvail","fieldClass":"java.lang.Double","classType":10},{"fieldClassName":"Double","name":"rol","fieldClass":"java.lang.Double","classType":10}]
},{
"size":1,
"values":[{"code":"CSIL","qtyDeci":4,"id":28,"desc":"CSIL TESTING (9.49)"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"code","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"String","name":"desc","fieldClass":"java.lang.String","classType":0},{"fieldClassName":"Integer","name":"qtyDeci","fieldClass":"java.lang.Integer","classType":10}]
},{
"size":0,
"values":[],
"name":"",
"fields":[{"fieldClassName":"Long","name":"beId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"proId","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"Long","name":"availTypeId","fieldClass":"java.lang.Long","classType":10}]
}
# 通过产品编号获取客户/供应商零件编号
通过客户/供应商编号和产品编号获取客户/供应商零件编号。
HTTP 请求
GET http://[server]/jsf/rfws/erp/trdg/refCode/getRefCode
参数
名字 | 类型 | 说明 |
---|---|---|
module | String (Query) | 必填. 模块类型。可以在数据字典中找到。 |
beCode | String (Query) | 必填. 企业法人编号 |
cliCode | String (Query) | 必填. 客户/供应商编号 |
proInfo | json (Query) | 必填. 产品信息 JSON 字符串 |
proInfo (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
proCode | String | 必填. 产品编号 |
unitCode | String | 必填. 单位编号 |
qty | double | 数量 |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
proId | int | 产品 ID |
proCode | String | 产品编号 |
refcode | String | 客户/供应商零件编号 |
请求示例:
OkHttpClient client = new OkHttpClient();
JSONArray array = new JSONArray();
JSONObject obj = new JSONObject();
obj.put("proCode", "NOTE1");
obj.put("unitCode", "盒");
obj.put("qty", 1);
array.put(obj);
obj = new JSONObject();
obj.put("proCode", "NOTEBOOK_01");
obj.put("unitCode", "个");
obj.put("qty", 1);
array.put(obj);
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/refCode/getRefCode");
url = url.newBuilder()
.addQueryParameter("module", "oldso")
.addQueryParameter("beCode", "SM")
.addQueryParameter("cliCode", "SM-CUS")
.addQueryParameter("proInfo", URLEncoder.encode(array.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
[{"proCode":"NOTEBOOK_01","proId":3881,"refCode":"NOTE_01_CUS"},{"proCode":"NOTE1","proId":3919,"refCode":"cusref01"}]
# 通过客户/供应商零件编号获取产品编号。
通过客户/供应商编号和客户/供应商零件编号获取产品代码。
HTTP 请求
GET http://[server]/jsf/rfws/erp/trdg/refCode/getProCode
参数
名字 | 类型 | 说明 |
---|---|---|
module | String (Query) | 必填. 模块类型。可以在数据字典中找到。 |
beCode | String (Query) | 必填. 企业法人编号 |
cliCode | String (Query) | 必填. 客户/供应商编号 |
refCode | String (Query) | 必填. 客户/供应商零件编号 |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
proId | int | 产品 ID |
proCode | String | 产品编号 |
proDesc | String | 产品说明 |
请求示例:
OkHttpClient client = new OkHttpClient();
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/refCode/getProCode");
url = url.newBuilder()
.addQueryParameter("module", "oldso")
.addQueryParameter("beCode", "SM")
.addQueryParameter("cliCode", "SM-CUS")
.addQueryParameter("refCode", "cus");
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
[{"proDesc":"笔记本电脑01(Simon)SC","proCode":"NOTEBOOK_01","proId":3881},{"proDesc":"NOTE1","proCode":"NOTE1","proId":3919}]
# 获取产品价格
获取产品单价/描述.
HTTP 请求
GET http://[server]/jsf/rfws/erp/trdg/price/multiPro
参数
名字 | 类型 | 说明 |
---|---|---|
module | String (Query) | 必填. 模块类型。可以在数据字典中找到。 |
beCode | String (Query) | 必填. 企业法人编号 |
cliCode | String (Query) | 必填. 客户/供应商编号 |
virDeptCode | String (Query) | 必填. 商业中心编号 |
date | String (Query) | 日期(默认:当前日期)。 |
upOrigin | String (Query) | 单价来源。定义获取单价的来源。下面列出了可能的值。 |
descOrigin | String (Query) | 描述来源。定义获取描述的来源。下面列出了可能的值。 |
proInfo | JSON (Query) | 必填. 交易信息 JSON 字符串 |
upOrigin (在origin.xml中定义)
名字 | 说明 |
---|---|
PRO | 产品 / 物料文件 |
UPLIST | 价目表 |
OLDQU | 销售报价单 |
SOLAST | 上一次交易 (销售) |
VQU | 采购报价单 |
GRN | 进货单 |
PI | 采购发票 |
POLAST | 上一次交易 (采购) |
descOrigin (在origin.xml中定义)
名字 | 说明 |
---|---|
PRO | 产品 / 物料文件 |
UPLIST | 价目表 |
OLDQU | 销售报价单 |
SOLAST | 上一次交易 (销售) |
VENREF | 供应商产品编号 |
CUSREF | 客户产品编号 |
VQU | 采购报价单 |
GRN | 进货单 |
PI | 采购发票 |
POLAST | 上一次交易 (采购) |
proInfo (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
proCode | String | 必填. 产品编号 |
unitCode | String | 必填. 单位编号 |
qty | double | 数量 |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
proId | int | 产品 ID |
proCode | String | 产品编号 |
unitId | int | 单位 ID |
unitCode | String | 单位编号 |
qty | double | 数量 |
upCurId | int | 单价货币 ID |
upRate | double | 单价汇率 |
up | double | 单价 |
ucCurId | int | 单位成本货币 ID |
ucRate | double | 成本汇率 |
uc | double | 单位成本 |
disc | double | 折扣(%) |
measUnit | String | 体积单位 |
weightUnit | String | 重量单位 |
lengthCm | double | 长度 (体积单位 = CBM) |
widthCm | double | 宽度 (体积单位 = CBM) |
heightCm | double | 高度 (体积单位 = CBM) |
bmctn | double | 体积 (体积单位 = CBM) |
lengthIn | double | 长度 (体积单位 = CUFT) |
widthIn | double | 宽度 (体积单位 = CUFT) |
heightIn | double | 高度 (体积单位 = CUFT) |
cuftctn | double | 体积 (体积单位 = CUFT) |
gwkg | double | G.W. (重量单位 = KG) |
nwkg | double | N.W. (重量单位 = KG) |
gwlb | double | G.W. (重量单位 = LB) |
nwlb | double | N.W. (重量单位 = LB) |
packingUnitId | int | 包装单位 ID |
packingUnitCode | String | 包装单位编号 |
innerQty | int | 内包装数量 |
innerUnitId | int | 内包装单位 ID |
perCtn | int | 数量 / 包装单位 |
packingDesc | String | 包装说明 |
shipMark | String | 箱唛 |
bDesc | String | 摘要 |
dDesc | String | 详细描述 |
upOrigin | String | 价格来源 |
descOrigin | String | 描述来源 |
请求示例:
OkHttpClient client = new OkHttpClient();
JSONArray array = new JSONArray();
JSONObject obj = new JSONObject();
obj.put("proCode", "NOTE1");
obj.put("unitCode", "盒");
obj.put("qty", 1);
array.put(obj);
obj = new JSONObject();
obj.put("proCode", "NOTEBOOK_01");
obj.put("unitCode", "个");
obj.put("qty", 1);
array.put(obj);
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/price/multiPro");
url = url.newBuilder()
.addQueryParameter("module", "oldso")
.addQueryParameter("beCode", "SM")
.addQueryParameter("cliCode", "SM-CUS")
.addQueryParameter("virDeptCode", "SM_VIRDEPT")
.addQueryParameter("upOrigin", "PRO")
.addQueryParameter("descOrigin", "PRO")
.addQueryParameter("proInfo", URLEncoder.encode(array.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
[{"lengthIn":40,"ucCurId":1,"innerQty":4,"proCode":"个","upOrigin":"PRO","nwlb":450,"ucRate":1,"uc":10,"packingUnitId":4,"nwkg":10,"gwlb":500,"bDesc":"笔记本电脑01(Simon)E","unitId":38726,"innerUnitId":17,"up":12,"lengthCm":70,"upCurId":1,"cuftctn":13.889,"widthIn":30,"perCtn":5,"upRate":1,"packingUnitCode":"BOX","heightCm":50,"bmctn":0.21,"descOrigin":"","heightIn":20,"dDesc":"haha","proId":3881,"widthCm":60,"gwkg":12,"packingDesc":"haha"},{"lengthIn":39.37,"ucCurId":1,"innerQty":0,"proCode":"盒","upOrigin":"PRO","nwlb":44,"ucRate":1,"uc":120,"packingUnitId":14,"nwkg":20,"gwlb":22,"bDesc":"NOTE1","unitId":38914,"innerUnitId":0,"up":160,"lengthCm":100,"upCurId":1,"cuftctn":211.887,"widthIn":78.74,"perCtn":2,"upRate":1,"packingUnitCode":"0.3兩","heightCm":300,"bmctn":6,"descOrigin":"","heightIn":118.11,"dDesc":"<p style=\"margin: 0px;\"><img src=\"/jsf/imageServlet?thumbnail=true&code=68O31317220596O15\" style=\"width: 255px;\"><br><\/p>","proId":3919,"widthCm":200,"gwkg":10,"packingDesc":""}]
# 获取未完成产品数量
获取未完成产品数量。
HTTP 请求
GET http://[server]/jsf/rfws/erp/trdg/common/getOSTranPro
参数
名字 | 类型 | 说明 |
---|---|---|
beId | Long (Header) | 必填. 企业法人 |
tDate | String (Header) | 必填. 日期(默认:当前日期)。 |
sourceType | String (Header) | 必填. |
tranType | String (Header) | 必填. |
param | JSON (Header) | 提取源主表字段。(cusId \ venId \ curId \ virDeptId) |
addFields | String (Header) | 附加返回字段(仅限源模块主表和下表字段) |
结果 (JSON 数组)
名字 | 类型 | 说明 |
---|---|---|
footerId | int | 源下表 ID |
orderId | int | 来源单据 ID |
proId | int | 产品 ID |
unitId | int | 单位 ID |
lot | string | 产品行次 |
orgQty | double | 产品数量 |
outQty | double | 产品未完成数量 |
请求示例:
OkHttpClient client = new OkHttpClient();
JSONObject param = new JSONObject();
param.put("venId", "1");
JSONArray addFields = new JSONArray();
addFields.add("pot.bDesc");
addFields.add("mainpo.venId");
HttpUrl url = HttpUrl.parse("http://" + server + "/jsf/rfws/erp/trdg/common/getOSTranPro");
url = url.newBuilder()
.addHeaderParameter("beId", "304")
.addHeaderParameter("tDate", "2023-12-01")
.addHeaderParameter("sourceType", "po")
.addHeaderParameter("tranType", "an")
.addHeaderParameter("param", URLEncoder.encode(param.toString(), "UTF-8"))
.addHeaderParameter("addFields", URLEncoder.encode(addFields.toString(), "UTF-8"));
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", MyValue.clientID)
.addHeader("Authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
响应示例:
{"size":1,"values":[{"footerId":1096,"orderId":640,"proId":4775,"lot":"A","outQty":1.0,"orgQty":1.0,"unitId":39867,"bDesc":"Product Brief Description(EN)","venId":1}]}
# 财务 Web Services
# 获取未付应付发票
获取特定企业法人的未付应付账款发票清单。
HTTP 请求
GET http://[server]/jsf/rfws/erp/ac/ap/getOsInvoice/{beId}/{uId}/{AIId}/{payRegId}/{multiPayId}/
参数
名字 | 类型 | 说明 |
---|---|---|
beId | int (Path) | 必填. 企业法人 ID |
uId | int (Path) | 必填. 用户 ID |
payRegId | int (Path) | 必填. 必须输入 0 。 |
multiPayId | int (Path) | 必填. 必须输入 0 。 |
AIId | int (Path) | 必填. 应付对象 ID。应付对象类型单据的 ID,如果应付对象类型 = ven ,则该字段代表供应商 FM 的 ID。 |
AIType | string (Header) | 必填. 应付对象类型。格式请参考请求示例,内置支持这些类型:ven , cus , staff , cnDept , virDept |
sDate | date (Header) | 必填. 交易日期 (由) |
eDate | date (Header) | 必填. 交易日期 (到) |
sDDate | date (Header) | 必填. 截止日期 (由) |
eDDate | date (Header) | 必填. 截止日期 (到) |
sStaff | string (Header) | 职员编号 (由) |
eStaff | string (Header) | 职员编号 (到) |
sTranType | string (Header) | 发票的交易类型。格式请参考请求示例,支持的类型: apIni、 apTran 和 pi。 |
loadDbNote | int (Header) | 默认值是 0 。如果为 1 ,结果将包括负的应付交易 |
loadGroupCo | boolean (Header) | 默认值是 false 。 如果为 true ,结果将考虑供应商的集团公司数据。 |
结果 (JSON 数组: "values")
名字 | 类型 | 说明 |
---|---|---|
id | int | 发票 ID |
code | string | 发票编号 |
tDate | date | 发票日期 |
sTranType | string | 发票的交易类型 |
sTranTypeMess | string | 发票的交易类型说明 |
AIType | string | 应付对象类别 |
AIId | int | 应付对象 ID |
curId | int | 货币 ID |
curCode | string | 货币编号 |
rate | decimal | 汇率 |
amt | decimal | 发票金额 |
bal | decimal | 已付金额 |
balAmt | decimal | 未付金额 |
cpDate | date | 截止日期 |
accDesc | string | 记账摘要 |
eDiscRate | decimal | 早付款折扣 |
eDiscAmt | decimal | 早付款折扣金额 |
virDeptId | int | 商业中心 ID |
virDeptCode | string | 商业中心编号 |
virDeptDesc | string | 商业中心描述 |
AI1 - AI30 | int | 分析编号 1 - 30 |
invDomAmt | decimal | 发票金额 (本位币) |
usedInvDomAmt | decimal | 已付金额 (本位币) |
balInvDomAmt | decimal | 未付金额 (本位币) |
请求示例:
OkHttpClient client = new OkHttpClient();
String beId = "19";
String uId = "9";
String AIId = "6"; // AIId: vendor id in this case
String payRegId = "0";
String multiPayId = "0";
String AIType = "(aiType)values(''ven'')"; // creditor type = "ven"
String sDate = "1990-01-01";
String eDate = "2017-11-04";
String sDDate = "1990-01-01";
String eDDate = "9999-12-31";
String sStaff = "";
String eStaff = "";
String loadGroupCo = "false";
String sTranType = "(sTranType) values ('apTran')";
String url = "http://" + server + "/jsf/rfws/erp/ac/ap/getOsInvoice/"
+ beId + "/"
+ uId + "/"
+ AIId + "/"
+ payRegId + "/"
+ multiPayId;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("AIType", AIType)
.addHeader("sDate", sDate)
.addHeader("eDate", eDate)
.addHeader("sDDate", sDDate)
.addHeader("eDDate", eDDate)
.addHeader("sStaff", sStaff)
.addHeader("eStaff", eStaff)
.addHeader("loadDbNote", loadDbNote)
.addHeader("sTranType", sTranType)
.addHeader("loadGroupCo", loadGroupCo)
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":6,
"values":[{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_001","virDeptId":3,"st_desc":"KC_ART_20170901_001","amt":100.0,"balInvDomAmt":110.0,"sTranId":396,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":396,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_002","virDeptId":3,"st_desc":"KC_ART_20170901_002","amt":100.0,"balInvDomAmt":110.0,"sTranId":397,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_002","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":397,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_003","virDeptId":3,"st_desc":"KC_ART_20170901_003","amt":100.0,"balInvDomAmt":110.0,"sTranId":398,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_003","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":398,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_004","virDeptId":3,"st_desc":"KC_ART_20170901_004","amt":100.0,"balInvDomAmt":110.0,"sTranId":399,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_004","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":399,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-15 00:00:00","cpDate":"2017-09-15 00:00:00","code":"KC_ART_20170915_001","virDeptId":3,"st_desc":"KC_ART_20170915_001","amt":110.0,"balInvDomAmt":119.9,"bal":1.0,"usedInvDomAmt":1.1,"sTranId":400,"ce01Module":"arTran","sTranCode":"KC_ART_20170915_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":109.0,"id":400,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":121.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-10-25 00:00:00","cpDate":"2017-10-25 00:00:00","code":"KC_ART_20171025_001","virDeptId":3,"st_desc":"KC_ART_20171025_001","amt":12.0,"balInvDomAmt":13.2,"sTranId":405,"ce01Module":"arTran","sTranCode":"KC_ART_20171025_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":12.0,"id":405,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":13.2,"virDeptDesc":"Sales Team 1"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"code","fieldClass":"java.lang.String","classType":0},
...{"fieldClassName":"String","name":"virDeptDesc","fieldClass":"java.lang.String","classType":0}]
}
# 获取未收应收发票
获取特定企业法人的未收应收账款发票清单。
HTTP 请求
GET http://[server]/jsf/rfws/erp/ac/ar/getOsInvoice/{beId}/{uId}/{AIId}/{recregId}/{multiRecId}
参数
名字 | 类型 | 说明 |
---|---|---|
beId | int (Path) | 必填. 企业法人 ID |
uId | int (Path) | 必填. 用户 ID |
payRegId | int (Path) | 必填. 必须输入 0 。 |
multiPayId | int (Path) | 必填. 必须输入 0 。 |
AIId | int (Path) | 必填. 应收对象 ID。应收对象类型单据的 ID,如果应收对象类型 = cus ,则该字段代表客户 FM 的ID。 |
AIType | string (Header) | 必填. 应收对象类型。格式请参考请求示例,内置支持这些类型: cus , ven , staff , cnDept , virDept 。 |
sDate | date (Header) | 必填. 交易日期 (由) |
eDate | date (Header) | 必填. 交易日期 (到) |
sDDate | date (Header) | 必填. 截止日期 (由) |
eDDate | date (Header) | 必填. 截止日期 (到) |
sStaff | string (Header) | 职员编号 (由) |
eStaff | string (Header) | 职员编号 (到) |
sTranType | string (Header) | 发票的交易类型。格式请参考请求示例,支持的类型:arIni 、arTran 和 siso 。 |
loadCrNote | int (Header) | 默认值是 0 。如果为1 ,结果将包括负的应收交易。 |
loadGroupCo | boolean (Header) | 默认值是 false 。如果为 true ,结果将考虑客户的集团公司数据。 |
结果 (JSON 数组: "values")
名字 | 类型 | 说明 |
---|---|---|
id | int | 发票 ID |
code | string | 发票编号 |
tDate | date | 发票日期 |
sTranType | string | 发票的交易类型 |
sTranTypeMess | string | 发票的交易类型说明 |
AIType | string | 应收对象类型 |
AIId | int | 应收对象ID |
curId | int | 货币 ID |
curCode | string | 货币编号 |
rate | decimal | 汇率 |
amt | decimal | 发票金额 |
bal | decimal | 已收金额 |
balAmt | decimal | 未收金额 |
cpDate | date | 截止日期 |
accDesc | string | 记账摘要 |
eDiscRate | decimal | 早付款折扣 |
eDiscAmt | decimal | 早付款折扣金额 |
virDeptId | int | 商业中心 ID |
virDeptCode | string | 商业中心编号 |
virDeptDesc | string | 商业中心描述 |
AI1 - AI30 | int | 分析编号 1 - 30 |
invDomAmt | decimal | 发票金额 (本位币) |
usedInvDomAmt | decimal | 已收金额 (本位币) |
balInvDomAmt | decimal | 未收金额 (本位币) |
请求示例:
OkHttpClient client = new OkHttpClient();
String beId = "19";
String uId = "9";
String AIId = "6"; // debtor id = customer id in this sample
String recregId = "0";
String multiRecId = "0";
String AIType = "(aiType) values (''cus'')"; // debtor type = "cus"
String sDate = "1900-01-01";
String eDate = "2017-11-04";
String sDDate = "1900-01-01";
String eDDate = "9999-12-31";
String sStaff = "";
String eStaff = "";
String loadCrNote = "1";
String sTranType = "(sTranType) values ('arTran')";
String loadGroupCo = "false";
String url = "http://" + server + "/jsf/rfws/erp/ac/ar/getOsInvoice/"
+ beId + "/"
+ uId + "/"
+ AIId + "/"
+ recregId + "/"
+ multiPayId;
Request request = new Request.Builder()
.url(url)
.get()
.addHeader("client_id", clientID)
.addHeader("authorization", "Bearer " + token)
.addHeader("cache-control", "no-cache")
.addHeader("AIType", AIType)
.addHeader("sDate", sDate)
.addHeader("eDate", eDate)
.addHeader("sDDate", sDDate)
.addHeader("eDDate", eDDate)
.addHeader("sStaff", sStaff)
.addHeader("eStaff", eStaff)
.addHeader("loadCrNote", loadCrNote)
.addHeader("sTranType", sTranType)
.addHeader("loadGroupCo", loadGroupCo)
.build();
Response response = client.newCall(request).execute();
响应示例:
{
"size":6,
"values":[{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_001","virDeptId":3,"st_desc":"KC_ART_20170901_001","amt":100.0,"balInvDomAmt":110.0,"sTranId":396,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":396,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_002","virDeptId":3,"st_desc":"KC_ART_20170901_002","amt":100.0,"balInvDomAmt":110.0,"sTranId":397,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_002","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":397,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_003","virDeptId":3,"st_desc":"KC_ART_20170901_003","amt":100.0,"balInvDomAmt":110.0,"sTranId":398,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_003","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":398,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-01 00:00:00","cpDate":"2017-09-01 00:00:00","code":"KC_ART_20170901_004","virDeptId":3,"st_desc":"KC_ART_20170901_004","amt":100.0,"balInvDomAmt":110.0,"sTranId":399,"ce01Module":"arTran","sTranCode":"KC_ART_20170901_004","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":100.0,"id":399,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":110.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-09-15 00:00:00","cpDate":"2017-09-15 00:00:00","code":"KC_ART_20170915_001","virDeptId":3,"st_desc":"KC_ART_20170915_001","amt":110.0,"balInvDomAmt":119.9,"bal":1.0,"usedInvDomAmt":1.1,"sTranId":400,"ce01Module":"arTran","sTranCode":"KC_ART_20170915_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":109.0,"id":400,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":121.0,"virDeptDesc":"Sales Team 1"},{"tDate":"2017-10-25 00:00:00","cpDate":"2017-10-25 00:00:00","code":"KC_ART_20171025_001","virDeptId":3,"st_desc":"KC_ART_20171025_001","amt":12.0,"balInvDomAmt":13.2,"sTranId":405,"ce01Module":"arTran","sTranCode":"KC_ART_20171025_001","sTranTypeMess":"arTran","curId":1,"AIType":"cus","rate":1.1,"balAmt":12.0,"id":405,"sTranType":"arTran","curCode":"R","virDeptCode":"SALES01","AIId":6,"invDomAmt":13.2,"virDeptDesc":"Sales Team 1"}],
"name":"",
"fields":[{"fieldClassName":"Long","name":"id","fieldClass":"java.lang.Long","classType":10},{"fieldClassName":"String","name":"code","fieldClass":"java.lang.String","classType":0},
...{"fieldClassName":"String","name":"virDeptDesc","fieldClass":"java.lang.String","classType":0}]
}
# 作废交易
根据给定的模块名称和交易 ID 作废交易。
HTTP 请求
GET http://[server]/jsf/rfws/erp/ac/voidunvoid/voidTran/
参数
所有参数都封装在一个 JSON 对象中。请阅读请求示例了解详情。
名字 | 类型 | 说明 |
---|---|---|
beId | int | 必填. 企业法人 ID |
moduleName | int | 必填. 交易的模块名字 |
tranId | int | 必填. 交易ID |
voidDate | int | 作废日期。 默认值:交易日期 |
结果
名字 | 类型 | 说明 |
---|---|---|
success | boolean | 说明该过程是否成功。 |
message | String | 结果信息 |
voucherId | int | 红冲记账凭证ID(如果存在)。 |
请求示例:
JsonObject data = new JsonObject();
data.addProperty("beId", 19);
data.addProperty("moduleName", "arTran");
data.addProperty("tranId", 431);
data.addProperty("voidDate", "2017-12-14");
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), data.toString());
Request request = new Request.Builder()
.url("http://" + server + "/jsf/rfws/erp/ac/voidunvoid/voidTran/")
.addHeader("client_id", MyValue.clientID)
.addHeader("authorization", "Bearer " + access_token)
.addHeader("cache-control", "no-cache")
.post(requestBody)
.build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
响应示例:
{
"success": true,
"voucherId": 18595,
"message": "Void Completed"
}
# 反作废交易
根据给定的模块名称和交易 ID 反作废交易。
HTTP 请求
GET http://[server]/jsf/rfws/erp/ac/voidunvoid/voidTran/
参数
所有参数都封装在一个 JSON 对象中。请阅读请求示例了解详情。
名字 | 类型 | 说明 |
---|---|---|
beId | int | 必填. 企业法人 ID |
moduleName | int | 必填. 交易的模块名字 |
tranId | int | 必填. 交易ID |
结果
名字 | 类型 | 说明 |
---|---|---|
success | boolean | 说明该过程是否成功 |
message | String | 结果信息 |
请求示例:
JsonObject data = new JsonObject();
data.addProperty("beId", 19);
data.addProperty("moduleName", "arTran");
data.addProperty("tranId", 431);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), data.toString());
Request request = new Request.Builder()
.url("http://" + server + "/jsf/rfws/erp/ac/voidunvoid/unvoidTran/")
.addHeader("client_id", MyValue.clientID)
.addHeader("authorization", "Bearer " + access_token)
.addHeader("cache-control", "no-cache")
.post(requestBody)
.build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
响应示例:
{
"success": true,
"message": "Unvoid Completed"
}