using KJD_Web.BLL.BXX; using KJD_Web.BLL.WXXD; using KJD_Web.Utils; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Web; using System.Web.Services; namespace KJD_Web { /// /// ProductService 的摘要说明 /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。 // [System.Web.Script.Services.ScriptService] public class WXProductService : System.Web.Services.WebService { private string GetRequestJsonString() { Context.Response.ContentType = "text/html;charset=utf-8"; Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流 { // 还原数据流 byte[] b = new byte[s.Length]; s.Read(b, 0, (int)s.Length); string jsonText = Encoding.UTF8.GetString(b); // JSON字符串 if (string.IsNullOrEmpty(jsonText)) { var qs = HttpContext.Current.Request.QueryString; if (qs != null && qs.Keys.Count > 0) { jsonText = "{"; foreach (var key in qs.Keys) { jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";"; } jsonText = jsonText.TrimEnd(';') + "}"; } } return jsonText; } } [WebMethod] public void get_pdd_product_list() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetPDDProductList(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void get_pdd_product_detail_list() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetPDDProductList(jsontext, true); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void get_pdd_product_list_random() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetPDDProductListRandom(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void get_pdd_prod_wx_complate_list() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new BXXProductManage().GetProdWXComplateList(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void get_pdd_product_groups() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetPDDProductGroups(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void get_pdd_product_cates() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetPDDProductCates(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void mdy_pdd_product() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXMdyPDDProduct(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void set_random_company_product_config() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().SetRandomCompanyProductConfig(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void get_random_company_product_config() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().GetRandomCompanyProductConfig(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void add_secret_spu_id_shop_id_map() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXAddSecretSpuIdShopIdMap(jsontext); Context.Response.Write(result); Context.Response.End(); } //WXAddSecretIdUpMap [WebMethod] public void wx_add_secret_id_up_map() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXAddSecretIdUpMap(jsontext); Context.Response.Write(result); Context.Response.End(); } /// /// 根据聚水潭加密商品编号(货号)查询所有上传过的店铺id 260224 未测试 /// [WebMethod] public void get_secret_spu_id_shop_id_map_List() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetSecretSpuIdShopIdMapList(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void wx_add_mdy_after_sale() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXAddMdyAfterSale(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void wx_get_after_sale() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetAfterSale(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void wx_get_after_sale_list() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetAfterSaleList(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void wx_del_address() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXDelAddress(jsontext); Context.Response.Write(result); Context.Response.End(); } //WXAddMdyAfterSale [WebMethod] public void wx_add_mdy_shipping_template() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXAddMdyShippingTemplate(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void wx_get_shipping_template() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().WXGetShippingTemplate(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void e57_get_freight_template() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().E57GetFreightTemplate(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void e57_after_sale() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new WXProductManage().E57AfterSale(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void wx_api_get_all_cate() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new BXXProductManage().WxApiGetWxAllCate(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void wx_api_category_classify() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new BXXProductManage().WxApiCategoryClassify(jsontext); Context.Response.Write(result); Context.Response.End(); } [WebMethod] public void wx_api_upload_image() { string jsontext = GetRequestJsonString(); var result = jsontext; result = new BXXProductManage().WxApiUploadImage(jsontext); Context.Response.Write(result); Context.Response.End(); } } }