升级方式优化
This commit is contained in:
1 parent
b762ff4c7f
commit
58c26725fb
39 files changed
+1525
-1614
No files matched your search
@@ -355,26 +355,37 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
cmbSourceType.Items.Insert(1, "------");
|
||||
cmbSourceType.Items.Insert(1, "1688商品");
|
||||
cmbSourceType.Items.Insert(1, "多多商品");
|
||||
|
||||
chkRandomFissionProduct.Visible = true;
|
||||
txtRandomFissionProductCount.Visible = true;
|
||||
}
|
||||
if (!BaseClass.UserAuthority.Contains("商品裂变"))
|
||||
cmbHot_TextChanged(null, null);
|
||||
|
||||
if (BaseClass.UserAuthority.Contains("商品裂变"))
|
||||
{
|
||||
chkRandomFissionProduct.Visible = true;
|
||||
txtRandomFissionProductCount.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ucTabControlMetro1.TabPages.Remove(商品裂变);
|
||||
}
|
||||
//#endif
|
||||
if (BaseClass.SaLevel == 1)
|
||||
{
|
||||
//chkImgRandomBlock.Visible = true;
|
||||
}
|
||||
|
||||
List<Control> ctrlLst = new List<Control>() {
|
||||
lblSourceType, cmbSourceType, lblGroupFilter, cmbGroupFilter, lblHot, cmbHot, lblIdFilter, txtIdFilter, lblJstInitSet, cmbJstInitSet
|
||||
List<Control> ctrlLst = new List<Control>()
|
||||
{
|
||||
lblSourceType, cmbSourceType, lblGroupFilter, cmbGroupFilter, lblHot, cmbHot, lblIdFilter, txtIdFilter,
|
||||
chkRandomFissionProduct, txtRandomFissionProductCount, lblJstInitSet, cmbJstInitSet
|
||||
};
|
||||
for (int i = 0; i < ctrlLst.Count - 1; i++)
|
||||
for (int i = 0; i < ctrlLst.Count - 2; i += 2)
|
||||
{
|
||||
if (ctrlLst[i].Visible == false)
|
||||
{
|
||||
for (int j= ctrlLst.Count - 1; j > i; j--)
|
||||
ctrlLst[j].Location = new Point(ctrlLst[j -1].Location.X, ctrlLst[j - 1].Location.Y);
|
||||
for (int j= ctrlLst.Count - 2; j > i; j-=2)
|
||||
{
|
||||
ctrlLst[j].Location = new Point(ctrlLst[j - 2].Location.X, ctrlLst[j - 2].Location.Y);
|
||||
ctrlLst[j + 1].Location = new Point(ctrlLst[j].Location.X + ctrlLst[j].Width - 3, ctrlLst[j - 1].Location.Y);
|
||||
ctrlLst[j + 1].BringToFront();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1456,6 +1467,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
isFinish = true;
|
||||
}
|
||||
selectProd.product_name = titles[0];
|
||||
selectProd.is_fission_title = true;
|
||||
titles.RemoveAt(0);
|
||||
txtFissionTitle.Text = string.Join("\r\n", titles);
|
||||
cell.Value = "标题裂变成功,更改为:" + selectProd.product_name;
|
||||
@@ -1471,7 +1483,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
if (chkSkipUploaded.Checked)
|
||||
{
|
||||
// 裂变按标题名称
|
||||
if (chkFissionProduct.Checked || chkFissionGoodsName.Checked)
|
||||
if (selectProd.is_fission_title)
|
||||
{
|
||||
var searchRst = WXUpload.searchProductWithTitle(shop, GetHtml.UrlEncodeUtf8(selectProd?.product_name));
|
||||
if (!searchRst.Contains("\"code\":0") && !searchRst.Contains("\"success\":true"))
|
||||
@@ -3604,6 +3616,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
if (prodInfo.detail.sku.FirstOrDefault().thumb_url.IsNullOrEmpty())
|
||||
prodInfo.detail.sku.FirstOrDefault().thumb_url = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1)?.url;
|
||||
|
||||
// 处理系统指定的规格名称
|
||||
if (upProdParam.product.info.category.FirstOrDefault()?.name == "食品饮料" || prodInfo.detail.cats.FirstOrDefault() == "食品饮料")
|
||||
{
|
||||
if (selectProd.cat_name == "坚果炒货" || selectProd.cat_name == "果干")
|
||||
@@ -3627,6 +3640,34 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var leafCat = upProdParam.product.info.category.LastOrDefault();
|
||||
if (leafCat?.catInfo?.saleAttr?.attr != null)
|
||||
{
|
||||
foreach (var att in leafCat.catInfo.saleAttr.attr)
|
||||
{
|
||||
if (att.isRequired == true)
|
||||
{
|
||||
if (att.normalRelease.ruleType == 2 && prodInfo.detail.sku.FirstOrDefault()?.spec.Count == 2)
|
||||
{
|
||||
foreach (var sku in prodInfo.detail.sku)
|
||||
{
|
||||
sku.spec[1].parent_name = att.name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var sku in prodInfo.detail.sku)
|
||||
{
|
||||
sku.spec[0].parent_name = att.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (prodInfo.detail.sku.FirstOrDefault()?.spec?.Count > 0)
|
||||
{
|
||||
productSaleAttrParam attrParam = new productSaleAttrParam()
|
||||
@@ -3862,7 +3903,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// 聚水潭上微信小店,加运费(其他平台shipPrice默认为0)
|
||||
skuParam.productSkuInfo.salePrice += (shipPrice * defaultAddPriceRule.ShippingPriceTimes).ParseToInt();
|
||||
// 商品裂变随机增加价格
|
||||
if (BaseClass.UserAuthority.Contains("商品裂变") && chkFissionRandomPriceChange.Checked)
|
||||
if (selectProd.is_fission_title && chkFissionRandomPriceChange.Checked)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
@@ -4377,8 +4418,9 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
#endregion
|
||||
|
||||
#region 添加图片随机外框,用于商品裂变
|
||||
if (BaseClass.UserAuthority.Contains("商品裂变") && chkRandomImgBorder.Checked)
|
||||
if (selectProd.is_fission_title && chkRandomImgBorder.Checked)
|
||||
{
|
||||
// selectProd.isFission
|
||||
int mainCount = 9;
|
||||
int detailCount = 1;
|
||||
Invoke(new Action(() =>
|
||||
@@ -4998,9 +5040,9 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
return;
|
||||
}
|
||||
|
||||
this.lstTemuDBProductSelect.Clear();
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_db_prod_upload_list", this.lstTemuDBProductSelect);
|
||||
lblWaitToUp.Text = "待上传 " + lstTemuDBProductSelect.Count + " 件";
|
||||
//this.lstTemuDBProductSelect.Clear();
|
||||
//NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_db_prod_upload_list", this.lstTemuDBProductSelect);
|
||||
//lblWaitToUp.Text = "待上传 " + lstTemuDBProductSelect.Count + " 件";
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -5050,11 +5092,11 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
foreach (var prod in prodLst)
|
||||
{
|
||||
var productNameLst = new List<string>() { prod.product_name };
|
||||
if (BaseClass.UserAuthority.Contains("商品裂变") && chkFissionProduct.Checked)
|
||||
if (chkRandomFissionProduct.Checked)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var titleCount = txtFissionProductCount.Text.Trim().ParseToInt();
|
||||
var titleCount = txtRandomFissionProductCount.Text.Trim().ParseToInt();
|
||||
if (prod.fission_words.ParseToString().Length > 20 && titleCount > 0)
|
||||
{
|
||||
productNameLst = prod.fission_words.Replace("fission_goods_names:", "")
|
||||
@@ -5066,9 +5108,11 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
foreach (var productName in productNameLst)
|
||||
{
|
||||
var selectProd = JsonHelper.DeserializeJsonToObject<TemuDBProductSelect>(JsonHelper.SerializeObject(prod));
|
||||
selectProd.product_name = productName;
|
||||
if (chkRandomFissionProduct.Checked)
|
||||
selectProd.is_fission_title = true;
|
||||
selectProd.out_product_Id = prod.id.ToString();
|
||||
selectProd.id = 1;
|
||||
selectProd.product_name = productName;
|
||||
if (lstTemuDBProductSelect.Count > 0)
|
||||
selectProd.id = lstTemuDBProductSelect.Max(p => p.id) + 1;
|
||||
this.lstTemuDBProductSelect.Add(selectProd);
|
||||
@@ -5134,8 +5178,9 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
string addUserName = BaseClass.UserAuthority.Contains("商品采集") ? ("admin," + BaseClass.UserName) : "admin";
|
||||
if (BaseClass.GroupId != 3)
|
||||
addUserName = BaseClass.ParentAuthority.Contains("商品采集") ? ("admin," + BaseClass.ParentUserName) : "admin";
|
||||
// 如果指定是自己采集的商品,则只随机自己采集的商品
|
||||
if (cmbSourceType.Text.Trim().Contains("多多商品") || cmbSourceType.Text.Trim().Contains("1688商品"))
|
||||
// 如果指定只有自己采集的商品,则只随机自己采集的商品
|
||||
if ((cmbSourceType.Text.Trim().Contains("多多商品") || cmbSourceType.Text.Trim().Contains("1688商品")) &&
|
||||
cmbSourceType.Text.Trim().Replace("多多商品", "").Replace("1688商品", "").Trim(',').IsNullOrEmpty())
|
||||
data += "&add_user_name=" + (BaseClass.GroupId == 3 ? BaseClass.UserName : BaseClass.ParentUserName);
|
||||
else
|
||||
data += "&add_user_name=" + addUserName;
|
||||
@@ -5214,7 +5259,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
if (chkWXComplateProd.Checked)
|
||||
data += "&has_wx_format=1";
|
||||
|
||||
if (BaseClass.UserAuthority.Contains("商品裂变") && chkFissionProduct.Checked)
|
||||
if (chkRandomFissionProduct.Checked)
|
||||
{
|
||||
data += "&fission_words=fission_goods_names:";
|
||||
}
|
||||
@@ -5468,6 +5513,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
cmbSourceType.Text = "厂商直采";
|
||||
cmbHot.Text = "普通商品";
|
||||
chkSkipQualification.Checked = false;
|
||||
cmbHot_TextChanged(null, null);
|
||||
|
||||
int prodCount;
|
||||
pbSelectProd.Visible = true;
|
||||
@@ -5661,7 +5707,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbJstInitSet.Text = "已设置";
|
||||
cmbJstInitSet.Text = "是";
|
||||
}
|
||||
|
||||
string sourceType = cmbSourceType.Text.Trim().Replace("已采集数据", "1688外部数据");
|
||||
@@ -6003,13 +6049,13 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void btnProdDb_Click(object sender, EventArgs e)
|
||||
{
|
||||
WXUserProdListForm.Instance.lstTemuDBProductSelect = this.lstTemuDBProductSelect;
|
||||
WXUserProdListForm.Instance.cmbSourceType.Items.Clear();
|
||||
WXUserProdListForm.Instance.cmbSourceType.Items.AddRange(this.cmbSourceType.Items.Cast<Object>().ToArray());
|
||||
WXUserProdListForm.Instance.SaveComplete -= dbProdList_SaveComplete;
|
||||
WXUserProdListForm.Instance.SaveComplete += dbProdList_SaveComplete;
|
||||
WXUserProdListForm.Instance.Show();
|
||||
WXUserProdListForm.Instance.BringToFront();
|
||||
WXSelectDBProdListForm.Instance.lstTemuDBProductSelect = this.lstTemuDBProductSelect;
|
||||
WXSelectDBProdListForm.Instance.cmbSourceType.Items.Clear();
|
||||
WXSelectDBProdListForm.Instance.cmbSourceType.Items.AddRange(this.cmbSourceType.Items.Cast<Object>().ToArray());
|
||||
WXSelectDBProdListForm.Instance.SaveComplete -= dbProdList_SaveComplete;
|
||||
WXSelectDBProdListForm.Instance.SaveComplete += dbProdList_SaveComplete;
|
||||
WXSelectDBProdListForm.Instance.Show();
|
||||
WXSelectDBProdListForm.Instance.BringToFront();
|
||||
}
|
||||
|
||||
public void dbProdList_SaveComplete(object obj)
|
||||
@@ -6025,13 +6071,20 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
if (cmbHot.Text == "爆款数据")
|
||||
{
|
||||
cmbSourceType.Text = "微信店采";
|
||||
cmbSourceType.Text = "";
|
||||
cmbJstInitSet.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbSourceType.Text = "厂商直采";
|
||||
cmbJstInitSet.Text = "已设置";
|
||||
cmbJstInitSet.Text = "是";
|
||||
// 商品采集用户无货源选择权限只能随机自己的商品
|
||||
if ((BaseClass.UserAuthority.Contains("商品采集") || BaseClass.ParentAuthority.Contains("商品采集")) &&
|
||||
!BaseClass.UserAuthority.Contains("货源选择") && BaseClass.SaLevel == 0)
|
||||
{
|
||||
cmbSourceType.Text = "多多商品,1688商品";
|
||||
cmbJstInitSet.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user