1店铺登录逻辑优化 2备货单查询显示
This commit is contained in:
1 parent
89eb9ce9d4
commit
862ad088f5
216 files changed
+3481
-1543
No files matched your search
@@ -2,10 +2,10 @@
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Result;
|
||||
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.Extension;
|
||||
@@ -18,7 +18,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
|
||||
namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
{
|
||||
public partial class FullMinusForm : Form
|
||||
{
|
||||
@@ -58,7 +58,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)
|
||||
{
|
||||
@@ -76,17 +76,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);
|
||||
}
|
||||
@@ -97,12 +97,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,
|
||||
@@ -112,7 +112,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
|
||||
}
|
||||
else
|
||||
{
|
||||
row.Cells["colSelect"].Value = lstShopId.Contains(shopEntity.ShopAccountId) && canUse;
|
||||
row.Cells["colSelect"].Value = lstShopId.Contains(shopEntity.ShopId) && canUse;
|
||||
if (!row.Cells["colSelect"].Value.ParseToBool())
|
||||
chkSelectAll.Checked = false;
|
||||
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
|
||||
@@ -130,7 +130,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)
|
||||
{
|
||||
@@ -548,7 +548,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;
|
||||
|
||||
@@ -559,7 +559,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 = "未登录";
|
||||
@@ -572,11 +572,11 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
|
||||
FullMinusShopForm fullMinusShopForm = 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;
|
||||
ucTabControl1.TabPages.Add(tab);
|
||||
|
||||
@@ -672,7 +672,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
|
||||
}
|
||||
|
||||
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);
|
||||
if (tab != null && this.btnManagerAct.Enabled == false)
|
||||
{
|
||||
var minusShopForm = tab.Controls[0] as FullMinusShopForm;
|
||||
@@ -688,7 +688,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
|
||||
}
|
||||
else
|
||||
{
|
||||
tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount + "活动管理" && t.Name == "tab" + shop.ShopAccountId + "Active");
|
||||
tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount + "活动管理" && t.Name == "tab" + shop.ShopId + "Active");
|
||||
if (tab != null)
|
||||
{
|
||||
var activeForm = tab.Controls[0] as FullMinusActiveForm;
|
||||
@@ -743,7 +743,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;
|
||||
|
||||
@@ -918,7 +918,7 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
|
||||
if (dptStartTime.Value <= DateTime.Now && dptEndTime.Value > DateTime.Now)
|
||||
minusForm.RefreshdgvProduct(strList);
|
||||
|
||||
var tab1 = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount + "活动管理" && t.Name == "tab" + shop.ShopAccountId + "Active");
|
||||
var tab1 = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount + "活动管理" && t.Name == "tab" + shop.ShopId + "Active");
|
||||
if (tab1 != null)
|
||||
{
|
||||
FullMinusActiveForm actForm = tab1.Controls[0] as FullMinusActiveForm;
|
||||
@@ -963,7 +963,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;
|
||||
|
||||
@@ -974,7 +974,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 = "未登录";
|
||||
@@ -987,11 +987,11 @@ namespace LittleRabbit.LittleRabbitForms.SalesCenterForms
|
||||
FullMinusActiveForm actForm = null;
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount + "活动管理" && t.Name == "tab" + shop.ShopAccountId + "Active");
|
||||
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount + "活动管理" && t.Name == "tab" + shop.ShopId + "Active");
|
||||
if (tab == null)
|
||||
{
|
||||
tab = new TabPage();
|
||||
tab.Name = "tab" + shop.ShopAccountId + "Active";
|
||||
tab.Name = "tab" + shop.ShopId + "Active";
|
||||
tab.Text = shop.ShopAccount + "活动管理";
|
||||
this.ucTabControl1.TabPages.Add(tab);
|
||||
|
||||
|
||||
Reference in new issue
Block a user