|
|
@ -16,6 +16,7 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
|
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -264,20 +265,33 @@ public class RechargeConfig { |
|
|
|
* @Param object |
|
|
|
* @Param object |
|
|
|
* @return com.alibaba.fastjson.JSONObject |
|
|
|
* @return com.alibaba.fastjson.JSONObject |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static JSONObject rechargeOrderByJn(JSONObject object) throws Exception{ |
|
|
|
public static JSONObject rechargeOrderByJn(JSONObject object){ |
|
|
|
|
|
|
|
try { |
|
|
|
log.info("发起简牛下单表"); |
|
|
|
log.info("发起简牛下单表"); |
|
|
|
Map<String,Object> paramMap = new HashMap<>(); |
|
|
|
Map<String,Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("appid" , CommonSysConst.getSysConfig().getJnApiKey()); |
|
|
|
paramMap.put("appid" , CommonSysConst.getSysConfig().getJnApiKey()); |
|
|
|
paramMap.put("account" , object.getBigDecimal("price")); |
|
|
|
paramMap.put("account" , object.getString("phone")); |
|
|
|
paramMap.put("goods_id" , object.getBigDecimal("goodsId")); |
|
|
|
paramMap.put("option_id" , object.getString("option_id")); |
|
|
|
paramMap.put("order_no" , object.getBigDecimal("orderNo")); |
|
|
|
paramMap.put("order_no" , object.getString("orderNo")); |
|
|
|
paramMap.put("option_id" , object.getBigDecimal("optionId")); |
|
|
|
paramMap.put("goods_id" , "136"); |
|
|
|
paramMap.put("notify_url" , CommonSysConst.getSysConfig().getJnNotifyUrl()); |
|
|
|
paramMap.put("notify_url" , URLEncoder.encode(CommonSysConst.getSysConfig().getJnNotifyUrl(), "UTF-8")); |
|
|
|
paramMap.put("sign", WxUtils.generateSignApi(paramMap , CommonSysConst.getSysConfig().getJnAppSecret() , WXPayConstants.SignType.MD5 , false)); |
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> paramMaps = new HashMap<>(); |
|
|
|
|
|
|
|
paramMaps.put("appid" , CommonSysConst.getSysConfig().getJnApiKey()); |
|
|
|
|
|
|
|
paramMaps.put("account" , object.getString("phone")); |
|
|
|
|
|
|
|
paramMaps.put("option_id" , object.getString("option_id")); |
|
|
|
|
|
|
|
paramMaps.put("order_no" , object.getString("orderNo")); |
|
|
|
|
|
|
|
paramMaps.put("goods_id" , "136"); |
|
|
|
|
|
|
|
paramMaps.put("notify_url" , CommonSysConst.getSysConfig().getJnNotifyUrl()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
paramMaps.put("sign", WxUtils.generateSignApi(paramMap , CommonSysConst.getSysConfig().getJnAppSecret() , WXPayConstants.SignType.MD5 , false)); |
|
|
|
log.info("发起简牛下单-请求参数: " + JSON.toJSONString(paramMap)); |
|
|
|
log.info("发起简牛下单-请求参数: " + JSON.toJSONString(paramMap)); |
|
|
|
JSONObject jsonObject = HttpsUtils.doPost(CommonSysConst.getSysConfig().getJnPostUrl()+ "/modules/api/open/order-create", paramMap , new HashMap<>()); |
|
|
|
JSONObject jsonObject = HttpsUtils.doPost(CommonSysConst.getSysConfig().getJnPostUrl()+ "/modules/api/open/order-create", paramMaps , new HashMap<>()); |
|
|
|
log.info("发起简牛下单-响应参数: " + jsonObject.toJSONString()); |
|
|
|
log.info("发起简牛下单-响应参数: " + jsonObject.toJSONString()); |
|
|
|
return jsonObject; |
|
|
|
return jsonObject; |
|
|
|
|
|
|
|
}catch (Exception e) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|