微信小店商品上传 50%
This commit is contained in:
1 parent
8f9bae9875
commit
343b01ab90
83 files changed
+12877
-656
No files matched your search
@@ -0,0 +1,411 @@
|
||||
using KJD_Web.Model;
|
||||
using KJD_Web.Model.ShopModel;
|
||||
using KJD_Web.Utils;
|
||||
using MySql.Data.MySqlClient;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
|
||||
namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
public class WXProductManage
|
||||
{
|
||||
public string WXGetPDDProductList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'");
|
||||
var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'");
|
||||
var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'");
|
||||
var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
|
||||
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
|
||||
var search_group = RegexUtils.GetStringQuery(ref inputData, "search_group")?.Replace("'", "\\'");
|
||||
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
|
||||
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
|
||||
var get_select_count = RegexUtils.GetStringQuery(ref inputData, "get_select_count")?.Replace("'", "\\'");
|
||||
var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'");
|
||||
var from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id")?.Replace("'", "\\'");
|
||||
var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select count(id) from bxx.product p where p.is_del=0";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrWhiteSpace(search_spu))
|
||||
where += " and p.spu_id like '%" + search_spu + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_skc))
|
||||
where += " and p.skc_id like '%" + search_skc + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_cat))
|
||||
where += " and p.cat_name like '%" + search_cat + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_ext_code))
|
||||
where += " and p.ext_code like '%" + search_ext_code + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_prod_name))
|
||||
where += " and p.product_name like '%" + search_prod_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_group))
|
||||
where += " and p.group like '%" + search_group + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
where += " and p.notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrEmpty(from_shop_id))
|
||||
where += " and p.from_shop_id ='" + from_shop_id + "'";
|
||||
if (!string.IsNullOrEmpty(search_db_ids))
|
||||
where += " and p.id in (" + search_db_ids + ")";
|
||||
sql += where;
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isDetail)
|
||||
sql = "select p.*,s.img_base64,s.img_url,e.ext_code_price from bxx.product p" +
|
||||
" left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
|
||||
" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
" where p.is_del=0";
|
||||
else if (string.IsNullOrEmpty(get_select_count))
|
||||
sql = "select p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name,p.main_img,p.notes," +
|
||||
" p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type,s.img_url,e.ext_code_price" +
|
||||
" FROM bxx.product p " +
|
||||
" left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
|
||||
" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
" where p.is_del=0";
|
||||
else
|
||||
sql = "SELECT p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name,p.main_img,p.notes," +
|
||||
" p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type,s.img_url,COUNT(se.id) AS select_count," +
|
||||
" e.ext_code_price" +
|
||||
" FROM bxx.product p left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id LEFT JOIN bxx.product_select se ON p.id=se.out_product_id AND se.shop_id='" + select_shop_id + "' " +
|
||||
" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
" WHERE p.is_del=0";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
|
||||
if (!isDetail && !string.IsNullOrEmpty(get_select_count))
|
||||
sql += " group by p.id";
|
||||
if (sort_field == "select_total_count")
|
||||
sql += " order by p.select_total_count desc, p.id desc";
|
||||
else
|
||||
sql += " order by p.id desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<DBProductResultParam> productLst = new List<DBProductResultParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
DBProductResultParam prod = new DBProductResultParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
from_shop_id = row["from_shop_id"].ToString(),
|
||||
skc_id = row["skc_id"].ToString(),
|
||||
spu_id = row["spu_id"].ToString(),
|
||||
cat_id = row["cat_id"].ToString(),
|
||||
cat_name = row["cat_name"].ToString(),
|
||||
product_name = row["product_name"].ToString(),
|
||||
main_img = row["main_img"].ToString(),
|
||||
ext_code = row["ext_code"].ToString(),
|
||||
ext_code_price = row["ext_code_price"].IsNullOrEmpty() ? new int?() : row["ext_code_price"].ParseToInt(),
|
||||
price_text = row["price_text"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
add_time = Convert.ToDateTime(row["add_time"]),
|
||||
mdy_time = Convert.ToDateTime(row["mdy_time"]),
|
||||
notes = row["notes"].ToString(),
|
||||
group = row["group"].ToString(),
|
||||
select_total_count = row["select_total_count"].ParseToInt(),
|
||||
end_words = row["end_words"].ParseToString(),
|
||||
fission_words = row["fission_words"].ParseToString(),
|
||||
head_words = row["head_words"].ParseToString(),
|
||||
sku_img_replace_id = row["sku_img_replace_id"].ParseToInt(),
|
||||
sku_img_replace_url = row["img_url"].ToString(),
|
||||
product_get_type_text = row["product_get_type"].ToString(),
|
||||
};
|
||||
if (isDetail)
|
||||
{
|
||||
prod.product_json = row["product_json"].ToString();
|
||||
prod.size_json = row["size_json"].ToString();
|
||||
prod.sku_edit_json = row["sku_edit_json"].ToString();
|
||||
prod.sku_img_replace_base64 = row["img_base64"].ToString();
|
||||
//prod.sku_img_replace_url = row["img_url"].ToString();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(get_select_count))
|
||||
{
|
||||
prod.select_count = row["select_count"].ParseToInt();
|
||||
}
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXGetPDDProductGroups(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT DISTINCT p.group FROM `bxx`.`product` p where p.is_del=0";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
string group_data = "";
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
group_data += row["group"].ToString() + ",";
|
||||
}
|
||||
var data = group_data.Trim(',');
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":\"" + data + "\"}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"" + ex.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXGetPDDProductCates(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT DISTINCT p.cat_name FROM `bxx`.`product` p where p.is_del=0";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
string group_data = "";
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
group_data += row["cat_name"].ToString() + ",";
|
||||
}
|
||||
var data = group_data.Trim(',');
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":\"" + data + "\"}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"" + ex.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 随机获取商品(无详情) 随机添加到上传列表所以不需要获取详情
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXGetPDDProductListRandom(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var in_ext_codes = RegexUtils.GetStringQuery(ref inputData, "in_ext_codes")?.Replace("'", "\\'");
|
||||
var in_skc_ids = RegexUtils.GetStringQuery(ref inputData, "in_skc_ids")?.Replace("'", "\\'");
|
||||
var in_groups = RegexUtils.GetStringQuery(ref inputData, "in_groups")?.Replace("'", "\\'");
|
||||
var in_cates = RegexUtils.GetStringQuery(ref inputData, "in_cates")?.Replace("'", "\\'");
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select count(id) from bxx.product p where p.is_del=0";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(in_ext_codes))
|
||||
{
|
||||
in_ext_codes = "'" + string.Join("','", in_ext_codes.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and p.ext_code in (" + in_ext_codes + ")";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(in_skc_ids))
|
||||
{
|
||||
in_skc_ids = "'" + string.Join("','", in_skc_ids.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and p.skc_id in (" + in_skc_ids + ")";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(in_groups))
|
||||
{
|
||||
in_groups = "'" + string.Join("','", in_groups.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and p.group in (" + in_groups + ")";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(in_cates))
|
||||
{
|
||||
in_cates = "'" + string.Join("','", in_cates.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and (p.cat_name in (" + in_cates + ") or p.main_cat_name in (" + in_cates + "))";
|
||||
}
|
||||
|
||||
sql += where;
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "select p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code," +
|
||||
"p.product_name,p.main_img,p.group,p.notes,p.add_time,p.mdy_time,p.select_total_count," +
|
||||
"p.fission_words,p.head_words,p.end_words from bxx.product p where p.is_del=0";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
|
||||
sql += " ORDER BY RAND()";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<DBProductResultParam> productLst = new List<DBProductResultParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
DBProductResultParam prod = new DBProductResultParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
from_shop_id = row["from_shop_id"].ToString(),
|
||||
skc_id = row["skc_id"].ToString(),
|
||||
spu_id = row["spu_id"].ToString(),
|
||||
cat_id = row["cat_id"].ToString(),
|
||||
cat_name = row["cat_name"].ToString(),
|
||||
main_cat_id = row["main_cat_id"].ToString(),
|
||||
main_cat_name = row["main_cat_name"].ToString(),
|
||||
price_text = row["price_text"].ToString(),
|
||||
product_name = row["product_name"].ToString(),
|
||||
main_img = row["main_img"].ToString(),
|
||||
ext_code = row["ext_code"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
add_time = Convert.ToDateTime(row["add_time"]),
|
||||
mdy_time = Convert.ToDateTime(row["mdy_time"]),
|
||||
group = row["group"].ToString(),
|
||||
notes = row["notes"].ToString(),
|
||||
select_total_count = row["select_total_count"].ParseToInt(),
|
||||
end_words = row["end_words"].ParseToString(),
|
||||
fission_words = row["fission_words"].ParseToString(),
|
||||
head_words = row["head_words"].ParseToString(),
|
||||
};
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,818 @@
|
||||
using KJD_Web.Model;
|
||||
using KJD_Web.Model.ShopModel;
|
||||
using KJD_Web.Utils;
|
||||
using MySqlX.XDevAPI;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
|
||||
namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
public class WXShopManage
|
||||
{
|
||||
public string GetShop(string inputData, bool isAdmin = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password");
|
||||
var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id");
|
||||
var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name");
|
||||
var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name");
|
||||
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes");
|
||||
var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name");
|
||||
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
|
||||
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");
|
||||
if (!string.IsNullOrWhiteSpace(shop_ids))
|
||||
{
|
||||
List<string> shopIdLst = shop_ids.Split(',').ToList();
|
||||
shop_ids = "'" + string.Join("','", shopIdLst) + "'";
|
||||
}
|
||||
var shop_names = RegexUtils.GetStringQuery(ref inputData, "shop_names");
|
||||
if (!string.IsNullOrWhiteSpace(shop_names))
|
||||
{
|
||||
List<string> shopNameLst = shop_names.Split(',').ToList();
|
||||
shop_names = "'" + string.Join("','", shopNameLst) + "'";
|
||||
}
|
||||
var shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes");
|
||||
if (!string.IsNullOrWhiteSpace(shop_notes))
|
||||
{
|
||||
List<string> shopNotesLst = shop_notes.Split(',').ToList();
|
||||
shop_notes = "'" + string.Join("','", shopNotesLst) + "'";
|
||||
}
|
||||
|
||||
var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt();
|
||||
|
||||
if (page_size == 0)
|
||||
page_size = 50;
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT COUNT(s.id) FROM wxxd.shop s WHERE 1=1";
|
||||
|
||||
//where子句
|
||||
string where = "";
|
||||
if (isAdmin)
|
||||
where += " and (s.cookie='' or s.shop_id!='')";
|
||||
if (!isAdmin)
|
||||
where += " and (s.user_name='" + user_name + "' or s.sub_user_name like '%" + user_name + "%')";
|
||||
if (!string.IsNullOrWhiteSpace(operate_sub_sa_name))
|
||||
where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'";
|
||||
if (!string.IsNullOrWhiteSpace(search_user_name))
|
||||
where += " and s.user_name like '%" + search_user_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_login_name))
|
||||
where += " and s.login_name like '%" + search_login_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
where += " and s.notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_id))
|
||||
where += " and s.shop_id like '%" + search_id + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_name))
|
||||
where += " and s.shop_account like '%" + search_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(shop_ids))
|
||||
where += " and s.shop_id in (" + shop_ids + ")";
|
||||
if (!string.IsNullOrWhiteSpace(shop_names))
|
||||
where += " and s.shop_account in (" + shop_names + ")";
|
||||
if (!string.IsNullOrWhiteSpace(shop_notes))
|
||||
where += " and s.notes in (" + shop_notes + ")";
|
||||
sql += where;
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.openid,s.shop_id,s.shop_account,s.sub_user_name," +
|
||||
"s.user_name,s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month," +
|
||||
"s.add_time,s.mdy_time,s.add_sub_sa_time,s.operate_sub_sa_name";
|
||||
//sql += " FROM wxxd.shop s WHERE 1=1";
|
||||
sql += " FROM wxxd.shop s LEFT JOIN wxxd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
|
||||
|
||||
sql += where; // where 子句
|
||||
|
||||
sql += " ORDER BY s.id DESC";
|
||||
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
List<ShopParam> shopList=new List<ShopParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
ShopParam shop = new ShopParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
login_name = row["login_name"].ToString(),
|
||||
login_pass = row["login_pass"].ToString(),
|
||||
cookie = row["cookie"].ToString(),
|
||||
cookie2 = row["cookie2"].ToString(),
|
||||
anti_contents = row["anti_contents"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
shop_account = row["shop_account"].ToString(),
|
||||
sub_user_name = row["sub_user_name"].ToString(),
|
||||
user_name = row["user_name"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
notes = row["notes"].ToString(),
|
||||
login_status = row["login_status"].ToString(),
|
||||
login_status2 = row["login_status2"].ToString(),
|
||||
add_product_remaining = row["add_product_remaining"].ParseToInt(),
|
||||
add_product_month = row["add_product_month"].ParseToInt(),
|
||||
operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(),
|
||||
openid = row["openid"].ParseToString(),
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
|
||||
//sql = "\r\nINSERT INTO wxxd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
|
||||
//foreach (var shop in shopList)
|
||||
//{
|
||||
// sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + shop.add_product_remaining + "," + shop.add_product_month + "),";
|
||||
//}
|
||||
//sql = sql.TrimEnd(',') + " \r\n";
|
||||
//sql += "ON DUPLICATE KEY UPDATE " +
|
||||
// "shop_account=VALUES(shop_account)," +
|
||||
// "add_product_remaining=VALUES(add_product_remaining)," +
|
||||
// "add_product_month=VALUES(add_product_month);";
|
||||
//var result = mySql.ExecuteNonQuery(sql);
|
||||
//mySql.Close();
|
||||
|
||||
int month = DateTime.Now.Month;
|
||||
var shopMonthList = shopList.Where(s => s.add_product_month != month);
|
||||
if (shopMonthList.Count() > 0)
|
||||
{
|
||||
int remainCount = 300;
|
||||
var shopMonthIdList = shopMonthList.Select(s => s.id);
|
||||
mySql = new MysqlUtils(conn);
|
||||
string ids = string.Join(",", shopMonthIdList);
|
||||
sql = "";
|
||||
sql += "update wxxd.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month +
|
||||
" where 1=1 and id in (" + ids + ");";
|
||||
|
||||
sql += "\r\nINSERT INTO wxxd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
|
||||
foreach (var shop in shopMonthList)
|
||||
{
|
||||
sql+= "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),";
|
||||
}
|
||||
sql = sql.TrimEnd(',') + " \r\n";
|
||||
sql += "ON DUPLICATE KEY UPDATE " +
|
||||
"shop_account=VALUES(shop_account)," +
|
||||
"add_product_remaining=VALUES(add_product_remaining)," +
|
||||
"add_product_month=VALUES(add_product_month);";
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (rst)
|
||||
{
|
||||
foreach (var shop in shopMonthList)
|
||||
{
|
||||
shop.add_product_month = month;
|
||||
shop.add_product_remaining = remainCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
public string SubSaGetSelectProdShop(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password");
|
||||
var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id");
|
||||
var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name");
|
||||
var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name");
|
||||
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes");
|
||||
var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name");
|
||||
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
|
||||
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");
|
||||
if (!string.IsNullOrWhiteSpace(shop_ids))
|
||||
{
|
||||
List<string> shopIdLst = shop_ids.Split(',').ToList();
|
||||
shop_ids = "'" + string.Join("','", shopIdLst) + "'";
|
||||
}
|
||||
var shop_names = RegexUtils.GetStringQuery(ref inputData, "shop_names");
|
||||
if (!string.IsNullOrWhiteSpace(shop_names))
|
||||
{
|
||||
List<string> shopNameLst = shop_names.Split(',').ToList();
|
||||
shop_names = "'" + string.Join("','", shopNameLst) + "'";
|
||||
}
|
||||
var shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes");
|
||||
if (!string.IsNullOrWhiteSpace(shop_notes))
|
||||
{
|
||||
List<string> shopNotesLst = shop_notes.Split(',').ToList();
|
||||
shop_notes = "'" + string.Join("','", shopNotesLst) + "'";
|
||||
}
|
||||
|
||||
var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt();
|
||||
|
||||
if (page_size == 0)
|
||||
page_size = 50;
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT COUNT(s.id) FROM wxxd.shop s WHERE 1=1";
|
||||
|
||||
//where子句
|
||||
string where = "";
|
||||
if (!string.IsNullOrWhiteSpace(operate_sub_sa_name))
|
||||
where += " and (s.shop_id in (SELECT DISTINCT shop_id From wxxd.product_select WHERE operate_sub_sa_name='" + operate_sub_sa_name + "') or " +
|
||||
"s.shop_id in (SELECT DISTINCT shop_id From wxxd.third_product_select WHERE operate_sub_sa_name='" + operate_sub_sa_name + "'))";
|
||||
where += " and (s.cookie='' or s.shop_id!='')";
|
||||
//if (!string.IsNullOrWhiteSpace(operate_sub_sa_name))
|
||||
// where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'";
|
||||
if (!string.IsNullOrWhiteSpace(search_user_name))
|
||||
where += " and s.user_name like '%" + search_user_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_login_name))
|
||||
where += " and s.login_name like '%" + search_login_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
where += " and s.notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_id))
|
||||
where += " and s.shop_id like '%" + search_id + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_name))
|
||||
where += " and s.shop_account like '%" + search_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(shop_ids))
|
||||
where += " and s.shop_id in (" + shop_ids + ")";
|
||||
if (!string.IsNullOrWhiteSpace(shop_names))
|
||||
where += " and s.shop_account in (" + shop_names + ")";
|
||||
if (!string.IsNullOrWhiteSpace(shop_notes))
|
||||
where += " and s.notes in (" + shop_notes + ")";
|
||||
sql += where;
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.shop_id,s.openid,s.shop_account,s.sub_user_name,s.user_name," +
|
||||
"s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," +
|
||||
"s.add_sub_sa_time,s.operate_sub_sa_name";
|
||||
sql += " FROM wxxd.shop s LEFT JOIN wxxd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
|
||||
|
||||
sql += where; // where 子句
|
||||
|
||||
sql += " ORDER BY s.id DESC";
|
||||
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
List<ShopParam> shopList = new List<ShopParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
ShopParam shop = new ShopParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
login_name = row["login_name"].ToString(),
|
||||
login_pass = row["login_pass"].ToString(),
|
||||
cookie = row["cookie"].ToString(),
|
||||
cookie2 = row["cookie2"].ToString(),
|
||||
anti_contents = row["anti_contents"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
shop_account = row["shop_account"].ToString(),
|
||||
sub_user_name = row["sub_user_name"].ToString(),
|
||||
user_name = row["user_name"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
notes = row["notes"].ToString(),
|
||||
login_status = row["login_status"].ToString(),
|
||||
login_status2 = row["login_status2"].ToString(),
|
||||
add_product_remaining = row["add_product_remaining"].ParseToInt(),
|
||||
add_product_month = row["add_product_month"].ParseToInt(),
|
||||
operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(),
|
||||
openid = row["openid"].ToString(),
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
|
||||
//sql = "\r\nINSERT INTO wxxd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
|
||||
//foreach (var shop in shopList)
|
||||
//{
|
||||
// sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + shop.add_product_remaining + "," + shop.add_product_month + "),";
|
||||
//}
|
||||
//sql = sql.TrimEnd(',') + " \r\n";
|
||||
//sql += "ON DUPLICATE KEY UPDATE " +
|
||||
// "shop_account=VALUES(shop_account)," +
|
||||
// "add_product_remaining=VALUES(add_product_remaining)," +
|
||||
// "add_product_month=VALUES(add_product_month);";
|
||||
//var result = mySql.ExecuteNonQuery(sql);
|
||||
//mySql.Close();
|
||||
|
||||
int month = DateTime.Now.Month;
|
||||
var shopMonthList = shopList.Where(s => s.add_product_month != month);
|
||||
if (shopMonthList.Count() > 0)
|
||||
{
|
||||
int remainCount = 300;
|
||||
var shopMonthIdList = shopMonthList.Select(s => s.id);
|
||||
mySql = new MysqlUtils(conn);
|
||||
string ids = string.Join(",", shopMonthIdList);
|
||||
sql = "";
|
||||
sql += "update wxxd.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month +
|
||||
" where 1=1 and id in (" + ids + ");";
|
||||
|
||||
sql += "\r\nINSERT INTO wxxd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
|
||||
foreach (var shop in shopMonthList)
|
||||
{
|
||||
sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),";
|
||||
}
|
||||
sql = sql.TrimEnd(',') + " \r\n";
|
||||
sql += "ON DUPLICATE KEY UPDATE " +
|
||||
"shop_account=VALUES(shop_account)," +
|
||||
"add_product_remaining=VALUES(add_product_remaining)," +
|
||||
"add_product_month=VALUES(add_product_month);";
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (rst)
|
||||
{
|
||||
foreach (var shop in shopMonthList)
|
||||
{
|
||||
shop.add_product_month = month;
|
||||
shop.add_product_remaining = remainCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public string UpdateAddProdRemaining(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password");
|
||||
var remainCount = RegexUtils.GetStringQuery(ref inputData, "remain_count");
|
||||
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");
|
||||
if (!string.IsNullOrWhiteSpace(shop_ids))
|
||||
{
|
||||
List<string> shopIdLst = shop_ids.Split(',').ToList();
|
||||
shop_ids = "'" + string.Join("','", shopIdLst) + "'";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
sql += "update wxxd.shop_add_prod_count set add_product_remaining=" + remainCount +
|
||||
" where 1=1 and shop_id in (" + shop_ids + ");";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
var msg = mySql.Message;
|
||||
mySql.Close();
|
||||
|
||||
if (rst)
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
else
|
||||
return "{\"code\":50000,\"msg\":\"" + msg + "\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
|
||||
//获取一个手机登录号码下的所有店铺(以便有则更新,无则新增)
|
||||
public string GetOneLoginNameShop(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select id,login_name,login_pass,cookie,cookie2,anti_contents,shop_id,openid,shop_account,sub_user_name,user_name from wxxd.shop where user_name='"
|
||||
+ user_name + "' and login_name='" + login_name + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
List<ShopParam> shopList = new List<ShopParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
ShopParam shop = new ShopParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
login_name = row["login_name"].ToString(),
|
||||
login_pass = row["login_pass"].ToString(),
|
||||
cookie = row["cookie"].ToString(),
|
||||
cookie2 = row["cookie2"].ToString(),
|
||||
anti_contents = row["anti_contents"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
shop_account = row["shop_account"].ToString(),
|
||||
sub_user_name = row["sub_user_name"].ToString(),
|
||||
user_name = row["user_name"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
notes = row["notes"].ToString(),
|
||||
login_status = row["login_status"].ToString(),
|
||||
openid = row["openid"].ToString(),
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
//获取一个手机登录号码下特定ID的店铺
|
||||
public string GetOneIdShop(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
|
||||
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select id,login_name,login_pass,cookie,cookie2,anti_contents,shop_id,openid,shop_account,sub_user_name,user_name from wxxd.shop where user_name='"
|
||||
+ user_name + "' and login_name='" + login_name + "' and shop_id='" + shop_id + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
List<ShopParam> shopList = new List<ShopParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
ShopParam shop = new ShopParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
login_name = row["login_name"].ToString(),
|
||||
login_pass = row["login_pass"].ToString(),
|
||||
cookie = row["cookie"].ToString(),
|
||||
cookie2 = row["cookie2"].ToString(),
|
||||
anti_contents = row["anti_contents"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
shop_account = row["shop_account"].ToString(),
|
||||
sub_user_name = row["sub_user_name"].ToString(),
|
||||
user_name = row["user_name"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
notes = row["notes"].ToString(),
|
||||
login_status = row["login_status"].ToString(),
|
||||
openid = row["openid"].ToString(),
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
public string AddShop(string inputData, bool isAdmin=false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
if (isAdmin)
|
||||
user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name");
|
||||
string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
|
||||
string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass");
|
||||
string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name"));
|
||||
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
|
||||
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
|
||||
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
|
||||
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account");
|
||||
string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
if (string.IsNullOrEmpty(login_name))
|
||||
{
|
||||
return "{\"code\":501,\"msg\":\"没有店铺登录名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
if (string.IsNullOrEmpty(shop_id))
|
||||
sql = "select exists (select 1 from wxxd.shop where login_name='" + login_name + "' and user_name='" + user_name + "')";
|
||||
else
|
||||
sql = "select exists (select 1 from wxxd.shop where login_name='" + login_name + "' and user_name='" + user_name +
|
||||
"' and shop_id='" + shop_id + "')";
|
||||
var exist = mySql.ExecuteFirstInt(sql);
|
||||
if (exist>0)
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"店铺" + login_name +" " + shop_account + "已存在\"}";
|
||||
}
|
||||
|
||||
sql = "insert into wxxd.shop (login_name,login_pass,cookie,cookie2,anti_contents,shop_account,shop_id,sub_user_name,user_name,group_name,notes,add_time,mdy_time) " +
|
||||
"values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + anti_contents + "','" + shop_account + "','" + shop_id + "','" +
|
||||
sub_user_name + "','" + user_name + "','" + group_name + "','" + notes + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
public string MdyShop(string inputData, bool isAdmin=false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
if (isAdmin)
|
||||
user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name");
|
||||
string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
|
||||
string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass");
|
||||
string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name"));
|
||||
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
|
||||
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
|
||||
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
|
||||
string new_shop_id = RegexUtils.GetStringQuery(ref inputData, "new_shop_id");
|
||||
string old_shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account");
|
||||
string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
|
||||
string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status"));
|
||||
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
if (string.IsNullOrEmpty(login_name))
|
||||
{
|
||||
return "{\"code\":501,\"msg\":\"没有店铺登录名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update wxxd.shop set";
|
||||
if (login_pass != null)
|
||||
sql += " login_pass='" + login_pass + "',";
|
||||
if (cookie != null)
|
||||
sql += " cookie='" + cookie + "',";
|
||||
if (cookie2 != null)
|
||||
sql += " cookie2='" + cookie2 + "',";
|
||||
if (anti_contents != null)
|
||||
sql += " anti_contents='" + anti_contents + "',";
|
||||
if (new_shop_id != null)
|
||||
sql += " shop_id='" + new_shop_id + "',";
|
||||
if (shop_account != null)
|
||||
sql += " shop_account='" + shop_account + "',";
|
||||
if (sub_user_name != null)
|
||||
sql += " sub_user_name='" + sub_user_name + "',";
|
||||
if (group_name != null)
|
||||
sql += " group_name='" + group_name + "',";
|
||||
if (notes != null)
|
||||
sql += " notes='" + notes + "',";
|
||||
if (login_status != null)
|
||||
sql += " login_status='" + login_status + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where login_name='" + login_name + "' and (user_name='" + user_name + "' or sub_user_name like '%" + user_name + "%')";
|
||||
if (!string.IsNullOrEmpty(old_shop_id))
|
||||
sql += " and shop_id='" + old_shop_id + "'";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
public string MdyAntiContent(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
|
||||
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
|
||||
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
if (string.IsNullOrEmpty(login_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"店铺没有登录名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update wxxd.shop set";
|
||||
if (anti_contents != null)
|
||||
sql += " anti_contents='" + anti_contents + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where login_name='" + login_name + "' and shop_id='" + shop_id + "';";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
public string MdyCookieAndLoginStatus(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
|
||||
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
|
||||
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
|
||||
string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status"));
|
||||
string login_status2 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status2"));
|
||||
string openid = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "openid"));
|
||||
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
if (string.IsNullOrEmpty(login_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"店铺没有登录名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update wxxd.shop set";
|
||||
if (cookie != null)
|
||||
sql += " cookie='" + cookie + "',";
|
||||
if (cookie2 != null)
|
||||
sql += " cookie2='" + cookie2 + "',";
|
||||
if (login_status != null)
|
||||
sql += " login_status='" + login_status + "',";
|
||||
if (login_status2 != null)
|
||||
sql += " login_status2='" + login_status2 + "',";
|
||||
if (openid != null)
|
||||
sql += " openid='" + openid + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where login_name='" + login_name + "'";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
|
||||
public string DelShop(string inputData, bool isAdmin=false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
if (isAdmin)
|
||||
user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name");
|
||||
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
if (string.IsNullOrEmpty(login_name))
|
||||
{
|
||||
return "{\"code\":501,\"msg\":\"没有店铺登录名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "delete from wxxd.shop where user_name='" + user_name + "' and login_name='" + login_name + "'";
|
||||
if (!string.IsNullOrEmpty(shop_id))
|
||||
sql += " and shop_id='" + shop_id + "'";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置店铺的二级超管
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string SetShopSubSa(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
|
||||
var login_name = RegexUtils.GetStringQuery(ref inputData, "shop_login_name")?.Replace("'", "\\'");
|
||||
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
|
||||
|
||||
if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(login_name))
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update wxxd.shop set";
|
||||
if (operate_sub_sa_name != null)
|
||||
sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',";
|
||||
sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
sql += " where id in (" + id + ")";
|
||||
else if (!string.IsNullOrEmpty(login_name))
|
||||
sql += " where login_name in ('" + login_name.Replace(",", "','") + "')";
|
||||
else
|
||||
sql += " where 1=2";
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,470 @@
|
||||
using KJD_Web.Model;
|
||||
using KJD_Web.Utils;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
public class WXUserManage
|
||||
{
|
||||
public string CheckUserLogin(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select * from wxxd.user where user_name='"
|
||||
+ mobile + "' and password='" + password + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
UserLoginResultParam user = new UserLoginResultParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
user_name = row["user_name"].ToString(),
|
||||
nick_name = row["nick_name"].ToString(),
|
||||
mobile = row["user_name"].ToString(),
|
||||
password = row["password"].ToString(),
|
||||
group_id = row["group_id"].ToString(),
|
||||
card_id = row["card_id"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
|
||||
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
|
||||
};
|
||||
|
||||
if (string.IsNullOrEmpty(user.company_name))
|
||||
{
|
||||
user.company_name = "-";
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(user);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string AddSubUser(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'");
|
||||
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'");
|
||||
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'");
|
||||
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
|
||||
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
|
||||
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "company"))?.Replace("'", "\\'");
|
||||
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
sql = "select exists (select 1 from wxxd.user where user_name='" + user_name + "')";
|
||||
var exist = mySql.ExecuteFirstInt(sql);
|
||||
if (exist > 0)
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
|
||||
}
|
||||
|
||||
sql = "insert into wxxd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,parent_user_name,add_time,mdy_time) " +
|
||||
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
|
||||
group_id + "','" + company_name + "','" + notes + "','" + parent_user_name + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (!rst)
|
||||
return "{\"code\":501,\"msg\":\""+ mySql.Message + "\"}";
|
||||
else
|
||||
return "{\"code\":200,\"msg\":\"子账户创建成功!\"}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetSubUser(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password");
|
||||
var group = RegexUtils.GetStringQuery(ref inputData, "group");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select * from wxxd.user where parent_user_name='"
|
||||
+ user_name + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
List<UserLoginResultParam> userList = new List<UserLoginResultParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
|
||||
UserLoginResultParam user = new UserLoginResultParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
user_name = row["user_name"].ToString(),
|
||||
nick_name = row["nick_name"].ToString(),
|
||||
mobile = row["mobile"].ToString(),
|
||||
password = row["password"].ToString(),
|
||||
group_id = row["group_id"].ToString(),
|
||||
card_id = row["card_id"].ToString(),
|
||||
parent_user_name = row["parent_user_name"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
notes = row["notes"].ToString(),
|
||||
};
|
||||
if (string.IsNullOrEmpty(user.mobile))
|
||||
{
|
||||
user.mobile = row["user_name"].ToString();
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string UpdateSubUser(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
|
||||
var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'");
|
||||
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'");
|
||||
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'");
|
||||
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
|
||||
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
|
||||
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
//sql = "select * from wxxd.user where parent_user_name='"
|
||||
// + user_name + "'";
|
||||
sql = "update wxxd.user set";
|
||||
if (!string.IsNullOrEmpty(nick_name))
|
||||
sql += " nick_name='" + nick_name + "',";
|
||||
if (!string.IsNullOrEmpty(user_name))
|
||||
sql += " user_name='" + user_name + "',";
|
||||
if (!string.IsNullOrEmpty(mobile))
|
||||
sql += " mobile='" + mobile + "',";
|
||||
if (!string.IsNullOrEmpty(password))
|
||||
sql += " password='" + password + "',";
|
||||
if (!string.IsNullOrEmpty(group_id))
|
||||
sql += " group_id=" + group_id + ",";
|
||||
if (!string.IsNullOrEmpty(card_id))
|
||||
sql += " card_id='" + card_id + "',";
|
||||
if (!string.IsNullOrEmpty(notes))
|
||||
sql += " notes='" + notes + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where id=" + id + "";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string DelUser(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "id");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "delete from wxxd.user where id='"
|
||||
+ id + "'";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
else
|
||||
return "{\"code\":500,\"msg\":\"删除失败,请稍后重试\"}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetAllUser(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
|
||||
var search = RegexUtils.GetStringQuery(ref inputData, "search")?.Replace("'", "\\'");
|
||||
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
//string sql = "select * from wxxd.user where group_id=3";
|
||||
string sql = "select * from wxxd.user where 1=1";
|
||||
if (!string.IsNullOrEmpty(group_id))
|
||||
sql += " and group_id=" + group_id;
|
||||
if (!string.IsNullOrEmpty(sa_level))
|
||||
sql += " and sa_level=" + sa_level;
|
||||
if (!string.IsNullOrEmpty(search))
|
||||
sql += " and (user_name like '%" + search +
|
||||
"%' or nick_name like '%" + search +
|
||||
"%' or company_name like '%" + search + "%')";
|
||||
sql += " order by id desc";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
List<UserLoginResultParam> userList = new List<UserLoginResultParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
|
||||
UserLoginResultParam user = new UserLoginResultParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
user_name = row["user_name"].ToString(),
|
||||
nick_name = row["nick_name"].ToString(),
|
||||
mobile = row["mobile"].ToString(),
|
||||
password = row["password"].ToString(),
|
||||
group_id = row["group_id"].ToString(),
|
||||
card_id = row["card_id"].ToString(),
|
||||
parent_user_name = row["parent_user_name"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
notes = row["notes"].ToString(),
|
||||
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
|
||||
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
|
||||
};
|
||||
if (string.IsNullOrEmpty(user.mobile))
|
||||
{
|
||||
user.mobile = row["user_name"].ToString();
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string AddUser(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'");
|
||||
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
|
||||
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'");
|
||||
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'");
|
||||
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); ;
|
||||
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
|
||||
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
|
||||
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
sql = "select exists (select 1 from wxxd.user where user_name='" + user_name + "')";
|
||||
var exist = mySql.ExecuteFirstInt(sql);
|
||||
if (exist > 0)
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
|
||||
}
|
||||
|
||||
sql = "insert into wxxd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,sa_level,add_time,mdy_time) " +
|
||||
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
|
||||
group_id + "','" + company_name + "','" + notes + "'," + sa_level + ",'" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (!rst)
|
||||
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
|
||||
else
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string UpdateUser(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
|
||||
var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'");
|
||||
var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
|
||||
var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'");
|
||||
var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'");
|
||||
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
|
||||
var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'");
|
||||
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
|
||||
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
//sql = "select * from wxxd.user where parent_user_name='"
|
||||
// + user_name + "'";
|
||||
sql = "update wxxd.user set";
|
||||
if (!string.IsNullOrEmpty(nick_name))
|
||||
sql += " nick_name='" + nick_name + "',";
|
||||
if (!string.IsNullOrEmpty(user_name))
|
||||
sql += " user_name='" + user_name + "',";
|
||||
if (!string.IsNullOrEmpty(mobile))
|
||||
sql += " mobile='" + mobile + "',";
|
||||
if (!string.IsNullOrEmpty(company_name))
|
||||
sql += " company_name='" + company_name + "',";
|
||||
if (!string.IsNullOrEmpty(password))
|
||||
sql += " password='" + password + "',";
|
||||
if (!string.IsNullOrEmpty(group_id))
|
||||
sql += " group_id=" + group_id + ",";
|
||||
if (!string.IsNullOrEmpty(card_id))
|
||||
sql += " card_id='" + card_id + "',";
|
||||
if (!string.IsNullOrEmpty(notes))
|
||||
sql += " notes='" + notes + "',";
|
||||
if (!string.IsNullOrEmpty(sa_level))
|
||||
sql += " sa_level=" + sa_level + ",";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where id=" + id + "";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public string ChangePassword(string inputData)
|
||||
{
|
||||
var userName = RegexUtils.GetStringJson(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringJson(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var newPassword = RegexUtils.GetStringJson(ref inputData, "new_password")?.Replace("'", "\\'");
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select user_id,password from pepdtp.user where user_id='"
|
||||
+ userName + "' and password='" + password + "'";
|
||||
|
||||
var dw = mySql.ExecuteDataTableRow(sql);
|
||||
if (dw != null)
|
||||
{
|
||||
UserLoginResultParam user = new UserLoginResultParam
|
||||
{
|
||||
user_name = dw["user_id"].ToString(),
|
||||
password = dw["password"].ToString(),
|
||||
};
|
||||
sql = "update pepdtp.user set password = '" + newPassword + "' where user_id='" + userName + "'";
|
||||
var result = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (result)
|
||||
{
|
||||
return "{\"code\":0,\"msg\":\"密码修改成功!\"}";
|
||||
}
|
||||
else
|
||||
return "{\"code\":19999,\"msg\":\"密码修改失败!请稍后再试。\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":1,\"msg\":\"原密码错误。\"}";
|
||||
}
|
||||
}
|
||||
|
||||
public string return_package_secret_key { get; set; } = "aaMETt2bPe6YHzZ1ojbC+6wOvgtwehqc6A+/Rz+pCUU=";
|
||||
|
||||
public string GetPackageSign(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var timestamp = RegexUtils.GetStringQuery(ref inputData, "timestamp")?.Replace("'", "\\'");
|
||||
var mallId = RegexUtils.GetStringQuery(ref inputData, "mallId")?.Replace("'", "\\'");
|
||||
var returnPackageNo = RegexUtils.GetStringQuery(ref inputData, "returnPackageNo")?.Replace("'", "\\'");
|
||||
int r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
|
||||
string c2 = RegexUtils.GetStringQuery(ref inputData, "c2");
|
||||
|
||||
if (EncrypUtil.Encryption(r2) != c2)
|
||||
return "{\"code\":2,\"msg\":\"不合法的输入内容\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select * from wxxd.user where user_name='"
|
||||
+ mobile + "' and password='" + password + "'";
|
||||
|
||||
sql = "select * from wxxd.user where user_name='" + mobile + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (dt == null || dt.Rows.Count <=0)
|
||||
{
|
||||
return "{\"code\":1,\"msg\":\"用户不存在\"}";
|
||||
}
|
||||
|
||||
string sign = EncrypUtil.GetMd5(timestamp + return_package_secret_key + mallId + returnPackageNo).ToLower();
|
||||
|
||||
return "{\"code\":200, \"sign\":\"" + sign + "\", \"msg\":\"\"}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using KJD_Web.BLL.BXX;
|
||||
using KJD_Web.BLL.DYXD;
|
||||
using KJD_Web.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -54,7 +55,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().GetShop(jsontext);
|
||||
result = new DYShopManage().GetShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -66,7 +67,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().GetOneLoginNameShop(jsontext);
|
||||
result = new DYShopManage().GetOneLoginNameShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -78,7 +79,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().AddShop(jsontext);
|
||||
result = new DYShopManage().AddShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -90,7 +91,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().DelShop(jsontext);
|
||||
result = new DYShopManage().DelShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -102,7 +103,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().MdyShop(jsontext);
|
||||
result = new DYShopManage().MdyShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -114,7 +115,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().MdyAntiContent(jsontext);
|
||||
result = new DYShopManage().MdyAntiContent(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -126,7 +127,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().MdyCookieAndLoginStatus(jsontext);
|
||||
result = new DYShopManage().MdyCookieAndLoginStatus(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -138,7 +139,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().GetShop(jsontext, true);
|
||||
result = new DYShopManage().GetShop(jsontext, true);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -150,7 +151,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().SubSaGetSelectProdShop(jsontext);
|
||||
result = new DYShopManage().SubSaGetSelectProdShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -162,7 +163,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().UpdateAddProdRemaining(jsontext);
|
||||
result = new DYShopManage().UpdateAddProdRemaining(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -174,7 +175,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().MdyShop(jsontext, true);
|
||||
result = new DYShopManage().MdyShop(jsontext, true);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -186,7 +187,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().AddShop(jsontext, true);
|
||||
result = new DYShopManage().AddShop(jsontext, true);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -198,7 +199,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().DelShop(jsontext, true);
|
||||
result = new DYShopManage().DelShop(jsontext, true);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -210,7 +211,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().SetShopSubSa(jsontext);
|
||||
result = new DYShopManage().SetShopSubSa(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using KJD_Web.BLL.BXX;
|
||||
using KJD_Web.BLL.DYXD;
|
||||
using KJD_Web.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -60,7 +61,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().CheckUserLogin(jsontext);
|
||||
result = new DYUserManage().CheckUserLogin(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -72,7 +73,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().GetPackageSign(jsontext);
|
||||
result = new DYUserManage().GetPackageSign(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -84,7 +85,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().ChangePassword(jsontext);
|
||||
result = new DYUserManage().ChangePassword(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -96,7 +97,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().GetSubUser(jsontext);
|
||||
result = new DYUserManage().GetSubUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -108,7 +109,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().UpdateSubUser(jsontext);
|
||||
result = new DYUserManage().UpdateSubUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -120,7 +121,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().AddSubUser(jsontext);
|
||||
result = new DYUserManage().AddSubUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -132,7 +133,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().DelUser(jsontext);
|
||||
result = new DYUserManage().DelUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -144,7 +145,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().GetAllUser(jsontext);
|
||||
result = new DYUserManage().GetAllUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -156,7 +157,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().UpdateUser(jsontext);
|
||||
result = new DYUserManage().UpdateUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -168,7 +169,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXUserManage().AddUser(jsontext);
|
||||
result = new DYUserManage().AddUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
|
||||
@@ -122,6 +122,39 @@ namespace KJD_Web
|
||||
hPath = hPath.Replace("/dyxd_price/", "/DYPriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_user/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_user/", "/WXUserService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_shop/", "/WXShopService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
//{
|
||||
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
|
||||
// Context.RewritePath(hPath);
|
||||
//}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_product/", "/WXProductService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product_third/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_product_third/", "/WXProductThirdService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_price/", "/WXPriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
}
|
||||
|
||||
protected void Application_AuthenticateRequest(object sender, EventArgs e)
|
||||
|
||||
@@ -74,7 +74,10 @@
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="WXProductService.asmx" />
|
||||
<Content Include="WXShopService.asmx" />
|
||||
<Content Include="DYShopService.asmx" />
|
||||
<Content Include="WXUserService.asmx" />
|
||||
<Content Include="DYUserService.asmx" />
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="BXXPriceService.asmx" />
|
||||
@@ -108,10 +111,25 @@
|
||||
<Compile Include="BLL\KJD\ToolManage.cs" />
|
||||
<Compile Include="BLL\KJD\UpadteManage.cs" />
|
||||
<Compile Include="BLL\KJD\UserManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXProductManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXShopManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXUserManage.cs" />
|
||||
<Compile Include="WXProductService.asmx.cs">
|
||||
<DependentUpon>WXProductService.asmx</DependentUpon>
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WXShopService.asmx.cs">
|
||||
<DependentUpon>WXShopService.asmx</DependentUpon>
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DYShopService.asmx.cs">
|
||||
<DependentUpon>DYShopService.asmx</DependentUpon>
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WXUserService.asmx.cs">
|
||||
<DependentUpon>WXUserService.asmx</DependentUpon>
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DYUserService.asmx.cs">
|
||||
<DependentUpon>DYUserService.asmx</DependentUpon>
|
||||
<SubType>Component</SubType>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
|
||||
@@ -20,6 +20,10 @@ namespace KJD_Web.Model.ShopModel
|
||||
/// 拼多多Id
|
||||
/// </summary>
|
||||
public string pddid { get; set; }
|
||||
/// <summary>
|
||||
/// 微信openId
|
||||
/// </summary>
|
||||
public string openid { get; set; }
|
||||
public string shop_id { get; set; }
|
||||
public string shop_account { get; set; }
|
||||
public string sub_user_name { get; set; }
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<%@ WebService Language="C#" CodeBehind="WXProductService.asmx.cs" Class="KJD_Web.WXProductService" %>
|
||||
@@ -0,0 +1,113 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// ProductService 的摘要说明
|
||||
/// </summary>
|
||||
[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_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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<%@ WebService Language="C#" CodeBehind="WXShopService.asmx.cs" Class="KJD_Web.WXShopService" %>
|
||||
@@ -0,0 +1,220 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// ShopService 的摘要说明
|
||||
/// </summary>
|
||||
[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 WXShopService : 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_shop_list()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().GetShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_one_login_name_shop()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().GetOneLoginNameShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void add_shop()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().AddShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void del_shop()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().DelShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void mdy_shop()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().MdyShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void mdy_anti_content()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().MdyAntiContent(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void mdy_shop_cookie_and_login_status()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().MdyCookieAndLoginStatus(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void admin_get_shop_list()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().GetShop(jsontext, true);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void sub_sa_get_select_prod_shop()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().SubSaGetSelectProdShop(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void update_add_prod_remaining()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().UpdateAddProdRemaining(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void admin_mdy_shop()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().MdyShop(jsontext, true);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void admin_add_shop()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().AddShop(jsontext, true);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void admin_del_shop()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().DelShop(jsontext, true);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void set_shop_sub_sa()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXShopManage().SetShopSubSa(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<%@ WebService Language="C#" CodeBehind="WXUserService.asmx.cs" Class="KJD_Web.WXUserService" %>
|
||||
@@ -0,0 +1,178 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// UserService 的摘要说明
|
||||
/// </summary>
|
||||
[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 WXUserService : System.Web.Services.WebService
|
||||
{
|
||||
[WebMethod]
|
||||
public string hello_world()
|
||||
{
|
||||
return "Hello World";
|
||||
}
|
||||
|
||||
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 user_login()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().CheckUserLogin(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_package_sign()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().GetPackageSign(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void change_password()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().ChangePassword(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_sub_user()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().GetSubUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void update_sub_user()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().UpdateSubUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void add_sub_user()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().AddSubUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void delete_user()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().DelUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_all_user()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().GetAllUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void update_user()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().UpdateUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void add_user()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXUserManage().AddUser(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user