优化客服统计功能

This commit is contained in:
wule committed 2026-02-05 19:32:45 +08:00
1 parent a2a6719a99
commit 4fd8d9cc17
17 files changed
+1218 -471

No files matched your search

@@ -80,9 +80,9 @@ namespace TemuKJD.WXForms.ProductForms
if (lstAddPriceRule == null)
{
lstAddPriceRule = new NaiBa.Util.ConcurrentList<AddPriceRule>();
lstAddPriceRule.Add(new AddPriceRule() { MoreThanPrice = 0, LessThanPrice = 10, AddPriceTimes = 2, AddMorePrice = 5, SinglePriceAdd = 1 });
lstAddPriceRule.Add(new AddPriceRule() { MoreThanPrice = 10, LessThanPrice = 20, AddPriceTimes = 2, AddMorePrice = 5, SinglePriceAdd = 1 });
lstAddPriceRule.Add(new AddPriceRule() { MoreThanPrice = 20, LessThanPrice = 999, AddPriceTimes = 2, AddMorePrice = 5, SinglePriceAdd = 1 });
lstAddPriceRule.Add(new AddPriceRule() { MoreThanPrice = 0, LessThanPrice = 10, AddPriceTimes = 2, AddMorePrice = 10, SinglePriceAdd = 1 });
lstAddPriceRule.Add(new AddPriceRule() { MoreThanPrice = 10, LessThanPrice = 20, AddPriceTimes = 2, AddMorePrice = 10, SinglePriceAdd = 1 });
lstAddPriceRule.Add(new AddPriceRule() { MoreThanPrice = 20, LessThanPrice = 999, AddPriceTimes = 2, AddMorePrice = 10, SinglePriceAdd = 1 });
}
this.fPnlPriceRule.Controls.Clear();
foreach (var priceItem in lstAddPriceRule)
@@ -265,19 +265,27 @@ namespace TemuKJD.WXForms.ProductForms
{
updateAuthor(true);
}
private void updateAuthor(bool refreshAll = false)
/// <summary>
/// 升级授权
/// </summary>
/// <param name="idRefreshTodayHasGet">今日取过的也取</param>
private void updateAuthor(bool idRefreshTodayHasGet = false)
{
this.pbLoadingShop.Visible = true;
Task.Run(() =>
{
// 店铺Id
var updateIds = dgvShop.Rows.Cast<DataGridViewRow>().Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
var selectIds = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
if (idRefreshTodayHasGet == true)
updateIds = selectIds;
List<Task> tList = new List<Task>();
if (refreshAll)
lstShopAuthInfo.Clear();
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => selectIds.Contains(s.ShopId)))
if (idRefreshTodayHasGet)
lstShopAuthInfo.RemoveAll(s => updateIds.Contains(s.ShopId));
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => updateIds.Contains(s.ShopId)))
{
Invoke(new Action(() => { BindShop(shop, selectIds, ""); }));
var t = Task.Run(() =>
@@ -291,7 +299,7 @@ namespace TemuKJD.WXForms.ProductForms
}
var authInfo = lstShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
if (refreshAll || authInfo == null || authInfo.AddTime.Date != DateTime.Now.Date)
if (idRefreshTodayHasGet || authInfo == null || authInfo?.AddTime.Date != DateTime.Now.Date)
{
lstShopAuthInfo.RemoveAll(sa => sa.ShopId == shop.ShopId);
var rst = WXUpload.GetApiServiceList(shop);
@@ -311,6 +319,7 @@ namespace TemuKJD.WXForms.ProductForms
foreach (var itemObj in JsonHelper.JObjectParse(rst)["itemList"])
{
// 找到了指定服务
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
@@ -319,14 +328,13 @@ namespace TemuKJD.WXForms.ProductForms
return;
}
}
// 没找到指定服务
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
}
if (refreshAll)
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
}
}
catch (Exception ex)
{
}
});
tList.Add(t);
@@ -2463,6 +2471,10 @@ namespace TemuKJD.WXForms.ProductForms
//书籍属性处理
if (upProdParam.product.info.category.FirstOrDefault()?.name == "图书" || prodInfo.detail.cats.FirstOrDefault() == "书籍/杂志/报纸")
{
//if (attr.name == "ISBN版号/CN刊号")
// attrValue = "9787922575016";
//if (attr.name == "书名")
// attrValue = upProdParam.product.info.title;
if (attr.name == "是否为单一书号丛书")
attrValue = "是";
if (attr.name == "图书册数")
@@ -3083,7 +3095,13 @@ namespace TemuKJD.WXForms.ProductForms
dicShopUpload[shop.ShopId] = new WxShopUploadInfo();
if (!dicShopUpload[shop.ShopId].DicDayUploadCount.ContainsKey(day))
dicShopUpload[shop.ShopId].DicDayUploadCount[day] = 0;
dicShopUpload[shop.ShopId].DicDayUploadCount[day]++;
dicShopUpload[shop.ShopId].DicDayUploadCount[day] += 1;
// 删除45天前的记录
var removeKeys = dicShopUpload[shop.ShopId].DicDayUploadCount.Keys.Where(s => s < DateTime.Now.AddDays(-45).ToString("yyyyMMdd").ParseToInt());
foreach (var key in removeKeys)
{
dicShopUpload[shop.ShopId].DicDayUploadCount.Remove(key);
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_shop_upload_info", dicShopUpload);
Invoke(new Action(() =>
@@ -3561,12 +3579,17 @@ namespace TemuKJD.WXForms.ProductForms
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]++;
dicShopUpload[shop.ShopId].DicDayUploadCount[day] += 1;
// 删除45天前的记录
var removeKeys = dicShopUpload[shop.ShopId].DicDayUploadCount.Keys.Where(s => s < DateTime.Now.AddDays(-45).ToString("yyyyMMdd").ParseToInt());
foreach (var key in removeKeys)
{
dicShopUpload[shop.ShopId].DicDayUploadCount.Remove(key);
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_shop_upload_info", dicShopUpload);
Invoke(new Action(() =>
@@ -4163,15 +4186,15 @@ Content-Type: application/octet-stream
/// <summary>
/// 加价倍数
/// </summary>
public decimal AddPriceTimes { get; set; }
public decimal AddPriceTimes { get; set; } = 2m;
/// <summary>
/// 额外加价金额
/// </summary>
public decimal AddMorePrice { get; set; }
public decimal AddMorePrice { get; set; } = 10m;
/// <summary>
/// 单买加价
/// </summary>
public decimal SinglePriceAdd { get; set; }
public decimal SinglePriceAdd { get; set; } = 1m;
/// <summary>
/// 先加后乘
/// </summary>
@@ -4179,7 +4202,7 @@ Content-Type: application/octet-stream
/// <summary>
/// 上货库存量设置
/// </summary>
public int StockNum { get; set; } = 0;
public int StockNum { get; set; } = 999;
public bool IsStepAddPrice { get; set; } = false;
/// <summary>
/// 运费倍率
@@ -4191,7 +4214,7 @@ Content-Type: application/octet-stream
{
public int PreSaleDays { get; set; } = 5;
public string FilterWords { get; set; } = "亏本,冲量,白菜价,跳楼价,xx,xxx,最大,最小,低价,降价,成本,赔钱,甩卖,真丝,蚕丝,香云纱,羊绒,羊毛,羊羔绒,羊羔毛,羽绒,皮草";
public string FilterWords { get; set; } = "二手,亏本,冲量,白菜价,跳楼价,xx,xxx,最大,最小,低价,降价,成本,赔钱,甩卖,真丝,蚕丝,香云纱,羊绒,羊毛,羊羔绒,羊羔毛,羽绒,皮草";
public int SkuMinPrice { get; set; } = 10;