产品库搜索无分组商品 页面模拟上传优化
This commit is contained in:
1 parent
ec559bd6cc
commit
2cc12d96c9
20 files changed
+1160
-878
No files matched your search
@@ -208,7 +208,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
}
|
||||
else
|
||||
{
|
||||
row.Cells["colSelect"].Value = !isInit || (selectShopId.Contains(shopEntity.ShopId) && canUse);
|
||||
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
|
||||
row.Cells["colShopLoginName"].Value = shopEntity.LoginName;
|
||||
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
|
||||
row.Cells["colShopNotes"].Value = shopEntity.Notes;
|
||||
@@ -2427,7 +2427,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
List<string> out_goods_sn_list = null;
|
||||
List<string> skuSns = null;
|
||||
long? minPrice = null, maxPrice = null;
|
||||
string jsonStr = PDDProductUpDownForm.shop_goods_search(shop, goods_id_list, goods_name, out_goods_sn_list, skuSns, isOnsale, minPrice, maxPrice, 1, pageSize);
|
||||
string jsonStr = PDDProductUpDownForm.shop_goods_search(shop, goods_id_list, goods_name, out_goods_sn_list, skuSns, isOnsale, null, minPrice, maxPrice, 1, pageSize);
|
||||
if (jsonStr.Contains("繁忙") && tryCount < 5)
|
||||
{
|
||||
tryCount++;
|
||||
@@ -2991,7 +2991,9 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
if (skuInfo.quantity != 0)
|
||||
skuInfo.quantity = txtStockNum.Text.Trim().ParseToInt();
|
||||
|
||||
// 聚水潭商品 加邮费×倍率 放前面
|
||||
var new_multi_price = sku.multi_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
|
||||
|
||||
// 使用货号价格做基础价
|
||||
if (chkUseExtCodePrice.Checked && dbProd.ext_code_price > 0)
|
||||
{
|
||||
@@ -2999,7 +3001,6 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
}
|
||||
|
||||
skuInfo.multi_price = (new_multi_price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
|
||||
//skuInfo.price = (sku.price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
|
||||
if (defaultAddPriceRule.AddMorePriceFirst) // 先加后乘
|
||||
skuInfo.multi_price = ((new_multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimes.Text.Trim().ParseToDecimal()).ParseToInt();
|
||||
skuInfo.price = skuInfo.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
|
||||
@@ -3020,16 +3021,11 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
}
|
||||
}
|
||||
}
|
||||
// 聚水潭商品 加邮费×倍率 放前面
|
||||
//skuInfo.multi_price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
|
||||
//skuInfo.price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
|
||||
|
||||
if (marketPrice < skuInfo.price + 1000)
|
||||
if (marketPrice < skuInfo.price * 2)
|
||||
{
|
||||
marketPrice = skuInfo.price.ParseToInt() + 1000;
|
||||
//pddApi.Data["market_price"] = marketPrice;
|
||||
marketPrice = skuInfo.price.ParseToInt() * 2;
|
||||
}
|
||||
|
||||
addPriceSkuInfoLst.Add(skuInfo);
|
||||
}
|
||||
}
|
||||
@@ -3252,18 +3248,21 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
foreach (var prodParam in prodParamLst)
|
||||
{
|
||||
var rws = rowOperateLst.Where(r => prodParam.goods_id == r.Cells["colSpuId"].Value.ParseToLong()).ToList();
|
||||
|
||||
var lowPrice = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().Min(s => s.multi_price);
|
||||
var highPrice = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().Max(s => s.multi_price);
|
||||
// sku全部同价不设置低价sku
|
||||
if (lowPrice == highPrice)
|
||||
continue;
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var rw in rws) rw.Cells["colOpResult"].Value += " 正在设置低价Sku";
|
||||
}));
|
||||
|
||||
var lowPrice = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().Min(s => s.multi_price);
|
||||
//var skuTmp = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().FirstOrDefault(s => s.multi_price == lowPrice);
|
||||
//var skuTmpLst = prodParam.skus.Where(s => s.spec[0].spec_id == skuTmp.spec[0].spec_id && s.multi_price == lowPrice).ToList();
|
||||
var skuTmpLst = prodParam.skus.Where(s => s.multi_price == lowPrice).ToList();
|
||||
var prodInfo = lstActListProdInfo.FirstOrDefault(a => a.goods_id == prodParam.goods_id).productInfo;
|
||||
var skuInfos = prodInfo.detail.sku.Where(s => skuTmpLst.Any(st => st.out_sku_sn == s.out_sku_sn)).ToList();
|
||||
//var newMultiPrice = skuInfos.Max(s => s.multi_price) + (prodInfo.ship_price * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
|
||||
var newMultiPrice = skuInfos.Max(s => s.multi_price) + prodInfo.ship_price;
|
||||
|
||||
PddEditProdStockQuantity prodQuantity = new PddEditProdStockQuantity();
|
||||
@@ -3288,7 +3287,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
}
|
||||
|
||||
var mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity);
|
||||
for (int i = 0; i < 5 && !mdyQuantityRst.Contains("\"success\":true"); i++)
|
||||
for (int i = 0; i < 3 && !mdyQuantityRst.Contains("\"success\":true"); i++)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(500, 1500));
|
||||
mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity);
|
||||
@@ -3298,6 +3297,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
if (!mdyQuantityRst.Contains("\"success\":true") && !mdyQuantityRst.Contains("\"errorMsg\":\"库存未修改\""))
|
||||
{
|
||||
goodsIds.Add(prodParam.goods_id);
|
||||
|
||||
var error = BaseRegex.GetStringJson(ref mdyQuantityRst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = mdyQuantityRst;
|
||||
@@ -3305,13 +3305,14 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var rw in rws)
|
||||
rw.Cells["colOpResult"].Value = rw.Cells["colOpResult"].Value.ParseToString().Replace("正在优化商品以报名活动", "商品优化失败 " + error);
|
||||
rw.Cells["colOpResult"].Value = rw.Cells["colOpResult"].Value.ParseToString().Replace("正在设置低价Sku", "设置低价Sku失败 " + error);
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// 移除修改库存失败的商品
|
||||
prodParamLst.RemoveAll(p => goodsIds.Contains(p.goods_id));
|
||||
rowOperateLst = rowOperateLst.Where(r => prodParamLst.Any(p => p.goods_id == r.Cells["colSpuId"].Value.ParseToLong())).ToList();
|
||||
}
|
||||
|
||||
string activityRsts = SignActivity(shop, prodParamLst, sign22347, sign20981, sign21365, sign15996, sign23513, sign23730, sign23456);
|
||||
|
||||
Reference in new issue
Block a user