1店铺登录逻辑优化 2备货单查询显示
This commit is contained in:
1 parent
89eb9ce9d4
commit
862ad088f5
216 files changed
+3481
-1543
No files matched your search
@@ -2,8 +2,8 @@
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Result;
|
||||
using CefSharp.WinForms;
|
||||
using LittleRabbit.Extension;
|
||||
using LittleRabbit.LittleRabbitForms.BaseForms;
|
||||
using TemuKJD.Extension;
|
||||
using TemuKJD.KJDForms.BaseForms;
|
||||
using NaiBa.CefHelper;
|
||||
using NaiBa.CefHelper.Handler;
|
||||
using NaiBa.Util.Extension;
|
||||
@@ -20,7 +20,7 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Work.DouyinApiClass;
|
||||
|
||||
namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
namespace TemuKJD.KJDForms.UploadForms
|
||||
{
|
||||
public partial class SpecialDelaySendForm : Form
|
||||
{
|
||||
@@ -56,12 +56,12 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
|
||||
public void LoadShops()
|
||||
{
|
||||
for (int i = 0; i < GlobalConfig.DouShopLoginList.Count; i++)
|
||||
for (int i = 0; i < GlobalConfig.ShopLoginList.Count; i++)
|
||||
{
|
||||
var shop = GlobalConfig.DouShopLoginList[i];
|
||||
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value?.ToString() == shop.ShopAccountId);
|
||||
var shop = GlobalConfig.ShopLoginList[i];
|
||||
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value?.ToString() == shop.ShopId);
|
||||
if (row == null)
|
||||
dgvShop.Rows.Add(false, shop.ShopAccountId, shop.ShopAccount, shop.LoginStatus == "登录成功" && shop.ApiAuthStatus == "授权成功" ? "可用" : "");
|
||||
dgvShop.Rows.Add(false, shop.ShopId, shop.ShopAccount, shop.LoginStatus == "登录成功" && shop.ApiAuthStatus == "授权成功" ? "可用" : "");
|
||||
else
|
||||
{
|
||||
row.Cells["colLoginStatus"].Value = shop.LoginStatus;
|
||||
@@ -88,7 +88,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
DataGridViewRow row = null;
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null)
|
||||
{
|
||||
if (isShowResult)
|
||||
@@ -165,7 +165,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
this.operateCount = this.txtTotalCount.Text.ParseToInt();
|
||||
var shopIds = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true)
|
||||
.Select(r => r.Cells["colShopId"].Value?.ToString()).ToList();
|
||||
var shops = GlobalConfig.DouShopLoginList.Where(s => shopIds.Contains(s.ShopAccountId)).ToList();
|
||||
var shops = GlobalConfig.ShopLoginList.Where(s => shopIds.Contains(s.ShopId)).ToList();
|
||||
if (shops.Count == 0)
|
||||
{
|
||||
BaseMsgForm.ShowError("请选择要操作的店铺");
|
||||
@@ -208,7 +208,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var row1 = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value?.ToString() == shop.ShopAccountId);
|
||||
var row1 = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value?.ToString() == shop.ShopId);
|
||||
if (row1 != null)
|
||||
row1.Cells["colMessage"].Value = "设置中断";
|
||||
}));
|
||||
@@ -242,7 +242,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
currentNum += pageSize;
|
||||
if (cancellationTokenSource != null && cancellationTokenSource.IsCancellationRequested)
|
||||
{
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null) { Invoke(new Action(() => { row.Cells["colMessage"].Value = "下架中断"; })); }
|
||||
break;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null)
|
||||
{
|
||||
//row.Cells["colOnSaleCount"].Value = totalNumBase;
|
||||
@@ -274,7 +274,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
offSaleMessage = "设置结束,店铺没有在售的商品";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null) { row.Cells["colMessage"].Value = offSaleMessage; }
|
||||
}));
|
||||
break;
|
||||
@@ -293,7 +293,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
offSaleMessage = "正在获取商品,第" + currentNum + "件商品,共" + operateCount + "件商品";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null) { row.Cells["colMessage"].Value = offSaleMessage; }
|
||||
}));
|
||||
}
|
||||
@@ -310,7 +310,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
offSaleMessage = ("设置发货延迟失败," + failMessage).TrimEnd(',');
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null) { row.Cells["colMessage"].Value = offSaleMessage; }
|
||||
}));
|
||||
}
|
||||
@@ -332,7 +332,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
{
|
||||
if (cancellationTokenSource != null && cancellationTokenSource.IsCancellationRequested)
|
||||
{
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null) { Invoke(new Action(() => { row.Cells["colMessage"].Value = "设置发货延迟中断"; })); }
|
||||
break;
|
||||
}
|
||||
@@ -340,7 +340,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
offSaleMessage = "正在设置发货延迟,第 " + (i + 1) + " 件商品,共 " + operateCount + " 件商品";
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null) { row.Cells["colMessage"].Value = offSaleMessage; }
|
||||
this.statusBar.lblTaskStatus.Text = offSaleMessage;
|
||||
}));
|
||||
@@ -425,7 +425,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
offSaleMessage = "设置特殊发货时间完成";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
|
||||
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
|
||||
if (row != null) { row.Cells["colMessage"].Value = offSaleMessage; }
|
||||
}));
|
||||
}
|
||||
@@ -485,7 +485,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText;
|
||||
long shopId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToLong();
|
||||
string shopName = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ToString();
|
||||
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ShopAccountId == shopId.ToString());
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId.ToString());
|
||||
switch (headerText)
|
||||
{
|
||||
case "操作":
|
||||
@@ -521,7 +521,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = GlobalConfig.DouShopLoginList.Where(s => s.ApiAuthStatus == "授权成功" && s.LoginStatus == "登录成功").Select(ss => ss.ShopAccountId);
|
||||
var list = GlobalConfig.ShopLoginList.Where(s => s.ApiAuthStatus == "授权成功" && s.LoginStatus == "登录成功").Select(ss => ss.ShopId);
|
||||
foreach (DataGridViewRow row in dgvShop.Rows)
|
||||
{
|
||||
if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
|
||||
|
||||
Reference in new issue
Block a user