From 69fe613f7b6c3cc0c3ea6a5d6ada0a313cf91389 Mon Sep 17 00:00:00 2001 From: xyiege Date: Fri, 21 Oct 2022 09:16:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=B3=E8=AF=B7=E5=90=88?= =?UTF-8?q?=E7=BA=A6=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/chjyj/szwh/utils/SzwhApiUtils.java | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/main/java/cn/chjyj/szwh/utils/SzwhApiUtils.java b/src/main/java/cn/chjyj/szwh/utils/SzwhApiUtils.java index b153a16..490b5ef 100644 --- a/src/main/java/cn/chjyj/szwh/utils/SzwhApiUtils.java +++ b/src/main/java/cn/chjyj/szwh/utils/SzwhApiUtils.java @@ -3,6 +3,7 @@ package cn.chjyj.szwh.utils; import cn.chjyj.szwh.service.impl.UserServiceImpl; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; +import jdk.nashorn.internal.scripts.JO; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -151,16 +152,51 @@ public class SzwhApiUtils { * distribute 同步订单数据 * @return */ - public static JSONObject synchInfo(){ + public static JSONObject synchInfo(JSONObject postJson){ String entHost= ProperUtils.getSzwhProp("REAL_URL");//委托系统主机 String url=entHost+"/dist/api/v1/synchInfo"; // 使用的token String sign=SignUtils.createSign("distribute"); - System.out.println(sign); Map hmap = new HashMap(); hmap.put("dist_token",sign); hmap.put("Content-Type","application/json"); - JSONObject json = RequestUtils.postData(url,"",hmap); + JSONObject json = RequestUtils.postData(url,postJson.toString(),hmap); + return json; + } + + /** + * 请求申请合约关联编码 接口1.5 + * @param goodsIsli + * @param buyIslicode + * @param ratio + * @param date + * @param batchcode + * @return + */ + public static JSONObject getApplyLinkCode(String goodsIsli,String buyIslicode,String ratio, + int count,String date,String batchcode){ + //渠道用户 + String channelUser=ProperUtils.getSzwhProp("CHANNEL_ISLI"); + String tlangHost= ProperUtils.getSzwhProp("TIANLANG_ENTRUST_URL"); + String url=tlangHost+"/consignation/v1/applylinkcode"; + // 使用的token + String sign=SignUtils.createSign("apply_code"); + Map hmap = new HashMap(); + hmap.put("cloudhub_token",sign); + hmap.put("Content-Type","application/json"); + hmap.put("channel_isli_flag",channelUser); + // 发送参数 + Map postMap = new HashMap(); + postMap.put("contractISLIFlag",goodsIsli); + postMap.put("buyerISLIFlag",buyIslicode); + postMap.put("shareProportion",ratio); + postMap.put("purchaseQuantity",count); + postMap.put("authorizationDate",date); + // convet to json string + JSONObject postJson = new JSONObject(postMap); + log.info(batchcode+"订单获取合约关联编码请求参数:"+postJson); + JSONObject json = RequestUtils.postData(url,postJson.toString(),hmap); + log.info(batchcode+"订单获取合约关联编码"+json); return json; } }