using BizCom; using Newtonsoft.Json; using SiteCore.taobao; using SQLData; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Net; using System.Reflection; using System.Security.Cryptography; using System.Text; using System.Web; using Utils; using static SiteCore.taoObj.work_core_vo; namespace SiteCore.Handler { public class apiDesign : BaseHandler, IHttpHandler { public void ProcessRequest(HttpContext context) { if (UrlParmsCheck("t")) { String tname = GetString("t"); MethodInfo method; Type type = this.GetType(); method = type.GetMethod(tname); con = context; if (method == null) { conError("找不到对应方法,服务器返回错误"); return; } successFlag = false; context.Response.ContentType = "application/json"; context.Response.Headers.Set("Access-Control-Allow-Origin", "*"); try { method.Invoke(this, null); } catch (Exception ex) { conError("处理接口错误,服务器返回错误"); } finally { //AfterInvoke(methodName); } //if (!successFlag) returnErrorMsg("服务器返回错误"); } } static string appID = "1823193185001"; //*************************************************** //static string signkey = "fed5be35cf5bd04b14dcfff984f861dd"; static HttpHelper tb_http = new HttpHelper(); static string merSecret = "D8FF9498A5A2E6A6B4CB6EF88DB1DC35"; static string pUrl = "https://front.lingtao8.com/designRest.htm"; //static string pUrl = "http://localhost:8999/designRest.htm"; //static string pUrl = "http://yi.yhmwacg.cn/designRest.htm"; public static int DateTimeToUnixTime(DateTime dateTime) { return (int)(dateTime - TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1))).TotalSeconds; } //public static string ToUrlParams(object jsonObject) //{ // var queryString = System.Web.HttpUtility.ParseQueryString(string.Empty); // 遍历JSON对象的属性,并添加到查询字符串中 // foreach (var property in jsonObject.GetType().GetProperties()) // { // queryString[property.Name] = property.GetValue(jsonObject)?.ToString() ?? string.Empty; // } // return queryString.ToString(); //} public static Dictionary ToDictionary(object obj) { var type = obj.GetType(); var properties = type.GetProperties(); var dictionary = new Dictionary(); foreach (var property in properties) { var value = property.GetValue(obj); dictionary.Add(property.Name, value); } return dictionary; } public static string ToUrlParams(Dictionary jsonObject) { var queryString = new System.Collections.Specialized.NameValueCollection(); // 遍历JSON对象的属性,并添加到查询字符串中 foreach (var property in jsonObject) { var value = property.Value; if (value != null) { // 如果属性值不为null,则添加到查询字符串中 if (value is System.Collections.IEnumerable && !(value is string)) { // 如果是数组或集合类型,需要进一步处理 var index = 0; foreach (var item in (System.Collections.IEnumerable)value) { queryString.Add(property.Key + "[" + index + "]", item != null ? item.ToString() : string.Empty); index++; } } else { // 普通属性 queryString.Add(property.Key, value.ToString()); } } } // 获取最终的查询字符串 return string.Join("&", queryString.AllKeys.Select(key => key + "=" + queryString[key])); } public static string createSignCode(string method, string timeStr, string design_app_id, string design_secret) { byte[] use_bytes; //query.Append(secret); //预留看一下到时候签名怎么用md5加密;*************************************************** string encryStr = design_secret + method + timeStr + design_app_id + design_secret; MD5 md5 = MD5.Create(); use_bytes = md5.ComputeHash(Encoding.UTF8.GetBytes(encryStr)); StringBuilder result = new StringBuilder(); for (int i = 0; i < use_bytes.Length; i++) { result.Append(use_bytes[i].ToString("x2")); } string singResult = result.ToString(); return singResult.Replace("-", ""); //return bytes.ToString(); } public static string API_GetPrintData_CreateOrder(CeErpTradeCell ceErpTradeCell) { if (ceErpTradeCell.IsSample == 2) { return "补差价订单不需要过设计系统"; } CeErpOrderFormData formData = null; formData = CeErpOrderFormData.GetByTid(ceErpTradeCell.ctid.ToString()); if (formData == null) { /* CeErpMessageTip ceErpMessageTip = new CeErpMessageTip(); ceErpMessageTip.tid = ceErpTradeCell.ctid; ceErpMessageTip.type = 2; ceErpMessageTip.userId = ceErpTradeCell.CustomerUserId; ceErpMessageTip.isVisit = false; ceErpMessageTip.content = "订单:" + ceErpTradeCell.ctid + "备注手机号或者微信号未填写!无法指派到设计系统!!请立马备注!!"; ceErpMessageTip.Create();*/ //return "请填写订单的手机号或者微信号才可指派到设计系统"; } //json参数 List postLst = new List(); Boolean isOldCustomerText = false; Boolean isReturn = false; Boolean isGai = false; if (ceErpTradeCell.IsOldCustomer == 1) { isOldCustomerText = true; } if (ceErpTradeCell.IsReturn > 0) { isReturn = true; } if (ceErpTradeCell.MemoOpt == 1) { isGai = true; } CeErpTrade ceErpTrade = CeErpTrade.Get(ceErpTradeCell.tid); CeErpShop ceErpShop = CeErpShop.Get(ceErpTradeCell.ShopId); string design_app_id = ceErpShop.design_app_id; string design_secret = ceErpShop.design_secret; if (design_app_id == null || design_app_id == "") { design_app_id = appID; } if (design_secret == null || design_secret == "") { design_secret = merSecret; } string method = "design.order.create"; string timeStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string sign = createSignCode(method, timeStr, design_app_id, design_secret); var res_obj = new { sign = sign, method = method, merchantId = design_app_id, appKey = design_app_id, outId = ceErpTradeCell.ID, designType = ceErpTradeCell.ProductId, draftType = 2, designPage = 1, afterNames = "null", printSpecial = "null", designWidth = 0, designHeight = 0, printKs = 1, printMs = 1, printWidth = 0, printHeight = 0, amount = ceErpTradeCell.payment, isUrgent = ceErpTradeCell.IsUrgency, userContact = ceErpTrade.buyer_nick != "" ? ceErpTrade.buyer_nick : "lingtao", userMobile = "null", userQq = "null", userWx = "null", userText = "null", userNotice = "null", servicesMessage = ceErpTradeCell.CustomerMemo, shopNick = ceErpShop.ShopName, buyerNick = ceErpTrade.buyer_nick != "" ? ceErpTrade.buyer_nick : "lingtao", apiFiles = new Array[1], receiverName = ceErpTrade.receiver_name, receiverMobile = ceErpTrade.receiver_mobile, receiverState = ceErpTrade.receiver_state, receiverCity = ceErpTrade.receiver_city, receiverDistrict = ceErpTrade.receiver_district, receiverAddress = ceErpTrade.receiver_address, expressCode = "null", creater = "null", orderSrc = "0", tids = ceErpTradeCell.ctid, isOnlyDesign = "false", isOldUser = isOldCustomerText, orderText = ceErpTradeCell.seller_memo, isChange = isGai, isBack = isReturn, tid = ceErpTradeCell.tid }; string ro_json = JsonConvert.SerializeObject(res_obj); ro_json = ro_json.Replace("{", ""); ro_json = ro_json.Replace("}", ""); ro_json = ro_json.Replace("\"", ""); ro_json = ro_json.Replace(",", "&"); ro_json = ro_json.Replace(":", "="); ro_json = ro_json.Replace("+", "%2B"); ro_json += "×tamp=" + timeStr; //;*************************************************** ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; //Dictionary dataDic = ToDictionary(ro_json); //string urlData = ToUrlParams(dataDic); string sql_pay = "INSERT INTO CE_ErpToDesignLog (ctid, ctime) VALUES ('" + ceErpTradeCell.ctid + "', '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; CeErpTradeCell.ExecuteNonQuery(sql_pay.ToString()); HttpItem item = new HttpItem() { URL = pUrl, Method = "POST", ContentType = "application/x-www-form-urlencoded", Postdata = ro_json }; item.PostEncoding = Encoding.UTF8; HttpResult hResult = tb_http.GetHtml(item); return hResult.Html; //string res = Base_Request_CreateOrder(ro_json, "design.order.create"); //return res; } public static string API_GetPrintData_Refund(CeErpTradeCell ceErpTradeCell) { if (ceErpTradeCell == null) { return ""; } //json参数 List postLst = new List(); Boolean isOldCustomerText = false; Boolean isReturn = false; Boolean isGai = false; if (ceErpTradeCell.IsOldCustomer == 1) { isOldCustomerText = true; } if (ceErpTradeCell.IsReturn > 0) { isReturn = true; } if (ceErpTradeCell.MemoOpt == 1) { isGai = true; } CeErpTrade ceErpTrade = CeErpTrade.Get(ceErpTradeCell.tid); CeErpShop ceErpShop = CeErpShop.Get(ceErpTradeCell.ShopId); string design_app_id = ""; string design_secret = ""; if (design_app_id == null || design_app_id == "") { design_app_id = appID; } if (design_secret == null || design_secret == "") { design_secret = merSecret; } string method = "design.order.refund"; string timeStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string sign = createSignCode(method, timeStr, design_app_id, design_secret); var res_obj = new { sign = sign, method = method, merchantId = design_app_id, appKey = design_app_id, outId = ceErpTradeCell.ID, designType = ceErpTradeCell.ProductId, draftType = 2, designPage = 1, afterNames = "null", printSpecial = "null", designWidth = 0, designHeight = 0, printKs = 1, printMs = 1, printWidth = 0, printHeight = 0, amount = ceErpTradeCell.payment, isUrgent = ceErpTradeCell.IsUrgency, userContact = ceErpTrade.buyer_nick != "" ? ceErpTrade.buyer_nick : "lingtao", userMobile = "null", userQq = "null", userWx = "null", userText = "null", userNotice = "null", servicesMessage = ceErpTradeCell.CustomerMemo, shopNick = "", buyerNick = ceErpTrade.buyer_nick != "" ? ceErpTrade.buyer_nick : "lingtao", apiFiles = new Array[1], receiverName = ceErpTrade.receiver_name, receiverMobile = ceErpTrade.receiver_mobile, receiverState = ceErpTrade.receiver_state, receiverCity = ceErpTrade.receiver_city, receiverDistrict = ceErpTrade.receiver_district, receiverAddress = ceErpTrade.receiver_address, expressCode = "null", creater = "null", orderSrc = "0", tids = ceErpTradeCell.tid, isOnlyDesign = "false", isOldUser = isOldCustomerText, orderText = ceErpTradeCell.seller_memo, isChange = isGai, isBack = isReturn }; string ro_json = JsonConvert.SerializeObject(res_obj); ro_json = ro_json.Replace("{", ""); ro_json = ro_json.Replace("}", ""); ro_json = ro_json.Replace("\"", ""); ro_json = ro_json.Replace(",", "&"); ro_json = ro_json.Replace(":", "="); ro_json += "×tamp=" + timeStr; //;*************************************************** ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; //Dictionary dataDic = ToDictionary(ro_json); //string urlData = ToUrlParams(dataDic); HttpItem item = new HttpItem() { URL = pUrl, Method = "POST", ContentType = "application/x-www-form-urlencoded", Postdata = ro_json }; item.PostEncoding = Encoding.UTF8; HttpResult hResult = tb_http.GetHtml(item); return hResult.Html; //string res = Base_Request_CreateOrder(ro_json, "design.order.create"); //return res; } //public static string Base_Request_CreateOrder(string jsonParams, string methodStr) //{ // int sc = DateTimeToUnixTime(DateTime.Now); // Dictionary postParamList = new Dictionary(); // postParamList.Add("sign", "fed5be35cf5bd04b14dcfff984f861dd"); // postParamList.Add("method", methodStr); // postParamList.Add("merchantId", appid); // postParamList.Add("appKey", appid); // //json参数 // List postLst = new List(); // string ro_json = jsonParams; // //post参数 // postLst.Add("method=" + methodStr); // postLst.Add("appKey=" + appid); // postLst.Add("timestamp=" + sc); // postLst.Add("sign=" + sign); // postLst.Add("merchantId=" + appid); // string pUrl = "http://127.0.0.1:8999/designRest.htm" + "?" + string.Join("&", postLst.ToArray()); // HttpItem item = new HttpItem() // { // URL = pUrl, // Method = "POST", // ContentType = "application/x-www-form-urlencoded", // Postdata = ro_json // }; // item.PostEncoding = Encoding.UTF8; // HttpResult hResult = tb_http.GetHtml(item); // return hResult.Html; //} public static string API_GetPrintData_ModifyOrder(string tid, string seller_memo, Boolean isGai, Boolean isReturn, string returnReason = "") { //json参数 List postLst = new List(); string method = "design.order.update.info"; string timeStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(tid); CeErpShop ceErpShop = null; if (ceErpTradeCell != null) { ceErpShop = CeErpShop.Get(ceErpTradeCell.ShopId); } string design_app_id = null; string design_secret = null; if (ceErpShop != null) { design_app_id = ceErpShop.design_app_id; design_secret = ceErpShop.design_secret; } if (design_app_id == null || design_app_id == "") { design_app_id = appID; } if (design_secret == null || design_secret == "") { design_secret = merSecret; } string sign = createSignCode(method, timeStr, design_app_id, design_secret); var res_obj = new { method = method, sign = sign, merchantId = design_app_id, appKey = design_app_id, outId = tid, orderText = seller_memo, isChange = isGai, isBack = isReturn, returnReason = returnReason, }; string ro_json = JsonConvert.SerializeObject(res_obj); ro_json = ro_json.Replace("{", ""); ro_json = ro_json.Replace("}", ""); ro_json = ro_json.Replace("\"", ""); ro_json = ro_json.Replace(",", "&"); ro_json = ro_json.Replace(":", "="); ro_json = ro_json.Replace("+", "%2B"); ro_json += "×tamp=" + timeStr; //*************************************************** ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; HttpItem item = new HttpItem() { URL = pUrl, Method = "POST", Accept = "*/*", ContentType = "application/x-www-form-urlencoded", Postdata = ro_json }; item.PostEncoding = Encoding.UTF8; HttpResult hResult = tb_http.GetHtml(item); return hResult.Html; //string res = Base_Request_ModifyOrder(ro_json, "design.order.update.info"); //return res; } //public static string Base_Request_ModifyOrder(string jsonParams, string methodStr) //{ // int sc = DateTimeToUnixTime(DateTime.Now); // Dictionary postParamList = new Dictionary(); // //json参数 // List postLst = new List(); // string ro_json = jsonParams; // //post参数 // postLst.Add("method=" + methodStr); // postLst.Add("appKey=" + appid); // postLst.Add("timestamp=" + sc); // postLst.Add("sign=" + sign); // postLst.Add("merchantId=" + appid); // string pUrl = "http://127.0.0.1:8999/designRest.htm" + "?" + string.Join("&", postLst.ToArray()); // HttpItem item = new HttpItem() // { // URL = pUrl, // Method = "POST", // ContentType = "application/x-www-form-urlencoded", // Postdata = ro_json // }; // item.PostEncoding = Encoding.UTF8; // HttpResult hResult = tb_http.GetHtml(item); // return hResult.Html; //} //http://47.114.150.226:88/Handler/apiDesign.ashx?t=DesignSys_AddLog post请求参数(参数放body中):string tid(淘宝订单号)string userName(操作用户)string con(日志内容)int orderState(订单状态) public void DesignSys_AddLog() { if (UrlPostParmsCheck("tid")) { try { //HttpContext.Current.Request.BinaryRead() string tid = GetPostString("tid"); int userId = GetPostInt("userId"); int orderState = GetPostInt("orderState"); string con = GetPostString("con"); if (userId == 0) { userId = 2125; } try { CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(tid); if (ceErpTradeCell != null) { LogHelper.addLog(tid, userId, con, orderState); return; } else { returnErrorMsg("找不到对应订单记录,核对淘宝订单号"); } } catch (Exception ex) { XLog.SaveLog(0, "xxxxx," + ex.Message); } } catch (Exception ex) { XLog.SaveLog(0, ex.Message); } return; } returnErrorMsg("缺少必要的参数"); } public void DesignSys_AddStateLog() { if (UrlPostParmsCheck("tid")) { try { //HttpContext.Current.Request.BinaryRead() string tid = GetPostString("tid"); int userId = GetPostInt("userId"); int orderState = GetPostInt("orderState"); string con = GetPostString("con"); if (userId == 0) { userId = 2125; } try { CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(tid); if (ceErpTradeCell != null) { ceErpTradeCell.OrderState = orderState; ceErpTradeCell.UpdateTime = DateTime.Now; LogHelper.addLog(tid, userId, con, orderState); return; } else { returnErrorMsg("找不到对应订单记录,核对淘宝订单号"); } } catch (Exception ex) { XLog.SaveLog(0, "xxxxx," + ex.Message); } } catch (Exception ex) { XLog.SaveLog(0, ex.Message); } return; } returnErrorMsg("缺少必要的参数"); } //http://47.114.150.226:88/Handler/apiDesign.ashx?t=DesignSys_OrderStateChange post请求参数(参数放body中):string tid(淘宝订单号)string userName(用户姓名)int orderState(订单状态) public void DesignSys_OrderStateChange() { if (UrlPostParmsCheck("tid")) { string tid = GetPostString("tid"); string userName = GetPostString("userName"); int orderState = GetPostInt("orderState"); CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(tid); if (ceErpTradeCell != null) { if (ceErpTradeCell.OrderState >= 5) { return; } if (userName != "") { CeErpUser ceErpUser = CeErpUser.GetByUserName(userName); if (ceErpUser != null) { } else { ceErpUser = CeErpUser.GetByUserName("外协设计-" + userName); if (ceErpUser == null) { returnErrorMsg("找不到对应用户"); return; } } ceErpTradeCell.DesignUserId = ceErpUser.ID; ceErpTradeCell.OrderState = orderState; if (orderState == 4) { ceErpTradeCell.WaitDesignTime = DateTime.Now; ceErpTradeCell.StartDesignTime = DateTime.Now; } ceErpTradeCell.UpdateTime = DateTime.Now; ceErpTradeCell.Update(); LogHelper.addLog(ceErpTradeCell.ctid, 3542, "接口请求:" + orderState, ceErpTradeCell.OrderState); commonHelper.UpdateRelationOrder(tid); return; } returnErrorMsg("找不到对应用户"); } else { returnErrorMsg("找不到对应订单记录,核对淘宝订单号"); return; } return; } returnErrorMsg("缺少必要的参数"); } //http://47.114.150.226:88/Handler/apiDesign.ashx?t=create_erp_account post请求参数(参数放body中):string name(用户姓名)string pwd(密码) public void create_erp_account() { if (UrlPostParmsCheck("name,pwd")) { string name = GetPostString("name"); if (CeErpUser.Exists(" Account=?", name)) { returnErrorMsg("该账户名已经存在,请更换!"); return; } string pwd = SecurityHelper.EncryptSymmetric(GetPostString("pwd")); CeErpUser user = new CeErpUser(); user.Account = name; user.Name = name; user.isOpen = false; user.CreateTime = DateTime.Now; user.PassWord = pwd; user.Create(); returnSuccessMsg("保存成功!"); } } //http://47.114.150.226:88/Handler/apiDesign.ashx?t=change_order_price post请求参数(参数放body中):ctid content public void change_order_price() { if (UrlPostParmsCheck("ctid")) { string ctid = GetPostString("ctid"); string content = GetPostString("content"); CeErpTradeCell ce = CeErpTradeCell.GetByCtid(ctid); if (ce == null) { returnErrorMsg("找不到订单!"); return; } CeErpMessageTip ct = new CeErpMessageTip(); string sql_pay = string.Format("select top 1 * from CE_ErpMessageTip where tid = '{0}' and type = 2", ctid); DataTable dth = DbHelper.DbConn.ExecuteDataset(sql_pay).Tables[0]; ct.tid = ctid; ct.sectionId = 0; ct.userId = ce.CustomerUserId; ct.type = 2; ct.isVisit = false; ct.content = content; if (dth.Rows.Count > 0) { ct.ID = Convert.ToInt32(dth.Rows[0]["ID"]); ct.Update(); } else { ct.Create(); } LogHelper.addLog(ce.ctid, 3542, "接口请求修改:" + content, ce.OrderState); returnSuccessMsg("保存成功!"); } } //http://47.114.150.226:88/Handler/apiDesign.ashx?t=change_order_price post请求参数(参数放body中):ctid content public void return_order() { if (UrlPostParmsCheck("ctid")) { string ctid = GetPostString("ctid"); string content = GetPostString("content"); CeErpTradeCell entity = CeErpTradeCell.GetByCtid(ctid); if (entity == null) { returnErrorMsg("找不到订单!"); return; } entity.OrderState = 0; entity.ReturnUserType = 1; entity.IsReadTag = 1; entity.IsVerifyToSupplier = false; entity.UnusualTag = 0; entity.UnusualTime = null; entity.UnusualCon = ""; entity.IsReturn = 2; entity.ReturnTime = DateTime.Now; entity.ReturnReason = content; entity.UpdateTime = DateTime.Now; entity.Update(); LogHelper.addLog(entity.ctid, 3542, "接口打回:" + content, entity.OrderState); returnSuccessMsg("保存成功!"); return; } returnErrorMsg("参数错误!"); } //http://47.114.150.226:88/Handler/apiDesign.ashx?t=handleAfterSale post请求参数(参数放body中):responsibleId-售后单id status-处理结果1同意2不同意 supmemo-理由 public void handleAfterSale() { string responsibleId = GetString("responsibleId"); int st = GetInt("status"); string afmemo = GetString("supmemo"); string id = "0"; CeErpTradeResponsible ceErpTradeResponsible = CeErpTradeResponsible.Get(responsibleId); CeErpTradeCell entity = null; if (ceErpTradeResponsible != null) { id = ceErpTradeResponsible.ID.ToString(); entity = CeErpTradeCell.GetByCtid(ceErpTradeResponsible.tid); if (ceErpTradeResponsible.VerifyState == 1) { returnErrorMsg("已超时自动认可"); return; } } if (entity != null) { if (entity.AfterSaleState != 3 || ceErpTradeResponsible.VerifyState != 0) { returnErrorMsg("此单售后当前状态不可操作!"); return; } entity.AfterSaleSupplierState = st; entity.AfterSaleSupplierMemo = afmemo; if (st == 1) { ceErpTradeResponsible.VerifyState = 1; ceErpTradeResponsible.VerifyTime = DateTime.Now; ceErpTradeResponsible.Update(); bool isAll = commonHelper.tradeResponsibleAll(entity); if (isAll) { entity.AfterSaleState = 4; entity.FinishAfterSaleTime = DateTime.Now; if (entity.AfterSaleResSupId > 0) { entity.AfterSaleSupplierState = 1; } } } else { CeErpTradeResponsible.dateByTid(entity.ctid); CeErpTradeAfterSaleExtend ceErpTradeAfterSaleExtend = CeErpTradeAfterSaleExtend.getByTid(entity.ctid); if (ceErpTradeAfterSaleExtend != null) { } else { ceErpTradeAfterSaleExtend = new CeErpTradeAfterSaleExtend(); ceErpTradeAfterSaleExtend.tid = entity.ctid; ceErpTradeAfterSaleExtend.Create(); } entity.AfterSaleState = 2; } if (entity.AfterSaleState == 4) { LogHelper.addLog(entity.tid, 0, "设计共创接口完成售后", 0, 3); if (entity.AfterSaleReason.IndexOf("设计") > 0 || entity.AfterSalePayment > 0) { LogHelper.addDesignerBillLog(entity.tid, 0, "设计共创接口售后取消设计费", "设计共创接口", 1); } ApiVo apiVo = new ApiVo(); apiVo.orderNumber = entity.ctid; apiVo.actionName = "afterOver"; designHelper.API_WorkCore(apiVo); //afterOver } entity.UpdateTime = DateTime.Now; entity.Update(); returnSuccessMsg("操作成功!"); CeErpSukuraData.createInfo(entity.ctid, 8); LogHelper.addLog(entity.ctid, 0, "设计共创接口" + (st == 1 ? "认可" : ("不认可," + afmemo)), 0, 3); LogHelper.AddAfterSaleLog(entity.ctid, Convert.ToInt32(id), "设计共创" + (st == 1 ? "认可" : "不认可"), 0, st == 1 ? 0 : 1, afmemo); return; } returnErrorMsg("找不到订单记录"); } //http://47.114.150.226:88/Handler/apiDesign.ashx?t=getOrderLogs post请求参数(参数放body中):responsibleId-售后单id status-处理结果1同意2不同意 supmemo-理由 public void getOrderLogs() { string ctid = GetPostString("ctid"); if (string.IsNullOrEmpty(ctid)) { returnErrorMsg("找不到订单记录"); return; } StringBuilder sql = new StringBuilder(); sql.AppendFormat("select * from view_erptradelog where tid='{0}' order by id;", ctid); DataTable ds = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0]; ReturnSuccess("{" + string.Format("\"data\":{0}", Utils.Serialization.JsonString.DataTable2MiniAjaxJson(ds)) + "}"); return; } } }