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

@@ -1,6 +1,6 @@
using AllBase.Helper;
using LittleRabbit.Extension;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.Extension;
using TemuKJD.KJDForms.BaseForms;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
@@ -15,7 +15,7 @@ using System.Windows.Forms;
using Work.BLL.Upload;
using Work.DouyinApiClass;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class MaterialManageForm : Form
{
@@ -47,7 +47,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
}
else
{
var list = GlobalConfig.DouShopLoginList.Where(s => s.ApiAuthStatus == "授权成功").Select(ss => ss.ShopAccountId);
var list = GlobalConfig.ShopLoginList.Where(s => s.ApiAuthStatus == "授权成功").Select(ss => ss.ShopId);
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
@@ -60,19 +60,19 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
// 获取被删除的店铺
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);
}
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);
dgvShop.Rows.Add(false, shop.ShopId, shop.ShopAccount, shop.LoginStatus);
else
{
row.Cells["colAuthStatus"].Value = shop.ApiAuthStatus;
@@ -161,7 +161,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
{
var shopList = GlobalConfig.DouShopLoginList.Where(s => s.ApiAuthStatus == "授权成功" && lstShopId.Contains(s.ShopAccountId));
var shopList = GlobalConfig.ShopLoginList.Where(s => s.ApiAuthStatus == "授权成功" && lstShopId.Contains(s.ShopId));
foreach (var shop in shopList)
{
DataGridViewRow row = null;
@@ -176,7 +176,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.statusBar.pgbTaskProgress.Text = n + "/" + total;
this.statusBar.pgbTaskProgress.Maximum = total;
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) { row.Cells["colMessage"].Value = "正在获取素材文件夹"; }
}));
@@ -335,7 +335,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.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) { row.Cells["colMessage"].Value = "素材文件夹删除完成"; }
}));
Thread.Sleep(2000);