aiM18开发者中心 aiM18开发者中心
文档主页
  • 平台

    • 平台总体概述
    • 前端开发须知
    • 后台开发须知
    • EBI开发须知
    • JSF组件属性表
    • BPM扩展接口
    • 一查到底扩展接口
    • 手机App设置
  • ERP

    • ERP 后端扩展
    • ERP 应用配置
    • ERP 前端扩展
  • 教程

    • 设置Eclipse开发环境
    • 创建App教程
  • 平台相关

    • API授权
    • 通用的数据对象
    • 核心的API
    • EBI相关接口
  • 企业资源规划
  • 人力资本管理
  • 业务流程处理
  • 日程管理
  • 文档管理
  • 教程

    • 通过API与aiM18进行交互
教程
GitHub (opens new window)
文档主页
  • 平台

    • 平台总体概述
    • 前端开发须知
    • 后台开发须知
    • EBI开发须知
    • JSF组件属性表
    • BPM扩展接口
    • 一查到底扩展接口
    • 手机App设置
  • ERP

    • ERP 后端扩展
    • ERP 应用配置
    • ERP 前端扩展
  • 教程

    • 设置Eclipse开发环境
    • 创建App教程
  • 平台相关

    • API授权
    • 通用的数据对象
    • 核心的API
    • EBI相关接口
  • 企业资源规划
  • 人力资本管理
  • 业务流程处理
  • 日程管理
  • 文档管理
  • 教程

    • 通过API与aiM18进行交互
教程
GitHub (opens new window)
  • 通用

    • 访问授权
    • 通用JSON对象
    • 核心服务
    • 商业智能
    • 错误码说明
  • 业务流程管理

    • 业务流程管理
  • 日程管理

    • 日程管理
  • 文档管理

    • 文档管理系统
  • 企业资源规划

    • API授权流程
    • 基础资料
    • 财务
    • 财务EBI
    • 委外代销
    • EBI
    • 仓库管理方案
    • 零售
    • 零售储值
    • 零售和第三方物流
    • 生产
    • 贸易和财务
    • 采购
      • 采购报价单
        • 获取采购报价单列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取采购报价单
        • 一、接口描述
        • 二、接口调用说明
        • 保存采购报价单
        • 一、接口描述
        • 二、接口调用说明
        • 新增采购报价单(自动补全)
        • 一、接口描述
        • 二、接口调用说明
        • 删除采购报价单
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:采购报价单列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:采购报价单报告
        • 一、接口描述
        • 二、接口调用说明
      • 采购订单
        • 获取采购订单列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取采购订单
        • 一、接口描述
        • 二、接口调用说明
        • 保存采购订单
        • 一、接口描述
        • 二、接口调用说明
        • 新增采购订单(自动补全)
        • 一、接口描述
        • 二、接口调用说明
        • 删除采购订单
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:采购订单列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:采购订单报告
        • 一、接口描述
        • 二、接口调用说明
      • 供应商发货单
        • 获取供应商发货单列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取供应商发货单
        • 一、接口描述
        • 二、接口调用说明
        • 保存供应商发货单
        • 一、接口描述
        • 二、接口调用说明
        • 新增供应商发货单(自动补全)
        • 一、接口描述
        • 二、接口调用说明
        • 删除供应商发货单
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:供应商发货单报告
        • 一、接口描述
        • 二、接口调用说明
      • 进货单
        • 获取进货单列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取进货单
        • 一、接口描述
        • 二、接口调用说明
        • 保存进货单
        • 一、接口描述
        • 二、接口调用说明
        • 新增进货单(自动补全)
        • 一、接口描述
        • 二、接口调用说明
        • 删除进货单
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:进货单列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:进货单报告
        • 一、接口描述
        • 二、接口调用说明
      • 采购退货
        • 获取采购退货列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取采购退货
        • 一、接口描述
        • 二、接口调用说明
        • 保存采购退货
        • 一、接口描述
        • 二、接口调用说明
        • 新增采购退货(自动补全)
        • 一、接口描述
        • 二、接口调用说明
        • 删除采购退货
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:采购退货列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:采购退货报告
        • 一、接口描述
        • 二、接口调用说明
      • 采购发票
        • 获取采购发票列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取采购发票
        • 一、接口描述
        • 二、接口调用说明
        • 保存采购发票
        • 一、接口描述
        • 二、接口调用说明
        • 新增采购发票(自动补全)
        • 一、接口描述
        • 二、接口调用说明
        • 删除采购发票
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:采购发票列表
        • 一、接口描述
        • 二、接口调用说明
        • 读取EBI数据:采购发票报告
        • 一、接口描述
        • 二、接口调用说明
    • 销售
    • 库存
    • 委外
  • 人力资本管理

    • API授权流程
    • 绩效管理
    • 考勤管理
    • 临时工
    • 人事管理
    • 请假管理
    • 医疗索偿
    • 薪资管理
    • 招聘管理
    • 培训&资助
  • Web Services中文
  • 企业资源规划
Multiable
2024-07-12
目录

采购

# 采购报价单

# 获取采购报价单列表

# 一、接口描述

​ 用于获取采购报价单列表(同UI界面左侧的Search List数据)

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/search/search
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
stSearch String(Query) 是 vqu
beId long(Query) 是 aiM18企业法人[部门]的ID
formatId long(Query) 否 aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。
startRow int(Query) 否 返回结果的开始行
endRow int(Query) 否 返回结果的结束行
quickSearchStr String(Query) 否 用于设定关键字查找数据

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=vqu&beId=11";

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
  	"stSearch": "vqu",
    "size": 10,
    "stSearchDisplay": "Purchase Quotation",
    "values": [
        {
            "code": "ITVQU220324A",
            "tDate": "2022-03-04",
            "mainvqu.venId.ven.code": "2000C-014",
            "mainvqu.venId.ven.desc__lang": "Choi Hop Hong Co., Ltd",
            "mainvqu.curId.cur.sym": "HK$",
            "mainvqu.flowTypeId.flowtype.code": "SALE",
            "mainvqu.flowTypeId.flowtype.desc": "Sales Flow",
            "iRev": 1,
            "lastModifyDate": "2022-03-24 12:24:49",
            "mainvqu.lastModifyUid.simpleUser.desc__lang": "Ivan Tan",
            "id": 47,
            "st_desc": "ITVQU220324A",
            "st_id": 47,
            "st_code": "ITVQU220324A"
        }
  	]
}

# 读取采购报价单

# 一、接口描述

​ 用于读取【采购报价单】数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/read/vqu
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 vqu
id long(Query) 是 采购报价单的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/vqu";
			String param = "&menuCode=vqu&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、返回示例

{
    "data": {
        "mainvqu": [
            {
                "lastModifyUid": 11,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "position_zh-CN": "",
                "sysJson": "",
                "viewCode": "vqu",
                "expDate": 253402185600000,
                "beId": 11,
                "useAccessBl": false,
                "id": 47,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648095889000,
                "createUid": 11,
                "rev": "1",
                "lastApproveUid": 11,
                "ttlCharge": 0.0,
                "expiredUid": 0,
                "freeQtyPer": 0.0,
                "descOrigin": "VENREF",
                "position_en": "",
                "position_zh-TW": "",
                "venId": 108,
                "i18nField": "{\"position_zh-CN\": \"\"}",
                "manId": 0,
                "ttlAmt": 0.0,
                "position": "",
                "flowTypeId": 1355,
                "status": "Y",
                "weightUnit": "kg",
                "tDate": 1646323200000,
                "code": "ITVQU220324A",
                "cnDeptId": 0,
                "amt": 0.0,
                "iRev": 1,
                "upOrigin": "POLAST",
                "ce01Module": "vqu",
                "curId": 2,
                "expired": false,
                "rate": 0.8,
                "domAmt": 0.0,
                "measUnit": "cbm",
                "printCount": 0,
                "statusModifyDate": 1648095889000,
                "createDate": 1648095889000,
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0.0,
                "position_haha1": "",
                "useAccessAutoCalc": false,
                "staffId": 723,
                "domAmtDiff": 0.0
            }
        ],
        "remvqu": [
            {
                "tradeTerm_ccn": "",
                "country": "",
                "tradeTerm_zh-CN": "",
                "shipAd4_haha1": "",
                "remarks_en": "",
                "packing_ccn": "",
                "recipient_ccn": "",
                "tradeTerm": "",
                "shipAd2_zh-TW": "",
                "shipAd1_en": "",
                "payTerm_zh-TW": "",
                "province": "",
                "packing_haha1": "",
                "tel": "",
                "recipient_haha1": "",
                "id": 47,
                "fax": "",
                "remarks_zh-TW": "",
                "shipAd1_zh-CN": "",
                "hId": 47,
                "payTerm": "",
                "payTerm_ccn": "",
                "remarks_ccn": "",
                "tradeTerm_zh-TW": "",
                "shipAd4_ccn": "",
                "zipcode": "",
                "shipAd2_en": "",
                "shipAd1_haha1": "",
                "i18nField": "{\"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipAd1_zh-CN\": \"\", \"shipAd2_zh-CN\": \"\", \"shipAd3_zh-CN\": \"\", \"shipAd4_zh-CN\": \"\", \"recipient_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "shipAd4_ctw": "",
                "packing_en": "",
                "shipAd3_zh-TW": "",
                "payTerm_zh-CN": "",
                "payTerm_ctw": "",
                "remarks_ctw": "",
                "lTime": "",
                "shipAd1_ccn": "",
                "tradeTerm_en": "",
                "shipCodeId": 0,
                "city": "",
                "shipAd3_ctw": "",
                "recipient_zh-CN": "",
                "payTerm_en": "",
                "iRev": 1,
                "shipAd4_zh-TW": "",
                "packing": "",
                "shipAd2_ccn": "",
                "ce01Module": "vqu",
                "payTerm_haha1": "",
                "shipAd3_en": "",
                "recipient_en": "",
                "packing_zh-TW": "",
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd2_ctw": "",
                "shipAd2_haha1": "",
                "shipAd1_ctw": "",
                "remarks_haha1": "",
                "email": "",
                "shipAd3_ccn": "",
                "recipient_zh-TW": "",
                "packing_ctw": "",
                "recipient_ctw": "",
                "tradeTerm_ctw": "",
                "packing_zh-CN": "",
                "telCountry": "",
                "tradeTerm_haha1": "",
                "shipAd1": "",
                "shipAd2": "",
                "shipAd3": "",
                "shipAd4": "",
                "telArea": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "recipient": "",
                "shipAd2_zh-CN": "",
                "shipAd3_haha1": "",
                "remarks": ""
            }
        ],
        "vqut": [
            {
                "sourceId": 0,
                "unit2Id": 24,
                "dualQty": 0.0,
                "qty2": 0.0,
                "itemNo": "     1",
                "qty1": 1.0,
                "beId": 11,
                "bDesc": "",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 68,
                "up": 10.0,
                "ctn": 0,
                "dDesc_haha1": "",
                "height": 0.0,
                "hId": 47,
                "perCtn": 0.0,
                "freeQtyPer": 0.0,
                "volume": 0.0,
                "dDesc": "",
                "footerKey": "",
                "i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "pro",
                "qty": 1.0,
                "disc": 0.0,
                "packingDesc": "",
                "refCode": "",
                "lotNoId": 0,
                "dDesc_ctw": "",
                "innerQty": 0.0,
                "unit1Id": 24,
                "costAmt": 0.0,
                "amt": 0.0,
                "nw": 0.0,
                "iRev": 1,
                "leadTime": 0,
                "dDesc_zh-CN": "",
                "packingUnitId": 0,
                "bDesc_ctw": "",
                "ce01Module": "vqu",
                "lot": "A",
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": 0.0,
                "bDesc_ccn": "",
                "unitId": 24,
                "innerUnitId": 0,
                "dDesc_ccn": "",
                "locId": 0,
                "bDesc_en": "",
                "sourceCliId": 0,
                "length": 0.0,
                "dDesc_en": "",
                "dualUnitId": 6,
                "gw": 0.0,
                "sourceLot": "",
                "proId": 18,
                "width": 0.0,
                "bDesc_zh-CN": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# 保存采购报价单

# 一、接口描述

​ 用于新增【采购报价单】

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/save/vqu
http请求方式 PUT
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 vqu
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/vqu";
		String param = "&menuCode=vqu";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Entity的JSON格式数据如下:

{
    "mainvqu": {
        "values": [
            {
                "beId": 11,
                "code": "ITVQU220324A",
                "tDate": "2022-03-04",
                "venId": 108,
                "curId": 2,
                "rate": 0.8,
                "flowTypeId": 1355,
                "staffId": 723
            }
        ]
    },
    "vqut": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 18,
                "unitId": 24,
                "qty": 1,
                "up": 10
            }
        ]
    }
}

​ 4、返回示例

{
	"recordId": 47,
	"messages": [],
	"status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "必填项为空",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}

# 新增采购报价单(自动补全)

# 一、接口描述

​ 1. 用于新增【采购报价单】

​ 2. 此接口方法有如下特点:

​ a. 支持使用code 替代 id 栏位

​ b. 货币栏位未填时,自动使用本位币

​ c. 职员栏位未填时,自动使用[个人选项]中的默认职员

​ d. 单据日期未填时,根据[贸易参数设定]中的日期选项取值

​ e. 业务流程未填时,根据[业务流程设置(贸易)]中设定的默认值

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/erp/bsFlow/save/vqu
http请求方式 POST
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/vqu";

		HttpPost post = new HttpPost(url);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

data数据示例

{
    "beCode": "IT",
    "venCode": "2000C-014",
    "vqut": [
        {
            "proCode": "ITPRO001",
            "unitCode": "个",
            "qty": 1,
            "up": 10
        }
    ]
}

​ 4、返回示例

{
  "tranId": 48,
  "tranCode": "PQ22030004",
  "message": "",
  "status": true
}

# 删除采购报价单

# 一、接口描述

​ 用于删除采购报价单

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/delete/vqu
http请求方式 DELETE
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 vqu
id long(Query) 是 采购报价单的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/vqu";
		String param = "&menuCode=vqu&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "单据已被删除",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# 读取EBI数据:采购报价单列表

# 一、接口描述

​ 用于执行EBI[采购报价单列表],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 5,
    "rows": [
        {
            "M_A_code": "ITVQU002",
            "M_A_ttlAmt": "0.00",
            "M_A_id": "21",
            "M_A_rate": "1.00000000",
            "aiM18ReservedCol_dataIndex": 1,
            "VEN_A_code": "V0001",
            "VEN_A_desc__lang": "Test Vendor",
            "STAFF_A_id": "3",
            "M_A_curId_desc__lang": "¥",
            "M_A_tDate": "2019.01.09",
            "STAFF_A_code": "IT001",
            "VEN_A_id": "1"
        }
  	]
}

ebi1

# 读取EBI数据:采购报价单报告

# 一、接口描述

​ 用于执行EBI[采购报价单报告],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
  "size": 4,
    "rows": [
        {
            "M_A_code": "ITVQU19100001",
            "M_A_id": "24",
            "aiM18ReservedCol_dataIndex": 1,
            "F_A_unitId_code": "个",
            "M_A_tDate": "2019.10.15",
            "PRO_A_code": "ITPRO001",
            "PRO_A_id": "18",
            "F_A_qty": "10.0000",
            "F_A_up": "44.0000"
        }
  	]
}

ebi2

# 采购订单

# 获取采购订单列表

# 一、接口描述

​ 用于获取采购订单列表(同UI界面左侧的Search List数据)

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/search/search
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
stSearch String(Query) 是 po
beId long(Query) 是 aiM18企业法人[部门]的ID
formatId long(Query) 否 aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。
startRow int(Query) 否 返回结果的开始行
endRow int(Query) 否 返回结果的结束行
quickSearchStr String(Query) 否 用于设定关键字查找数据

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=po&beId=11";

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
  	"stSearch": "po",
    "size": 26,
    "stSearchDisplay": "Purchase Order",
    "values": [
        {
            "code": "ITPO220324A",
            "tDate": "2022-03-24",
            "mainpo.venId.ven.code": "2000C-014",
            "mainpo.venId.ven.desc__lang": "Choi Hop Hong Co., Ltd",
            "mainpo.curId.cur.sym": "¥",
            "mainpo.flowTypeId.flowtype.code": "PURCHASE",
            "mainpo.flowTypeId.flowtype.desc": "Purchase Flow",
            "iRev": 1,
            "lastModifyDate": "2022-03-24 15:40:46",
            "mainpo.lastModifyUid.simpleUser.desc__lang": "Ivan Tan",
            "id": 10661,
            "st_desc": "ITPO220324A",
            "st_id": 10661,
            "st_code": "ITPO220324A"
        }
  	]
}

# 读取采购订单

# 一、接口描述

​ 用于读取【采购订单】数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/read/po
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 po
id long(Query) 是 采购订单的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/po";
			String param = "&menuCode=po&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、返回示例

{
    "data": {
        "mainpo": [
            {
                "lastModifyUid": 11,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "invShipedStatus": 0,
                "position_zh-CN": "",
                "sysJson": "",
                "viewCode": "po",
                "beId": 11,
                "dDate": 1648051200000,
                "shipedStatus": 0,
                "useAccessBl": false,
                "id": 10661,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648107646000,
                "createUid": 11,
                "rev": "1",
                "lastApproveUid": 11,
                "ttlCharge": 0,
                "completed": false,
                "expiredUid": 0,
                "freeQtyPer": 0,
                "descOrigin": "VENREF",
                "position_en": "",
                "position_zh-TW": "",
                "venId": 108,
                "i18nField": "{\"position_zh-CN\": \"\"}",
                "manId": 0,
                "deposit": 0,
                "ttlAmt": 0,
                "multiFlowSrcId": 0,
                "position": "",
                "flowTypeId": 1356,
                "status": "Y",
                "weightUnit": "kg",
                "multiFlowFlowId": 0,
                "tDate": 1648051200000,
                "code": "ITPO220324A",
                "cnDeptId": 0,
                "multiFlowSrcModule": "",
                "amt": 0,
                "iRev": 1,
                "upOrigin": "POLAST",
                "ce01Module": "po",
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": 0,
                "sumMethod": "no",
                "settlementStatus": 0,
                "measUnit": "cbm",
                "printCount": 0,
                "udfsm3": "",
                "statusModifyDate": 1648107646000,
                "createDate": 1648107646000,
                "shipedASIStatus": 0,
                "depoRate": 0,
                "loadGpCoData": false,
                "cp": 0,
                "useAccessWl": false,
                "billingStatus": 0,
                "position_ccn": "",
                "ttlDisc": 0,
                "multiFlowSrcBeId": 0,
                "position_haha1": "",
                "depositStatus": 0,
                "useAccessAutoCalc": false,
                "staffId": 723,
                "domAmtDiff": 0
            }
        ],
        "pot": [
            {
                "sourceId": 0,
                "unit2Id": 40,
                "shipMark": "",
                "dualQty": 0,
                "prqFooterKey": "",
                "qty2": 0,
                "itemNo": "     1",
                "prqSourceId": 0,
                "qty1": 1,
                "beId": 11,
                "dDate": 1648051200000,
                "bDesc": "",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 11525,
                "up": 10,
                "ctn": 0,
                "qcRequired": false,
                "dDesc_haha1": "",
                "height": 0,
                "hId": 10661,
                "perCtn": 0,
                "prqResultId": 0,
                "completed": false,
                "freeQtyPer": 0,
                "volume": 0,
                "dDesc": "",
                "footerKey": "",
                "i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "pro",
                "qty": 1,
                "disc": 0,
                "packingDesc": "",
                "refCode": "",
                "lotNoId": 0,
                "dDesc_ctw": "",
                "innerQty": 0,
                "unit1Id": 40,
                "costAmt": 0,
                "pproId": 26,
                "amt": 0,
                "nw": 0,
                "iRev": 1,
                "dDesc_zh-CN": "",
                "qup": 0,
                "packingUnitId": 0,
                "udfsm": 0,
                "bDesc_ctw": "",
                "ce01Module": "po",
                "lot": "A",
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": 0,
                "bDesc_ccn": "",
                "unitId": 40,
                "innerUnitId": 0,
                "udfsm2": "",
                "dDesc_ccn": "",
                "locId": 0,
                "bDesc_en": "",
                "sourceCliId": 0,
                "length": 0,
                "dDesc_en": "",
                "dualUnitId": 29,
                "gw": 0,
                "prqSourceType": "pro",
                "sourceLot": "",
                "prqSourceLot": "",
                "proId": 26,
                "width": 0,
                "cuspono": "",
                "bDesc_zh-CN": ""
            }
        ],
        "rempo": [
            {
                "tradeTerm_ccn": "",
                "country": "",
                "shipMark": "",
                "heading_en": "",
                "shipMark_zh-CN": "",
                "tradeTerm_zh-CN": "",
                "shipAd4_haha1": "",
                "remarks_en": "",
                "packing_ccn": "",
                "dest": "",
                "recipient_ccn": "",
                "tradeTerm": "",
                "shipAd2_zh-TW": "",
                "heading_ccn": "",
                "shipAd1_en": "",
                "payTerm_zh-TW": "",
                "province": "",
                "packing_haha1": "",
                "tel": "",
                "shipMark_en": "",
                "recipient_haha1": "",
                "id": 10564,
                "fax": "",
                "remarks_zh-TW": "",
                "shipAd1_zh-CN": "",
                "hId": 10661,
                "payTerm": "",
                "heading_zh-TW": "",
                "payTerm_ccn": "",
                "remarks_ccn": "",
                "heading_ctw": "",
                "tradeTerm_zh-TW": "",
                "shipMark_ccn": "",
                "shipAd4_ccn": "",
                "zipcode": "",
                "shipAd2_en": "",
                "shipAd1_haha1": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipAd1_zh-CN\": \"\", \"shipAd2_zh-CN\": \"\", \"shipAd3_zh-CN\": \"\", \"shipAd4_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"recipient_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "shipAd4_ctw": "",
                "packing_en": "",
                "shipAd3_zh-TW": "",
                "payTerm_zh-CN": "",
                "payTerm_ctw": "",
                "shipMark_zh-TW": "",
                "remarks_ctw": "",
                "shipAd1_ccn": "",
                "tradeTerm_en": "",
                "shipCodeId": 0,
                "city": "",
                "shipMark_ctw": "",
                "shipAd3_ctw": "",
                "recipient_zh-CN": "",
                "payTerm_en": "",
                "iRev": 1,
                "shipAd4_zh-TW": "",
                "packing": "",
                "shipAd2_ccn": "",
                "heading_zh-CN": "",
                "ce01Module": "po",
                "payTerm_haha1": "",
                "shipAd3_en": "",
                "recipient_en": "",
                "packing_zh-TW": "",
                "shipAd3_zh-CN": "",
                "shipAd4_zh-CN": "",
                "shipAd2_ctw": "",
                "shipAd2_haha1": "",
                "shipAd1_ctw": "",
                "remarks_haha1": "",
                "email": "",
                "shipAd3_ccn": "",
                "recipient_zh-TW": "",
                "packing_ctw": "",
                "heading_haha1": "",
                "heading": "",
                "recipient_ctw": "",
                "tradeTerm_ctw": "",
                "packing_zh-CN": "",
                "telCountry": "",
                "tradeTerm_haha1": "",
                "shipAd1": "",
                "shipAd2": "",
                "shipAd3": "",
                "shipAd4": "",
                "telArea": "",
                "shipAd1_zh-TW": "",
                "shipAd4_en": "",
                "recipient": "",
                "shipAd2_zh-CN": "",
                "shipAd3_haha1": "",
                "shipMark_haha1": "",
                "smthId": 0,
                "remarks": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# 保存采购订单

# 一、接口描述

​ 用于新增【采购订单】

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/save/po
http请求方式 PUT
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 po
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/po";
		String param = "&menuCode=po";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

Entity的JSON格式数据如下:

{
    "mainpo": {
        "values": [
            {
                "beId": 11,
                "code": "ITPO220324A",
                "tDate": "2022-03-24",
                "venId": 108,
                "curId": 1,
                "rate": 1,
                "flowTypeId": 1356,
                "staffId": 723
            }
        ]
    },
    "pot": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 26,
                "unitId": 40,
                "qty": 1,
                "up": 10
            }
        ]
    }
}

​ 4、返回示例

{
	"recordId": 10661,
	"messages": [],
	"status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "必填项为空",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}

# 新增采购订单(自动补全)

# 一、接口描述

​ 1. 用于新增【采购订单】

​ 2. 此接口方法有如下特点:

​ a. 支持使用code 替代 id 栏位

​ b. 货币栏位未填时,自动使用本位币

​ c. 职员栏位未填时,自动使用个人选项中的默认职员

​ d. 单据日期未填时,根据贸易参数设定中的日期选项取值

​ e. 业务流程未填时,根据[业务流程设置(贸易)]中设定的默认值

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/erp/bsFlow/save/po
http请求方式 POST
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/po";

		HttpPost post = new HttpPost(url);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

data数据示例

{
    "beCode": "IT",
    "venCode": "VIT001",
    "pot": [
        {
            "proCode": "ITPRO002",
            "unitCode": "PCS",
            "qty": 1,
            "up": 10,
            "amt": 10
        }
    ]
}

​ 4、返回示例

{
  "tranId": 10662,
  "tranCode": "PO2203010064",
  "message": "",
  "status": true
}

# 删除采购订单

# 一、接口描述

​ 用于删除采购订单

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/delete/po
http请求方式 DELETE
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 po
id long(Query) 是 采购订单的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/po";
		String param = "&menuCode=po&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "单据已被删除",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# 读取EBI数据:采购订单列表

# 一、接口描述

​ 用于执行EBI[采购订单列表],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 26,
    "rows": [
        {
            "PO_A_dDate": "2016.08.22",
            "PO_A_curId": "1",
            "PO_A_id": "2",
            "aiM18ReservedCol_dataIndex": 1,
            "PO_A_ttlCharge": "0.00",
            "PO_A_code": "ITPO16080001",
            "PO_A_curId_code": "R",
            "PO_A_amt": "4,350.00",
            "PO_A_ttlAmt": "4,350.00",
            "PO_A_tDate": "2016.08.15",
            "PO_A_rate": "1.00000000",
            "VEN_A_code": "V0001",
            "PO_A_ttlDisc": "0.00",
            "VEN_A_id": "1"
        }
    ]
}

ebi1

# 读取EBI数据:采购订单报告

# 一、接口描述

​ 用于执行EBI[采购订单报告],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 46,
    "rows": [
        {
            "PO_A_dDate": "2016.08.22",
            "PO_A_tDate": "2016.08.15",
            "PO_A_id": "2",
            "aiM18ReservedCol_dataIndex": 1,
            "VEN_A_code": "V0001",
            "POT_A_qty": "10.0000",
            "PO_A_code": "ITPO16080001",
            "POT_A_unitId_code": "个",
            "PRO_A_code": "COMPUTER_01",
            "PRO_A_id": "3",
            "VEN_A_id": "1"
        }
    ]
}

ebi2

# 供应商发货单

# 获取供应商发货单列表

# 一、接口描述

​ 用于获取供应商发货单列表(同UI界面左侧的Search List数据)

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/search/search
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
stSearch String(Query) 是 asi
beId long(Query) 是 aiM18企业法人[部门]的ID
formatId long(Query) 否 aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。
startRow int(Query) 否 返回结果的开始行
endRow int(Query) 否 返回结果的结束行
quickSearchStr String(Query) 否 用于设定关键字查找数据

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=asi&beId=11";

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
  	"stSearch": "asi",
    "size": 10,
    "stSearchDisplay": "Vendor Shipment Note",
    "values": [
        {
            "code": "ITVSN220330A",
            "tDate": "2022-03-30",
            "mainasi.flowTypeId.flowtype.code": "PURCHASE",
            "mainasi.flowTypeId.flowtype.desc": "Purchase Flow",
            "iRev": 1,
            "lastModifyDate": "2022-03-30 12:59:52",
            "mainasi.lastModifyUid.simpleUser.desc__lang": "Ivan Tan",
            "id": 51,
            "st_desc": "ITVSN220330A",
            "st_id": 51,
            "st_code": "ITVSN220330A"
        }
  	]
}

# 读取供应商发货单

# 一、接口描述

​ 用于读取【供应商发货单】数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/read/asi
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 asi
id long(Query) 是 供应商发货单的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/asi";
			String param = "&menuCode=asi&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、返回示例

{
    "data": {
        "asit": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "unit2Id": 40,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "qty2": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "qty1": -5,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "bDesc_zh-TW": "",
                "id": 75,
                "ctn": 0,
                "dDesc_haha1": "",
                "height": 30,
                "perCtn": 20,
                "lotnoNumAttr20": 0,
                "completed": false,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "freeQtyPer": 0,
                "lotnoLookupAttr11": 0,
                "i18nField": "{\"bDesc_zh-CN\": \"Lot no. can be duplicated\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "pro",
                "packingDesc": "",
                "innerQty": 0,
                "iRev": 1,
                "poId": 0,
                "bDesc_ctw": "",
                "ce01Module": "asi",
                "lot": "A",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": -2209017600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "bDesc_ccn": "",
                "lotnoDateAttr6": -2209017600000,
                "unitId": 40,
                "lotnoDateAttr9": -2209017600000,
                "bDesc_en": "",
                "lotnoTextAttr1": "",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "width": 38,
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "bDesc_zh-CN": "Lot no. can be duplicated",
                "sourceId": 0,
                "dualQty": -5,
                "itemNo": "     1",
                "poLot": "",
                "beId": 11,
                "bDesc": "Lot no. can be duplicated",
                "up": 6,
                "qcRequired": false,
                "hId": 51,
                "lotnoNumAttr1": 0,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "volume": 0.066,
                "lotnoExpDate": 253402185600000,
                "dDesc": "",
                "qty": -5,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "disc": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "refCode": "",
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "dDesc_ctw": "",
                "lotnoTextAttr18": "",
                "unit1Id": 40,
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "nw": 0.135,
                "amt": -30,
                "dDesc_zh-CN": "",
                "lotnoTextAttr19": "",
                "packingUnitId": 3,
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": -30,
                "innerUnitId": 3,
                "dDesc_ccn": "",
                "lotnoTextAttr10": "",
                "length": 58,
                "dDesc_en": "",
                "dualUnitId": 29,
                "gw": 0.135,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "sourceLot": "",
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotno": "",
                "lotnoLookupAttr9": 0,
                "proId": 26,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoDateAttr11": -2209017600000,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr15": -2209017600000,
                "lotnoLookupAttr4": 0
            }
        ],
        "mainasi": [
            {
                "lastModifyUid": 11,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "invShipedStatus": 0,
                "position_zh-CN": "",
                "sysJson": "",
                "viewCode": "asi",
                "venDnNo": "",
                "beId": 11,
                "shipedStatus": 20,
                "useAccessBl": false,
                "id": 51,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648616392000,
                "createUid": 11,
                "rev": "1",
                "lastApproveUid": 11,
                "ttlCharge": 0,
                "completed": false,
                "expiredUid": 0,
                "freeQtyPer": 0,
                "descOrigin": "VENREF",
                "position_en": "",
                "position_zh-TW": "",
                "i18nField": "{\"position_zh-CN\": \"\"}",
                "manId": 0,
                "ttlAmt": -30,
                "multiFlowSrcId": 0,
                "position": "",
                "flowTypeId": 1356,
                "status": "Y",
                "weightUnit": "kg",
                "multiFlowFlowId": 0,
                "tDate": 1648569600000,
                "code": "ITVSN220330A",
                "cnDeptId": 0,
                "multiFlowSrcModule": "",
                "amt": -30,
                "iRev": 1,
                "upOrigin": "POLAST",
                "ce01Module": "asi",
                "curId": 1,
                "expired": false,
                "asnRefId": 592,
                "rate": 1,
                "domAmt": -30,
                "measUnit": "cbm",
                "printCount": 0,
                "statusModifyDate": 1648616392000,
                "createDate": 1648616392000,
                "asnRefType": "ven",
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "multiFlowSrcBeId": 0,
                "position_haha1": "",
                "useAccessAutoCalc": false,
                "staffId": 723,
                "domAmtDiff": 0
            }
        ],
        "remasi": [
            {
                "tradeTerm_ccn": "",
                "tradeTerm_en": "",
                "shipMark": "",
                "heading_en": "",
                "shipMark_zh-CN": "",
                "tradeTerm_zh-CN": "",
                "shipMark_ctw": "",
                "remarks_en": "",
                "payTerm_en": "",
                "iRev": 1,
                "packing_ccn": "",
                "packing": "",
                "heading_zh-CN": "",
                "ce01Module": "asi",
                "tradeTerm": "",
                "heading_ccn": "",
                "payTerm_haha1": "",
                "packing_zh-TW": "",
                "payTerm_zh-TW": "",
                "packing_haha1": "",
                "remarks_haha1": "",
                "shipMark_en": "",
                "id": 40,
                "remarks_zh-TW": "",
                "hId": 51,
                "packing_ctw": "",
                "heading_haha1": "",
                "payTerm": "",
                "heading_zh-TW": "",
                "payTerm_ccn": "",
                "heading": "",
                "remarks_ccn": "",
                "heading_ctw": "",
                "tradeTerm_ctw": "",
                "packing_zh-CN": "",
                "tradeTerm_zh-TW": "",
                "shipMark_ccn": "",
                "tradeTerm_haha1": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "packing_en": "",
                "shipMark_haha1": "",
                "payTerm_zh-CN": "",
                "payTerm_ctw": "",
                "shipMark_zh-TW": "",
                "remarks": "",
                "remarks_ctw": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# 保存供应商发货单

# 一、接口描述

​ 用于新增【供应商发货单】

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/save/asi
http请求方式 PUT
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 asi
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/asi";
		String param = "&menuCode=asi";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity的JSON格式数据如下:

{
    "mainasi": {
        "values": [
            {
                "beId": 11,
                "code": "ITVSN220324A",
                "tDate": "2022-03-24",
                "asnRefId": 592,
                "curId": 1,
                "rate": 1,
                "flowTypeId": 1356,
                "staffId": 723
            }
        ]
    },
    "asit": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 26,
                "unitId": 40,
                "qty": 1,
                "up": 10,
                "amt": 10
            }
        ]
    }
}

​ 4、返回示例

{
	"recordId": 49,
	"messages": [],
	"status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "必填项为空",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}

# 新增供应商发货单(自动补全)

# 一、接口描述

​ 1. 用于新增【供应商发货单】

​ 2. 此接口方法有如下特点:

​ a. 支持使用code 替代 id 栏位

​ b. 货币栏位未填时,自动使用本位币

​ c. 职员栏位未填时,自动使用个人选项中的默认职员

​ d. 单据日期未填时,根据贸易参数设定中的日期选项取值

​ e. 业务流程未填时,根据[业务流程设置(贸易)]中设定的默认值

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/erp/bsFlow/save/asi
http请求方式 POST
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/asi";

		HttpPost post = new HttpPost(url);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

data数据示例

{
    "beCode": "IT",
    "asnRefCode": "VIT001",
    "asit": [
        {
            "proCode": "ITPRO002",
            "unitCode": "PCS",
            "qty": 1,
            "up": 10,
            "amt": 10
        }
    ]
}

​ 4、返回示例

{
  "tranId": 50,
  "tranCode": "ASI220002",
  "message": "",
  "status": true
}

# 删除供应商发货单

# 一、接口描述

​ 用于删除供应商发货单

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/delete/asi
http请求方式 DELETE
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 asi
id long(Query) 是 供应商发货单的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/asi";
		String param = "&menuCode=asi&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "单据已被删除",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# 读取EBI数据:供应商发货单报告

# 一、接口描述

​ 用于执行EBI[供应商发货单报告],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 11,
    "rows": [
        {
            "ASIT_A_qty": "10.0000",
            "ASI_A_tDate": "2018.12.11",
            "aiM18ReservedCol_dataIndex": 1,
            "VEN_A_code": "VIT001",
            "ASIT_A_unitId_code": "个",
            "ASI_A_code": "ASI180003",
            "ASI_A_id": "11",
            "PRO_A_code": "ITPRO001",
            "PRO_A_id": "18",
            "VEN_A_id": "592"
        }
    ]
}

ebi1

# 进货单

# 获取进货单列表

# 一、接口描述

​ 用于获取进货单列表(同UI界面左侧的Search List数据)

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/search/search
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
stSearch String(Query) 是 an
beId long(Query) 是 aiM18企业法人[部门]的ID
formatId long(Query) 否 aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。
startRow int(Query) 否 返回结果的开始行
endRow int(Query) 否 返回结果的结束行
quickSearchStr String(Query) 否 用于设定关键字查找数据

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=an&beId=11";

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
  	"stSearch": "an",
    "size": 36,
    "stSearchDisplay": "Goods Receipt Note",
    "values": [
        {
            "code": "ITAN220325A",
            "tDate": "2022-03-25",
            "mainan.venId.ven.code": "2000C-014",
            "mainan.venId.ven.desc__lang": "Choi Hop Hong Co., Ltd",
            "venDnNo": "",
            "mainan.curId.cur.sym": "¥",
            "mainan.flowTypeId.flowtype.code": "PURCHASE",
            "mainan.flowTypeId.flowtype.desc": "Purchase Flow",
            "iRev": 1,
            "lastModifyDate": "2022-03-25 10:51:16",
            "mainan.lastModifyUid.simpleUser.desc__lang": "Ivan Tan",
            "id": 679,
            "st_desc": "ITAN220325A",
            "st_id": 679,
            "st_code": "ITAN220325A"
        }
  	]
}

# 读取进货单

# 一、接口描述

​ 用于读取【进货单】数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/read/an
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 an
id long(Query) 是 进货单的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/an";
			String param = "&menuCode=an&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、返回示例

{
    "data": {
        "antlot": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 1,
                "lotnoLot": "A",
                "id": 332,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 1,
                "ce01Module": "an",
                "lotnoDateAttr3": -2209017600000,
                "lotnoDateAttr4": -2209017600000,
                "lotnoDateAttr1": -2209017600000,
                "lotnoDateAttr2": -2209017600000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 40,
                "lotnoDateAttr9": -2209017600000,
                "locId": 7,
                "lotnoTextAttr1": "",
                "udfaaa": "",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 0,
                "itemNo": "",
                "hId": 679,
                "lotnoNumAttr1": 0,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 253402271999000,
                "footerKey": "     1",
                "qty": 1,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 5479,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 29,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "ITAN220325A00",
                "lotnoLookupAttr9": 0,
                "proId": 26,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 0,
                "lotnoDateAttr15": -2209017600000
            }
        ],
        "reman": [
            {
                "hId": 679,
                "i18nField": "{\"remarks_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "remarks_ccn": "",
                "remarks_en": "",
                "remarks_haha1": "",
                "iRev": 1,
                "id": 679,
                "remarks_zh-TW": "",
                "remarks": "",
                "remarks_ctw": "",
                "ce01Module": "an"
            }
        ],
        "ant": [
            {
                "sourceId": 10661,
                "unit2Id": 40,
                "scrapQty2": 0,
                "scrapQty1": 0,
                "dualQty": 0,
                "qty2": 0,
                "itemNo": "     1",
                "venDnNo": "",
                "qty1": 1,
                "poLot": "A",
                "beId": 11,
                "passQty1": 0,
                "passQty2": 0,
                "bDesc": "",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "udfString": "",
                "id": 1006,
                "up": 10,
                "ctn": 0,
                "dDesc_haha1": "",
                "height": 0,
                "isInventory": true,
                "hId": 679,
                "perCtn": 0,
                "reDeliveryId": 10661,
                "completed": false,
                "freeQtyPer": 0,
                "passQty": 0,
                "volume": 0,
                "dDesc": "",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "po",
                "qty": 1,
                "invup": 10,
                "asnLot": "",
                "disc": 0,
                "asnId": 0,
                "packingDesc": "",
                "refCode": "",
                "lotNoId": 0,
                "dDesc_ctw": "",
                "innerQty": 0,
                "unit1Id": 40,
                "costAmt": 0,
                "reDeliveryType": "po",
                "amt": 10,
                "nw": 0,
                "iRev": 1,
                "dDesc_zh-CN": "",
                "qup": 0,
                "packingUnitId": 0,
                "poId": 10661,
                "bDesc_ctw": "",
                "ce01Module": "an",
                "lot": "A",
                "bDesc_haha1": "",
                "reDeliveryLot": "A",
                "dDesc_zh-TW": "",
                "domAmt": 10,
                "reShipType": "asi",
                "udfCheck": false,
                "bDesc_ccn": "",
                "unitId": 40,
                "innerUnitId": 0,
                "dDesc_ccn": "",
                "locId": 7,
                "bDesc_en": "",
                "reDelivery": false,
                "scrapQty": 0,
                "sourceCliId": 0,
                "length": 0,
                "dDesc_en": "",
                "dualUnitId": 29,
                "gw": 0,
                "sourceLot": "A",
                "proId": 26,
                "width": 0,
                "qcId": 0,
                "bDesc_zh-CN": ""
            }
        ],
        "mainan": [
            {
                "lastModifyUid": 11,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "position_zh-CN": "",
                "sysJson": "",
                "viewCode": "an",
                "venDnNo": "",
                "beId": 11,
                "useAccessBl": false,
                "id": 679,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648176676000,
                "createUid": 11,
                "rev": "1",
                "lastApproveUid": 0,
                "ttlCharge": 0,
                "completed": false,
                "expiredUid": 0,
                "freeQtyPer": 0,
                "descOrigin": "VENREF",
                "position_en": "",
                "position_zh-TW": "",
                "venId": 108,
                "i18nField": "{\"position_zh-CN\": \"\"}",
                "manId": 0,
                "ttlAmt": 10,
                "multiFlowSrcId": 0,
                "position": "",
                "flowTypeId": 1356,
                "status": "N",
                "weightUnit": "kg",
                "multiFlowFlowId": 0,
                "tDate": 1648137600000,
                "code": "ITAN220325A",
                "cnDeptId": 0,
                "multiFlowSrcModule": "",
                "amt": 10,
                "iRev": 1,
                "upOrigin": "POLAST",
                "ce01Module": "an",
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": 10,
                "measUnit": "cbm",
                "printCount": 0,
                "statusModifyDate": 1648176676000,
                "locId": 0,
                "createDate": 1648176676000,
                "loadGpCoData": false,
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "multiFlowSrcBeId": 0,
                "position_haha1": "",
                "useAccessAutoCalc": false,
                "staffId": 723,
                "domAmtDiff": 0
            }
        ]
    },
    "messages": [],
    "status": true
}

# 保存进货单

# 一、接口描述

​ 用于新增【进货单】

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/save/an
http请求方式 PUT
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 an
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/an";
		String param = "&menuCode=an";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity的JSON格式数据如下:

{
    "mainan": {
        "values": [
            {
                "beId": 11,
                "code": "ITAN220325A",
                "venId": 108,
                "curId": 1,
                "rate": 1,
                "flowTypeId": 1356,
                "staffId": 723
            }
        ]
    },
    "ant": {
        "values": [
            {
                "sourceType": "po",
                "sourceId": 10661,
                "sourceLot": "A",
                "proId": 26,
                "locId": 7,
                "unitId": 40,
                "qty": 1,
                "up": 10,
                "amt": 10
            }
        ]
    }
}

​ 4、返回示例

{
	"recordId": 679,
	"messages": [],
	"status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "必填项为空",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}

# 新增进货单(自动补全)

# 一、接口描述

​ 1. 用于新增【进货单】

​ 2. 此接口方法有如下特点:

​ a. 支持使用code 替代 id 栏位

​ b. 货币栏位未填时,自动使用本位币

​ c. 职员栏位未填时,自动使用个人选项中的默认职员

​ d. 单据日期未填时,根据贸易参数设定中的日期选项取值

​ e. 业务流程未填时,根据[业务流程设置(贸易)]中设定的默认值

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/erp/bsFlow/save/an
http请求方式 POST
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/an";

		HttpPost post = new HttpPost(url);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

data数据示例

{
    "beCode": "IT",
    "venCode": "VIT001",
    "ant": [
        {
            "proCode": "ITPRO002",
            "unitCode": "PCS",
            "locCode": "SZO",
            "qty": 1,
            "up": 10,
            "amt": 10
        }
    ]
}

​ 4、返回示例

{
  "tranId": 680,
  "tranCode": "AN0220006",
  "message": "",
  "status": true
}

# 删除进货单

# 一、接口描述

​ 用于删除进货单

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/delete/an
http请求方式 DELETE
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 an
id long(Query) 是 进货单的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/an";
		String param = "&menuCode=an&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "单据已被删除",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# 读取EBI数据:进货单列表

# 一、接口描述

​ 用于执行EBI[进货单列表],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 36,
    "rows": [
        {
            "AN_A_ttlDisc": "0.00",
            "AN_A_curId": "1",
            "AN_A_id": "7",
            "aiM18ReservedCol_dataIndex": 1,
            "AN_A_curId_code": "R",
            "LOC_A_id": "1",
            "AN_A_tDate": "2016.08.22",
            "AN_A_ttlCharge": "0.00",
            "LOC_A_code": "PHY",
            "AN_A_rate": "1.00000000",
            "AN_A_ttlAmt": "4,350.00",
            "VEN_A_code": "V0001",
            "AN_A_amt": "4,350.00",
            "AN_A_code": "ITGRN16080001",
            "VEN_A_id": "1"
        }
    ]
}

ebi1

# 读取EBI数据:进货单报告

# 一、接口描述

​ 用于执行EBI[进货单报告],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 56,
    "rows": [
        {
            "MAIN_lotAmt": "4,350.00",
            "AN_A_id": "7",
            "ANT_A_qty": "500.0000",
            "ANT_A_unitId_code": "PCS",
            "aiM18ReservedCol_dataIndex": 1,
            "MAIN_lotQty": "500.0000",
            "AN_A_code": "ITGRN16080001",
            "PRO_A_code": "PRO004",
            "PRO_A_id": "8",
            "LOTNO_A_lotno": "ITGRN16080001-01"
        }
    ]
}

ebi2

# 采购退货

# 获取采购退货列表

# 一、接口描述

​ 用于获取采购退货列表(同UI界面左侧的Search List数据)

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/search/search
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
stSearch String(Query) 是 pret
beId long(Query) 是 aiM18企业法人[部门]的ID
formatId long(Query) 否 aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。
startRow int(Query) 否 返回结果的开始行
endRow int(Query) 否 返回结果的结束行
quickSearchStr String(Query) 否 用于设定关键字查找数据

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=pret&beId=11";

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
  	"stSearch": "pret",
    "size": 8,
    "stSearchDisplay": "Purchase Return",
    "values": [
        {
            "code": "ITPRET220330A",
            "tDate": "2022-03-30",
            "mainpret.venId.ven.code": "VIT001",
            "mainpret.venId.ven.desc__lang": "Global Shared (Test printing long text stretch with overflow)",
            "mainpret.curId.cur.sym": "¥",
            "mainpret.flowTypeId.flowtype.code": "PURCHASE",
            "mainpret.flowTypeId.flowtype.desc": "Purchase Flow",
            "iRev": 1,
            "lastModifyDate": "2022-03-30 14:24:48",
            "mainpret.lastModifyUid.simpleUser.desc__lang": "Ivan Tan",
            "id": 88,
            "st_desc": "ITPRET220330A",
            "st_id": 88,
            "st_code": "ITPRET220330A"
        }
  	]
}

# 读取采购退货

# 一、接口描述

​ 用于读取【采购退货】数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/read/pret
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 pret
id long(Query) 是 采购退货的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pret";
			String param = "&menuCode=pret&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、返回示例

{
    "data": {
        "prettlot": [
            {
                "lotnoNumAttr17": 0,
                "lotnoNumAttr16": 0,
                "lotnoNumAttr15": 0,
                "lotnoNumAttr14": 0,
                "lotnoNumAttr19": 0,
                "lotnoNumAttr18": 0,
                "lotnoLookupAttr20": 0,
                "lotnoNumAttr13": 0,
                "lotnoNumAttr12": 0,
                "lotnoNumAttr11": 0,
                "lotnoNumAttr10": 0,
                "lotnoLookupAttr16": 0,
                "lotnoLookupAttr17": 0,
                "lotnoLookupAttr14": 0,
                "lotnoLookupAttr15": 0,
                "lotnoLookupAttr18": 0,
                "lotnoLookupAttr19": 0,
                "newLotno": 0,
                "lotnoLot": "A",
                "id": 34,
                "lotnoNumAttr20": 0,
                "lotnoLookupAttr12": 0,
                "lotnoLookupAttr13": 0,
                "lotnoLookupAttr10": 0,
                "lotnoLookupAttr11": 0,
                "iRev": 1,
                "ce01Module": "pret",
                "lotnoDateAttr3": -2561356800000,
                "lotnoDateAttr4": -2435126400000,
                "lotnoDateAttr1": -2561356800000,
                "lotnoDateAttr2": -2561356800000,
                "lotnoDateAttr7": -2209017600000,
                "lotnoDateAttr8": -2209017600000,
                "lotnoDateAttr5": -2209017600000,
                "lotnoDateAttr6": -2209017600000,
                "unitId": 40,
                "lotnoDateAttr9": -2209017600000,
                "locId": 7,
                "lotnoTextAttr1": "",
                "lotnoTextAttr2": "",
                "lotnoTextAttr3": "",
                "lotnoTextAttr4": "",
                "lotnoTextAttr5": "",
                "lotnoTextAttr6": "",
                "lotnoTextAttr7": "",
                "lotnoTextAttr8": "",
                "lotnoTextAttr9": "",
                "dualQty": 1,
                "itemNo": "",
                "hId": 88,
                "lotnoNumAttr1": 0,
                "lotnoNumAttr2": 0,
                "lotnoNumAttr3": 0,
                "lotnoNumAttr4": 0,
                "lotnoExpDate": 253144540800000,
                "footerKey": "     1",
                "qty": 1,
                "lotnoNumAttr5": 0,
                "lotnoNumAttr6": 0,
                "lotnoNumAttr7": 0,
                "lotnoNumAttr8": 0,
                "lotnoNumAttr9": 0,
                "lotNoId": 625,
                "lotnoTextAttr16": "",
                "lotnoTextAttr15": "",
                "lotnoTextAttr18": "",
                "lotnoTextAttr17": "",
                "lotnoTextAttr12": "",
                "lotnoTextAttr11": "",
                "lotnoDateAttr20": -2209017600000,
                "lotnoTextAttr14": "",
                "lotnoTextAttr13": "",
                "lotnoTextAttr19": "",
                "lotnoTextAttr10": "",
                "dualUnitId": 29,
                "lotnoLookupAttr5": 0,
                "lotnoLookupAttr6": 0,
                "lotnoLookupAttr7": 0,
                "lotnoDateAttr18": -2209017600000,
                "lotnoLookupAttr8": 0,
                "lotnoDateAttr19": -2209017600000,
                "lotno": "XXXXXXXXXXXOS0160069-01",
                "lotnoLookupAttr9": 0,
                "proId": 26,
                "lotnoDateAttr12": -2209017600000,
                "lotnoDateAttr13": -2209017600000,
                "lotnoDateAttr10": -2209017600000,
                "lotnoDateAttr11": -2209017600000,
                "lotnoTextAttr20": "",
                "lotnoLookupAttr1": 0,
                "lotnoDateAttr16": -2209017600000,
                "lotnoLookupAttr2": 0,
                "lotnoDateAttr17": -2209017600000,
                "lotnoLookupAttr3": 0,
                "lotnoDateAttr14": -2209017600000,
                "lotnoLookupAttr4": 3,
                "lotnoDateAttr15": -2209017600000
            }
        ],
        "mainpret": [
            {
                "lastModifyUid": 11,
                "useAccess": false,
                "virDeptId": 0,
                "expiredDate": -2209017600000,
                "position_zh-CN": "",
                "sysJson": "",
                "viewCode": "pret",
                "beId": 11,
                "useAccessBl": false,
                "id": 88,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648621488000,
                "createUid": 11,
                "rev": "1",
                "lastApproveUid": 11,
                "ttlCharge": 0,
                "completed": false,
                "expiredUid": 0,
                "freeQtyPer": 0,
                "descOrigin": "POLAST",
                "position_en": "",
                "position_zh-TW": "",
                "venId": 592,
                "i18nField": "{\"position_zh-CN\": \"\"}",
                "manId": 0,
                "ttlAmt": 6,
                "multiFlowSrcId": 0,
                "position": "",
                "flowTypeId": 1356,
                "status": "Y",
                "multiFlowFlowId": 0,
                "tDate": 1648569600000,
                "code": "ITPRET220330A",
                "cnDeptId": 29,
                "multiFlowSrcModule": "",
                "amt": 6,
                "iRev": 1,
                "upOrigin": "POLAST",
                "ce01Module": "pret",
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": 6,
                "printCount": 0,
                "statusModifyDate": 1648621488000,
                "locId": 7,
                "createDate": 1648621488000,
                "loadGpCoData": false,
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "multiFlowSrcBeId": 0,
                "position_haha1": "",
                "useAccessAutoCalc": false,
                "staffId": 723,
                "domAmtDiff": 0
            }
        ],
        "prett": [
            {
                "sourceId": 51,
                "unit2Id": 40,
                "dualQty": 1,
                "qty2": 0,
                "itemNo": "     1",
                "qty1": 1,
                "poLot": "",
                "beId": 11,
                "bDesc": "Lot no. can be duplicated",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 178,
                "up": 6,
                "dDesc_haha1": "",
                "isInventory": true,
                "hId": 88,
                "reDeliveryId": 0,
                "completed": false,
                "freeQtyPer": 0,
                "dDesc": "",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_zh-CN\": \"Lot no. can be duplicated\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "asi",
                "qty": 1,
                "invup": 6,
                "asnLot": "A",
                "disc": 0,
                "asnId": 51,
                "refCode": "",
                "lotNoId": 0,
                "dDesc_ctw": "",
                "unit1Id": 40,
                "costAmt": 0,
                "reDeliveryType": "",
                "amt": 6,
                "iRev": 1,
                "dDesc_zh-CN": "",
                "poId": 0,
                "bDesc_ctw": "",
                "ce01Module": "pret",
                "lot": "A",
                "bDesc_haha1": "",
                "reDeliveryLot": "",
                "dDesc_zh-TW": "",
                "domAmt": 6,
                "reShipType": "asi",
                "bDesc_ccn": "",
                "unitId": 40,
                "dDesc_ccn": "",
                "locId": 7,
                "bDesc_en": "",
                "reDelivery": false,
                "sourceCliId": 0,
                "dDesc_en": "",
                "dualUnitId": 29,
                "sourceLot": "A",
                "proId": 26,
                "qcId": 0,
                "bDesc_zh-CN": "Lot no. can be duplicated"
            }
        ],
        "rempret": [
            {
                "hId": 88,
                "heading_haha1": "",
                "heading_en": "",
                "heading_zh-TW": "",
                "heading": "",
                "remarks_ccn": "",
                "remarks_en": "",
                "heading_ctw": "",
                "iRev": 1,
                "heading_zh-CN": "",
                "ce01Module": "pret",
                "heading_ccn": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"remarks_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "remarks_haha1": "",
                "id": 88,
                "remarks_zh-TW": "",
                "remarks": "",
                "remarks_ctw": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# 保存采购退货

# 一、接口描述

​ 用于新增【采购退货】

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/save/pret
http请求方式 PUT
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 pret
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pret";
		String param = "&menuCode=pret";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity的JSON格式数据如下:

 {
    "mainpret": {
        "values": [
            {
                "beId": 11,
                "code": "ITPRET220325A",
                "venId": 108,
                "curId": 1,
                "rate": 1,
                "flowTypeId": 1356,
                "staffId": 723
            }
        ]
    },
    "prett": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 26,
                "locId": 7,
                "unitId": 40,
                "qty": 1
            }
        ]
    }
}

​ 4、返回示例

{
	"recordId": 86,
	"messages": [],
	"status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "必填项为空",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}

# 新增采购退货(自动补全)

# 一、接口描述

​ 1. 用于新增【采购退货】

​ 2. 此接口方法有如下特点:

​ a. 支持使用code 替代 id 栏位

​ b. 货币栏位未填时,自动使用本位币

​ c. 职员栏位未填时,自动使用个人选项中的默认职员

​ d. 单据日期未填时,根据贸易参数设定中的日期选项取值

​ e. 业务流程未填时,根据[业务流程设置(贸易)]中设定的默认值

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/erp/bsFlow/save/pret
http请求方式 POST
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pret";

		HttpPost post = new HttpPost(url);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

data数据示例

{
    "beCode": "IT",
    "venCode": "VIT001",
    "prett": [
        {
            "proCode": "ITPRO002",
            "unitCode": "PCS",
            "locCode": "SZO",
            "qty": 1
        }
    ]
}

​ 4、返回示例

{
  "tranId": 87,
  "tranCode": "PRE220001",
  "message": "",
  "status": true
}

# 删除采购退货

# 一、接口描述

​ 用于删除采购退货

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/delete/pret
http请求方式 DELETE
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 pret
id long(Query) 是 采购退货的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pret";
		String param = "&menuCode=pret&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "单据已被删除",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# 读取EBI数据:采购退货列表

# 一、接口描述

​ 用于执行EBI[采购退货列表],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 8,
    "rows": [
        {
            "M_A_code": "ITPR16080001",
            "M_A_ttlDisc": "0.00",
            "M_A_amt": "87.00",
            "aiM18ReservedCol_dataIndex": 1,
            "M_A_tDate": "2016.08.23",
            "M_A_curId": "1",
            "M_A_ttlAmt": "87.00",
            "M_A_id": "4",
            "M_A_rate": "1.00000000",
            "VEN_A_code": "V0001",
            "M_A_curId_code": "R",
            "VEN_A_id": "1",
            "M_A_ttlCharge": "0.00"
        }
    ]
}

ebi1

# 读取EBI数据:采购退货报告

# 一、接口描述

​ 用于执行EBI[采购退货报告],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 7,
    "rows": [
        {
            "PRETT_A_sourceType": "Product / Material",
            "MAIN_multiFlowSrcId": "0",
            "aiM18ReservedCol_dataIndex": 1,
            "PRET_A_id": "5",
            "PRETT_A_qty": "10.0000",
            "MAIN_multiFlowSrcCode": "",
            "LOC_A_id": "1",
            "PRETT_A_unitId_code": "PCS",
            "LOT_A_lotno": "ITGRN16080001-01",
            "PRET_A_code": "ITPR16080002",
            "PRO_A_id": "8",
            "LOC_A_code": "PHY",
            "MAIN_multiFlowSrcModule": "",
            "PRO_A_code": "PRO004"
        }
    ]
}

ebi2

# 采购发票

# 获取采购发票列表

# 一、接口描述

​ 用于获取采购发票列表(同UI界面左侧的Search List数据)

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/search/search
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
stSearch String(Query) 是 pi
beId long(Query) 是 aiM18企业法人[部门]的ID
formatId long(Query) 否 aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。
startRow int(Query) 否 返回结果的开始行
endRow int(Query) 否 返回结果的结束行
quickSearchStr String(Query) 否 用于设定关键字查找数据

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=pi&beId=11";

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
		}
		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
  	"stSearch": "pi",
    "size": 6,
    "stSearchDisplay": "Purchase Invoice",
    "values": [
        {
            "code": "ITPI220328A",
            "tDate": "2022-03-28",
            "maintap.venId.ven.code": "2000C-014",
            "maintap.venId.ven.desc__lang": "Choi Hop Hong Co., Ltd",
            "venInvNo": "",
            "maintap.curId.cur.sym": "¥",
            "maintap.flowTypeId.flowtype.code": "PURCHASE",
            "maintap.flowTypeId.flowtype.desc": "Purchase Flow",
            "iRev": 1,
            "lastModifyDate": "2022-03-28 16:31:35",
            "maintap.lastModifyUid.simpleUser.desc__lang": "Ivan Tan",
            "id": 962,
            "st_desc": "ITPI220328A",
            "st_id": 962,
            "st_code": "ITPI220328A"
        }
  	]
}

# 读取采购发票

# 一、接口描述

​ 用于读取【采购发票】数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/read/pi
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 pi
id long(Query) 是 采购发票的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pi";
			String param = "&menuCode=pi&id=" + id;

			HttpGet get = new HttpGet(url + "?" + param);
			get.addHeader("authorization", access_token);
			get.addHeader("client_id", ClientID);
			res = client.execute(get);
			if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
				JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

				System.out.println(json);
			}

			get.releaseConnection();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (res != null) {
					res.close();
				}
				if (client != null) {
					client.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}

​ 4、返回示例

{
    "data": {
        "maintap": [
            {
                "useAccess": false,
                "virDeptId": 0,
                "accDesc_ccn": "",
                "installNo": 0,
                "expiredDate": -2209017600000,
                "AI1": 0,
                "AI2": 0,
                "sysJson": "",
                "AI3": 0,
                "AI4": 0,
                "viewCode": "pi",
                "accDesc": "",
                "AI5": 0,
                "AI6": 0,
                "AI7": 0,
                "AI8": 0,
                "AI9": 0,
                "useAccessBl": false,
                "id": 962,
                "position_ctw": "",
                "lastModifyDate": 1648456295000,
                "createUid": 11,
                "accDesc_ctw": "",
                "method": "cod",
                "acCompletedDate": -2209017600000,
                "completed": false,
                "freeQtyPer": 0,
                "descOrigin": "VENREF",
                "i18nField": "{\"accDesc_zh-CN\": \"\", \"position_zh-CN\": \"\"}",
                "dayOfMonth": 0,
                "accDesc_en": "",
                "manId": 0,
                "multiFlowSrcId": 0,
                "flowTypeId": 1356,
                "status": "Y",
                "weightUnit": "kg",
                "multiFlowFlowId": 0,
                "cnDeptId": 0,
                "jlTypeId": 0,
                "iRev": 1,
                "upOrigin": "POLAST",
                "aInvMonth": 0,
                "AI19": 0,
                "ce01Module": "pi",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "AI14": 0,
                "AI11": 0,
                "AI12": 0,
                "AI10": 0,
                "statusModifyDate": 1648456295000,
                "locId": 0,
                "createDate": 1648456295000,
                "loadNeed": true,
                "cp": 0,
                "useAccessWl": false,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "multiFlowSrcBeId": 0,
                "AI23": 0,
                "position_haha1": "",
                "AI20": 0,
                "AI21": 0,
                "useAccessAutoCalc": false,
                "domAmtDiff": 0,
                "cpDate": 1648396800000,
                "lastModifyUid": 11,
                "position_zh-CN": "",
                "accDesc_haha1": "",
                "eDiscRate": 0,
                "beId": 11,
                "comRate": 0,
                "AI30": 0,
                "locked": false,
                "showEarlyPayDisc": false,
                "fromModule": "",
                "rev": "1",
                "batchNo": "",
                "lastApproveUid": 11,
                "ttlCharge": 0,
                "acCompleted": false,
                "expiredUid": 0,
                "completedDate": -2209017600000,
                "position_en": "",
                "position_zh-TW": "",
                "venId": 108,
                "monthEndDate": 0,
                "ttlAmt": 10,
                "position": "",
                "venInvNo": "",
                "hpSetting": "dayAfterInv",
                "tDate": 1648396800000,
                "code": "ITPI220328A",
                "multiFlowSrcModule": "",
                "amt": 10,
                "accDesc_zh-TW": "",
                "depoAmt": 0,
                "curId": 1,
                "expired": false,
                "rate": 1,
                "domAmt": 10,
                "measUnit": "cbm",
                "printCount": 0,
                "domDepoAmt": 0,
                "accDesc_zh-CN": "",
                "loadGpCoData": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "attachmentCount": 0,
                "staffId": 723
            }
        ],
        "remtap": [
            {
                "tradeTerm_ccn": "",
                "tradeTerm_en": "",
                "shipMark": "",
                "heading_en": "",
                "shipMark_zh-CN": "",
                "tradeTerm_zh-CN": "",
                "shipMark_ctw": "",
                "remarks_en": "",
                "payTerm_en": "",
                "iRev": 1,
                "heading_zh-CN": "",
                "ce01Module": "pi",
                "tradeTerm": "",
                "heading_ccn": "",
                "payTerm_haha1": "",
                "payTerm_zh-TW": "",
                "remarks_haha1": "",
                "shipMark_en": "",
                "id": 962,
                "remarks_zh-TW": "",
                "particular_ccn": "",
                "hId": 962,
                "heading_haha1": "",
                "payTerm": "",
                "particular_en": "",
                "heading_zh-TW": "",
                "payTerm_ccn": "",
                "heading": "",
                "particular_haha1": "",
                "remarks_ccn": "",
                "particular_zh-TW": "",
                "heading_ctw": "",
                "tradeTerm_ctw": "",
                "particular": "",
                "tradeTerm_zh-TW": "",
                "shipMark_ccn": "",
                "tradeTerm_haha1": "",
                "particular_zh-CN": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\", \"particular_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "particular_ctw": "",
                "shipMark_haha1": "",
                "payTerm_zh-CN": "",
                "payTerm_ctw": "",
                "shipMark_zh-TW": "",
                "remarks": "",
                "remarks_ctw": ""
            }
        ],
        "apt": [
            {
                "unit2Id": 40,
                "qty2": 0,
                "AI1": 0,
                "AI2": 0,
                "AI3": 0,
                "AI4": 0,
                "AI5": 0,
                "qty1": 1,
                "AI6": 0,
                "AI7": 0,
                "AI8": 0,
                "AI9": 0,
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "id": 1431,
                "ctn": 0,
                "dDesc_haha1": "",
                "height": 0,
                "perCtn": 0,
                "completed": false,
                "freeQtyPer": 0,
                "passQty": 0,
                "i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "pro",
                "asnLot": "",
                "asnId": 0,
                "packingDesc": "",
                "innerQty": 0,
                "costAmt": 0,
                "iRev": 1,
                "poId": 0,
                "AI19": 0,
                "bDesc_ctw": "",
                "ce01Module": "pi",
                "lot": "A",
                "AI17": 0,
                "AI18": 0,
                "AI15": 0,
                "AI16": 0,
                "AI13": 0,
                "reShipType": "asi",
                "AI14": 0,
                "AI11": 0,
                "bDesc_ccn": "",
                "AI12": 0,
                "unitId": 40,
                "AI10": 0,
                "locId": 0,
                "bDesc_en": "",
                "scrapQty": 0,
                "sourceCliId": 0,
                "AI28": 0,
                "AI29": 0,
                "AI26": 0,
                "AI27": 0,
                "AI24": 0,
                "AI25": 0,
                "AI22": 0,
                "AI23": 0,
                "width": 0,
                "AI20": 0,
                "AI21": 0,
                "bDesc_zh-CN": "",
                "sourceId": 0,
                "scrapQty2": 0,
                "scrapQty1": 0,
                "dualQty": 0,
                "itemNo": "     1",
                "venDnNo": "",
                "poLot": "",
                "beId": 11,
                "passQty1": 0,
                "passQty2": 0,
                "bDesc": "",
                "up": 10,
                "AI30": 0,
                "isInventory": false,
                "hId": 962,
                "reDeliveryId": 0,
                "volume": 0,
                "dDesc": "",
                "footerKey": "",
                "qty": 1,
                "invup": 10,
                "disc": 0,
                "refCode": "",
                "lotNoId": 0,
                "dDesc_ctw": "",
                "unit1Id": 40,
                "reDeliveryType": "",
                "amt": 10,
                "nw": 0,
                "dDesc_zh-CN": "",
                "qup": 0,
                "packingUnitId": 0,
                "bDesc_haha1": "",
                "reDeliveryLot": "",
                "dDesc_zh-TW": "",
                "domAmt": 10,
                "innerUnitId": 0,
                "dDesc_ccn": "",
                "reDelivery": false,
                "length": 0,
                "dDesc_en": "",
                "dualUnitId": 29,
                "gw": 0,
                "sourceLot": "",
                "proId": 26,
                "qcId": 0
            }
        ]
    },
    "messages": [],
    "status": true
}

# 保存采购发票

# 一、接口描述

​ 用于新增【采购发票】

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/save/pi
http请求方式 PUT
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 pi
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pi";
		String param = "&menuCode=pi";

		HttpPut put = new HttpPut(url + "?" + param);
		put.addHeader("authorization", access_token);
		put.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		put.setEntity(entity);

		res = client.execute(put);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("recordId");
			}

			System.out.println(json);
		}

		put.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

Entity的JSON格式数据如下:

{
    "maintap": {
        "values": [
            {
                "beId": 11,
                "code": "ITPI220328A",
                "venId": 108,
                "curId": 1,
                "rate": 1,
                "flowTypeId": 1356,
                "staffId": 723
            }
        ]
    },
    "apt": {
        "values": [
            {
                "sourceType": "pro",
                "proId": 26,
                "unitId": 40,
                "qty": 1,
                "up": 10,
                "amt": 10
            }
        ]
    }
}

​ 4、返回示例

{
	"recordId": 962,
	"messages": [],
	"status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "必填项为空",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}

# 新增采购发票(自动补全)

# 一、接口描述

​ 1. 用于新增【采购发票】

​ 2. 此接口方法有如下特点:

​ a. 支持使用code 替代 id 栏位

​ b. 货币栏位未填时,自动使用本位币

​ c. 职员栏位未填时,自动使用个人选项中的默认职员

​ d. 单据日期未填时,根据贸易参数设定中的日期选项取值

​ e. 业务流程未填时,根据[业务流程设置(贸易)]中设定的默认值

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/erp/bsFlow/save/pi
http请求方式 POST
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pi";

		HttpPost post = new HttpPost(url);
		post.addHeader("authorization", access_token);
		post.addHeader("client_id", ClientID);

		StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
		entity.setContentEncoding("UTF-8");
		post.setEntity(entity);

		res = client.execute(post);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			if (json != null) {
				recordId = json.getLongValue("tranId");
			}
			System.out.println(json);
		}

		post.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

data数据示例

{
    "beCode": "IT",
    "venCode": "VIT001",
    "apt": [
        {
            "proCode": "ITPRO002",
            "unitCode": "PCS",
            "qty": 1
        }
    ]
}

​ 4、返回示例

{
  "tranId": 963,
  "tranCode": "PI0220206",
  "message": "",
  "status": true
}

# 删除采购发票

# 一、接口描述

​ 用于删除采购发票

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/root/api/delete/pi
http请求方式 DELETE
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
menuCode String(Query) 是 pi
id long(Query) 是 采购发票的id
param String(Query) 否 额外的系统参数;JSON字符串

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pi";
		String param = "&menuCode=pi&id=" + id;

		HttpDelete delete = new HttpDelete(url + "?" + param);
		delete.addHeader("authorization", access_token);
		delete.addHeader("client_id", ClientID);

		res = client.execute(delete);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		delete.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

​ 4、返回示例

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "单据已被删除",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# 读取EBI数据:采购发票列表

# 一、接口描述

​ 用于执行EBI[采购发票列表],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 6,
    "rows": [
        {
            "M_A_code": "ITPI17060001",
            "M_A_ttlAmt": "500.00",
            "M_A_amt": "490.00",
            "M_A_id": "60",
            "M_A_rate": "1.00000000",
            "aiM18ReservedCol_dataIndex": 1,
            "VEN_A_code": "V0001",
            "M_A_curId_code": "R",
            "M_A_depoAmt": "0.00",
            "M_A_tDate": "2017.06.23",
            "M_A_curId": "1",
            "VEN_A_id": "1"
        }
    ]
}

ebi1

# 读取EBI数据:采购发票报告

# 一、接口描述

​ 用于执行EBI[采购发票报告],返回EBI数据

# 二、接口调用说明

​ 1、请求说明

URL http://[server]/jsf/rfws/ebiWidget/loadReport
http请求方式 GET
编码类型 UTF-8

​ 2、URL参数

参数 类型 必填 说明
authorization String(Header) 是 OAuth获取的Access Token
client_id String(Header) 是 aiM18[授权应用列表]中的Client ID
formatId long(Query) 是 通过EBI接口获取到formatId
beId long(Query) 否 企业法人的ID。若不传,则查询所有有权限的BE数据
offset int(Query) 否 返回结果的开始行
rows int(Query) 否 返回结果的结束行

​ 3、请求示例

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
		String param = "&formatId=" + formatId;

		HttpGet get = new HttpGet(url + "?" + param);
		get.addHeader("authorization", access_token);
		get.addHeader("client_id", ClientID);
		res = client.execute(get);
		if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
			JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));

			System.out.println(json);
		}

		get.releaseConnection();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		try {
			if (res != null) {
				res.close();
			}
			if (client != null) {
				client.close();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}				

​ 4、返回示例

{
    "size": 7,
    "rows": [
        {
            "APT_A_unitId_code": "PCS",
            "M_A_code": "ITPI17060001",
            "M_A_id": "60",
            "aiM18ReservedCol_dataIndex": 1,
            "APT_A_amt": "500.00",
            "APT_A_qty": "5.0000",
            "M_A_tDate": "2017.06.23",
            "APT_A_up": "100.0000",
            "PRO_A_code": "ITPRO002",
            "PRO_A_id": "26"
        }
    ]
}

ebi2

Last Updated: 2025/04/09, 02:58:38
贸易和财务
销售

← 贸易和财务 销售→

Theme by Vdoing | Copyright © 1990-2025 Multiable | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式