// 請求URL
String httpUrl = "https://tch.xunkuyun.com/vcrm/script/api/exec";
// MD5密鑰
String md5Passwsword = "44703afbe00a4ab785c7a70a976a5189";
// 13位時間戳
String timestamp = LocalDateTime.now(ZoneOffset.ofHours(8)).toInstant(ZoneOffset.ofHours(8)).toEpochMilli() + "";
Map<String, String> paramMap = new HashMap<>();
// 共通參數
paramMap.put("apikey", "quote.getTechniqueList"); // 請求接口KEY,如工序列表
paramMap.put("companyid", "5010770"); // 企業ID,訪問詳情頁面時會傳入
paramMap.put("userid", "myy@xunkukeji.com"); // 用戶ID,訪問詳情頁面時會傳入
paramMap.put("timestamp", timestamp);
// 其他參數
paramMap.put("reqStyle", "PC"); // 請求方式 PC/H5
// 生成加密串
String signStr = Utils.createLinkStr(paramMap) + md5Passwsword;
paramMap.put("apisign", UtilMD5.MD5EncodeUTF8(signStr)); // 簽名處理
// 接口請求
String respStr = xkhttp.sendGet(paramMap, httpUrl);
System.out.println("請求參數:" + httpUrl + "..." + paramMap.toString());
System.out.println("請求結果:" + respStr);
/**
* 把數組所有元素排序,并按照“參數=參數值”的模式用“&”字符拼接成字符串
*
* @param pMap 數據
* @return 拼接之后字符串
*/
public static String createLinkStr(Map<String, ?> pMap) {
if (!mapIsNotEmpty(pMap)) {
return "";
}
TreeMap<String, Object> treeMap = new TreeMap<String, Object>();
for (Map.Entry<String, ?> entry : pMap.entrySet()) {
treeMap.put(entry.getKey(), entry.getValue());
}
StringBuffer sb = new StringBuffer();
for (Map.Entry<String, ?> entry : treeMap.entrySet()) {
sb.append(entry.getKey()).append(Const.EQUAL)
.append(UtilStr.encode(UtilBase.getObjectStrValue(entry.getValue()))).append(Const.AND);
}
String sSignStr = sb.toString();
sSignStr = sSignStr.substring(0, sSignStr.length() - 1);
return sSignStr;
}
- 消息推送
- 查詢接口
- 終端信息
- 字典管理
- 班組信息
- 車間信息
- 設備信息
- 工序工價(月度)
- 物料分類
- 工序信息
- 字典明細
- 物料信息
- 生產任務單
- 大貨工藝單
- 物料領用清單(MRP運算)
- 物料領用清單(出庫后)
- 質檢方案
- 倉庫信息
- 線邊倉物料庫存信息
- 委外類型
- 委外訂單(新增/變更/返工完成/返工取消)
- 委外訂單明細(暫不用)
- 委外報工統計
- 銷售訂單信息
- 包裝訂單單箱SKU信息
- 獲取已掃描入庫條碼
- 普通倉物料庫存信息
- 工時工價維護
- 委外報工統計V2
- 工時工價維護V2
- 獲取發染色/回染數
- 物料領用清單(已出庫匯總)
- 多版本款式需求查詢
- 多版本款式工序查詢
- 委托生產工單信息
- 委外收貨質檢結果
- 包裝入庫信息查詢
- 委外收貨發起入庫分筐制碼
- 織造下機參數錄入
- 半檢報工數據匯總
- 按照款式訂單維度獲取色紗信息
- 委外收貨(筐)_瑞澤
- 領料出庫單號推送
- 領料出庫單明細
- 領料出庫單條碼
- 尺碼表【瑞澤】
- 加工商信息【瑞澤】
- 委外發貨筐信息 【知音】
- 委外工序質檢明細【知音】
- 包裝類型入庫單推送
- 結賬數據
- 裝箱入庫類型 入庫單推送【棉田】
- 包裝入庫類型 入庫單據推送【知音】
- 接口交互方式
- 杭宏報價單
- 數據字典
- 用戶列表
- 工序列表
- 報價單列表
- 報價單詳情
- 提交報價單
- 報價單詳情(有縫)
- 提交報價單(有縫)
- 客戶名稱列表
- 款號列表
- 報價確認/取消確認