1添加随机上传商品 2优化pdd api授权逻辑

This commit is contained in:
wule committed 2026-04-02 19:48:38 +08:00
1 parent 07b912e9eb
commit c0b7c2d986
34 files changed
+1651 -603

No files matched your search

@@ -2822,6 +2822,98 @@ namespace KJD_Web.BLL.BXX
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string SetRandomCompanyProductConfig(string inputData)
{
var timeCalc = DateTime.Now;
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\":50000,\"msg\":\"用户不存在\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string product_group = RegexUtils.GetStringQuery(ref inputData, "product_group")?.Replace("'", "\\'");
string product_interval = RegexUtils.GetStringQuery(ref inputData, "product_interval")?.Replace("'", "\\'");
string is_on = RegexUtils.GetStringQuery(ref inputData, "is_on")?.Replace("'", "\\'");
string sql = "update bxx.product_com_random set ";
if (product_group != null)
sql += "product_group='" + product_group + "',";
if (product_interval != null)
sql += "product_interval=" + product_interval + ",";
if (is_on != null)
sql += "is_on=" + is_on + ",";
sql = sql.TrimEnd(',');
sql += " where 1=1;";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetRandomCompanyProductConfig(string inputData)
{
var timeCalc = DateTime.Now;
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\":50000,\"msg\":\"用户不存在\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select p.* from bxx.product_com_random p" +
" where 1=1;";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
try
{
string product_group = dt.Rows[0]["product_group"].ParseToString();
string product_interval = dt.Rows[0]["product_interval"].ParseToString();
string is_on = dt.Rows[0]["is_on"].ParseToString();
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\"" +
",\"product_group\":\"" + product_group + "\"" +
",\"product_interval\":" + product_interval +
",\"is_on\":" + is_on +
",\"seconds\":" + seconds + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\"}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -532,6 +532,101 @@ namespace KJD_Web.BLL.WXXD
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string SetRandomCompanyProductConfig(string inputData)
{
var timeCalc = DateTime.Now;
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\":50000,\"msg\":\"用户不存在\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string product_group = RegexUtils.GetStringQuery(ref inputData, "product_group")?.Replace("'", "\\'");
string product_interval = RegexUtils.GetStringQuery(ref inputData, "product_interval")?.Replace("'", "\\'");
string is_on = RegexUtils.GetStringQuery(ref inputData, "is_on")?.Replace("'", "\\'");
string sql = "update wxxd.product_com_random set ";
if (product_group != null)
sql += "product_group='" + product_group + "',";
if (product_interval != null)
sql += "product_interval=" + product_interval + ",";
if (is_on != null)
sql += "is_on=" + is_on + ",";
sql = sql.TrimEnd(',');
sql += " where 1=1;";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetRandomCompanyProductConfig(string inputData)
{
var timeCalc = DateTime.Now;
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\":50000,\"msg\":\"用户不存在\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select p.* from wxxd.product_com_random p" +
" where 1=1;";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
try
{
string product_group = dt.Rows[0]["product_group"].ParseToString();
string product_interval = dt.Rows[0]["product_interval"].ParseToString();
string is_on = dt.Rows[0]["is_on"].ParseToString();
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\"" +
",\"product_group\":\"" + product_group + "\"" +
",\"product_interval\":" + product_interval +
",\"is_on\":" + is_on +
",\"seconds\":" + seconds + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\"}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXAddMdyAfterSale(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
@@ -504,5 +504,28 @@ namespace KJD_Web
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void set_random_company_product_config()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().SetRandomCompanyProductConfig(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_random_company_product_config()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetRandomCompanyProductConfig(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -134,6 +134,29 @@ namespace KJD_Web
Context.Response.End();
}
[WebMethod]
public void set_random_company_product_config()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXProductManage().SetRandomCompanyProductConfig(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_random_company_product_config()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXProductManage().GetRandomCompanyProductConfig(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_secret_spu_id_shop_id_map()
{