|
|
@@ -30,6 +30,7 @@ using System.Security.Principal;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Web;
|
|
|
+using System.Web.Routing;
|
|
|
using Utils.Serialization;
|
|
|
using static SiteCore.taoObj.dataShopResponseVo;
|
|
|
using static SiteCore.taoObj.dataSpuInfoResponseVo;
|
|
|
@@ -366,7 +367,7 @@ namespace SiteCore.Handler
|
|
|
string post_url = "http://api.presales.lingtao8.com/open/order/generateSplitOrderUniqueNos/1";
|
|
|
try
|
|
|
{
|
|
|
- string remoteInfo = httpSaleContent(post_url, "");
|
|
|
+ string remoteInfo = httpSaleContent(HttpMethod.Get, post_url, new Dictionary<string, string>());
|
|
|
saleOrderResponse dataTokenBean = JsonConvert.DeserializeObject<saleOrderResponse>(remoteInfo);
|
|
|
if ("200".Equals(dataTokenBean.code))
|
|
|
{
|
|
|
@@ -379,6 +380,32 @@ namespace SiteCore.Handler
|
|
|
return orderSn;
|
|
|
}
|
|
|
|
|
|
+ public static void api_orderBack(string orderNumber, string state, string content)
|
|
|
+ {
|
|
|
+ string post_url = "http://api.presales.lingtao8.com/open/order/orderProcessReturn";
|
|
|
+ //string post_url = "http://admin.lingtao.zmht888.com/prod-api/open/order/orderProcessReturn";
|
|
|
+ string remoteInfo = "";
|
|
|
+ string param = JsonConvert.SerializeObject(new
|
|
|
+ {
|
|
|
+ orderSplitNo = orderNumber,
|
|
|
+ errorStatus = state,
|
|
|
+ reason = content
|
|
|
+ });
|
|
|
+ Dictionary<string, string> map = new Dictionary<string, string>();
|
|
|
+ map.Add("orderSplitNo", orderNumber);
|
|
|
+ map.Add("errorStatus", state);
|
|
|
+ map.Add("reason", content);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ remoteInfo = httpSaleContent(HttpMethod.Post, post_url, map);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ XLog.SaveLog(0, "api_orderBack:" + ex.Message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static string getToken()
|
|
|
{
|
|
|
//return "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsiYXBpIl0sInNjb3BlIjpbInJlYWQiLCJ3cml0ZSJdLCJleHAiOjE3MzU5NjU0ODAsImF1dGhvcml0aWVzIjpbIm9wZW5hcGkiXSwianRpIjoiYjY4NTRhZjctZjNmMy00OTU0LTk4ZmUtZDRlZTE4ZDllNzQyIiwiY2xpZW50X2lkIjoieGNsaWVudCJ9.E6U0NVMZPcUypl4P7L5718J1X8UxSJg9R7vZX_oMkuEJ-yelNXuYwu7-eAi1JTgIJ0GuuviQu-KEAH-W7sHb7t-JJJc-wLPMsLKmpwQDG2EpiRK5hW5ZmyUgL8rPuTUawKVP5k8SGrN60sVyXA2zKm4ztEQ39EGudXnam1Lld2w";
|
|
|
@@ -943,17 +970,21 @@ namespace SiteCore.Handler
|
|
|
|
|
|
static HttpClient client = new HttpClient();
|
|
|
|
|
|
- private static string httpSaleContent(string post_url, string content)
|
|
|
+ private static string httpSaleContent(HttpMethod httpMethod, string post_url, Dictionary<string, string> map)
|
|
|
{
|
|
|
var request = new HttpRequestMessage
|
|
|
{
|
|
|
- Method = HttpMethod.Get,
|
|
|
+ Method = httpMethod,
|
|
|
RequestUri = new Uri(post_url),
|
|
|
Headers =
|
|
|
{
|
|
|
{ "token", "Zk2ncXqH8hFyA6Rj"},
|
|
|
}
|
|
|
};
|
|
|
+ if (map.Keys.Count > 0)
|
|
|
+ {
|
|
|
+ request.Content = new FormUrlEncodedContent(map);
|
|
|
+ }
|
|
|
|
|
|
var task = Task.Run(() =>
|
|
|
{
|