1修复sku有特殊字符被截断的bug 2优化店铺进店/登录逻辑
This commit is contained in:
1 parent
91b1ea7dbc
commit
358bb5490e
21 files changed
+304
-171
No files matched your search
@@ -56,7 +56,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
/// </summary>
|
||||
/// <param name="shop"></param>
|
||||
/// <param name="isBack">后台静默执行</param>
|
||||
public bool GetReturnPackage(ShopLoginInfo shop, bool isBack = false)
|
||||
public bool GetReturnPackage(ShopLoginInfo shop, bool isBack = false, DateTime? backStartTime = null, DateTime? backEndTime = null)
|
||||
{
|
||||
bool isError = false;
|
||||
|
||||
@@ -82,8 +82,12 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
if (isBack)
|
||||
{
|
||||
endTime = this.dtpEndDate.Value.Date.AddDays(1);
|
||||
startTime = endTime.AddMonths(-1);
|
||||
//startTime = endTime.AddMonths(-1);
|
||||
startTime = endTime.AddDays(-20);
|
||||
if (backEndTime != null)
|
||||
backEndTime = backEndTime.Value;
|
||||
if (backStartTime != null)
|
||||
startTime = backStartTime.Value;
|
||||
}
|
||||
cancellationTokenSource = new CancellationTokenSource();
|
||||
var t = Task.Run(() =>
|
||||
|
||||
+34
-34
@@ -30,18 +30,18 @@
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShopAddEditForm));
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.lblNotes = new System.Windows.Forms.Label();
|
||||
this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.cmbGroup = new System.Windows.Forms.ComboBox();
|
||||
this.txtBuyAccount = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.txtChatAccount = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.lblChatAccount = new System.Windows.Forms.Label();
|
||||
this.txtUploadAccount = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.txtShopPassword = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.lblShopPassword = new System.Windows.Forms.Label();
|
||||
this.txtLoginName = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
@@ -52,18 +52,18 @@
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BackColor = System.Drawing.Color.White;
|
||||
this.panel2.Controls.Add(this.label8);
|
||||
this.panel2.Controls.Add(this.lblNotes);
|
||||
this.panel2.Controls.Add(this.txtNotes);
|
||||
this.panel2.Controls.Add(this.label7);
|
||||
this.panel2.Controls.Add(this.cmbGroup);
|
||||
this.panel2.Controls.Add(this.txtBuyAccount);
|
||||
this.panel2.Controls.Add(this.label6);
|
||||
this.panel2.Controls.Add(this.txtChatAccount);
|
||||
this.panel2.Controls.Add(this.label4);
|
||||
this.panel2.Controls.Add(this.lblChatAccount);
|
||||
this.panel2.Controls.Add(this.txtUploadAccount);
|
||||
this.panel2.Controls.Add(this.label3);
|
||||
this.panel2.Controls.Add(this.txtShopPassword);
|
||||
this.panel2.Controls.Add(this.label2);
|
||||
this.panel2.Controls.Add(this.lblShopPassword);
|
||||
this.panel2.Controls.Add(this.txtLoginName);
|
||||
this.panel2.Controls.Add(this.label1);
|
||||
this.panel2.Controls.Add(this.label5);
|
||||
@@ -71,18 +71,18 @@
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(1, 33);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(295, 285);
|
||||
this.panel2.Size = new System.Drawing.Size(295, 276);
|
||||
this.panel2.TabIndex = 1;
|
||||
this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);
|
||||
//
|
||||
// label8
|
||||
// lblNotes
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(29, 135);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(56, 17);
|
||||
this.label8.TabIndex = 386;
|
||||
this.label8.Text = " 备注";
|
||||
this.lblNotes.AutoSize = true;
|
||||
this.lblNotes.Location = new System.Drawing.Point(29, 136);
|
||||
this.lblNotes.Name = "lblNotes";
|
||||
this.lblNotes.Size = new System.Drawing.Size(56, 17);
|
||||
this.lblNotes.TabIndex = 386;
|
||||
this.lblNotes.Text = " 备注";
|
||||
//
|
||||
// txtNotes
|
||||
//
|
||||
@@ -124,7 +124,7 @@
|
||||
"上货",
|
||||
"数据",
|
||||
"登录"});
|
||||
this.cmbGroup.Location = new System.Drawing.Point(91, 257);
|
||||
this.cmbGroup.Location = new System.Drawing.Point(91, 253);
|
||||
this.cmbGroup.Name = "cmbGroup";
|
||||
this.cmbGroup.Size = new System.Drawing.Size(172, 25);
|
||||
this.cmbGroup.TabIndex = 383;
|
||||
@@ -183,14 +183,14 @@
|
||||
this.txtChatAccount.Click += new System.EventHandler(this.txt_Click);
|
||||
this.txtChatAccount.TextChanged += new System.EventHandler(this.txtChat_TextChanged);
|
||||
//
|
||||
// label4
|
||||
// lblChatAccount
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(29, 102);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(56, 17);
|
||||
this.label4.TabIndex = 379;
|
||||
this.label4.Text = " 子账户";
|
||||
this.lblChatAccount.AutoSize = true;
|
||||
this.lblChatAccount.Location = new System.Drawing.Point(29, 102);
|
||||
this.lblChatAccount.Name = "lblChatAccount";
|
||||
this.lblChatAccount.Size = new System.Drawing.Size(56, 17);
|
||||
this.lblChatAccount.TabIndex = 379;
|
||||
this.lblChatAccount.Text = " 子账户";
|
||||
//
|
||||
// txtUploadAccount
|
||||
//
|
||||
@@ -229,14 +229,14 @@
|
||||
this.txtShopPassword.Size = new System.Drawing.Size(172, 23);
|
||||
this.txtShopPassword.TabIndex = 338;
|
||||
//
|
||||
// label2
|
||||
// lblShopPassword
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(29, 67);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(56, 17);
|
||||
this.label2.TabIndex = 337;
|
||||
this.label2.Text = "登录密码";
|
||||
this.lblShopPassword.AutoSize = true;
|
||||
this.lblShopPassword.Location = new System.Drawing.Point(29, 67);
|
||||
this.lblShopPassword.Name = "lblShopPassword";
|
||||
this.lblShopPassword.Size = new System.Drawing.Size(56, 17);
|
||||
this.lblShopPassword.TabIndex = 337;
|
||||
this.lblShopPassword.Text = "登录密码";
|
||||
//
|
||||
// txtLoginName
|
||||
//
|
||||
@@ -257,7 +257,7 @@
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(29, 260);
|
||||
this.label5.Location = new System.Drawing.Point(29, 256);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(56, 17);
|
||||
this.label5.TabIndex = 377;
|
||||
@@ -283,7 +283,7 @@
|
||||
// ShopAddEditForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(297, 319);
|
||||
this.ClientSize = new System.Drawing.Size(297, 310);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
@@ -302,7 +302,6 @@
|
||||
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox txtLoginName;
|
||||
private UserControls.ButtonEx btnOk;
|
||||
private System.Windows.Forms.Label label5;
|
||||
@@ -310,12 +309,13 @@
|
||||
private System.Windows.Forms.Label label3;
|
||||
private DevComponents.DotNetBar.Controls.TextBoxX txtBuyAccount;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.ComboBox cmbGroup;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
public System.Windows.Forms.TextBox txtShopPassword;
|
||||
public DevComponents.DotNetBar.Controls.TextBoxX txtChatAccount;
|
||||
public DevComponents.DotNetBar.Controls.TextBoxX txtNotes;
|
||||
public System.Windows.Forms.Label lblNotes;
|
||||
public System.Windows.Forms.Label lblChatAccount;
|
||||
public System.Windows.Forms.Label lblShopPassword;
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,8 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
public static void UpdateShop()
|
||||
{
|
||||
// 获取本地店铺和服务端店铺。将服务端相关信息与本地店铺合并后暂时存在内存中(不保存敏感信息)。
|
||||
GlobalConfig.ShopLoginList = new ConcurrentList<ShopLoginInfo>();
|
||||
//GlobalConfig.ShopLoginList = new ConcurrentList<ShopLoginInfo>();
|
||||
GlobalConfig.ShopLoginList.Clear();
|
||||
// 获取服务端店铺
|
||||
var serverShopList = ShopListForm.GetServerShop();
|
||||
//var localShopList = NaiBa.Util.Helper.ConfigHelper.LoadConfig<ConcurrentList<ShopLoginInfo>>("dou_shop_login");
|
||||
@@ -99,8 +100,6 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
GlobalConfig.ShopLoginList.Add(localShop);
|
||||
}
|
||||
}
|
||||
GlobalConfig.DouShopLoginOtherUserShopList = new ConcurrentList<ShopLoginInfo>();
|
||||
GlobalConfig.DouShopLoginOtherUserShopList.AddRange(localShopList.Where(l => !GlobalConfig.ShopLoginList.Any(s => s.LoginName == l.LoginName)));
|
||||
}
|
||||
|
||||
public static List<ShopLoginInfo> GetServerShop()
|
||||
@@ -612,7 +611,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
|
||||
// 先从服务端取最新cookie
|
||||
var serverCampanys = ShopBLL.AdminGetServerShopLstByIds(campanys.Select(c => c.ShopId).ToList());
|
||||
var sss = string.Join(",", serverCampanys.Select(s => s.UserName + s.ShopAccount));
|
||||
var sJoin = string.Join(",", serverCampanys.Select(s => s.UserName + s.ShopAccount));
|
||||
var serverShop = serverCampanys.FirstOrDefault();
|
||||
if (shop != null && serverShop != null)
|
||||
{
|
||||
@@ -981,8 +980,8 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
case "编辑":
|
||||
{
|
||||
ShopAddEditForm editForm = new ShopAddEditForm(shop);
|
||||
editForm.txtNotes.ReadOnly = true;
|
||||
editForm.txtNotes.Enabled = false;
|
||||
editForm.lblNotes.Visible = false;
|
||||
editForm.txtNotes.Visible = false;
|
||||
editForm.SaveCompleteWithDescribe += Sae_SaveComplete;
|
||||
editForm.ShowDialog();
|
||||
}
|
||||
@@ -990,10 +989,19 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
case "编辑备注":
|
||||
{
|
||||
ShopAddEditForm editForm = new ShopAddEditForm(shop);
|
||||
editForm.txtChatAccount.ReadOnly = true;
|
||||
editForm.txtChatAccount.Enabled = false;
|
||||
editForm.txtShopPassword.ReadOnly = true;
|
||||
editForm.txtShopPassword.Enabled = false;
|
||||
editForm.txtShopPassword.Visible = false;
|
||||
editForm.lblShopPassword.Visible = false;
|
||||
|
||||
editForm.txtChatAccount.ReadOnly = true;
|
||||
editForm.txtChatAccount.Enabled = false;
|
||||
editForm.txtChatAccount.Visible = false;
|
||||
editForm.lblChatAccount.Visible = false;
|
||||
|
||||
editForm.lblNotes.Location = editForm.lblShopPassword.Location;
|
||||
editForm.txtNotes.Location = editForm.txtShopPassword.Location;
|
||||
|
||||
editForm.ShowDialog();
|
||||
if (editForm.HasChange)
|
||||
{
|
||||
|
||||
@@ -875,10 +875,18 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
|
||||
if (jArr.Count() == 0)
|
||||
return list;
|
||||
|
||||
list = JsonHelper.DeserializeJsonToList<TemuDBProductPurchasePriceInfo>(jArr.ToString());
|
||||
list = JsonHelper.DeserializeJsonToList<TemuDBProductPurchasePriceInfo>(JsonHelper.SerializeObject(jArr));
|
||||
foreach (var pPrice in list)
|
||||
{
|
||||
pPrice.dbSkuPurchasePriceList = JsonHelper.DeserializeJsonToList<TemuDBSkuPurchasePriceInfo>(pPrice.sku_purchase_price_json);
|
||||
//skc"19938266422",sku"3733016951"
|
||||
//[{"productSkuId":90853786355,"className":"黑色","productSkuSpecList":null,"priceValue":2974,"purchasePriceValue":1100},{"productSkuId":18684743772,"className":"黑色
|
||||
try
|
||||
{
|
||||
pPrice.dbSkuPurchasePriceList = JsonHelper.DeserializeJsonToList<TemuDBSkuPurchasePriceInfo>(pPrice.sku_purchase_price_json);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
if (pPrice.dbSkuPurchasePriceList == null)
|
||||
pPrice.dbSkuPurchasePriceList = new List<TemuDBSkuPurchasePriceInfo>();
|
||||
else
|
||||
|
||||
@@ -122,13 +122,13 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
|
||||
data += "&skc_id=" + purchasePriceItem.skc_id;
|
||||
data += "&cat_id=" + purchasePriceItem.cat_id;
|
||||
data += "&cat_name=" + purchasePriceItem.cat_name;
|
||||
data += "&ext_code=" + purchasePriceItem.ext_code;
|
||||
data += "&product_name=" + purchasePriceItem.product_name;
|
||||
data += "&main_img=" + purchasePriceItem.main_img;
|
||||
data += "&ext_code=" + GetHtml.UrlEncodeUtf8(purchasePriceItem.ext_code);
|
||||
data += "&product_name=" + GetHtml.UrlEncodeUtf8(purchasePriceItem.product_name);
|
||||
data += "&main_img=" + GetHtml.UrlEncodeUtf8(purchasePriceItem.main_img);
|
||||
data += "&discount=" + purchasePriceItem.discount;
|
||||
data += "&price_text=" + purchasePriceItem.price_text;
|
||||
data += "&sku_purchase_price_json=" + purchasePriceItem.sku_purchase_price_json;
|
||||
data += "¬es=" + purchasePriceItem.notes;
|
||||
data += "&price_text=" + GetHtml.UrlEncodeUtf8(purchasePriceItem.price_text);
|
||||
data += "&sku_purchase_price_json=" + GetHtml.UrlEncodeUtf8(purchasePriceItem.sku_purchase_price_json);
|
||||
data += "¬es=" + GetHtml.UrlEncodeUtf8(purchasePriceItem.notes);
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
// html = GetHtml.PostUtf8(url, data);
|
||||
|
||||
Reference in new issue
Block a user