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,8 +3,8 @@ using AllBase.Helper;
using AllBase.Model.Param.FissionManage;
using AllBase.Model.Param.ProductManage;
using AllBase.Model.Result;
using LittleRabbit.Extension;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.Extension;
using TemuKJD.KJDForms.BaseForms;
using NaiBa.Util;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
@@ -25,7 +25,7 @@ using Work.BLL.Product;
using Work.BLL.Upload;
using Work.DouyinApiClass;
namespace LittleRabbit.LittleRabbitForms.UploadForms
namespace TemuKJD.KJDForms.UploadForms
{
public partial class ViolateManageForm : Form
{
@@ -92,7 +92,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
{
string dataFromDescribe = GetDataFromDescribe(violateParam.DataFrom);
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ShopAccountId == violateParam.DouShopId);
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == violateParam.DouShopId);
Invoke(new Action(() =>
{
this.dgvCheck.Rows.Add(true, dataFromDescribe, violateParam.DouShopId, shop?.ShopAccount, violateParam.DouProductId,
@@ -116,7 +116,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
}
else
{
var list = GlobalConfig.DouShopLoginList.Where(s => s.ApiAuthStatus == "授权成功").Select(ss => ss.ShopAccountId).ToList();
var list = GlobalConfig.ShopLoginList.Where(s => s.ApiAuthStatus == "授权成功").Select(ss => ss.ShopId).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
@@ -203,19 +203,19 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
{
// 获取被删除的店铺
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;
@@ -470,7 +470,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
var lstShopId = dgvShop.Rows.Cast<DataGridViewRow>()
.Where(r => r.Cells["colSelect"].Value.ParseToBool())
.Select(r => r.Cells["colShopId"].Value?.ToString()).ToList();
var shopList = GlobalConfig.DouShopLoginList.Where(s => lstShopId.Contains(s.ShopAccountId) && s.ApiAuthStatus == "授权成功").ToList();
var shopList = GlobalConfig.ShopLoginList.Where(s => lstShopId.Contains(s.ShopId) && s.ApiAuthStatus == "授权成功").ToList();
if (shopList.Count == 0 && (chkOperateOffSale.Checked || chkOperateOnSale.Checked))
{
BaseMsgForm.ShowInfo("请选择要清理素材的店铺");
@@ -554,7 +554,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
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 (shop.PayStatus != 1)
@@ -597,7 +597,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
currentNum += pageSize;
if (cancellationTokenSource != null && cancellationTokenSource.IsCancellationRequested)
{
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) { Invoke(new Action(() => { row.Cells["colMessage"].Value = "排查中断"; })); }
break;
}
@@ -633,7 +633,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
deleteProductMessage = "排查结束,店铺没有仓库商品";
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 = deleteProductMessage; }
}));
break;
@@ -656,7 +656,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
deleteProductMessage = "已获取:" + currentNum + ",仓库商品获取中...";
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 = deleteProductMessage; }
}));
}
@@ -673,7 +673,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
deleteProductMessage = ("排查遇到错误," + failMessage).TrimEnd(',');
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 = deleteProductMessage; }
}));
}
@@ -688,7 +688,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
deleteProductMessage = "店铺商品排查完成";
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 = deleteProductMessage; }
}));
}
@@ -698,7 +698,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
deleteProductMessage = "店铺商品排查完成";
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 = deleteProductMessage; }
}));
}
@@ -709,7 +709,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
{
if (cancellationTokenSource != null && cancellationTokenSource.IsCancellationRequested)
{
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) { Invoke(new Action(() => { row.Cells["colMessage"].Value = "排查中断"; })); }
break;
}
@@ -724,7 +724,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
deleteProductMessage = "正在排查在售商品,第 " + (i + 1) + " 件商品,共 " + operateCount + " 件商品";
if (!isOperateOnline)
deleteProductMessage = "正在排查仓库商品,第 " + (i + 1) + " 件商品,共 " + operateCount + " 件商品";
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 = deleteProductMessage; }
}));
Thread.Sleep(Randomx.GetId(50, 150));
@@ -736,7 +736,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
{
DataFrom = isOperateOnline ? 2 : 3,
DouProductId = product.product_id.ToString(),
DouShopId = shop.ShopAccountId,
DouShopId = shop.ShopId,
};
violateParamList.Add(violateParam);
@@ -1220,7 +1220,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)
@@ -1367,7 +1367,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
}
else
{
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ShopAccountId == shopId);
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (shop != null)
{
Dictionary<string, string> dictionary = new Dictionary<string, string>();