|
|
@@ -384,6 +384,107 @@ namespace SiteCore.Handler
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
+ //http://47.114.150.226:88/Handler/dataHelper.ashx?t=set_sys_price post请求参数(参数放body中):string tid(淘宝订单号)
|
|
|
+ public void set_sys_price()
|
|
|
+ {
|
|
|
+ string data = GetPostString("data");
|
|
|
+ if (!string.IsNullOrEmpty(data))
|
|
|
+ {
|
|
|
+ List<SysPriceResponseVo> list = JsonConvert.DeserializeObject<List<SysPriceResponseVo>>(data);
|
|
|
+ foreach (SysPriceResponseVo item in list)
|
|
|
+ {
|
|
|
+ string ordersn = item.ordersn;
|
|
|
+ double price = item.price;
|
|
|
+ string sysPriceContent = item.sysContent;
|
|
|
+
|
|
|
+
|
|
|
+ CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCode(ordersn);
|
|
|
+ if (ceErpTradeCell == null)
|
|
|
+ {
|
|
|
+ ceErpTradeCell = CeErpTradeCell.GetByCtid(ordersn);
|
|
|
+ }
|
|
|
+ if (ceErpTradeCell == null)
|
|
|
+ {
|
|
|
+ returnErrorMsg("查无订单");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ CeErpTradeCellExtend ce = CeErpTradeCellExtend.getByTid(ceErpTradeCell.ctid);
|
|
|
+ if (ce == null)
|
|
|
+ {
|
|
|
+ ce = new CeErpTradeCellExtend();
|
|
|
+ ce.ctid = ceErpTradeCell.ctid;
|
|
|
+ }
|
|
|
+ ce.sysPrice = price;
|
|
|
+ ce.sysPriceContent = sysPriceContent;
|
|
|
+ string sql = string.Format("select ptid,payment from CE_ErpTradeCell where ptid ='{0}' and IsSample = 2", ceErpTradeCell.tid);
|
|
|
+ DataTable dt_price = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
+ if (dt_price != null && dt_price.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ double diffPirce = 0;
|
|
|
+ foreach (DataRow dr in dt_price.Rows)
|
|
|
+ {
|
|
|
+ if (Convert.IsDBNull(dr["payment"]))
|
|
|
+ {
|
|
|
+ diffPirce += Convert.ToDouble(dr["payment"]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ce.differentAmount = diffPirce;
|
|
|
+ }
|
|
|
+ if (ce.ID != 0)
|
|
|
+ {
|
|
|
+ ce.Update();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ce.Create();
|
|
|
+ }
|
|
|
+ returnSuccessMsg("修改成功!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ returnErrorMsg("缺少必要参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void get_sys_price(CeErpTradeCell ceErpTradeCell)
|
|
|
+ {
|
|
|
+ CeErpProduct product = CeErpProduct.GetById(ceErpTradeCell.ProductId);
|
|
|
+ string param = "[{ \"product_type\": \"" + product.PType + "\", \"remark\": \"" + ceErpTradeCell.seller_memo + "\" }]";
|
|
|
+ string result = sysHttpClient(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static string sysHttpClient(string param)
|
|
|
+ {
|
|
|
+ var client = new HttpClient();
|
|
|
+ var request = new HttpRequestMessage
|
|
|
+ {
|
|
|
+ Method = HttpMethod.Post,
|
|
|
+ RequestUri = new Uri("http://47.122.57.102:11004/quotations/batch"),
|
|
|
+ Content = new StringContent(param)
|
|
|
+ {
|
|
|
+ Headers =
|
|
|
+ {
|
|
|
+ ContentType = new MediaTypeHeaderValue("application/json")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var task = Task.Run(() =>
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var response = client.SendAsync(request).Result;
|
|
|
+ response.EnsureSuccessStatusCode();
|
|
|
+ return response.Content.ReadAsStringAsync().Result;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+ return task.Result;
|
|
|
+ }
|
|
|
|
|
|
public void getOrderInvoiceInfo()
|
|
|
{
|