1微信优化客服检测逻辑 新增消息提醒 2微信日上货数量记录

This commit is contained in:
wule committed 2026-01-22 19:10:51 +08:00
1 parent 6d7b9d7b56
commit 84dbc94047
15 files changed
+1006 -267

No files matched your search

@@ -28,6 +28,7 @@ using AllBase.Model.Param.WXParam;
using AllBase.Model.Result.WXResult;
using Newtonsoft.Json;
using NaiBa.Util;
using AllBase.Model.Config;
namespace TemuKJD.WXForms.ProductForms
{
@@ -44,7 +45,9 @@ namespace TemuKJD.WXForms.ProductForms
NaiBa.Util.ConcurrentList<AddPriceRule> lstAddPriceRule = new NaiBa.Util.ConcurrentList<AddPriceRule>();
AddPriceRule defaultAddPriceRule = null;
WXUploadRule wxUploadRule = null;
public Dictionary<string, List<string>> dicCheckedShopIdList = new Dictionary<string, List<string>>();
//public Dictionary<string, List<string>> dicCheckedShopIdList = new Dictionary<string, List<string>>();
public Dictionary<string, bool> dicCheckedShopId = new Dictionary<string, bool>();
public Dictionary<string, WxShopUploadInfo> dicShopUpload = new Dictionary<string, WxShopUploadInfo>();
public WXDBProdUploadForm()
{
InitializeComponent();
@@ -97,11 +100,12 @@ namespace TemuKJD.WXForms.ProductForms
ucPrice.PriceChange += ucAddPrice_PriceChange;
}
dicCheckedShopIdList = NaiBa.Util.Helper.ConfigHelper.LoadConfig<Dictionary<string, List<string>>>("wx_checked_shop_dic_list");
if (dicCheckedShopIdList == null)
dicCheckedShopIdList = new Dictionary<string, List<string>>();
if (!dicCheckedShopIdList.Keys.Contains(BaseClass.UserName))
dicCheckedShopIdList[BaseClass.UserName] = new List<string>();
dicCheckedShopId = NaiBa.Util.Helper.ConfigHelper.LoadConfig<Dictionary<string, bool>>("wx_checked_shop_dic");
if (dicCheckedShopId == null)
dicCheckedShopId = new Dictionary<string, bool>();
dicShopUpload = NaiBa.Util.Helper.ConfigHelper.LoadConfig<Dictionary<string, WxShopUploadInfo>>("wx_shop_upload_info");
if (dicShopUpload == null)
dicShopUpload = new Dictionary<string, WxShopUploadInfo>();
defaultAddPriceRule = NaiBa.Util.Helper.ConfigHelper.LoadConfig<AddPriceRule>("wx_default_add_price_rule");
if (defaultAddPriceRule == null)
@@ -251,13 +255,16 @@ namespace TemuKJD.WXForms.ProductForms
}
}
dicCheckedShopIdList[BaseClass.UserName] = dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true)
.Select(r => r.Cells["colShopId"].Value.ParseToString()).ToList();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_checked_shop_dic_list", dicCheckedShopIdList);
foreach (var r in dgvShop.Rows.Cast<DataGridViewRow>())
{
dicCheckedShopId[r.Cells["colShopId"].Value.ParseToString()] = r.Cells["colSelect"].Value.ParseToBool();
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_checked_shop_dic", dicCheckedShopId);
}
private void btnRefreshShop_Click(object sender, EventArgs e)
{
pbLoadingShop.Visible = true;
RefreshShop();
RefreshDbProd();
}
@@ -278,7 +285,6 @@ namespace TemuKJD.WXForms.ProductForms
Task.Run(() =>
{
PDDDBProdListForm.GetPDDProductGroup(cmbGroupFilter); // 同时刷新下商品分组
GetPddProductCate();
});
}
@@ -343,18 +349,21 @@ namespace TemuKJD.WXForms.ProductForms
bool canUse = shopEntity.LoginStatus == "登录成功";
//canUse = true; // 内部库不需要校验登录状态
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
var day = DateTime.Now.ToString("yyyyMMdd").ParseToInt();
if (row == null)
{
this.dgvShop.Rows.Add(
//!isInit || (selectShopId.Contains(shopEntity.ShopId) && canUse),
dicCheckedShopIdList[BaseClass.UserName].Contains(shopEntity.ShopId),
dicCheckedShopId.Keys.Contains(shopEntity.ShopId) && dicCheckedShopId[shopEntity.ShopId] == true,
shopEntity.LoginName,
shopEntity.ShopId,
shopEntity.ShopAccount,
shopEntity.Notes,
"选择商品",
canUse ? "在线" : "掉线",
canUse,
canUse,
dicShopUpload.ContainsKey(shopEntity.ShopId) && dicShopUpload[shopEntity.ShopId].DicDayUploadCount.ContainsKey(day) ?
dicShopUpload[shopEntity.ShopId].DicDayUploadCount[day] : 0,
0,
shopEntity.AddProductRemaining,
string.Empty
@@ -401,9 +410,9 @@ namespace TemuKJD.WXForms.ProductForms
{
//BaseMsgForm.ShowInfo("店铺未登录!");
}
dicCheckedShopIdList[BaseClass.UserName] = dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true)
.Select(r => r.Cells["colShopId"].Value.ParseToString()).ToList();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_checked_shop_dic_list", dicCheckedShopIdList);
dicCheckedShopId[row.Cells["colShopId"].Value.ParseToString()] = row.Cells["colSelect"].Value.ParseToBool();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_checked_shop_dic", dicCheckedShopId);
break;
case "colLoginStatus":
if (WXShopListForm.Instance == null)
@@ -2098,9 +2107,17 @@ namespace TemuKJD.WXForms.ProductForms
var dgvShopRow = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(row => row.Cells["colShopId"]?.Value.ParseToString() == shop.ShopId);
if (dgvShopRow != null)
{
var day = DateTime.Now.ToString("yyyyMMdd").ParseToInt();
if (!dicShopUpload.ContainsKey(shop.ShopId))
dicShopUpload[shop.ShopId] = new WxShopUploadInfo();
if (!dicShopUpload[shop.ShopId].DicDayUploadCount.ContainsKey(day))
dicShopUpload[shop.ShopId].DicDayUploadCount[day] = 0;
dicShopUpload[shop.ShopId].DicDayUploadCount[day]++;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_shop_upload_info", dicShopUpload);
Invoke(new Action(() =>
{
dgvShopRow.Cells["colUploadCount"].Value = dgvShopRow.Cells["colUploadCount"].Value.ParseToInt() + 1;
dgvShopRow.Cells["colUploadCount"].Value = dicShopUpload[shop.ShopId].DicDayUploadCount[day];
}));
}
@@ -2344,6 +2361,8 @@ namespace TemuKJD.WXForms.ProductForms
}
ucPrice.PriceChange += ucAddPrice_PriceChange;
this.fPnlPriceRule.Controls.Add(ucPrice);
ucPrice.lblSinglePriceAdd.Visible = false;
ucPrice.txtSinglePriceAdd.Visible = false;
}
private void ucAddPrice_PriceChange(object obj)
@@ -2521,9 +2540,18 @@ namespace TemuKJD.WXForms.ProductForms
var dgvShopRow = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(row => row.Cells["colShopId"]?.Value.ParseToString() == shop.ShopId);
if (dgvShopRow != null)
{
var day = DateTime.Now.ToString("yyyyMMdd").ParseToInt();
var removeDay = DateTime.Now.Date.AddMonths(-1).ToString("yyyyMMdd").ParseToInt();
if (!dicShopUpload.ContainsKey(shop.ShopId))
dicShopUpload[shop.ShopId] = new WxShopUploadInfo();
if (!dicShopUpload[shop.ShopId].DicDayUploadCount.ContainsKey(day))
dicShopUpload[shop.ShopId].DicDayUploadCount[day] = 0;
dicShopUpload[shop.ShopId].DicDayUploadCount[day]++;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_shop_upload_info", dicShopUpload);
Invoke(new Action(() =>
{
dgvShopRow.Cells["colUploadCount"].Value = dgvShopRow.Cells["colUploadCount"].Value.ParseToInt() + 1;
dgvShopRow.Cells["colUploadCount"].Value = dicShopUpload[shop.ShopId].DicDayUploadCount[day];
}));
}
}
@@ -2582,6 +2610,11 @@ namespace TemuKJD.WXForms.ProductForms
wxUploadRule.IsPreSale = chkPreSale.Checked;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_upload_rule", wxUploadRule);
}
private void btnRefreshNum_Click(object sender, EventArgs e)
{
}
}
public class WXUpload