pdd上货逻辑继续优化 temu选品数据店铺筛选功能
This commit is contained in:
1 parent
0e6a034d5f
commit
b868c718f0
19 files changed
+562
-271
No files matched your search
@@ -33,61 +33,6 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
#region 服务端店铺管理
|
||||
public static string AddServerDouShop(ShopLoginInfo _shop)
|
||||
{
|
||||
var url = BaseClass.BuildObjString("shop/add_shop");
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&login_name=" + _shop.LoginName
|
||||
+ "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password)
|
||||
+ "&shop_id=" + _shop.ShopId
|
||||
+ "&shop_account=" + _shop.ShopAccount
|
||||
+ "&cookie=" + _shop.Cookies
|
||||
+ "&cookie2=" + _shop.Cookies2
|
||||
+ "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName)
|
||||
+ "&sub_user_name=" + GetHtml.UrlEncodeUtf8(_shop.SubUserName)
|
||||
+ "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes)
|
||||
+ "&login_status=" + _shop.LoginStatus;
|
||||
|
||||
var result = GetHtml.PostUtf8(url, data);
|
||||
if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在"))
|
||||
result = GetHtml.PostUtf8(url, data);
|
||||
if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在"))
|
||||
result = GetHtml.PostUtf8(url, data);
|
||||
if (!result.Contains("\"code\":200"))
|
||||
{
|
||||
var msg = BaseRegex.GetStringJson(ref result, "msg");
|
||||
if (string.IsNullOrEmpty(msg))
|
||||
msg = "店铺保存失败!";
|
||||
BaseMsgForm.ShowError(msg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string MdyServerDouShop(ShopLoginInfo _shop)
|
||||
{
|
||||
var url = BaseClass.BuildObjString("shop/mdy_shop");
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&login_name=" + _shop.LoginName
|
||||
+ "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password)
|
||||
+ "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName)
|
||||
+ "&sub_user_name=" + _shop.SubUserName
|
||||
+ "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes);
|
||||
|
||||
var result = GetHtml.PostUtf8(url, data);
|
||||
if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在"))
|
||||
result = GetHtml.PostUtf8(url, data);
|
||||
if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在"))
|
||||
result = GetHtml.PostUtf8(url, data);
|
||||
if (!result.Contains("\"code\":200"))
|
||||
{
|
||||
var msg = BaseRegex.GetStringJson(ref result, "msg");
|
||||
if (string.IsNullOrEmpty(msg))
|
||||
msg = "店铺保存失败!";
|
||||
BaseMsgForm.ShowError(msg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void UpdateShop()
|
||||
{
|
||||
// 获取本地店铺和服务端店铺。将服务端相关信息与本地店铺合并后暂时存在内存中(不保存敏感信息)。
|
||||
@@ -327,13 +272,13 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopListForm.AddServerDouShop(shopInfo);
|
||||
ShopBLL.AddServerShop(shopInfo);
|
||||
btnRefreshCookie_Click(null, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopListForm.MdyServerDouShop(shopInfo);
|
||||
ShopBLL.MdyServerShopSubInfo(shopInfo);
|
||||
btnRefreshCookie_Click(null, null);
|
||||
}
|
||||
}
|
||||
@@ -417,7 +362,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
else
|
||||
GlobalConfig.ShopLoginList.Add(shop);
|
||||
StartUp.SaveLocalShopLoginInfo();
|
||||
ShopListForm.AddServerDouShop(shop);
|
||||
ShopBLL.AddServerShop(shop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ using System.Windows.Forms;
|
||||
using Work;
|
||||
using Work.BLL.Tools;
|
||||
using TemuKJD.KJDForms.AdminForms;
|
||||
using TemuKJD.BLL;
|
||||
|
||||
namespace TemuKJD.KJDForms.ShopForms
|
||||
{
|
||||
@@ -169,7 +170,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
if (oldShop == null)
|
||||
{
|
||||
GlobalConfig.ShopLoginList.Add(newShop);
|
||||
ShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端
|
||||
ShopBLL.AddServerShop(newShop); // 店铺写入到服务端
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -276,7 +277,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
if (oldShop == null)
|
||||
{
|
||||
GlobalConfig.ShopLoginList.Add(newShop);
|
||||
ShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端
|
||||
ShopBLL.AddServerShop(newShop); // 店铺写入到服务端
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
if (updateFrom != SetCookieFromEnum.normal_user)
|
||||
ShopBLL.AdminAddServerShop(newShop); // 店铺写入到服务端
|
||||
else
|
||||
ShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端
|
||||
ShopBLL.AddServerShop(newShop); // 店铺写入到服务端
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user