1跨境达sku增加随机字符 2跨境达搜索同货号商品随机替换主图及sku随机转主
This commit is contained in:
1 parent
2388ea8ae9
commit
1487bc31c8
8 files changed
+141
-7
No files matched your search
@@ -27,7 +27,7 @@ namespace AllBase
|
||||
/// <summary>
|
||||
/// 版本ID
|
||||
/// </summary>
|
||||
public static int VersionCount = 630;
|
||||
public static int VersionCount = 631;
|
||||
//public static int VersionCount = 613;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<PublishUrlHistory>publish\</PublishUrlHistory>
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
|
||||
+15
@@ -144,6 +144,7 @@
|
||||
this.colOpResult = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
|
||||
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
|
||||
this.chkSameExtcodeRandomMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
@@ -183,6 +184,7 @@
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.chkSameExtcodeRandomMainImg);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.lblSkuRandomLetterNotes);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.btnAdd);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.label21);
|
||||
@@ -1669,6 +1671,18 @@
|
||||
this.statusBar.Size = new System.Drawing.Size(1558, 25);
|
||||
this.statusBar.TabIndex = 5;
|
||||
//
|
||||
// chkSameExtcodeRandomMainImg
|
||||
//
|
||||
this.chkSameExtcodeRandomMainImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.chkSameExtcodeRandomMainImg.AutoSize = true;
|
||||
this.chkSameExtcodeRandomMainImg.Location = new System.Drawing.Point(1372, 71);
|
||||
this.chkSameExtcodeRandomMainImg.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.chkSameExtcodeRandomMainImg.Name = "chkSameExtcodeRandomMainImg";
|
||||
this.chkSameExtcodeRandomMainImg.Size = new System.Drawing.Size(188, 21);
|
||||
this.chkSameExtcodeRandomMainImg.TabIndex = 488;
|
||||
this.chkSameExtcodeRandomMainImg.Text = "同货号主图随机+sku随机转主";
|
||||
this.chkSameExtcodeRandomMainImg.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// DbProductSelectListManageForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
@@ -1824,5 +1838,6 @@
|
||||
private DevComponents.DotNetBar.PanelEx btnSearch;
|
||||
private UserComponent.UcCheckBox chkSkuRandomLetter;
|
||||
private System.Windows.Forms.Label lblSkuRandomLetterNotes;
|
||||
private UserComponent.UcCheckBox chkSameExtcodeRandomMainImg;
|
||||
}
|
||||
}
|
||||
@@ -815,7 +815,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
return list.FirstOrDefault();
|
||||
}
|
||||
|
||||
public static KJDDBProduct GetProductDetail(string prodDbId)
|
||||
public static KJDDBProduct GetProductDetail(string prodDbId, string extCode="")
|
||||
{
|
||||
if (string.IsNullOrEmpty(prodDbId))
|
||||
return new KJDDBProduct();
|
||||
@@ -826,6 +826,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
var data = "";
|
||||
|
||||
data = UserLogin.GetSignaturex() + "&search_db_ids=" + prodDbId;
|
||||
if (!string.IsNullOrEmpty(extCode))
|
||||
{
|
||||
data += "&search_ext_code=" + extCode;
|
||||
}
|
||||
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
@@ -856,6 +860,44 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
}
|
||||
}
|
||||
|
||||
public static List< KJDDBProduct> GetProductSameExtCodeDetailList(string extCode)
|
||||
{
|
||||
if (string.IsNullOrEmpty(extCode))
|
||||
return new List<KJDDBProduct>();
|
||||
|
||||
List<KJDDBProduct> list = new List<KJDDBProduct>();
|
||||
|
||||
var url = BaseClass.BuildObjString("product/get_product_detail_list");
|
||||
var data = "";
|
||||
|
||||
data = UserLogin.GetSignaturex() + "&search_ext_code=" + extCode;
|
||||
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var jArr = JObject.Parse(html)["data"];
|
||||
if (jArr.Count() == 0)
|
||||
return null;
|
||||
var sProd = JsonHelper.SerializeObject(jArr);
|
||||
|
||||
try
|
||||
{
|
||||
list = JsonHelper.DeserializeJsonToList<KJDDBProduct>(sProd);
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
string UploadProduct(ShopLoginInfo shop, KJDDBProduct dbProd, TemuDBProductSelect selectProd, DataGridViewCell cell)
|
||||
{
|
||||
if (shop == null || string.IsNullOrEmpty(shop.ShopId) || shop.LoginStatus != "登录成功" || shop.LoginStatus2 != "国际版在线")
|
||||
@@ -940,7 +982,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
List<string> realCarouselImageUrls = new List<string>();
|
||||
realCarouselImageUrls.AddRange(prodInfo.carouselImageUrls);
|
||||
|
||||
if (chkCustomPic.Checked) // 上传自定义图片
|
||||
if (chkCustomPic.Checked) // 上传自定义图片 自定义主图
|
||||
{
|
||||
for (int i = 0; i < prodParam.carouselImageUrls.Count; i++)
|
||||
{
|
||||
@@ -952,6 +994,47 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
}
|
||||
}
|
||||
|
||||
if (chkSameExtcodeRandomMainImg.Checked) //选择同货号(extcode)的商品主图和sku图做随机主图
|
||||
{
|
||||
var sameExtCodeDBProdLst = GetProductSameExtCodeDetailList(dbProd.ext_code);
|
||||
var sameExtCodeProdInfoLst = new List<TemuDetailProductInfo>();
|
||||
var sameExtCodeMainImgUrlLst = new List<string>();
|
||||
var sameExtCodeSkuImgUrlLst = new List<string>();
|
||||
try
|
||||
{
|
||||
foreach(var sameExtCodeDbProd in sameExtCodeDBProdLst)
|
||||
{
|
||||
var pInfo = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(sameExtCodeDbProd.product_json);
|
||||
sameExtCodeProdInfoLst.Add(pInfo);
|
||||
sameExtCodeMainImgUrlLst.AddRange(pInfo.carouselImageUrls);
|
||||
foreach (var sku in pInfo.productSkcList.FirstOrDefault().productSkuList)
|
||||
{
|
||||
sameExtCodeSkuImgUrlLst.Add(sku.thumbUrl);
|
||||
}
|
||||
}
|
||||
if (sameExtCodeMainImgUrlLst.Count > 0 && sameExtCodeSkuImgUrlLst.Count > 0)
|
||||
{
|
||||
bool isUseDefault = false;
|
||||
for (int i = 0; i < prodParam.carouselImageUrls.Count; i++)
|
||||
{
|
||||
// 主图 :sku转主 比例 2 :1
|
||||
if (Randomx.GetId(3) > 0 || (isUseDefault == false && i == prodParam.carouselImageUrls.Count - 1))
|
||||
{
|
||||
isUseDefault = true;
|
||||
prodParam.carouselImageUrls[i] = sameExtCodeMainImgUrlLst[Randomx.GetId(sameExtCodeMainImgUrlLst.Count)];
|
||||
}
|
||||
else
|
||||
{
|
||||
prodParam.carouselImageUrls[i] = sameExtCodeSkuImgUrlLst[Randomx.GetId(sameExtCodeSkuImgUrlLst.Count)];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
prodParam.goodsAdvantageLabelTypes = prodInfo.goodsAdvantageLabelVOList != null ?
|
||||
prodInfo.goodsAdvantageLabelVOList : new List<object>();
|
||||
prodParam.goodsLayerDecorationCustomizeI18nReqs = prodInfo.goodsLayerDecorationCustomizeI18nVOList;
|
||||
|
||||
@@ -495,7 +495,8 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
{
|
||||
splitContainer1.Panel1.Enabled = true;
|
||||
pbLoading.Visible = false;
|
||||
string sRst = "已完成退货包裹明细查询!";
|
||||
var pacCount = lstReturnPackageInfo.Select(p => p.packageSn).Distinct().ToList().Count;
|
||||
string sRst = "已完成退货包裹明细查询!共有 " + pacCount + " 个退货包裹。";
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
sRst = "已取消查询!";
|
||||
|
||||
|
||||
@@ -1937,7 +1937,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
{
|
||||
img_type = "拖鞋";
|
||||
}
|
||||
else if (sneakersCatName.Contains(dbProd.cat_name) || sneakersCatName.Contains("鞋"))
|
||||
else if (sneakersCatName.Contains(dbProd.cat_name) || dbProd.cat_name.Contains("鞋"))
|
||||
{
|
||||
img_type = "鞋(不含拖鞋)";
|
||||
}
|
||||
|
||||
@@ -1378,6 +1378,8 @@ function getElementWithText(sText)
|
||||
BaseMsgForm.ShowError("上传窗口不存在!");
|
||||
return;
|
||||
}
|
||||
//var t4 = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync("alert('" + 22 + "');");
|
||||
//t4.Wait(2000);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -1385,6 +1387,27 @@ function getElementWithText(sText)
|
||||
var prodInfoStr = JsonHelper.SerializeObject(jObj["result"]);
|
||||
PDDProductDetailInfo detailInfo = JsonHelper.DeserializeJsonToObject<PDDProductDetailInfo>(prodInfoStr);
|
||||
|
||||
//string jsStr = "function getSkuChange() {" +
|
||||
// " var spec1 = document.getElementsByClassName('property-container-v2 package');" +
|
||||
// " var spec2 = document.getElementsByClassName('goods-spec-row');" +
|
||||
// " if (spec1) return 'success';" +
|
||||
// " if (spec1) return spec1;" +
|
||||
// " else if (spec2) return spec2;" +
|
||||
// " else return document.body;" +
|
||||
// "}" +
|
||||
// "getSkuChange();";
|
||||
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// var t1 = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
|
||||
// t1.Wait();
|
||||
|
||||
|
||||
// var t2 = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync("alert('" + 333 + "');");
|
||||
// t2.Wait(2000);
|
||||
//});
|
||||
//return;
|
||||
|
||||
var skuPrice = (this.txtSendPrice.Text.ParseToDecimal() * 100).ParseToInt();
|
||||
foreach (var sku in detailInfo.sku)
|
||||
{
|
||||
@@ -1395,6 +1418,15 @@ function getElementWithText(sText)
|
||||
{
|
||||
detailInfo.market_price = skuPrice + 1000;
|
||||
}
|
||||
List<sku_item> skuTmpLst = new List<sku_item>();
|
||||
foreach (var sku in detailInfo.sku)
|
||||
{
|
||||
if (1==1)
|
||||
{
|
||||
skuTmpLst.Add(sku);
|
||||
}
|
||||
}
|
||||
detailInfo.sku = skuTmpLst;
|
||||
|
||||
jObj = JObject.Parse(pddSourceGoodsDecorationTemp);
|
||||
var prodDecorationTStr = JsonHelper.SerializeObject(jObj["result"]);
|
||||
|
||||
+4
-1
@@ -119,6 +119,8 @@ namespace TemuKJD
|
||||
|
||||
while (true)
|
||||
{
|
||||
#if DEBUG
|
||||
#else
|
||||
foreach (var shop in GlobalConfig.ShopLoginList)
|
||||
{
|
||||
if (string.IsNullOrEmpty(shop.ShopId))
|
||||
@@ -133,6 +135,7 @@ namespace TemuKJD
|
||||
dicUpReturn[shop] = DateTime.Now.ToString("yyyyMMdd");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if DEBUG
|
||||
for (int i = 0; i < 3600; i++)
|
||||
{
|
||||
@@ -143,7 +146,7 @@ namespace TemuKJD
|
||||
#endif
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
public static void InitProxy()
|
||||
|
||||
Reference in new issue
Block a user