1店铺登录逻辑优化 2备货单查询显示

This commit is contained in:
wule committed 2025-07-01 18:58:51 +08:00
1 parent 89eb9ce9d4
commit 862ad088f5
216 files changed
+3481 -1543

No files matched your search

@@ -3,10 +3,10 @@ using AllBase.Helper;
using AllBase.Model.Result;
using CefSharp;
using CefSharp.WinForms;
using LittleRabbit.Extension;
using LittleRabbit.Helper;
using LittleRabbit.LittleRabbitForms.BaseForms;
using LittleRabbit.LittleRabbitForms.ShopForms;
using TemuKJD.Extension;
using TemuKJD.Helper;
using TemuKJD.KJDForms.BaseForms;
using TemuKJD.KJDForms.ShopForms;
using NaiBa.CefHelper;
using NaiBa.CefHelper.Handler;
using NaiBa.Util;
@@ -23,7 +23,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
namespace TemuKJD.KJDForms.SalesCenterForms
{
public partial class GroupBuyForm : Form
{
@@ -89,7 +89,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
else
{
lstShopId.Clear();
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);
lstShopId.AddRange(list);
foreach (DataGridViewRow row in dgvShop.Rows)
{
@@ -123,17 +123,17 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
private void RefreshShop()
{
// 更新选中的上货店铺Id
lstShopId = lstShopId.Where(id => GlobalConfig.DouShopLoginList.Any(s => s.ShopAccountId == id && s.LoginStatus == "已授权")).ToList();
lstShopId = lstShopId.Where(id => GlobalConfig.ShopLoginList.Any(s => s.ShopId == id && s.LoginStatus == "已授权")).ToList();
// 获取被删除的店铺
List<DataGridViewRow> dgvRowList = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> !GlobalConfig.DouShopLoginList.Any(s => s.ShopAccountId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
=> !GlobalConfig.ShopLoginList.Any(s => s.ShopId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
// 更新被删除的店铺列表
foreach (var row in dgvRowList)
{
dgvShop.Rows.Remove(row);
}
// 绑定其他店铺(含新导入的店铺)
foreach (DouShopLoginInfo shopEntity in GlobalConfig.DouShopLoginList)
foreach (DouShopLoginInfo shopEntity in GlobalConfig.ShopLoginList)
{
BindShop(shopEntity);
}
@@ -145,12 +145,12 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
return;
bool canUse = shopEntity.ApiAuthStatus == "授权成功" && shopEntity.LoginStatus == "登录成功";
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopAccountId);
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
if (row == null)
{
this.dgvShop.Rows.Add(
lstShopId.Contains(shopEntity.ShopAccountId) && canUse,
shopEntity.ShopAccountId,
lstShopId.Contains(shopEntity.ShopId) && canUse,
shopEntity.ShopId,
shopEntity.ShopAccount,
shopEntity.ApiAuthStatus,
shopEntity.LoginStatus,
@@ -160,7 +160,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
}
else
{
row.Cells["colSelect"].Value = lstShopId.Contains(shopEntity.ShopAccountId) && canUse;
row.Cells["colSelect"].Value = lstShopId.Contains(shopEntity.ShopId) && canUse;
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
row.Cells["colAuthStatus"].Value = shopEntity.ApiAuthStatus;
row.Cells["colLoginStatus"].Value = shopEntity.LoginStatus;
@@ -262,7 +262,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
if (cancellationTokenSource.IsCancellationRequested)
break;
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ShopAccountId == shopId);
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (shop == null)
continue;
@@ -273,7 +273,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
{
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["colLoginStatus"].Value = "未登录";
@@ -286,11 +286,11 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
GroupBuyShopForm groupBuyShopForm = null;
Invoke(new Action(() =>
{
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount && t.Name == "tab" + shop.ShopAccountId);
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount && t.Name == "tab" + shop.ShopId);
if (tab == null)
{
tab = new TabPage();
tab.Name = "tab" + shop.ShopAccountId;
tab.Name = "tab" + shop.ShopId;
tab.Text = shop.ShopAccount;
this.ucTabControl1.TabPages.Add(tab);
@@ -488,7 +488,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
Invoke(new Action(() =>
{
var shop = webBrowser.Tag as DouShopLoginInfo;
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount && t.Name == "tab" + shop.ShopAccountId);
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount && t.Name == "tab" + shop.ShopId);
salesForm = tab.Controls[0] as GroupBuyShopForm;
}));
@@ -542,7 +542,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
string columnName = dgvShop.Columns[e.ColumnIndex].Name;
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());
var row = dgvShop.Rows[e.RowIndex];
switch (columnName)
{
@@ -619,7 +619,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
{
foreach (var shopId in lstShopId)
{
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ShopAccountId == shopId);
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (shop == null)
continue;