1.界面优化调整 2.618取消活动 3.清理无流量新 4.用户商品库1688及拼多多外部商品入库逻辑优化 5.带百分号的属性微信上货优化 6.数据库产品在不同用户间迁移 7.删除店铺功能开放给充值用户防止店铺导入错误无法删除

This commit is contained in:
wule committed 2026-06-11 11:38:08 +08:00
1 parent 2759ff0f6d
commit 0a9980335f
59 files changed
+3078 -652

No files matched your search

@@ -53,6 +53,7 @@ namespace TemuKJD.WXForms.ProductForms
string currentGetTalentParam = "";
List<WXFinderTalentInfo> lstWXFinderTalentInfo = new List<WXFinderTalentInfo>();
List<WXLiveObjectInfo> lstWXLiveObjectInfo = new List<WXLiveObjectInfo>();
List<WXFeedObjectInfo> lstWXFeedObjectInfo = new List<WXFeedObjectInfo>();
public WXFinderSquareForm()
{
@@ -1150,33 +1151,123 @@ namespace TemuKJD.WXForms.ProductForms
dgvDaRenProd.Rows.Clear();
lstWXLiveObjectInfo.Clear();
lstWXFeedObjectInfo.Clear();
if (cancellationTokenSource != null)
cancellationTokenSource.Cancel();
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
{
{
int num = 0;
foreach (var row in selectRows)
foreach (var row in selectRows)
{
num++;
Invoke(new Action(() =>
{
num++;
Invoke(new Action(() =>
this.statusBar.lblTaskStatus.Text = "达人带货商品查询 第 " + num + " 位,共 " + selectRows.Count + " 位达人";
row.Cells["colOpResult"].Value = "";
}));
if (this.cancellationTokenSource.IsCancellationRequested)
break;
var shopId = row.Cells["colSupplierId"].Value.ParseToString();
var shop = GlobalConfig.ValidShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (chkReUse.Visible && chkReUse.Checked)
shop = currentShop;
var talentAppid = row.Cells["colTalentAppid"].Value.ParseToString();
var talent = this.lstWXFinderTalentInfo.FirstOrDefault(t => t.talentAppid == talentAppid);
if (shop != null && talent != null && talent.accountList != null)
{
// 短视频带货
if (chkFeed.Checked)
{
this.statusBar.lblTaskStatus.Text = "达人带货商品查询 第 " + num + " 位,共 " + selectRows.Count + " 位达人";
row.Cells["colOpResult"].Value = "";
}));
if (this.cancellationTokenSource.IsCancellationRequested)
break;
var finderUser = talent.accountList.FirstOrDefault(a => !a.finderUsername.IsNullOrEmpty() && !a.mpAppid.IsNullOrEmpty());
finderUser = talent.accountList.FirstOrDefault(a => !a.finderUsername.IsNullOrEmpty());
var finderUsername = finderUser?.finderUsername;
var mpAppid = finderUser?.mpAppid;
var endMs = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date) - 1;
var startMs = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date.AddDays(-7));
int page = 0;
int pageSize = 10;
var shopId = row.Cells["colSupplierId"].Value.ParseToString();
var shop = GlobalConfig.ValidShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (chkReUse.Visible && chkReUse.Checked)
shop = currentShop;
var talentAppid = row.Cells["colTalentAppid"].Value.ParseToString();
var talent = this.lstWXFinderTalentInfo.FirstOrDefault(t => t.talentAppid == talentAppid);
while (true)
{
page++;
var getLiveObjectRst = WXFinderSquareBLL.GetDaRenLiveFeedList(shop, finderUsername, mpAppid, talent.talentAppid, startMs, endMs, 2, page, pageSize);
Thread.Sleep(Randomx.GetId(300, 600));
if (shop != null && talent != null && talent.accountList != null)
if (!getLiveObjectRst.ParseToString().Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref getLiveObjectRst, getLiveObjectRst, "errmsg");
if (error.ParseToString().Contains("biz magic invalid"))
{
shop.LoginStatus = "未登录";
var selectIds = dgvShop.Rows.Cast<DataGridViewRow>().Where(r
=> r.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
Invoke(new Action(() => { BindShop(shop, selectIds, "店铺掉线"); }));
error = "店铺掉线";
}
Invoke(new Action(() =>
{
row.Cells["colOpResult"].Value = "达人带货商品查询失败 " + error;
}));
break;
}
var wxFeedObjectInfoResult = JsonHelper.DeserializeJsonToObject<WXFeedObjectInfoResult>(getLiveObjectRst);
var feedList = wxFeedObjectInfoResult.list;
this.lstWXFeedObjectInfo.AddRange(feedList);
foreach (var feed in feedList)
{
var prod = feed;
Invoke(new Action(() =>
{
if (prod.spuMonthSales.ParseToInt() >= txtSaleCount.Text.Trim().ParseToInt() &&
!dgvDaRenProd.Rows.Cast<DataGridViewRow>().Any(r => r.Cells["colTalentSpuId"].Value.ParseToString() == prod.spuId))
{
var startTimeStr = BaseClass.StampToDateTime(feed.feedObjectStartTime.ParseToInt()).ToString("yy-MM-dd HH:mm");
var rowIndex = dgvDaRenProd.Rows.Add(
false,
shop.ShopId,
shop.ShopAccount,
"登录",
"进店",
"短视频",
talent.talentAppid,
finderUser.finderUsername,
finderUser.nickname, // 达人昵称
feed.objectId, // 达人活动ID
feed.feedObjectImg,
DataGridViewExtension.defaultBitmap, // 短视频标题图
feed.feedObjectDescription, // 达人活动短视频标题
startTimeStr + " 点赞数" + feed.finderxshortvideoLikeCnt + " 分享数" + feed.finderxshortvideoShareCnt + " 喜欢数" + feed.finderxshortvideoFavoriteCnt,
prod.spuImgUrl,
DataGridViewExtension.defaultBitmap,
prod.spuAppid,
prod.spuShopNickname,
prod.spuId,
prod.spuName,
prod.spuPrice.ParseToInt() * 0.01m,
prod.spuMonthSales.ParseToInt(),
"联系达人"
);
dgvDaRenProd.Rows[rowIndex].Height = 60;
}
}));
}
var total = wxFeedObjectInfoResult.total.ParseToInt();
var totalPage = Math.Ceiling(total * 1m / pageSize).ParseToInt();
if (page >= totalPage)
break;
}
}
// 直播带货
if (chkLive.Checked)
{
var finderUser = talent.accountList.FirstOrDefault(a => !a.finderUsername.IsNullOrEmpty() && !a.mpAppid.IsNullOrEmpty());
finderUser = talent.accountList.FirstOrDefault(a => !a.finderUsername.IsNullOrEmpty());
@@ -1220,7 +1311,8 @@ namespace TemuKJD.WXForms.ProductForms
{
Invoke(new Action(() =>
{
if (prod.spuMonthSales.ParseToInt() >= txtSaleCount.Text.Trim().ParseToInt())
if (prod.spuMonthSales.ParseToInt() >= txtSaleCount.Text.Trim().ParseToInt() &&
!dgvDaRenProd.Rows.Cast<DataGridViewRow>().Any(r => r.Cells["colTalentSpuId"].Value.ParseToString() == prod.spuId))
{
var startTimeStr = BaseClass.StampToDateTime(live.liveObjectStartTime.ParseToInt()).ToString("yy-MM-dd HH:mm");
var duration = new TimeSpan(live.liveObjectDuringTimeSecond.ParseToLong() * 10000000);
@@ -1231,6 +1323,7 @@ namespace TemuKJD.WXForms.ProductForms
shop.ShopAccount,
"登录",
"进店",
"直播",
talent.talentAppid,
finderUser.finderUsername,
finderUser.nickname, // 达人昵称
@@ -1259,7 +1352,7 @@ namespace TemuKJD.WXForms.ProductForms
int prodPage = 1;
int prodPageSize = 10;
var prodTotalPage = Math.Ceiling(live.productList.total.ParseToInt() * 1m / prodPageSize).ParseToInt();
while (prodPage < prodTotalPage)
{
if (this.cancellationTokenSource.IsCancellationRequested)
@@ -1294,7 +1387,8 @@ namespace TemuKJD.WXForms.ProductForms
{
Invoke(new Action(() =>
{
if (prod.spuMonthSales.ParseToInt() >= txtSaleCount.Text.Trim().ParseToInt())
if (prod.spuMonthSales.ParseToInt() >= txtSaleCount.Text.Trim().ParseToInt() &&
!dgvDaRenProd.Rows.Cast<DataGridViewRow>().Any(r => r.Cells["colTalentSpuId"].Value.ParseToString() == prod.spuId))
{
var startTimeStr = BaseClass.StampToDateTime(live.liveObjectStartTime.ParseToInt()).ToString("yy-MM-dd HH:mm");
var duration = new TimeSpan(live.liveObjectDuringTimeSecond.ParseToLong() * 10000000);
@@ -1305,6 +1399,7 @@ namespace TemuKJD.WXForms.ProductForms
shop.ShopAccount,
"登录",
"进店",
"直播",
talent.talentAppid,
finderUser.finderUsername,
finderUser.nickname, // 达人昵称
@@ -1344,7 +1439,7 @@ namespace TemuKJD.WXForms.ProductForms
Invoke(new Action(() =>
{
pictureBox1.Visible = false;
this.statusBar.lblTaskStatus.Text += "达人带货商品查询操作结束";
this.statusBar.lblTaskStatus.Text += " 达人带货商品查询操作结束";
BaseMsgForm.ShowInfo("达人带货商品查询操作结束");
}));
}, cancellationTokenSource.Token);
@@ -1403,7 +1498,7 @@ namespace TemuKJD.WXForms.ProductForms
imgFrom.ShowDialog();
break;
}
case "直播题图":
case "带货题图":
{
ShowImgForm imgFrom = new ShowImgForm(dgvDaRenProd.Rows[e.RowIndex].Cells["colLiveObjectImgUrl"].Value.ParseToString());
imgFrom.ShowDialog();