designHelper.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. using BizCom;
  2. using Newtonsoft.Json;
  3. using NPOI.POIFS.Properties;
  4. using NPOI.SS.Formula.Functions;
  5. using SiteCore.Handler;
  6. using SiteCore.taoObj;
  7. using SQLData;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Collections.Specialized;
  11. using System.Data;
  12. using System.Linq;
  13. using System.Net;
  14. using System.Net.Http;
  15. using System.Reflection;
  16. using System.Runtime.Remoting.Messaging;
  17. using System.Runtime.Remoting.Metadata.W3cXsd2001;
  18. using System.Security.Policy;
  19. using System.Text;
  20. using System.Text.RegularExpressions;
  21. using System.Threading.Tasks;
  22. using System.Web;
  23. using static NHibernate.Linq.Visitors.LeftJoinDetector;
  24. using static SiteCore.taoObj.work_core_vo;
  25. namespace SiteCore.Handler
  26. {
  27. public class designHelper : BaseHandler, IHttpHandler
  28. {
  29. public void ProcessRequest(HttpContext context)
  30. {
  31. if (UrlParmsCheck("t"))
  32. {
  33. String tname = GetString("t");
  34. MethodInfo method;
  35. Type type = this.GetType();
  36. method = type.GetMethod(tname);
  37. con = context;
  38. if (method == null)
  39. {
  40. conError("找不到对应方法,服务器返回错误");
  41. return;
  42. }
  43. successFlag = false;
  44. context.Response.ContentType = "application/json";
  45. context.Response.Headers.Set("Access-Control-Allow-Origin", "*");
  46. try
  47. {
  48. method.Invoke(this, null);
  49. }
  50. catch (Exception ex)
  51. {
  52. conError("处理接口错误,服务器返回错误");
  53. }
  54. finally
  55. {
  56. }
  57. }
  58. }
  59. static string baseUrl = "http://api.lingtao8.com/";
  60. static string test_baseUrl = "https://sj.lingtao8.com/";
  61. //static string test_baseUrl = "http://47.122.40.91:8181/";
  62. //static string baseUrl = "http://47.122.40.91:8099/";
  63. static string pUrl = baseUrl + "api/manager/";
  64. static HttpHelper tb_http = new HttpHelper();
  65. public static designApiResponseVo API_GetPrintData_CreateOrder(CeErpTradeCell ceErpTradeCell, string post = "")
  66. {
  67. if (ceErpTradeCell.IsSample == 2)
  68. {
  69. return new designApiResponseVo(-1, "补差价订单不需要过设计系统");
  70. }
  71. string post_url = pUrl + "createOrder";
  72. CeErpOrderFormData formData = null;
  73. if (post != "SysAdmin" && post != "Summarize")
  74. {
  75. if (!ceErpTradeCell.ctid.Contains("S_"))
  76. {
  77. formData = CeErpOrderFormData.GetByTid(ceErpTradeCell.ctid.ToString());
  78. if (formData == null)
  79. {
  80. return new designApiResponseVo(-1, "请填写订单的手机号或者微信号才可指派到设计系统");
  81. }
  82. }
  83. }
  84. designApiResponseVo response = commonHelper.checkOrderDesignInfo(ceErpTradeCell, post);
  85. if (response.code != 200)
  86. {
  87. return response;
  88. }
  89. WebClient wc = new WebClient();
  90. wc.Encoding = Encoding.GetEncoding("utf-8");
  91. //json参数
  92. NameValueCollection PostVars = getParams(ceErpTradeCell);
  93. if (ceErpTradeCell.CustomerUserId > 0)
  94. {
  95. string sql = "select top 1 Name,Mobile from view_ErpUser where ID = '" + ceErpTradeCell.CustomerUserId + "'";
  96. DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
  97. PostVars.Add("customerName", dt.Rows[0]["Name"].ToString());
  98. PostVars.Add("customerTel", dt.Rows[0]["Mobile"].ToString());
  99. }
  100. //{"msg":"推送成功","code":200,"success":true}
  101. string result = "";
  102. try
  103. {
  104. byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
  105. string remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
  106. response = JsonConvert.DeserializeObject<designApiResponseVo>(remoteInfo);
  107. result = "设计共创:失败-" + response.msg;
  108. if (response.code == 200)
  109. {
  110. result = "设计共创:成功";
  111. CeErpSukuraData.createInfo(ceErpTradeCell.ctid, 2);
  112. //commonHelper.updateDataTradeCellDesignInfo(ceErpTradeCell.ctid);
  113. }
  114. }
  115. catch (Exception ex)
  116. {
  117. XLog.SaveLog(0, "API_GetPrintData_CreateOrder:" + ex.Message);
  118. }
  119. return new designApiResponseVo(200, result);
  120. }
  121. public static designApiResponseVo API_update_order(CeErpTradeCell ceErpTradeCell)
  122. {
  123. string post_url = pUrl + "workCore";
  124. WebClient wc = new WebClient();
  125. wc.Encoding = Encoding.GetEncoding("utf-8");
  126. NameValueCollection PostVars = getParams(ceErpTradeCell);
  127. PostVars.Add("actionName", "orderRemarks");
  128. PostVars.Add("orderNumber", ceErpTradeCell.ctid);
  129. string result = "";
  130. try
  131. {
  132. byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
  133. string remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
  134. designApiResponseVo response = JsonConvert.DeserializeObject<designApiResponseVo>(remoteInfo);
  135. result = "设计共创:失败-" + response.msg;
  136. if (response.code == 200)
  137. {
  138. result = "设计共创:成功";
  139. CeErpSukuraData.createInfo(ceErpTradeCell.ctid, 2);
  140. //commonHelper.updateDataTradeCellDesignInfo(ceErpTradeCell.ctid);
  141. }
  142. }
  143. catch (Exception ex)
  144. {
  145. XLog.SaveLog(0, "API_GetPrintData_CreateOrder:" + ex.Message);
  146. }
  147. return new designApiResponseVo(200, result);
  148. }
  149. public static designApiResponseVo API_update_renewOrder(CeErpTradeCell ceErpTradeCell)
  150. {
  151. string post_url = pUrl + "renewOrder";
  152. WebClient wc = new WebClient();
  153. wc.Encoding = Encoding.GetEncoding("utf-8");
  154. NameValueCollection PostVars = getParams(ceErpTradeCell);
  155. PostVars.Add("actionName", "orderRemarks");
  156. PostVars.Add("orderNumber", ceErpTradeCell.ctid);
  157. string result = "";
  158. try
  159. {
  160. byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
  161. string remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
  162. designApiResponseVo response = JsonConvert.DeserializeObject<designApiResponseVo>(remoteInfo);
  163. result = "设计共创:失败-" + response.msg;
  164. if (response.code == 200)
  165. {
  166. result = "设计共创:成功";
  167. CeErpSukuraData.createInfo(ceErpTradeCell.ctid, 2);
  168. //commonHelper.updateDataTradeCellDesignInfo(ceErpTradeCell.ctid);
  169. }
  170. }
  171. catch (Exception ex)
  172. {
  173. XLog.SaveLog(0, "API_update_renewOrder:" + ex.Message);
  174. }
  175. return new designApiResponseVo(200, result);
  176. }
  177. private static NameValueCollection getParams(CeErpTradeCell ceErpTradeCell)
  178. {
  179. Boolean isOldCustomerText = false;
  180. Boolean isReturn = false;
  181. Boolean isGai = false;
  182. if (ceErpTradeCell.IsOldCustomer == 1)
  183. {
  184. isOldCustomerText = true;
  185. }
  186. if (ceErpTradeCell.IsReturn > 0)
  187. {
  188. isReturn = true;
  189. }
  190. if (ceErpTradeCell.MemoOpt == 1)
  191. {
  192. isGai = true;
  193. }
  194. CeErpTrade ceErpTrade = CeErpTrade.Get(ceErpTradeCell.tid);
  195. CeErpShop ceErpShop = CeErpShop.Get(ceErpTradeCell.ShopId);
  196. CeErpTradeCellExtend ceErpTradeCellExtend = CeErpTradeCellExtend.getByTid(ceErpTradeCell.ctid);
  197. //Dictionary<string, object> dataDic = ToDictionary(ro_json);
  198. //string urlData = ToUrlParams(dataDic);
  199. //string sql_pay = "INSERT INTO CE_ErpToDesignLog (ctid, ctime) VALUES ('" + ceErpTradeCell.ctid + "', '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
  200. //CeErpTradeCell.ExecuteNonQuery(sql_pay.ToString());
  201. NameValueCollection PostVars = new NameValueCollection();
  202. PostVars.Add("outId", ceErpTradeCell.ID.ToString());
  203. PostVars.Add("productId", ceErpTradeCell.ProductId.ToString());
  204. PostVars.Add("payment", ceErpTradeCell.payment.ToString());
  205. PostVars.Add("isUrgent", ceErpTradeCell.IsUrgency.ToString());
  206. PostVars.Add("customerMemo", ceErpTradeCell.CustomerMemo);
  207. PostVars.Add("shopName", ceErpShop.ShopName);
  208. PostVars.Add("buyerNick", ceErpTrade.buyer_nick != "" ? ceErpTrade.buyer_nick : "lingtao");
  209. PostVars.Add("receiverName", ceErpTrade.receiver_name);
  210. PostVars.Add("receiverMobile", ceErpTrade.receiver_mobile);
  211. PostVars.Add("receiverState", ceErpTrade.receiver_state);
  212. PostVars.Add("receiverCity", ceErpTrade.receiver_city);
  213. PostVars.Add("receiverDistrict", ceErpTrade.receiver_district);
  214. PostVars.Add("receiverAddress", ceErpTrade.receiver_address);
  215. PostVars.Add("tids", ceErpTradeCell.ctid);
  216. PostVars.Add("isOldUser", isOldCustomerText.ToString());
  217. PostVars.Add("sellerMemo", ceErpTradeCell.seller_memo);
  218. PostVars.Add("orderRemarks", ceErpTradeCell.seller_memo);
  219. PostVars.Add("isChange", isGai.ToString());
  220. PostVars.Add("isBack", isReturn.ToString());
  221. PostVars.Add("tid", ceErpTradeCell.tid);
  222. PostVars.Add("isDianziOrder", ceErpTradeCell.isDianziOrder.ToString());
  223. PostVars.Add("orderUnique", ceErpTradeCell.OrderSn);
  224. PostVars.Add("ptid", ceErpTradeCell.ptid);
  225. PostVars.Add("SplitTag", ceErpTradeCell.SplitTag);
  226. PostVars.Add("remarkSign", ceErpTradeCell.MemoOpt.ToString());
  227. PostVars.Add("otherMemo", ceErpTradeCell.OtherMemo);
  228. PostVars.Add("parentSplitNo", ceErpTradeCell.ParentSplitNo);
  229. if (ceErpTradeCellExtend != null)
  230. {
  231. PostVars.Add("productFirName", ceErpTradeCellExtend.cate1);/// 分类1
  232. PostVars.Add("productFirId", ceErpTradeCellExtend.cate1Id);/// 分类id
  233. PostVars.Add("productSecName", ceErpTradeCellExtend.cate2);/// 分类2
  234. PostVars.Add("productSecId", ceErpTradeCellExtend.cate2Id);/// 分类id
  235. PostVars.Add("productThirdId", ceErpTradeCellExtend.cate3Id);/// 分类id
  236. PostVars.Add("sceneName", ceErpTradeCellExtend.scene); /// 场景
  237. PostVars.Add("sceneId", ceErpTradeCellExtend.sceneId); /// 场景id
  238. PostVars.Add("productSizeW", ceErpTradeCellExtend.length.ToString()); /// 长
  239. PostVars.Add("productSizeH", ceErpTradeCellExtend.height.ToString()); /// 高
  240. PostVars.Add("productSizeL", ceErpTradeCellExtend.width.ToString()); /// 宽
  241. PostVars.Add("productCraftName", ceErpTradeCellExtend.craft); /// 工艺
  242. PostVars.Add("offerAmount", ceErpTradeCellExtend.offerAmount.ToString()); /// 报价金额
  243. PostVars.Add("styleCount", ceErpTradeCellExtend.numbers.ToString()); /// 款数
  244. PostVars.Add("materialName", ceErpTradeCellExtend.material); /// 材质
  245. PostVars.Add("materialId", ceErpTradeCellExtend.materialId); /// 材质id
  246. PostVars.Add("stylePricing", ceErpTradeCellExtend.numberType); /// 多款类型
  247. PostVars.Add("productSceneName", ceErpTradeCellExtend.typeScene); /// 品类场景
  248. PostVars.Add("productSceneId", ceErpTradeCellExtend.typeSceneId); /// 品类场景id
  249. PostVars.Add("opScene", ceErpTradeCellExtend.opScene); /// 运营场景
  250. PostVars.Add("opSceneId", ceErpTradeCellExtend.opSceneId); /// 运营场景id
  251. PostVars.Add("quantity", ceErpTradeCellExtend.quantity.ToString()); /// 数量
  252. PostVars.Add("productUnit", ceErpTradeCellExtend.numberUnit); /// 数量单位
  253. PostVars.Add("spuId", ceErpTradeCellExtend.spu_id); /// spuid
  254. PostVars.Add("recSize", ceErpTradeCellExtend.recSize); /// 推荐尺寸
  255. PostVars.Add("productSizeUnit", ceErpTradeCellExtend.sizeUnit); /// 尺寸单位
  256. PostVars.Add("orderFrom", ceErpTradeCellExtend.orderFrom.ToString()); /// 【订单来源】"10":第三方平台"15":私域电商"20":ERP"30":售前系统
  257. PostVars.Add("orderType", ceErpTradeCellExtend.orderType.ToString()); /// 【订单类型】"10":线上单"15":线下单"20":补差单"30":售后单
  258. PostVars.Add("discountAmount", ceErpTradeCellExtend.discountAmount.ToString());//折扣金额
  259. PostVars.Add("differentAmount", ceErpTradeCellExtend.differentAmount.ToString());//补差金额
  260. PostVars.Add("differentSplitNo", ceErpTradeCellExtend.differentSplitNo);//补差识别号
  261. }
  262. return PostVars;
  263. }
  264. /**
  265. *actionName:
  266. * followRemarks 跟单备注
  267. * orderRemarks 修改订单备注
  268. * rebutDesign 下单部打回设计单
  269. * afterDesign 售后设计单
  270. * changeDesign 改稿/定稿/加急
  271. * remarkSign 1改稿2定稿3加急
  272. * closeDesign 关闭订单
  273. * resetDesign 重置订单
  274. * packageDesign 顺丰状态
  275. * finishDesign 顺丰状态
  276. * approveDesign 下单部通过
  277. **/
  278. public static void API_WorkCore(string orderNumber, string actionName, string orderRemarks = "", int remarkSign = 0, string reasonRemarks = "", string isSf = "", int demandExamine = 0)
  279. {
  280. string post_url = pUrl + "workCore";
  281. WebClient wc = new WebClient();
  282. wc.Encoding = Encoding.GetEncoding("utf-8");
  283. NameValueCollection PostVars = new NameValueCollection();
  284. PostVars.Add("orderNumber", orderNumber);
  285. PostVars.Add("actionName", actionName);
  286. if (remarkSign > 0)
  287. {
  288. PostVars.Add("remarkSign", remarkSign.ToString());
  289. }
  290. if (orderRemarks != "")
  291. {
  292. PostVars.Add("orderRemarks", orderRemarks);
  293. }
  294. if (reasonRemarks != "")
  295. {
  296. PostVars.Add("reasonRemarks", reasonRemarks);
  297. }
  298. if (isSf != "")
  299. {
  300. PostVars.Add("packageSign", isSf);
  301. }
  302. if (demandExamine != 0)
  303. {
  304. PostVars.Add("demandExamine", demandExamine.ToString());
  305. }
  306. string remoteInfo = "";
  307. try
  308. {
  309. byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
  310. remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
  311. }
  312. catch (Exception ex)
  313. {
  314. XLog.SaveLog(0, "API_WorkCore:" + ex.Message);
  315. }
  316. }
  317. /**
  318. *actionName:
  319. * followRemarks 跟单备注
  320. * orderRemarks 修改订单备注
  321. * rebutDesign 下单部打回设计单
  322. * afterDesign 售后设计单
  323. * changeDesign 改稿/定稿/加急
  324. * remarkSign 1改稿2定稿3加急
  325. * closeDesign 关闭订单
  326. * resetDesign 重置订单
  327. * packageDesign 顺丰状态
  328. * finishDesign 上传设计
  329. * repairDesign 补差金额
  330. * approveDesign 下单部通过
  331. * afterOver 售后结束
  332. **/
  333. public static void API_WorkCore(ApiVo vo)
  334. {
  335. string post_url = pUrl + "workCore";
  336. WebClient wc = new WebClient();
  337. wc.Encoding = Encoding.GetEncoding("utf-8");
  338. NameValueCollection PostVars = new NameValueCollection();
  339. PostVars.Add("orderNumber", vo.orderNumber);
  340. PostVars.Add("actionName", vo.actionName);
  341. PostVars.Add("isDesign", vo.isDesign.ToString());
  342. PostVars.Add("isOriginal", vo.isOriginal.ToString());
  343. if (vo.remarkSign > 0)
  344. {
  345. PostVars.Add("remarkSign", vo.remarkSign.ToString());
  346. }
  347. if (vo.orderRemarks != "")
  348. {
  349. PostVars.Add("orderRemarks", vo.orderRemarks);
  350. }
  351. if (vo.reasonRemarks != "")
  352. {
  353. PostVars.Add("reasonRemarks", vo.reasonRemarks);
  354. }
  355. if (vo.isSf != "")
  356. {
  357. PostVars.Add("packageSign", vo.isSf);
  358. }
  359. if (vo.demandExamine != 0)
  360. {
  361. PostVars.Add("demandExamine", vo.demandExamine.ToString());
  362. }
  363. if (vo.payment != 0)
  364. {
  365. PostVars.Add("payment", vo.payment.ToString());
  366. }
  367. if (vo.designFree != 0)
  368. {
  369. PostVars.Add("designFree", vo.designFree.ToString());
  370. }
  371. if (vo.responsibleId != 0)
  372. {
  373. PostVars.Add("responsibleId", vo.responsibleId.ToString());
  374. }
  375. if (!string.IsNullOrEmpty(vo.afterFiles))
  376. {
  377. PostVars.Add("afterFiles", vo.afterFiles);
  378. }
  379. string remoteInfo = "";
  380. try
  381. {
  382. byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
  383. remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
  384. if ("orderRemarks".Equals(vo.actionName))
  385. {
  386. XLog.SaveLog(0, "API_WorkCore:" + remoteInfo + vo.actionName);
  387. }
  388. }
  389. catch (Exception ex)
  390. {
  391. XLog.SaveLog(0, "API_WorkCore:" + ex.Message);
  392. }
  393. }
  394. public static void api_approveDesign(string orderNumber)
  395. {
  396. string post_url = pUrl + "approveDesign";
  397. WebClient wc = new WebClient();
  398. wc.Encoding = Encoding.GetEncoding("utf-8");
  399. NameValueCollection PostVars = new NameValueCollection();
  400. PostVars.Add("orderNumber", orderNumber);
  401. string remoteInfo = "";
  402. try
  403. {
  404. byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
  405. remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
  406. }
  407. catch (Exception ex)
  408. {
  409. XLog.SaveLog(0, "api_approveDesign:" + ex.Message);
  410. }
  411. }
  412. /**
  413. *actionName:
  414. * refundIng 退款申请
  415. * refundEd 已退款
  416. * refundCancel 取消退款
  417. **/
  418. public static void API_refundOrder(string orderNumber, string actionName, string remark)
  419. {
  420. string post_url = pUrl + "refundOrder";
  421. WebClient wc = new WebClient();
  422. wc.Encoding = Encoding.GetEncoding("utf-8");
  423. NameValueCollection PostVars = new NameValueCollection();
  424. PostVars.Add("orderNumber", orderNumber);
  425. PostVars.Add("actionName", actionName);
  426. PostVars.Add("orderRemarks", remark);
  427. string remoteInfo = "";
  428. try
  429. {
  430. byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
  431. remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
  432. }
  433. catch (Exception ex)
  434. {
  435. XLog.SaveLog(0, "API_refundOrder:" + ex.Message);
  436. }
  437. }
  438. public static string API_CheckOrderTo(string orderNumber, string spuId)
  439. {
  440. string post_url = test_baseUrl + "api/originalOrder/discernOrder";
  441. System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // 根据需要选择合适的协议版本
  442. WebClient wc = new WebClient();
  443. wc.Encoding = Encoding.GetEncoding("utf-8");
  444. NameValueCollection PostVars = new NameValueCollection();
  445. PostVars.Add("orderNumber", orderNumber);
  446. PostVars.Add("spuId", spuId);
  447. string result = "无";
  448. try
  449. {
  450. byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
  451. string remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
  452. designApiResponseVo designApiResponseVo = JsonConvert.DeserializeObject<designApiResponseVo>(remoteInfo);
  453. if (designApiResponseVo.code == 200)
  454. {
  455. result = designApiResponseVo.msg;
  456. }
  457. }
  458. catch (Exception ex)
  459. {
  460. XLog.SaveLog(0, "API_refundOrder:" + ex.Message);
  461. }
  462. return result;
  463. }
  464. public static string API_GetPrintData_Refund(CeErpTradeCell ceErpTradeCell)
  465. {
  466. string post_url = pUrl + "refund";
  467. //json参数
  468. List<string> postLst = new List<string>();
  469. Boolean isOldCustomerText = false;
  470. Boolean isReturn = false;
  471. Boolean isGai = false;
  472. if (ceErpTradeCell.IsOldCustomer == 1)
  473. {
  474. isOldCustomerText = true;
  475. }
  476. if (ceErpTradeCell.IsReturn > 0)
  477. {
  478. isReturn = true;
  479. }
  480. if (ceErpTradeCell.MemoOpt == 1)
  481. {
  482. isGai = true;
  483. }
  484. CeErpTrade ceErpTrade = CeErpTrade.Get(ceErpTradeCell.tid);
  485. CeErpShop ceErpShop = CeErpShop.Get(ceErpTradeCell.ShopId);
  486. var res_obj = new
  487. {
  488. outId = ceErpTradeCell.ID,
  489. productId = ceErpTradeCell.ProductId,
  490. payment = ceErpTradeCell.payment,
  491. isUrgent = ceErpTradeCell.IsUrgency,
  492. customerMemo = ceErpTradeCell.CustomerMemo,
  493. shopName = ceErpShop.ShopName,
  494. buyerNick = ceErpTrade.buyer_nick != "" ? ceErpTrade.buyer_nick : "lingtao",
  495. receiverName = ceErpTrade.receiver_name,
  496. receiverMobile = ceErpTrade.receiver_mobile,
  497. receiverState = ceErpTrade.receiver_state,
  498. receiverCity = ceErpTrade.receiver_city,
  499. receiverDistrict = ceErpTrade.receiver_district,
  500. receiverAddress = ceErpTrade.receiver_address,
  501. tids = ceErpTradeCell.ctid,
  502. isOldUser = isOldCustomerText,
  503. sellerMemo = ceErpTradeCell.seller_memo,
  504. isChange = isGai,
  505. isBack = isReturn,
  506. tid = ceErpTradeCell.tid
  507. };
  508. string ro_json = JsonConvert.SerializeObject(res_obj);
  509. //;***************************************************
  510. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
  511. HttpItem item = new HttpItem()
  512. {
  513. URL = post_url,
  514. Method = "POST",
  515. Postdata = ro_json
  516. };
  517. item.PostEncoding = Encoding.UTF8;
  518. HttpResult hResult = tb_http.GetHtml(item);
  519. return hResult.Html;
  520. }
  521. public static string API_GetPrintData_ModifyOrder(string tid, string seller_memo, Boolean isGai, Boolean isReturn, string returnReason = "")
  522. {
  523. string post_url = pUrl + "modify";
  524. //json参数
  525. List<string> postLst = new List<string>();
  526. CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(tid);
  527. CeErpShop ceErpShop = null;
  528. if (ceErpTradeCell != null)
  529. {
  530. ceErpShop = CeErpShop.Get(ceErpTradeCell.ShopId);
  531. }
  532. var res_obj = new
  533. {
  534. outId = tid,
  535. orderText = seller_memo,
  536. isChange = isGai,
  537. isBack = isReturn,
  538. returnReason = returnReason,
  539. };
  540. string ro_json = JsonConvert.SerializeObject(res_obj);
  541. //***************************************************
  542. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
  543. HttpItem item = new HttpItem()
  544. {
  545. URL = post_url,
  546. Method = "POST",
  547. Postdata = ro_json
  548. };
  549. item.PostEncoding = Encoding.UTF8;
  550. HttpResult hResult = tb_http.GetHtml(item);
  551. return hResult.Html;
  552. }
  553. }
  554. }