1.Jit客户端功能 2.pdd活动报名新增及优化

This commit is contained in:
wule committed 2025-12-01 10:01:54 +08:00
1 parent e77914bafc
commit 480d8c2cd4
41 files changed
+5136 -2863

No files matched your search

@@ -330,7 +330,7 @@ namespace TemuKJD.KJDForms.ProductForms
}
if (!dgvOrder.Rows.Cast<DataGridViewRow>().Any(r => r.Cells["colSelect"].Value.ParseToBool() == true))
{
BaseMsgForm.ShowError("请至少勾选一项!");
BaseMsgForm.ShowError("请至少勾选一项!"); // todo
return;
}
foreach (DataGridViewRow r in dgvOrder.Rows)
+1
View File
@@ -1473,6 +1473,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.panelEx1.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.panelEx1.TabIndex = 668;
this.panelEx1.Text = "停止当前操作";
this.panelEx1.Click += new System.EventHandler(this.panelEx1_Click);
//
// btnClear
//
+27 -11
View File
@@ -903,6 +903,7 @@ namespace TemuKJD.KJDForms.ProductForms
tryAgain:
Thread.Sleep(100 + Randomx.GetId(200));
string jsonStr = getAdsGoodsList(shop, page, pageSize);
Thread.Sleep(Randomx.GetId(300, 800));
if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5)
{
tryCount++;
@@ -962,21 +963,24 @@ namespace TemuKJD.KJDForms.ProductForms
ads_goods_info adsGoodsInfo = JsonHelper.DeserializeJsonToObject<ads_goods_info>(sItem); // 反序列化得到类
if (adsGoodsInfo != null && !lstAdsMallGoodsInfo.Any(a => a.goods_id == adsGoodsInfo.goods_id))
{
if (adsGoodsInfo.gray_reason != null)
continue;
//if (adsGoodsInfo.gray_reason != null)
// continue;
adsGoodsInfo.shopId = shop.ShopId;
lstAdsMallGoodsInfo.Add(adsGoodsInfo);
spuIdLst.Add(adsGoodsInfo.spu_id);
var create_ad_req_param = new create_ad_req_param()
if (adsGoodsInfo.gray_reason == null)
{
budget = chkLimitValue.Checked ? (txtBudget.Text.ParseToDecimal() * 100).ParseToInt() : -1,
goods_id = adsGoodsInfo.goods_id.ParseToString(),
site_id = adsGoodsInfo.site_list.FirstOrDefault().ParseToInt(),
roas = (txtSameRoas.Text.ParseToDecimal() * 10000).ParseToInt(),
};
createAds.create_ad_reqs.Add(create_ad_req_param);
var create_ad_req_param = new create_ad_req_param()
{
budget = chkLimitValue.Checked ? (txtBudget.Text.ParseToDecimal() * 100).ParseToInt() : -1,
goods_id = adsGoodsInfo.goods_id.ParseToString(),
site_id = adsGoodsInfo.site_list.FirstOrDefault().ParseToInt(),
roas = (txtSameRoas.Text.ParseToDecimal() * 10000).ParseToInt(),
};
createAds.create_ad_reqs.Add(create_ad_req_param);
}
Invoke(new Action(() =>
{
@@ -1012,7 +1016,7 @@ namespace TemuKJD.KJDForms.ProductForms
"点击率(CTR)",
"转化率(CVR)",
"加入购物车数",
"" // 操作结果,状态
adsGoodsInfo.gray_reason == null ? "" : string.Join(",", adsGoodsInfo.gray_reason.Select(g => g.reason)) // 操作结果,状态
);
dgvAds.Rows[rowId].Height = 50;
@@ -1130,7 +1134,13 @@ namespace TemuKJD.KJDForms.ProductForms
}
int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt();
totalPage = Math.Ceiling(1.0 * total / pageSize).ParseToInt();
if (totalPage == 1)
totalPage = Math.Ceiling(1.0 * total / pageSize).ParseToInt();
bool hasMore = BaseRegex.GetBoolJson(ref jsonStr, "has_more");
if (hasMore && totalPage == page)
{
totalPage++;
}
}
page++;
}
@@ -2344,6 +2354,12 @@ namespace TemuKJD.KJDForms.ProductForms
{
txtNotes.Text = txtShopId.Text = txtShopName.Text = "";
}
private void panelEx1_Click(object sender, EventArgs e)
{
if (cancellationTokenSource != null)
cancellationTokenSource.Cancel();
}
}
public class CreateAdsParam
+110 -101
View File
@@ -106,6 +106,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn();
this.colJitStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.pnlSpecDetail = new System.Windows.Forms.Panel();
@@ -113,6 +114,10 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnClose = new DevComponents.DotNetBar.PanelEx();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.dgvOpenJit = new TemuKJD.UserComponent.DataGridViewEx();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colProdIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOrderId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -135,10 +140,6 @@ namespace TemuKJD.KJDForms.ProductForms
this.colStock = new System.Windows.Forms.DataGridViewLinkColumn();
this.colRecevieArea = new System.Windows.Forms.DataGridViewLinkColumn();
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -940,14 +941,14 @@ namespace TemuKJD.KJDForms.ProductForms
this.splitContainer2.Panel2.Controls.Add(this.dgvOpenJit);
this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0);
this.splitContainer2.Size = new System.Drawing.Size(1584, 437);
this.splitContainer2.SplitterDistance = 280;
this.splitContainer2.SplitterDistance = 325;
this.splitContainer2.TabIndex = 0;
//
// pbShopLoading
//
this.pbShopLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbShopLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbShopLoading.Location = new System.Drawing.Point(115, 193);
this.pbShopLoading.Location = new System.Drawing.Point(137, 193);
this.pbShopLoading.Name = "pbShopLoading";
this.pbShopLoading.Size = new System.Drawing.Size(50, 50);
this.pbShopLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -992,6 +993,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colShopName,
this.colShopNotes,
this.colLoginStatus,
this.colJitStatus,
this.colCanUse,
this.colMessage});
this.dgvShop.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -1000,7 +1002,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.dgvShop.ReadOnly = true;
this.dgvShop.RowHeadersWidth = 25;
this.dgvShop.RowTemplate.Height = 23;
this.dgvShop.Size = new System.Drawing.Size(276, 437);
this.dgvShop.Size = new System.Drawing.Size(321, 437);
this.dgvShop.TabIndex = 6;
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
//
@@ -1059,6 +1061,13 @@ namespace TemuKJD.KJDForms.ProductForms
this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colLoginStatus.Width = 38;
//
// colJitStatus
//
this.colJitStatus.HeaderText = "JIT";
this.colJitStatus.Name = "colJitStatus";
this.colJitStatus.ReadOnly = true;
this.colJitStatus.Width = 38;
//
// colCanUse
//
this.colCanUse.HeaderText = "可用";
@@ -1085,7 +1094,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.pnlSpecDetail.Controls.Add(this.btnClose);
this.pnlSpecDetail.Location = new System.Drawing.Point(115, 58);
this.pnlSpecDetail.Name = "pnlSpecDetail";
this.pnlSpecDetail.Size = new System.Drawing.Size(1071, 124);
this.pnlSpecDetail.Size = new System.Drawing.Size(1026, 124);
this.pnlSpecDetail.TabIndex = 683;
this.pnlSpecDetail.Visible = false;
//
@@ -1098,7 +1107,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new System.Drawing.Size(1012, 65);
this.textBox1.Size = new System.Drawing.Size(967, 65);
this.textBox1.TabIndex = 690;
//
// btnClose
@@ -1108,7 +1117,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnClose.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClose.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClose.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClose.Location = new System.Drawing.Point(982, 88);
this.btnClose.Location = new System.Drawing.Point(937, 88);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(58, 23);
this.btnClose.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -1130,7 +1139,7 @@ namespace TemuKJD.KJDForms.ProductForms
//
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbLoading.Location = new System.Drawing.Point(609, 193);
this.pbLoading.Location = new System.Drawing.Point(586, 193);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -1185,10 +1194,80 @@ namespace TemuKJD.KJDForms.ProductForms
this.dgvOpenJit.ReadOnly = true;
this.dgvOpenJit.RowHeadersWidth = 36;
this.dgvOpenJit.RowTemplate.Height = 23;
this.dgvOpenJit.Size = new System.Drawing.Size(1296, 437);
this.dgvOpenJit.Size = new System.Drawing.Size(1251, 437);
this.dgvOpenJit.TabIndex = 187;
this.dgvOpenJit.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvOpenJit_CellContentClick);
//
// splitContainer4
//
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
this.splitContainer4.Name = "splitContainer4";
//
// splitContainer4.Panel1
//
this.splitContainer4.Panel1.Controls.Add(this.ucSplitPage1);
//
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
this.splitContainer4.Panel2.Controls.Add(this.statusBar);
this.splitContainer4.Size = new System.Drawing.Size(1584, 26);
this.splitContainer4.SplitterDistance = 282;
this.splitContainer4.TabIndex = 3;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Left;
this.ucSplitPage1.IsShowPageSize = false;
this.ucSplitPage1.Location = new System.Drawing.Point(0, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(282, 26);
this.ucSplitPage1.TabIndex = 5;
this.ucSplitPage1.TotalPage = 1;
this.ucSplitPage1.PageChange += new System.Action<object>(this.ucSplitPage1_PageChange);
//
// btnClear
//
this.btnClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClear.Location = new System.Drawing.Point(1204, 0);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(90, 21);
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.Style.GradientAngle = 90;
this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.TabIndex = 440;
this.btnClear.Text = "清空结果";
this.btnClear.Visible = false;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1298, 26);
this.statusBar.TabIndex = 2;
//
// colCheck
//
this.colCheck.HeaderText = "选择";
@@ -1267,7 +1346,6 @@ namespace TemuKJD.KJDForms.ProductForms
this.colProdName.HeaderText = "标题";
this.colProdName.Name = "colProdName";
this.colProdName.ReadOnly = true;
this.colProdName.Width = 120;
//
// colSkuName
//
@@ -1293,7 +1371,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colExtCodePrice.HeaderText = "货号进价";
this.colExtCodePrice.Name = "colExtCodePrice";
this.colExtCodePrice.ReadOnly = true;
this.colExtCodePrice.Width = 65;
this.colExtCodePrice.Width = 62;
//
// colPrcie
//
@@ -1309,7 +1387,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colCreatTime.HeaderText = "创建时间";
this.colCreatTime.Name = "colCreatTime";
this.colCreatTime.ReadOnly = true;
this.colCreatTime.Width = 65;
this.colCreatTime.Width = 62;
//
// colChangePrice
//
@@ -1351,7 +1429,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colStock.Name = "colStock";
this.colStock.ReadOnly = true;
this.colStock.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colStock.Width = 65;
this.colStock.Width = 62;
//
// colRecevieArea
//
@@ -1361,7 +1439,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colRecevieArea.Name = "colRecevieArea";
this.colRecevieArea.ReadOnly = true;
this.colRecevieArea.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colRecevieArea.Width = 65;
this.colRecevieArea.Width = 62;
//
// colMsg
//
@@ -1370,76 +1448,6 @@ namespace TemuKJD.KJDForms.ProductForms
this.colMsg.ReadOnly = true;
this.colMsg.Width = 180;
//
// splitContainer4
//
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
this.splitContainer4.Name = "splitContainer4";
//
// splitContainer4.Panel1
//
this.splitContainer4.Panel1.Controls.Add(this.ucSplitPage1);
//
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
this.splitContainer4.Panel2.Controls.Add(this.statusBar);
this.splitContainer4.Size = new System.Drawing.Size(1584, 26);
this.splitContainer4.SplitterDistance = 282;
this.splitContainer4.TabIndex = 3;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Left;
this.ucSplitPage1.IsShowPageSize = false;
this.ucSplitPage1.Location = new System.Drawing.Point(0, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(282, 26);
this.ucSplitPage1.TabIndex = 5;
this.ucSplitPage1.TotalPage = 1;
this.ucSplitPage1.PageChange += new System.Action<object>(this.ucSplitPage1_PageChange);
//
// btnClear
//
this.btnClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClear.Location = new System.Drawing.Point(1204, 0);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(90, 21);
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.Style.GradientAngle = 90;
this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.TabIndex = 440;
this.btnClear.Text = "清空结果";
this.btnClear.Visible = false;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1298, 26);
this.statusBar.TabIndex = 2;
//
// TemuJitForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1498,15 +1506,6 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.PictureBox pbShopLoading;
private UserComponent.DataGridViewEx dgvShop;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colUser;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes;
private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
private UserComponent.UcCheckBox chkSearchAllShop;
private System.Windows.Forms.PictureBox pbLoading;
private DevComponents.DotNetBar.PanelEx btnClear;
@@ -1552,6 +1551,21 @@ namespace TemuKJD.KJDForms.ProductForms
private DevComponents.DotNetBar.Controls.Line line3;
private DevComponents.DotNetBar.Controls.Line line2;
private DevComponents.DotNetBar.Controls.Line line1;
private DevComponents.DotNetBar.PanelEx btnSaveExtCodeJitConfig;
private DevComponents.DotNetBar.PanelEx btnRestoreJitParams;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelectExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colFilterExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colJitConfig;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colUser;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes;
private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus;
private System.Windows.Forms.DataGridViewTextBoxColumn colJitStatus;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colProdIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn colOrderId;
@@ -1574,10 +1588,5 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.DataGridViewLinkColumn colStock;
private System.Windows.Forms.DataGridViewLinkColumn colRecevieArea;
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
private DevComponents.DotNetBar.PanelEx btnSaveExtCodeJitConfig;
private DevComponents.DotNetBar.PanelEx btnRestoreJitParams;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelectExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colFilterExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colJitConfig;
}
}
+86 -24
View File
@@ -18,6 +18,7 @@ using TemuKJD.BaseForms;
using TemuKJD.BLL;
using TemuKJD.Extension;
using TemuKJD.KJDForms.AdminForms;
using TemuKJD.KJDForms.JITForms;
using TemuKJD.KJDForms.ProductForms.TemuJitSubForms;
using TemuKJD.KJDForms.ShopForms;
using TemuKJD.ToolForms;
@@ -27,7 +28,7 @@ namespace TemuKJD.KJDForms.ProductForms
{
public partial class TemuJitForm : BaseForm
{
public bool IsAdmin = false;
public bool IsClientJit { get; set; } = false;
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
public List<ShopLoginInfo> lstAdminShopInfo { get; set; } = new List<ShopLoginInfo>();
/// <summary>
@@ -50,7 +51,7 @@ namespace TemuKJD.KJDForms.ProductForms
/// 期望到货区域列表
/// </summary>
public List<SkcReceiveAreaPickOutInfo> lstReceiveArea = new List<SkcReceiveAreaPickOutInfo>();
/// <summary>
/// 界面参数配置
/// </summary>
@@ -61,6 +62,8 @@ namespace TemuKJD.KJDForms.ProductForms
/// </summary>
List<OpenJitFullParams> lstOpenJitParams = null;
CheckBox chkSelectAll;
public TemuJitForm()
{
InitializeComponent();
@@ -68,21 +71,30 @@ namespace TemuKJD.KJDForms.ProductForms
private void TemuJitForm_Load(object sender, EventArgs e)
{
if (IsAdmin)
if (!IsClientJit)
{
ucSplitPage1.Visible = true;
this.colJitStatus.Visible = false;
}
else
{
ucSplitPage1.Visible = false;
this.colJitStatus.Visible = true;
}
this.dgvShop.AddSelectorColumn("colSelect");
//this.dgvShop.AddSelectorColumn("colSelect");
chkSelectAll = dgvShop.Columns["colSelect"].AddHeaderCheckBox(HorizontalAlignment.Center, 0, 0, null, null, false, null, true);
chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged;
this.dgvOpenJit.AddSelectorColumn("colCheck");
var chkSelectExtCode = this.dgvExtCode.AddSelectorColumn("colSelectExtCode");
chkSelectExtCode.CheckedChanged += ChkSelectExtCode_CheckedChanged;
this.dgvOpenJit.AddSelectorColumn("colCheck");
this.dgvOpenJit.AddImgColumn("colProductSkcPic", "colImgUrl");
this.dtpEndTime.Value = DateTime.Now.Date.AddDays(1).AddMilliseconds(-1);
this.dtpStartTime.Value = DateTime.Now.Date.AddDays(-7);
if (IsAdmin)
if (!IsClientJit)
setJitConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<SetJitConfig>("admin_set_jit_config");
else
setJitConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<SetJitConfig>("set_jit_config");
@@ -113,6 +125,28 @@ namespace TemuKJD.KJDForms.ProductForms
lstOpenJitParams = new List<OpenJitFullParams>();
}
private void chkSelectAll_CheckedChanged(object sender, EventArgs e)
{
if (!chkSelectAll.Checked)
{
foreach (DataGridViewRow row in dgvShop.Rows)
{
row.Cells["colSelect"].Value = false;
}
}
else
{
var list = lstAdminShopInfo.Where(s => s.LoginStatus2 == "国际版在线").ToList();
if (IsClientJit)
list = list.Where(s => s.LoginStatus2 == "国际版在线" && s.jit_expire_time >= DateTime.Now.Date).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (list.Any(l => l.ShopId == row.Cells["colShopId"]?.Value?.ToString()))
row.Cells["colSelect"].Value = true;
}
}
}
private void Txt_TextChanged(object sender, EventArgs e)
{
setJitConfig.SearchNotes = this.txtNotes.Text.Trim();
@@ -124,7 +158,7 @@ namespace TemuKJD.KJDForms.ProductForms
setJitConfig.SearchExtCode = this.txtExtCode.Text.Trim();
setJitConfig.SearchDuration = this.chkSearchTime.Checked;
if (IsAdmin)
if (!IsClientJit)
NaiBa.Util.Helper.ConfigHelper.SaveConfig("admin_set_jit_config", setJitConfig);
else
NaiBa.Util.Helper.ConfigHelper.SaveConfig("set_jit_config", setJitConfig);
@@ -134,7 +168,7 @@ namespace TemuKJD.KJDForms.ProductForms
{
if (this.Visible)
{
if (IsAdmin)
if (!IsClientJit)
{
this.pbShopLoading.Visible = true;
SearchShop(this.ucSplitPage1.CurrentPage);
@@ -148,7 +182,7 @@ namespace TemuKJD.KJDForms.ProductForms
private void btnRefreshShop_Click(object sender, EventArgs e)
{
if (IsAdmin)
if (!IsClientJit)
{
if (this.ucSplitPage1.CurrentPage != 1)
this.ucSplitPage1.CurrentPage = 1;
@@ -216,6 +250,7 @@ namespace TemuKJD.KJDForms.ProductForms
shopEntity.ShopAccount,
shopEntity.Notes,
canUse ? "在线" : "掉线",
shopEntity.jit_expire_time >= DateTime.Now.Date ? "可用" : "失效",
canUse,
string.Empty
);
@@ -279,6 +314,7 @@ namespace TemuKJD.KJDForms.ProductForms
shop.ShopAccount,
shop.Notes,
canUse ? "在线" : "掉线",
shop.jit_expire_time >= DateTime.Now.Date ? "可用" : "失效",
canUse,
string.Empty
);
@@ -340,6 +376,11 @@ namespace TemuKJD.KJDForms.ProductForms
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed;
}
if (IsClientJit)
{
var jitRow = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ParseToString() == shop?.ShopId);
jitRow.Cells["colJitStatus"].Style.ForeColor = JitShopActiveForm.GetJitStatusStyleColor(shop);
}
}
private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
@@ -350,7 +391,7 @@ namespace TemuKJD.KJDForms.ProductForms
string loginName = dgvShop.Rows[e.RowIndex].Cells["colLoginName"].Value.ParseToString();
string accountId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToString();
ShopLoginInfo shop = null;
if (IsAdmin)
if (!IsClientJit)
shop = lstAdminShopInfo.FirstOrDefault(v => v.LoginName == loginName && v.ShopId == accountId);
else
shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == loginName && v.ShopId == accountId);
@@ -361,7 +402,7 @@ namespace TemuKJD.KJDForms.ProductForms
case "登录":
case "状态":
{
if (IsAdmin)
if (!IsClientJit)
{
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
if (shop.LoginStatus2 == "国际版在线")
@@ -401,9 +442,29 @@ namespace TemuKJD.KJDForms.ProductForms
}
}
break;
default:
case "":
if (IsClientJit)
{
if (shop != null && shop.jit_expire_time > DateTime.Now.Date)
{
if (shop.LoginStatus2 != "国际版在线")
{
dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = false;
BaseMsgForm.ShowError("店铺未登录", "JIT-操作失败");
return;
}
}
else
{
dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = false;
BaseMsgForm.ShowError("JIT卡密过期或未开通", "JIT-操作失败");
return;
}
}
dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value;
break;
default:
break;
}
}
private void shopLoginForm_SaveComplete(object obj)
@@ -471,7 +532,7 @@ namespace TemuKJD.KJDForms.ProductForms
{
shopIndex++;
ShopLoginInfo shop = null;
if (IsAdmin)
if (!IsClientJit)
shop = lstAdminShopInfo.FirstOrDefault(s => shopId == s.ShopId);
else
shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => shopId == s.ShopId);
@@ -479,10 +540,10 @@ namespace TemuKJD.KJDForms.ProductForms
continue;
// 检测是否掉线
if (IsAdmin)
if (!IsClientJit)
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
else
ShopListForm.Instance.CheckShopLogin(new string[] { shop.ShopAccount }, false);
ShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
if (shop.LoginStatus2 != "国际版在线")
{
@@ -511,10 +572,10 @@ namespace TemuKJD.KJDForms.ProductForms
var searchRst = this.SearchForChainSupplier(shop, page, pageSize, null, searchSpuIds, searchExtCodes, type, startTime, endTime);
if (searchRst.Contains("登录过期") || searchRst.Contains("Invalid Login State"))
{
if (IsAdmin)
if (!IsClientJit)
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
else
ShopListForm.Instance.CheckShopLogin(new string[] { shop.ShopAccount }, false);
ShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
Invoke(new Action(() =>
{
displayShopStatus(shop);
@@ -964,7 +1025,7 @@ Content-Disposition: form-data; name=""upload_sign""
string skcId = dgvOpenJit.Rows[e.RowIndex].Cells["colProdSkc"].Value.ParseToString();
string accountId = dgvOpenJit.Rows[e.RowIndex].Cells["colSupplierId"].Value.ParseToString();
ShopLoginInfo shop = null;
if (IsAdmin)
if (!IsClientJit)
shop = lstAdminShopInfo.FirstOrDefault(v => v.ShopId == accountId);
else
shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.ShopId == accountId);
@@ -1090,6 +1151,7 @@ Content-Disposition: form-data; name=""upload_sign""
}
}
break;
case "库存":
case "修改库存":
{
var product = lstProductInfo.FirstOrDefault(p => p.productId.ParseToString() == prodId);
@@ -1490,7 +1552,7 @@ Content-Disposition: form-data; name=""upload_sign""
string skcId = dgvRow.Cells["colProdSkc"].Value.ParseToString();
string accountId = dgvRow.Cells["colSupplierId"].Value.ParseToString();
ShopLoginInfo shop = null;
if (IsAdmin)
if (!IsClientJit)
shop = lstAdminShopInfo.FirstOrDefault(v => v.ShopId == accountId);
else
shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.ShopId == accountId);
@@ -2093,7 +2155,7 @@ Content-Disposition: form-data; name=""upload_sign""
{
shopIndex++;
ShopLoginInfo shop = null;
if (IsAdmin)
if (!IsClientJit)
shop = lstAdminShopInfo.FirstOrDefault(s => shopId == s.ShopId);
else
shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => shopId == s.ShopId);
@@ -2101,10 +2163,10 @@ Content-Disposition: form-data; name=""upload_sign""
continue;
// 检测是否掉线
if (IsAdmin)
if (!IsClientJit)
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
else
ShopListForm.Instance.CheckShopLogin(new string[] { shop.ShopAccount }, false);
ShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
if (shop.LoginStatus2 != "国际版在线")
{
@@ -2133,10 +2195,10 @@ Content-Disposition: form-data; name=""upload_sign""
var productReceiveAreaLstRst = this.GetProductReceiveAreaList(shop, page, pageSize);
if (productReceiveAreaLstRst.Contains("登录过期") || productReceiveAreaLstRst.Contains("Invalid Login State"))
{
if (IsAdmin)
if (!IsClientJit)
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
else
ShopListForm.Instance.CheckShopLogin(new string[] { shop.ShopAccount }, false);
ShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
Invoke(new Action(() =>
{
displayShopStatus(shop);
@@ -144,6 +144,9 @@
<metadata name="colLoginStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colJitStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCanUse.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>