上货后参加20981活动
This commit is contained in:
1 parent
b868c718f0
commit
4fcfb2875a
25 files changed
+1379
-119
No files matched your search
@@ -187,6 +187,8 @@
|
||||
<Compile Include="Model\Param\DyProductManage\ViolateParam.cs" />
|
||||
<Compile Include="Model\Param\DyProductManage\QualificationConfig.cs" />
|
||||
<Compile Include="Model\Param\DyProductManage\ViolateRuleParam.cs" />
|
||||
<Compile Include="Model\Param\PDDProdParam\PDDActivityPriceCheckParam.cs" />
|
||||
<Compile Include="Model\Param\PDDProdParam\PDDActivitySubmitParam.cs" />
|
||||
<Compile Include="Model\Param\PDDProdParam\PDDProdDecorationCommitParam.cs" />
|
||||
<Compile Include="Model\Param\PDDProdParam\PDDProductUploadParam.cs" />
|
||||
<Compile Include="Model\Param\SalesManage\PromotionAddParam.cs" />
|
||||
@@ -194,6 +196,7 @@
|
||||
<Compile Include="Model\Param\ShopManage\DouShopSettingParam.cs" />
|
||||
<Compile Include="Model\Param\TemuProductManage\TemuProductWords.cs" />
|
||||
<Compile Include="Model\Param\TemuProductManage\TemuSizeSpecParam.cs" />
|
||||
<Compile Include="Model\Result\PDDResult\PDDActivitiInfo.cs" />
|
||||
<Compile Include="Model\Result\PDDResult\PDDChanceProductInfo.cs" />
|
||||
<Compile Include="Model\Result\PDDResult\PDDMaterialInfo.cs" />
|
||||
<Compile Include="Model\Result\PDDResult\PDDProductDecorationInfo.cs" />
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace AllBase
|
||||
/// <summary>
|
||||
/// 版本ID
|
||||
/// </summary>
|
||||
public static int VersionCount = 596;
|
||||
public static int VersionCount = 597;
|
||||
//public static int VersionCount = 596;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Param.PDDProdParam
|
||||
{
|
||||
public class PDDActivityPriceCheckParam
|
||||
{
|
||||
public long? activity_id { get; set; }
|
||||
public int? low_price_check_source_type { get; set; }
|
||||
public List<GoodsParam> goods_list { get; set; }
|
||||
}
|
||||
|
||||
public class GoodsParam
|
||||
{
|
||||
public long? goods_id { get; set; }
|
||||
public List<SkuTypeItem> sku_type_list { get; set; }
|
||||
}
|
||||
|
||||
public class SkuTypeItem
|
||||
{
|
||||
public string sku_activity_price_type { get; set; }
|
||||
public List<SkuActivityPriceItem> sku_activity_price_list { get; set; }
|
||||
}
|
||||
|
||||
public class SkuActivityPriceItem
|
||||
{
|
||||
public int? sku_activity_price { get; set; }
|
||||
public long? sku_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Param.PDDProdParam
|
||||
{
|
||||
public class PDDActivitySubmitParam
|
||||
{
|
||||
public long? activity_id { get; set; } = 20981;
|
||||
public List<goods_vo_param> goods_volist { get; set; } = new List<goods_vo_param>();
|
||||
public create_protocol_vo_item create_protocol_vo { get; set; } = new create_protocol_vo_item();
|
||||
public create_outer_activity_price_ratio_vo_item create_outer_activity_price_ratio_vo { get; set; } = new create_outer_activity_price_ratio_vo_item();
|
||||
public enroll_source_ctx_item enroll_source_ctx { get; set; } = new enroll_source_ctx_item();
|
||||
public string behavior_collection_v1_cas_boost_factor { get; set; } = "dXlyaGxldXItNDkwOTQzMTM0LTE3NTgzNzMzNDQwMjE=";
|
||||
}
|
||||
|
||||
public class enroll_source_ctx_item
|
||||
{
|
||||
public int? enroll_type { get; set; } = 34;
|
||||
public string scene_full_coverage { get; set; } = "mmsActQuickEnrollMultiActivityRealTableV1";
|
||||
public string source_type { get; set; } = "PROMO-OwnHome_MultiActEnrollMMS";
|
||||
}
|
||||
|
||||
public class create_outer_activity_price_ratio_vo_item
|
||||
{
|
||||
public bool? merchant_confirm_outer_activity_price_ratio { get; set; } = true;
|
||||
}
|
||||
|
||||
public class create_protocol_vo_item
|
||||
{
|
||||
public bool? need_create_cost_template { get; set; } = true;
|
||||
}
|
||||
|
||||
public class goods_vo_param
|
||||
{
|
||||
public long? goods_id { get; set; }
|
||||
public create_material_vo_param create_material_vo { get; set; } = new create_material_vo_param();
|
||||
public view_confirmed_goods_protocol_vo_item view_confirmed_goods_protocol_vo { get; set; } = new view_confirmed_goods_protocol_vo_item();
|
||||
public create_activity_price_vo_item create_activity_price_vo { get; set; } = new create_activity_price_vo_item();
|
||||
}
|
||||
|
||||
public class create_activity_price_vo_item
|
||||
{
|
||||
public List<create_sku_vo_item> create_sku_vos { get; set; } = new List<create_sku_vo_item>();
|
||||
public create_traffic_protect_vo_item create_traffic_protect_vo { get; set; } = new create_traffic_protect_vo_item();
|
||||
public object create_quantity_vo { get; set; } = new object();
|
||||
}
|
||||
|
||||
public class create_traffic_protect_vo_item
|
||||
{
|
||||
public int? max_cut_price_amount { get; set; } = 100;
|
||||
}
|
||||
|
||||
public class create_sku_vo_item
|
||||
{
|
||||
public sku_front_ctx_vo_item sku_front_ctx_vo { get; set; }
|
||||
public int? sku_activity_price { get; set; }
|
||||
public long? sku_id { get; set; }
|
||||
}
|
||||
|
||||
public class sku_front_ctx_vo_item
|
||||
{
|
||||
public int? filling_sku_price { get; set; }
|
||||
public int? gear_rule { get; set; }
|
||||
public int? require_price { get; set; }
|
||||
}
|
||||
|
||||
public class view_confirmed_goods_protocol_vo_item
|
||||
{
|
||||
public object confirm_hit_cut_price { get; set; } = null;
|
||||
}
|
||||
|
||||
public class create_material_vo_param
|
||||
{
|
||||
public object create_goods_image_vo { get; set; } = new object();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,8 @@ namespace AllBase.Model.Param.PDDProdParam
|
||||
public int? is_sku_pre_sale { get; set; } = 0;
|
||||
public int? is_group_pre_sale { get; set; } = 0;
|
||||
|
||||
public List<goods_property_param> goods_properties { get; set; }
|
||||
//public List<goods_property_param> goods_properties { get; set; }
|
||||
public List<goods_spec_property_param> goods_properties { get; set; }
|
||||
public object is_goods_copy { get; set; }
|
||||
public bool? is_auto_save { get; set; } = false;
|
||||
public string validate_message { get; set; }
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace AllBase.Model.Result
|
||||
public string product_name { get; set; }
|
||||
public string product_json { get; set; }
|
||||
public string size_json { get; set; }
|
||||
public int sku_img_replace_id { get; set; }
|
||||
public string sku_img_replace_base64 { get; set; }
|
||||
public string main_img { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Result.PDDResult
|
||||
{
|
||||
public class PDDActivitiInfo
|
||||
{
|
||||
public long? mall_id { get; set; }
|
||||
public List<PDDActivitiGoodsRenderFormItem> theme_activity_quick_enroll_goods_render_form_list { get; set; }
|
||||
public Dictionary<long, PDDActivitiInfoMapValueItem> activity_info_map { get; set; }
|
||||
public PictureRenderingItem page_bottom_picture_rendering_element { get; set; }
|
||||
}
|
||||
public class PDDActivitiGoodsRenderFormItem
|
||||
{
|
||||
public long? goods_id { get; set; }
|
||||
public GoodsInfoRenderItem goods_info_render { get; set; }
|
||||
public GoodsPromotionBenefitRenderItem goods_promotion_benefit_render { get; set; }
|
||||
public GoodsPromotionProtocolRenderItem goods_promotion_protocol_render { get; set; }
|
||||
public ActivityPriceRenderItem activity_price_render { get; set; }
|
||||
public List<SkuInfoRenderItem> sku_info_render_list { get; set; }
|
||||
public ActivityQuantityRenderItem activity_quantity_render { get; set; }
|
||||
public ActivityMaterialRenderItem activity_material_render { get; set; }
|
||||
public int? order_number { get; set; } //22
|
||||
public GoodsActivityEffectRenderItem goods_activity_effect_render { get; set; }
|
||||
public long? activity_id { get; set; }
|
||||
public GoodsTrafficProtectInfoItem goods_traffic_protect_info { get; set; }
|
||||
public object goods_service_tag_render { get; set; }
|
||||
public object supply_tool_mms_enroll_form_goods_param_items { get; set; }
|
||||
public GoodsExtensionInfoItem goods_extension_info { get; set; }
|
||||
public GoodsShippingConfigRenderItem goods_shipping_config_render { get; set; }
|
||||
}
|
||||
|
||||
public class GoodsShippingConfigRenderItem
|
||||
{
|
||||
public bool? not_default_selection { get; set; } //false,
|
||||
public bool? need_create_cost_template { get; set; } //false,
|
||||
public object cost_template_id { get; set; } //null,
|
||||
public object cost_template_name { get; set; } //null,
|
||||
public object valuation { get; set; } //null,
|
||||
public object delivery_region { get; set; } //null,
|
||||
public object free_shipping_region { get; set; } //null,
|
||||
public object not_free_shipping_region { get; set; } //null,
|
||||
public object not_shipping_region { get; set; } //null
|
||||
|
||||
}
|
||||
|
||||
public class GoodsExtensionInfoItem
|
||||
{
|
||||
public long? goods_id { get; set; }
|
||||
public int? cat_id1 { get; set; }
|
||||
public bool? not_default_selection { get; set; }
|
||||
}
|
||||
|
||||
public class GoodsTrafficProtectInfoItem
|
||||
{
|
||||
public bool? high_sensitive_goods { get; set; } //false,
|
||||
public int? fill_max_cut_price_amount { get; set; } //100
|
||||
|
||||
}
|
||||
|
||||
public class GoodsActivityEffectRenderItem
|
||||
{
|
||||
public object sold_quantity1m { get; set; } //null
|
||||
}
|
||||
public class ActivityMaterialRenderItem
|
||||
{
|
||||
public object activity_goods_image_render { get; set; }
|
||||
}
|
||||
|
||||
public class ActivityQuantityRenderItem
|
||||
{
|
||||
public bool? need_goods_activity_quantity { get; set; } // false,
|
||||
public object min_activity_quantity { get; set; } // null,
|
||||
public object max_activity_quantity { get; set; } // null
|
||||
|
||||
}
|
||||
|
||||
public class SkuInfoRenderItem
|
||||
{
|
||||
public long? sku_id { get; set; } //1788544288237,
|
||||
public string sku_name { get; set; } // "红格子",
|
||||
public int? sku_quantity { get; set; } //100,
|
||||
public int? group_price { get; set; } //5000
|
||||
|
||||
}
|
||||
|
||||
public class ActivityPriceRenderItem
|
||||
{
|
||||
public bool? not_must_check_price_restrict { get; set; } //false
|
||||
public List<SkuActivityPriceRenderDtoItem> sku_activity_price_render_dtolist { get; set; }
|
||||
}
|
||||
|
||||
public class SkuActivityPriceRenderDtoItem
|
||||
{
|
||||
public long? sku_id { get; set; } // 1788544288237
|
||||
public string sku_name { get; set; } //"红格子",
|
||||
public int? sku_quantity { get; set; } // 100,
|
||||
public int? group_price { get; set; } // 5000,
|
||||
public int? suggest_price { get; set; } // 3869,
|
||||
public int? gear_rule { get; set; } // 100,
|
||||
public int? filling_sku_price { get; set; } // 3860,
|
||||
public object cur_goods_acty_prc { get; set; } // null
|
||||
|
||||
}
|
||||
|
||||
public class GoodsPromotionProtocolRenderItem
|
||||
{
|
||||
public object need_show_cut_price_compensation { get; set; }
|
||||
public object need_sign_manfan_protocol { get; set; }
|
||||
public quickEnrollManfanGoodsInfoVoItem quick_enroll_manfan_goods_info_vo { get; set; }
|
||||
}
|
||||
|
||||
public class quickEnrollManfanGoodsInfoVoItem
|
||||
{
|
||||
public object need_join_manfan_act { get; set; }
|
||||
public object goods_join_manfan_act_info_content { get; set; }
|
||||
public object protocol_type { get; set; }
|
||||
}
|
||||
|
||||
public class GoodsPromotionBenefitRenderItem
|
||||
{
|
||||
public List<object> goods_promotion_label_render_list { get; set; }
|
||||
public string benefit_text { get; set; }
|
||||
public object goods_list_benefit_sales { get; set; }
|
||||
}
|
||||
|
||||
public class GoodsInfoRenderItem
|
||||
{
|
||||
public long? goods_id { get; set; }
|
||||
public string goods_name { get; set; }
|
||||
public int? quantity { get; set; }
|
||||
public string thumb_url { get; set; }
|
||||
}
|
||||
|
||||
public class PDDActivitiInfoMapValueItem
|
||||
{
|
||||
public long? activity_id { get; set; } //20981
|
||||
public int? activity_type { get; set; } //27
|
||||
public string activity_type_desc { get; set; } //"大促搜索池"
|
||||
public string icon_url { get; set; } //"https://promotion.pddpic.com/ignore_query/promo-icontest/9cb3674b-ca45-4479-807e-a7e46070fcbd.png"
|
||||
public MultiActivityMediaMaterialItem multi_activity_media_material { get; set; }
|
||||
public ActivityQuickEnrollMallRenderFormItem activity_quick_enroll_mall_render_form { get; set; }
|
||||
public object important_tips { get; set; } //null
|
||||
}
|
||||
|
||||
public class ActivityQuickEnrollMallRenderFormItem
|
||||
{
|
||||
public bool need_promotion_mobile { get; set; } //false
|
||||
public ActivityProtocolRender activity_protocol_render { get; set; }
|
||||
public object supply_tool_activity_introduction_list { get; set; } //null
|
||||
}
|
||||
|
||||
public class ActivityProtocolRender
|
||||
{
|
||||
public bool need_show_ten_billion_draw_commission { get; set; } //false
|
||||
public bool need_show_create_cost_template { get; set; } //true
|
||||
public bool need_show_agree_auto_white_back_pic { get; set; } //false
|
||||
public bool need_show_traffic_protect { get; set; } //true
|
||||
}
|
||||
public class MultiActivityMediaMaterialItem
|
||||
{
|
||||
public string brief_activity_name { get; set; } //"【10周年庆】20981长期报名入口"
|
||||
public object multi_activity_benefit_labels { get; set; } //null
|
||||
}
|
||||
|
||||
public class PictureRenderingItem
|
||||
{
|
||||
public object pop_up_material { get; set; }
|
||||
public BottomPictureConfigMapItem page_bottom_picture_rendering_element { get; set; }
|
||||
public object not_effective_activity_price_adjust_enroll_config_vo { get; set; }
|
||||
}
|
||||
|
||||
public class BottomPictureConfigMapItem
|
||||
{
|
||||
public string texture_picture { get; set; } //"https://commimg.pddpic.com/oms_img_ng/2025-09-12/56cbe3bd-3123-446f-8392-d55d8cfbb657.png"
|
||||
public string gradient_picture { get; set; } //"https://commimg.pddpic.com/oms_img_ng/2025-09-12/4c020e03-8691-4a59-bd50-58cc351eaf12.png",
|
||||
public string left_benefit_point_1 { get; set; } //"https://commimg.pddpic.com/oms_img_ng/2025-09-12/2d892518-a486-497b-a824-d93eb275f610.png"
|
||||
public string left_benefit_point_2 { get; set; } //"https://commimg.pddpic.com/oms_img_ng/2025-09-12/aad5d6f5-3cba-4b17-8558-2e4092a280bc.png"
|
||||
public string left_benefit_point_3 { get; set; } //"https://commimg.pddpic.com/oms_img_ng/2025-09-12/46b9e65f-c88c-446c-9ddd-c5776b57b64f.png"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using KJD_Web.Model;
|
||||
using KJD_Web.Model.ShopModel;
|
||||
using KJD_Web.Utils;
|
||||
using MySql.Data.MySqlClient;
|
||||
using NaiBa.Util.Extension;
|
||||
@@ -203,20 +204,21 @@ namespace KJD_Web.BLL.BXX
|
||||
else
|
||||
{
|
||||
if (isDetail)
|
||||
sql = "select * from bxx.product p where 1=1";
|
||||
sql = "select p.*,s.img_base64 from bxx.product p left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id where 1=1";
|
||||
else if (string.IsNullOrEmpty(get_select_count))
|
||||
sql = "select p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name,p.main_img,p.notes," +
|
||||
"p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words from bxx.product p where 1=1";
|
||||
"p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id from bxx.product p where 1=1";
|
||||
else
|
||||
sql = "SELECT p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name,p.main_img,p.notes," +
|
||||
"p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,COUNT(s.id) AS select_count " +
|
||||
"p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,COUNT(s.id) AS select_count " +
|
||||
"FROM bxx.product p LEFT JOIN bxx.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "' " +
|
||||
"WHERE 1=1";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
|
||||
sql += " group by p.id";
|
||||
if (!isDetail && !string.IsNullOrEmpty(get_select_count))
|
||||
sql += " group by p.id";
|
||||
if (sort_field == "select_total_count")
|
||||
sql += " order by p.select_total_count desc, p.id desc";
|
||||
else
|
||||
@@ -243,7 +245,8 @@ namespace KJD_Web.BLL.BXX
|
||||
cat_name = row["cat_name"].ToString(),
|
||||
product_name = row["product_name"].ToString(),
|
||||
main_img = row["main_img"].ToString(),
|
||||
ext_code = row["ext_code"].ToString(),
|
||||
ext_code = row["ext_code"].ToString(),
|
||||
price_text = row["price_text"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
add_time = Convert.ToDateTime(row["add_time"]),
|
||||
@@ -253,9 +256,11 @@ namespace KJD_Web.BLL.BXX
|
||||
end_words = row["end_words"].ParseToString(),
|
||||
fission_words = row["fission_words"].ParseToString(),
|
||||
head_words = row["head_words"].ParseToString(),
|
||||
sku_img_replace_id = row["sku_img_replace_id"].ParseToInt(),
|
||||
};
|
||||
if (isDetail)
|
||||
{
|
||||
prod.sku_img_replace_base64 = row["img_base64"].ToString();
|
||||
prod.product_json = row["product_json"].ToString();
|
||||
prod.size_json = row["size_json"].ToString();
|
||||
}
|
||||
@@ -281,6 +286,90 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询商品替换sku
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <param name="isDetail"></param>
|
||||
/// <returns></returns>
|
||||
public string GetSkuImgReplaceList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var sku_img_replace_ids = RegexUtils.GetStringQuery(ref inputData, "sku_img_replace_ids")?.Replace("'", "\\'");
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select count(id) from bxx.sku_img_replace p where 1=1";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(sku_img_replace_ids))
|
||||
where += " and p.id in (" + sku_img_replace_ids + ")";
|
||||
sql += where;
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isDetail)
|
||||
sql = "select * from bxx.product p left where 1=1";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
|
||||
sql += " order by p.id desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<sku_img_replace> skuImgReplaceLst = new List<sku_img_replace>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
sku_img_replace skuImgReplace = new sku_img_replace
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
img_base64 = row["img_base64"].ToString(),
|
||||
img_md5 = row["img_md5"].ToString(),
|
||||
};
|
||||
skuImgReplaceLst.Add(skuImgReplace);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(skuImgReplaceLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetProductListRandom(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -452,6 +541,12 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑商品备注信息、货号、头尾词和分词
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <param name="isAdmin"></param>
|
||||
/// <returns></returns>
|
||||
public string MdyDBProduct(string inputData, bool isAdmin = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -507,7 +602,104 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string AddSkuImgReplace(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
string img_md5 = RegexUtils.GetStringQuery(ref inputData, "img_md5");
|
||||
string img_base64 = RegexUtils.GetStringQuery(ref inputData, "img_base64");
|
||||
string product_db_id = RegexUtils.GetStringQuery(ref inputData, "product_db_id");
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
int sku_img_replace_id = 0;
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
|
||||
sql = "select id from bxx.sku_img_replace where img_md5='" + img_md5 + "';";
|
||||
var rst = mySql.ExecuteFirstInt(sql).ParseToLong();
|
||||
if (rst <= 0)
|
||||
{
|
||||
sql = "insert into bxx.sku_img_replace (img_md5,img_base64) " +
|
||||
"values ('" + img_md5 + "','" + img_base64 + "');";
|
||||
rst = mySql.ExecuteInsertId(sql);
|
||||
}
|
||||
if (rst > 0)
|
||||
{
|
||||
sku_img_replace_id = (int)rst;
|
||||
sql = "update bxx.product set sku_img_replace_id= "+ sku_img_replace_id + " where id=" + product_db_id + ";";
|
||||
|
||||
var bRst = mySql.ExecuteNonQuery(sql);
|
||||
if (bRst)
|
||||
return "{\"code\":200,\"msg\":\"success\",\"sku_img_replace_id\":" + rst + "}";
|
||||
}
|
||||
mySql.Close();
|
||||
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string MdySkuImgReplace(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
|
||||
string img_md5 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "img_md5"));
|
||||
string img_base64 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "img_base64"));
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update bxx.sku_img_replace set";
|
||||
if (img_md5 != null)
|
||||
sql += " img_md5='" + img_md5 + "',";
|
||||
if (img_base64 != null)
|
||||
sql += " img_base64='" + img_base64 + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where id=" + id + ";";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加用户选择商品
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <param name="isAdmin"></param>
|
||||
/// <returns></returns>
|
||||
public string AddUserSelectProduct(string inputData, bool isAdmin = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
|
||||
@@ -133,7 +133,8 @@ namespace KJD_Web.BLL
|
||||
//where子句
|
||||
sql += where;
|
||||
|
||||
sql += " group by p.id";
|
||||
if (!isDetail && !string.IsNullOrEmpty(get_select_count))
|
||||
sql += " group by p.id";
|
||||
if (sort_field == "select_total_count")
|
||||
sql += " order by p.select_total_count desc, p.id desc";
|
||||
else
|
||||
|
||||
@@ -156,6 +156,39 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void add_sku_img_replace()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXProductManage().AddSkuImgReplace(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
[WebMethod]
|
||||
public void mdy_sku_img_replace()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXProductManage().MdySkuImgReplace(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
[WebMethod]
|
||||
public void get_sku_img_replace_list()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXProductManage().GetSkuImgReplaceList(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void add_user_select_product()
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
<Compile Include="Model\ProductPurchasePriceResultParam.cs" />
|
||||
<Compile Include="Model\ProductSelectResultParam.cs" />
|
||||
<Compile Include="Model\ShopModel\ShopParam.cs" />
|
||||
<Compile Include="Model\ShopModel\sku_img_replace.cs" />
|
||||
<Compile Include="Model\UserLoginResultParam.cs" />
|
||||
<Compile Include="BXXPriceService.asmx.cs">
|
||||
<DependentUpon>BXXPriceService.asmx</DependentUpon>
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace KJD_Web.Model
|
||||
public string product_name { get; set; }
|
||||
public string product_json { get; set; }
|
||||
public string size_json { get; set; }
|
||||
public int sku_img_replace_id { get; set; }
|
||||
public string sku_img_replace_base64 { get; set; }
|
||||
public string main_img { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Model.ShopModel
|
||||
{
|
||||
public class sku_img_replace
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string img_md5 { get; set; }
|
||||
public string img_base64 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -441,7 +441,77 @@ namespace TemuKJD.BLL
|
||||
result = GetProxyHtml.ReadResponse(response);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string PDDPostResponseUpload(ShopLoginInfo shop, string _url, string _data, string referer, string boundary, string AntiContent = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(AntiContent))
|
||||
AntiContent = "0apAfa5e-wCEXaTg0FNtNj4PklUKt0E_FNynruEIx9qGLdY6b5YUhnqi7QxYqQqi2Ugraphm85CrR0oU0XYn0dYX5dqXqXJnqg8npDTnpTJnpAaX9swaKE20Tbw_yKnoaXIXxHGB_IxWWlIXMnxghvniTodnXt2wcA7sxhbV_CEBcCez4H92maXI2d1qgoYswoG4Mf_ojlph0nGig8nqWzXqwTYh0j4W6jYs6PxHjXvJslpHyXjseoqZhfqdydn5_Jj0g2TPpCaGDgSgL1FT_lZPGmxIq9UXkPCQpBhPtTZaqGAq06gXkNxXZPrXO0gQ4SHl0bZSZth9LG_j0dKS54JX1PCPZM4XObhaxYjH0oMqm06oiXHYmpnOkTbo-z4QlrCxT43eEBgmrk8AvVbKI3FKz-FAL4pwdFveGf5c1JO_csO50lnqQNy9909u6zLUrFMiTy";
|
||||
string rckk = "Z07QGtUzw1cgd58IPWnC1OAGCW9xcH1m";
|
||||
string cookies = "";
|
||||
try
|
||||
{
|
||||
var cookieLst = JsonHelper.DeserializeJsonToList<CefSharp.Cookie>(shop.Cookies);
|
||||
foreach (var cook in cookieLst)
|
||||
{
|
||||
cookies += cook.Name + "=" + cook.Value + ";";
|
||||
}
|
||||
var rckkCookie = cookieLst.FirstOrDefault(c => c.Name == "rckk");
|
||||
if (rckkCookie != null)
|
||||
rckk = rckkCookie.Value;
|
||||
}
|
||||
catch { }
|
||||
|
||||
|
||||
HttpWebResponse response = null;
|
||||
string result;
|
||||
try
|
||||
{
|
||||
string url = _url;
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
|
||||
request.KeepAlive = true;
|
||||
request.Headers.Set(HttpRequestHeader.CacheControl, "max-age=0");
|
||||
request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
|
||||
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36";
|
||||
request.Headers.Add("ETag", rckk);
|
||||
request.Headers.Add("sec-ch-ua", @"""Not;A=Brand"";v=""99"", ""Google Chrome"";v=""139"", ""Chromium"";v=""139""");
|
||||
request.ContentType = "multipart/form-data; boundary=" + boundary;
|
||||
request.Headers.Add("sec-ch-ua-mobile", @"?0");
|
||||
request.Accept = "*/*";
|
||||
request.Headers.Add("Origin", @"https://mms.pinduoduo.com");
|
||||
request.Headers.Set(HttpRequestHeader.Cookie, cookies);
|
||||
request.Headers.Add("Sec-Fetch-Site", @"same-site");
|
||||
request.Headers.Add("Sec-Fetch-Mode", @"cors");
|
||||
request.Headers.Add("Sec-Fetch-Dest", @"empty");
|
||||
request.Referer = referer;
|
||||
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
|
||||
request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
|
||||
|
||||
request.Method = "POST";
|
||||
request.ServicePoint.Expect100Continue = false;
|
||||
|
||||
string body = _data;
|
||||
WriteMultipartBodyToRequest(request, body);
|
||||
|
||||
response = (HttpWebResponse)request.GetResponse();
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.ProtocolError)
|
||||
{
|
||||
response = (HttpWebResponse)ex.Response;
|
||||
result = GetProxyHtml.ReadResponse(response);
|
||||
return result;
|
||||
}
|
||||
else return ex.Message;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (response != null) response.Close();
|
||||
return e.Message;
|
||||
}
|
||||
result = GetProxyHtml.ReadResponse(response);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -30,6 +30,8 @@
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDDBProdEditNotesForm));
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.pictureBox2 = new System.Windows.Forms.PictureBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.txtFissionWords = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||
this.txtEndWords = new System.Windows.Forms.TextBox();
|
||||
@@ -48,13 +50,18 @@
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||
this.btnOk = new TemuKJD.UserControls.ButtonEx();
|
||||
this.buttonEx1 = new TemuKJD.UserControls.ButtonEx();
|
||||
this.panel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BackColor = System.Drawing.Color.White;
|
||||
this.panel2.Controls.Add(this.buttonEx1);
|
||||
this.panel2.Controls.Add(this.pictureBox2);
|
||||
this.panel2.Controls.Add(this.label9);
|
||||
this.panel2.Controls.Add(this.label7);
|
||||
this.panel2.Controls.Add(this.txtFissionWords);
|
||||
this.panel2.Controls.Add(this.txtEndWords);
|
||||
@@ -79,10 +86,30 @@
|
||||
this.panel2.Size = new System.Drawing.Size(464, 686);
|
||||
this.panel2.TabIndex = 1;
|
||||
//
|
||||
// pictureBox2
|
||||
//
|
||||
this.pictureBox2.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
||||
this.pictureBox2.Location = new System.Drawing.Point(165, 491);
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.Size = new System.Drawing.Size(136, 136);
|
||||
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox2.TabIndex = 405;
|
||||
this.pictureBox2.TabStop = false;
|
||||
this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(19, 496);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(68, 17);
|
||||
this.label9.TabIndex = 404;
|
||||
this.label9.Text = "SKU替换图";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(31, 391);
|
||||
this.label7.Location = new System.Drawing.Point(31, 386);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(56, 17);
|
||||
this.label7.TabIndex = 403;
|
||||
@@ -105,10 +132,10 @@
|
||||
this.txtFissionWords.Border.PaddingLeft = 2;
|
||||
this.txtFissionWords.Border.PaddingRight = 2;
|
||||
this.txtFissionWords.Border.PaddingTop = 2;
|
||||
this.txtFissionWords.Location = new System.Drawing.Point(90, 391);
|
||||
this.txtFissionWords.Location = new System.Drawing.Point(90, 386);
|
||||
this.txtFissionWords.Multiline = true;
|
||||
this.txtFissionWords.Name = "txtFissionWords";
|
||||
this.txtFissionWords.Size = new System.Drawing.Size(337, 238);
|
||||
this.txtFissionWords.Size = new System.Drawing.Size(337, 93);
|
||||
this.txtFissionWords.TabIndex = 402;
|
||||
this.txtFissionWords.WatermarkText = "一行一个";
|
||||
//
|
||||
@@ -116,7 +143,7 @@
|
||||
//
|
||||
this.txtEndWords.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtEndWords.Location = new System.Drawing.Point(291, 353);
|
||||
this.txtEndWords.Location = new System.Drawing.Point(291, 348);
|
||||
this.txtEndWords.Name = "txtEndWords";
|
||||
this.txtEndWords.Size = new System.Drawing.Size(136, 23);
|
||||
this.txtEndWords.TabIndex = 401;
|
||||
@@ -124,7 +151,7 @@
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(233, 356);
|
||||
this.label6.Location = new System.Drawing.Point(233, 351);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(56, 17);
|
||||
this.label6.TabIndex = 400;
|
||||
@@ -132,7 +159,7 @@
|
||||
//
|
||||
// txtHeadWords
|
||||
//
|
||||
this.txtHeadWords.Location = new System.Drawing.Point(90, 353);
|
||||
this.txtHeadWords.Location = new System.Drawing.Point(90, 348);
|
||||
this.txtHeadWords.Name = "txtHeadWords";
|
||||
this.txtHeadWords.Size = new System.Drawing.Size(136, 23);
|
||||
this.txtHeadWords.TabIndex = 399;
|
||||
@@ -140,7 +167,7 @@
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(31, 356);
|
||||
this.label5.Location = new System.Drawing.Point(31, 351);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(56, 17);
|
||||
this.label5.TabIndex = 398;
|
||||
@@ -150,7 +177,7 @@
|
||||
//
|
||||
this.txtProductName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtProductName.Location = new System.Drawing.Point(90, 205);
|
||||
this.txtProductName.Location = new System.Drawing.Point(90, 200);
|
||||
this.txtProductName.Multiline = true;
|
||||
this.txtProductName.Name = "txtProductName";
|
||||
this.txtProductName.Size = new System.Drawing.Size(337, 46);
|
||||
@@ -160,7 +187,7 @@
|
||||
//
|
||||
this.txtSkcId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtSkcId.Location = new System.Drawing.Point(291, 171);
|
||||
this.txtSkcId.Location = new System.Drawing.Point(291, 166);
|
||||
this.txtSkcId.Name = "txtSkcId";
|
||||
this.txtSkcId.ReadOnly = true;
|
||||
this.txtSkcId.Size = new System.Drawing.Size(136, 23);
|
||||
@@ -168,7 +195,7 @@
|
||||
//
|
||||
// txtSpuId
|
||||
//
|
||||
this.txtSpuId.Location = new System.Drawing.Point(90, 171);
|
||||
this.txtSpuId.Location = new System.Drawing.Point(90, 166);
|
||||
this.txtSpuId.Name = "txtSpuId";
|
||||
this.txtSpuId.ReadOnly = true;
|
||||
this.txtSpuId.Size = new System.Drawing.Size(136, 23);
|
||||
@@ -178,7 +205,7 @@
|
||||
//
|
||||
this.txtExtCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtExtCode.Location = new System.Drawing.Point(90, 262);
|
||||
this.txtExtCode.Location = new System.Drawing.Point(90, 257);
|
||||
this.txtExtCode.Name = "txtExtCode";
|
||||
this.txtExtCode.Size = new System.Drawing.Size(337, 23);
|
||||
this.txtExtCode.TabIndex = 394;
|
||||
@@ -186,7 +213,7 @@
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(31, 265);
|
||||
this.label4.Location = new System.Drawing.Point(31, 260);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(56, 17);
|
||||
this.label4.TabIndex = 393;
|
||||
@@ -195,7 +222,7 @@
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(31, 209);
|
||||
this.label3.Location = new System.Drawing.Point(31, 204);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(56, 17);
|
||||
this.label3.TabIndex = 392;
|
||||
@@ -204,7 +231,7 @@
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(233, 174);
|
||||
this.label2.Location = new System.Drawing.Point(233, 169);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(56, 17);
|
||||
this.label2.TabIndex = 391;
|
||||
@@ -213,7 +240,7 @@
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(31, 174);
|
||||
this.label1.Location = new System.Drawing.Point(31, 169);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(56, 17);
|
||||
this.label1.TabIndex = 390;
|
||||
@@ -228,11 +255,12 @@
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox1.TabIndex = 389;
|
||||
this.pictureBox1.TabStop = false;
|
||||
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(31, 296);
|
||||
this.label8.Location = new System.Drawing.Point(31, 291);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(56, 17);
|
||||
this.label8.TabIndex = 386;
|
||||
@@ -255,7 +283,7 @@
|
||||
this.txtNotes.Border.PaddingLeft = 2;
|
||||
this.txtNotes.Border.PaddingRight = 2;
|
||||
this.txtNotes.Border.PaddingTop = 2;
|
||||
this.txtNotes.Location = new System.Drawing.Point(90, 296);
|
||||
this.txtNotes.Location = new System.Drawing.Point(90, 291);
|
||||
this.txtNotes.Multiline = true;
|
||||
this.txtNotes.Name = "txtNotes";
|
||||
this.txtNotes.Size = new System.Drawing.Size(337, 47);
|
||||
@@ -278,20 +306,38 @@
|
||||
this.btnOk.UseVisualStyleBackColor = false;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// DbProductEditNotesForm
|
||||
// buttonEx1
|
||||
//
|
||||
this.buttonEx1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonEx1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.buttonEx1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.buttonEx1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.buttonEx1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.buttonEx1.ForeColor = System.Drawing.Color.White;
|
||||
this.buttonEx1.Location = new System.Drawing.Point(90, 491);
|
||||
this.buttonEx1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.buttonEx1.Name = "buttonEx1";
|
||||
this.buttonEx1.Size = new System.Drawing.Size(70, 26);
|
||||
this.buttonEx1.TabIndex = 406;
|
||||
this.buttonEx1.Text = "上传图片";
|
||||
this.buttonEx1.UseVisualStyleBackColor = false;
|
||||
this.buttonEx1.Click += new System.EventHandler(this.buttonEx1_Click);
|
||||
//
|
||||
// PDDDBProdEditNotesForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(466, 720);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "DbProductEditNotesForm";
|
||||
this.Name = "PDDDBProdEditNotesForm";
|
||||
this.Text = "编辑商品备注/货号";
|
||||
this.TitleText = "编辑商品备注/货号";
|
||||
this.Load += new System.EventHandler(this.ProductSelectListForm_Load);
|
||||
this.Controls.SetChildIndex(this.panel2, 0);
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
@@ -318,5 +364,8 @@
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox txtHeadWords;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.PictureBox pictureBox2;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private UserControls.ButtonEx buttonEx1;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,10 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using AllBase;
|
||||
using Work;
|
||||
using TemuKJD.ToolForms;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using Work.BLL.Tools;
|
||||
|
||||
namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
{
|
||||
@@ -39,6 +43,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.txtFissionWords.Text = dbProd.fission_words;
|
||||
this.txtHeadWords.Text = string.IsNullOrWhiteSpace(dbProd.head_words) ? "5-99个" : dbProd.head_words;
|
||||
this.txtEndWords.Text = string.IsNullOrWhiteSpace(dbProd.end_words) ? "适合不同的搭配风格" : dbProd.end_words;
|
||||
this.txtHeadWords.Text = dbProd.head_words;
|
||||
this.txtEndWords.Text = dbProd.end_words;
|
||||
|
||||
var prodTmp = GetProductDetail(dbProd.id.ToString());
|
||||
dbProd.sku_img_replace_base64 = prodTmp.sku_img_replace_base64;
|
||||
if (!string.IsNullOrWhiteSpace(dbProd.sku_img_replace_base64))
|
||||
this.pictureBox2.Image = Base64ChangeImgUrl.Base64ToImage(dbProd.sku_img_replace_base64); // Convert.FromBase64String(dbProd.sku_img_replace_base64);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,5 +84,118 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void pictureBox1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowImgForm imgFrom = new ShowImgForm(pictureBox1.ImageLocation);
|
||||
imgFrom.ShowDialog();
|
||||
}
|
||||
|
||||
public KJDDBProduct GetProductDetail(string prodDbId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(prodDbId))
|
||||
return new KJDDBProduct();
|
||||
|
||||
List<KJDDBProduct> list = new List<KJDDBProduct>();
|
||||
|
||||
var url = BaseClass.BuildObjString("product/get_product_detail_list");
|
||||
var data = "";
|
||||
|
||||
data = UserLogin.GetSignaturex() + "&search_db_ids=" + prodDbId;
|
||||
|
||||
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);
|
||||
var item = list.FirstOrDefault();
|
||||
if (item == null)
|
||||
item = new KJDDBProduct();
|
||||
return item;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonEx1_Click(object sender, EventArgs e)
|
||||
{
|
||||
string text = "";
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Multiselect = false;
|
||||
// 设置过滤条件,只显示文本文件
|
||||
openFileDialog.Filter = "图片文件 (*.jepg;*.jpg;*.png)|*.jepg;*.jpg;*.png|All files (*.*)|*.*";
|
||||
// 显示对话框并获取结果
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
string filePath = openFileDialog.FileName;
|
||||
//using (Image image = Image.FromFile(filePath))
|
||||
//{
|
||||
// // 现在你可以使用image对象进行各种操作,比如绘制、保存等
|
||||
// //Console.WriteLine("Image loaded successfully.");
|
||||
// this.pictureBox2.Image = image;
|
||||
//}
|
||||
Image image = Image.FromFile(filePath);
|
||||
this.pictureBox2.Image = image;
|
||||
|
||||
string imgBase64 = "";
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
{
|
||||
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
byte[] imageBytes = memoryStream.ToArray();
|
||||
imgBase64 = Convert.ToBase64String(imageBytes);
|
||||
}
|
||||
string img_md5 = BaseClass.GetMd5(imgBase64);
|
||||
|
||||
var url = BaseClass.BuildObjString("product/add_sku_img_replace");
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&product_db_id=" + dbProd.id;
|
||||
data += "&img_base64=" + imgBase64;
|
||||
data += "&img_md5=" + img_md5;
|
||||
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"))
|
||||
{
|
||||
BaseMsgForm.ShowError("商品备注编辑失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
}
|
||||
else
|
||||
{
|
||||
dbProd.sku_img_replace_base64 = imgBase64;
|
||||
dbProd.sku_img_replace_id = BaseRegex.GetIntJson(ref html, "sku_img_replace_id");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Console.WriteLine("An error occurred: " + ex.Message);
|
||||
BaseMsgForm.ShowError("打开自定义图片失败 " + ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void pictureBox2_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowImgForm imgFrom = new ShowImgForm(pictureBox2.Image);
|
||||
imgFrom.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
+30
-20
@@ -45,8 +45,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.lblNotes = new System.Windows.Forms.Label();
|
||||
this.txtSPU = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.txtSKC = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.pnlEmpty = new DevComponents.DotNetBar.PanelEx();
|
||||
this.btnSearch = new TemuKJD.UserControls.ButtonEx();
|
||||
this.txtExtCode = new System.Windows.Forms.TextBox();
|
||||
@@ -58,6 +56,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.pbLoading = new System.Windows.Forms.PictureBox();
|
||||
this.txtSKC = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx();
|
||||
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
|
||||
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
|
||||
@@ -71,6 +71,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.col_skc_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_cat_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_ext_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colPriceText = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colAddTimes = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colSelectTotalCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_notes = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -209,24 +210,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.label5.TabIndex = 435;
|
||||
this.label5.Text = "商品ID:";
|
||||
//
|
||||
// txtSKC
|
||||
//
|
||||
this.txtSKC.Location = new System.Drawing.Point(87, 80);
|
||||
this.txtSKC.Name = "txtSKC";
|
||||
this.txtSKC.Size = new System.Drawing.Size(90, 23);
|
||||
this.txtSKC.TabIndex = 432;
|
||||
this.txtSKC.Visible = false;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(54, 83);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(43, 17);
|
||||
this.label1.TabIndex = 433;
|
||||
this.label1.Text = "SKC:";
|
||||
this.label1.Visible = false;
|
||||
//
|
||||
// pnlEmpty
|
||||
//
|
||||
this.pnlEmpty.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
@@ -359,6 +342,24 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.pbLoading.TabIndex = 7;
|
||||
this.pbLoading.TabStop = false;
|
||||
//
|
||||
// txtSKC
|
||||
//
|
||||
this.txtSKC.Location = new System.Drawing.Point(87, 80);
|
||||
this.txtSKC.Name = "txtSKC";
|
||||
this.txtSKC.Size = new System.Drawing.Size(90, 23);
|
||||
this.txtSKC.TabIndex = 432;
|
||||
this.txtSKC.Visible = false;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(54, 83);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(43, 17);
|
||||
this.label1.TabIndex = 433;
|
||||
this.label1.Text = "SKC:";
|
||||
this.label1.Visible = false;
|
||||
//
|
||||
// dgvDbProduct
|
||||
//
|
||||
this.dgvDbProduct.AllowUserToAddRows = false;
|
||||
@@ -388,6 +389,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.col_skc_id,
|
||||
this.col_cat_name,
|
||||
this.col_ext_code,
|
||||
this.colPriceText,
|
||||
this.colAddTimes,
|
||||
this.colSelectTotalCount,
|
||||
this.col_notes,
|
||||
@@ -509,6 +511,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.col_ext_code.Name = "col_ext_code";
|
||||
this.col_ext_code.ReadOnly = true;
|
||||
//
|
||||
// colPriceText
|
||||
//
|
||||
this.colPriceText.FillWeight = 60F;
|
||||
this.colPriceText.HeaderText = "母店价格";
|
||||
this.colPriceText.Name = "colPriceText";
|
||||
this.colPriceText.ReadOnly = true;
|
||||
//
|
||||
// colAddTimes
|
||||
//
|
||||
this.colAddTimes.FillWeight = 52F;
|
||||
@@ -662,6 +671,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn col_skc_id;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn col_cat_name;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn col_ext_code;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colPriceText;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTimes;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colSelectTotalCount;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn col_notes;
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.dgvDbProduct.Columns["colHeadWords"].Visible = true;
|
||||
this.dgvDbProduct.Columns["colEndWords"].Visible = true;
|
||||
this.dgvDbProduct.Columns["colFissionWords"].Visible = true;
|
||||
this.dgvDbProduct.Columns["colPriceText"].Visible = true;
|
||||
//this.dgvDbProduct.Columns["col_notes"].Visible = true;
|
||||
//this.lblNotes.Visible = true;
|
||||
//this.txtNotes.Visible = true;
|
||||
@@ -64,6 +65,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.dgvDbProduct.Columns["colHeadWords"].Visible = false;
|
||||
this.dgvDbProduct.Columns["colEndWords"].Visible = false;
|
||||
this.dgvDbProduct.Columns["colFissionWords"].Visible = false;
|
||||
this.dgvDbProduct.Columns["colPriceText"].Visible = false;
|
||||
//this.dgvDbProduct.Columns["col_notes"].Visible = false;
|
||||
//this.lblNotes.Visible = false;
|
||||
//this.txtNotes.Visible = false;
|
||||
@@ -140,6 +142,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
prod.skc_id,
|
||||
prod.cat_name,
|
||||
prod.ext_code,
|
||||
prod.price_text,
|
||||
prod.select_count,
|
||||
prod.select_total_count,
|
||||
prod.notes,
|
||||
|
||||
@@ -147,6 +147,9 @@
|
||||
<metadata name="col_ext_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colPriceText.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colAddTimes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
||||
+3
-2
@@ -181,6 +181,7 @@
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox1.TabIndex = 389;
|
||||
this.pictureBox1.TabStop = false;
|
||||
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
|
||||
//
|
||||
// label8
|
||||
//
|
||||
@@ -208,14 +209,14 @@
|
||||
this.btnOk.UseVisualStyleBackColor = false;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// DbProductUserSelectEditNotesForm
|
||||
// PDDDBProdUserSelectEditNotesForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(393, 580);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "DbProductUserSelectEditNotesForm";
|
||||
this.Name = "PDDDBProdUserSelectEditNotesForm";
|
||||
this.Text = "编辑上传备注";
|
||||
this.TitleText = "编辑上传备注";
|
||||
this.Load += new System.EventHandler(this.ProductSelectListForm_Load);
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Windows.Forms;
|
||||
using AllBase;
|
||||
using Work;
|
||||
using TemuKJD.BLL;
|
||||
using TemuKJD.ToolForms;
|
||||
|
||||
namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
{
|
||||
@@ -100,5 +101,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
else
|
||||
lblTextCount.ForeColor = Color.Gray;
|
||||
}
|
||||
|
||||
private void pictureBox1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowImgForm imgFrom = new ShowImgForm(pictureBox1.ImageLocation);
|
||||
imgFrom.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,13 +30,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
|
||||
this.txtAddTimesFake = new System.Windows.Forms.TextBox();
|
||||
this.chkActivity = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.chkSizeSpec = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.chkAddMorePriceFirst = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.btnClearDgv = new DevComponents.DotNetBar.PanelEx();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
@@ -130,7 +134,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.btnClear = new DevComponents.DotNetBar.PanelEx();
|
||||
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
|
||||
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
|
||||
this.chkSizeSpec = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
@@ -187,6 +190,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
|
||||
this.ucGroupBoxEx2.Controls.Add(this.txtAddTimesFake);
|
||||
this.ucGroupBoxEx2.Controls.Add(this.chkActivity);
|
||||
this.ucGroupBoxEx2.Controls.Add(this.label17);
|
||||
this.ucGroupBoxEx2.Controls.Add(this.chkSizeSpec);
|
||||
this.ucGroupBoxEx2.Controls.Add(this.chkAddMorePriceFirst);
|
||||
this.ucGroupBoxEx2.Controls.Add(this.btnClearDgv);
|
||||
@@ -213,10 +219,57 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.ucGroupBoxEx2.TabStop = false;
|
||||
this.ucGroupBoxEx2.Text = "商品上传";
|
||||
//
|
||||
// txtAddTimesFake
|
||||
//
|
||||
this.txtAddTimesFake.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.txtAddTimesFake.Location = new System.Drawing.Point(694, 63);
|
||||
this.txtAddTimesFake.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
this.txtAddTimesFake.Name = "txtAddTimesFake";
|
||||
this.txtAddTimesFake.Size = new System.Drawing.Size(31, 23);
|
||||
this.txtAddTimesFake.TabIndex = 645;
|
||||
this.txtAddTimesFake.Text = "3";
|
||||
//
|
||||
// chkActivity
|
||||
//
|
||||
this.chkActivity.AutoSize = true;
|
||||
this.chkActivity.Checked = true;
|
||||
this.chkActivity.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkActivity.Location = new System.Drawing.Point(567, 64);
|
||||
this.chkActivity.Name = "chkActivity";
|
||||
this.chkActivity.Size = new System.Drawing.Size(135, 21);
|
||||
this.chkActivity.TabIndex = 648;
|
||||
this.chkActivity.Text = "参加活动并虚拟加价";
|
||||
this.chkActivity.UseVisualStyleBackColor = true;
|
||||
this.chkActivity.CheckedChanged += new System.EventHandler(this.chkActivity_CheckedChanged);
|
||||
//
|
||||
// label17
|
||||
//
|
||||
this.label17.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label17.AutoSize = true;
|
||||
this.label17.Location = new System.Drawing.Point(725, 66);
|
||||
this.label17.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label17.Name = "label17";
|
||||
this.label17.Size = new System.Drawing.Size(20, 17);
|
||||
this.label17.TabIndex = 647;
|
||||
this.label17.Text = "倍";
|
||||
//
|
||||
// chkSizeSpec
|
||||
//
|
||||
this.chkSizeSpec.AutoSize = true;
|
||||
this.chkSizeSpec.Checked = true;
|
||||
this.chkSizeSpec.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkSizeSpec.Location = new System.Drawing.Point(567, 87);
|
||||
this.chkSizeSpec.Name = "chkSizeSpec";
|
||||
this.chkSizeSpec.Size = new System.Drawing.Size(111, 21);
|
||||
this.chkSizeSpec.TabIndex = 635;
|
||||
this.chkSizeSpec.Text = "使用上家尺码表";
|
||||
this.chkSizeSpec.UseVisualStyleBackColor = true;
|
||||
this.chkSizeSpec.CheckedChanged += new System.EventHandler(this.chkSizeSpec_CheckedChanged);
|
||||
//
|
||||
// chkAddMorePriceFirst
|
||||
//
|
||||
this.chkAddMorePriceFirst.AutoSize = true;
|
||||
this.chkAddMorePriceFirst.Location = new System.Drawing.Point(577, 111);
|
||||
this.chkAddMorePriceFirst.Location = new System.Drawing.Point(567, 111);
|
||||
this.chkAddMorePriceFirst.Name = "chkAddMorePriceFirst";
|
||||
this.chkAddMorePriceFirst.Size = new System.Drawing.Size(111, 21);
|
||||
this.chkAddMorePriceFirst.TabIndex = 625;
|
||||
@@ -258,9 +311,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.label14.Location = new System.Drawing.Point(317, 113);
|
||||
this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label14.Name = "label14";
|
||||
this.label14.Size = new System.Drawing.Size(260, 17);
|
||||
this.label14.Size = new System.Drawing.Size(248, 17);
|
||||
this.label14.TabIndex = 599;
|
||||
this.label14.Text = "说明:若未勾选或不满足阶梯加价,按默认加价";
|
||||
this.label14.Text = "说明:阶梯加价未勾选或不满足,按默认加价";
|
||||
//
|
||||
// label15
|
||||
//
|
||||
@@ -738,18 +791,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.dgvShop.AllowUserToAddRows = false;
|
||||
this.dgvShop.AllowUserToDeleteRows = false;
|
||||
dataGridViewCellStyle16.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
|
||||
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle17.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle17.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle17.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17;
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.colSelect,
|
||||
@@ -1167,18 +1220,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.dgvSelectProduct.AllowUserToAddRows = false;
|
||||
this.dgvSelectProduct.AllowUserToDeleteRows = false;
|
||||
dataGridViewCellStyle18.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||
this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18;
|
||||
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||
this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.dgvSelectProduct.BackgroundColor = System.Drawing.Color.White;
|
||||
this.dgvSelectProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle19.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle19;
|
||||
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.dgvSelectProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvSelectProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.colCheck,
|
||||
@@ -1298,8 +1351,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
// colProductName
|
||||
//
|
||||
dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colProductName.DefaultCellStyle = dataGridViewCellStyle20;
|
||||
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colProductName.DefaultCellStyle = dataGridViewCellStyle5;
|
||||
this.colProductName.HeaderText = "商品标题";
|
||||
this.colProductName.Name = "colProductName";
|
||||
this.colProductName.ReadOnly = true;
|
||||
@@ -1466,19 +1519,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.ucSplitPage1.TabIndex = 675;
|
||||
this.ucSplitPage1.TotalPage = 1;
|
||||
//
|
||||
// chkSizeSpec
|
||||
//
|
||||
this.chkSizeSpec.AutoSize = true;
|
||||
this.chkSizeSpec.Checked = true;
|
||||
this.chkSizeSpec.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkSizeSpec.Location = new System.Drawing.Point(577, 87);
|
||||
this.chkSizeSpec.Name = "chkSizeSpec";
|
||||
this.chkSizeSpec.Size = new System.Drawing.Size(111, 21);
|
||||
this.chkSizeSpec.TabIndex = 635;
|
||||
this.chkSizeSpec.Text = "使用上家尺码表";
|
||||
this.chkSizeSpec.UseVisualStyleBackColor = true;
|
||||
this.chkSizeSpec.CheckedChanged += new System.EventHandler(this.chkSizeSpec_CheckedChanged);
|
||||
//
|
||||
// PDDDBProdUserSelectForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
@@ -1567,7 +1607,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
private UserComponent.UcGroupBoxEx ucGroupBoxEx2;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.TextBox txtAddMorePrice;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.TextBox txtAddTimes;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.TextBox txtStockNum;
|
||||
@@ -1623,5 +1662,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
|
||||
private UserComponent.UcCheckBox chkSizeSpec;
|
||||
private System.Windows.Forms.Label label17;
|
||||
private System.Windows.Forms.TextBox txtAddTimesFake;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private UserComponent.UcCheckBox chkActivity;
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
|
||||
|
||||
bool isInit = false;
|
||||
bool isActivityFake = true;
|
||||
bool isChanceApi = false;
|
||||
bool isUseUpperSizeSpec = true;
|
||||
bool isAddMorePriceFirst = false;
|
||||
@@ -108,6 +109,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.ucSplitPage1.PageChange += UcSplitPage1_PageChange;
|
||||
|
||||
isChanceApi = chkChance.Checked;
|
||||
isActivityFake = chkActivity.Checked;
|
||||
}
|
||||
|
||||
private void UcSplitPage1_PageChange(object obj)
|
||||
@@ -920,7 +922,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
{
|
||||
row.Cells["colDraftId"].Value = productDraftId; // 草稿箱id
|
||||
row.Cells["colAddTime"].Value = DateTime.Now.ToString("yy-MM-dd HH:mm:ss");
|
||||
row.Cells["colOpResult"].Value = (prod.status == "已上传" ? "已成功上传" : "已上传草稿箱" + (" " + error).TrimEnd(' ')) + " " + duration.ParseToInt() + "秒";
|
||||
row.Cells["colOpResult"].Value = (prod.status == "已上传" ? "已成功上传" : "已上传草稿箱") + (" " + error).TrimEnd(' ') + " " + duration.ParseToInt() + "秒";
|
||||
row.Cells["colMsg"].Value = prod.status;
|
||||
}
|
||||
}));
|
||||
@@ -1240,7 +1242,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
prodParam.goods_name = prodInfo.detail.goods_name;
|
||||
prodParam.goods_name_prefix = prodInfo.detail.goods_name_prefix;
|
||||
prodParam.goods_pattern = prodInfo.detail.goods_pattern;
|
||||
prodParam.goods_properties = new List<goods_property_param>(); // 商品属性,通过接口获取商品模板并做匹配
|
||||
//prodParam.goods_properties = new List<goods_spec_property>(); // 商品属性,通过接口获取商品模板并做匹配
|
||||
prodParam.goods_properties = new List<goods_spec_property_param>(); // 商品属性,通过接口获取商品模板并做匹配
|
||||
//step1(共3个step)通过商品属性获取二级必填属性
|
||||
foreach (var propInfo in prodInfo.property.goods_properties)
|
||||
{
|
||||
@@ -1322,7 +1325,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
if (propTemp == null)
|
||||
continue;
|
||||
|
||||
var prop = new goods_property_param()
|
||||
//var prop = new goods_property_param()
|
||||
var prop = new goods_spec_property_param()
|
||||
{
|
||||
template_pid = propTemp.id,
|
||||
template_module_id = prodCatTemplateInfo.modules.FirstOrDefault().id,
|
||||
@@ -1343,7 +1347,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
var contentOther = propTemp.values.content.FirstOrDefault(c => c.value == "其他");
|
||||
if (contentOther != null)
|
||||
{
|
||||
var prop = new goods_property_param()
|
||||
//var prop = new goods_property_param()
|
||||
var prop = new goods_spec_property_param()
|
||||
{
|
||||
template_pid = propTemp.id,
|
||||
template_module_id = prodCatTemplateInfo.modules.FirstOrDefault().id,
|
||||
@@ -1524,6 +1529,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
}
|
||||
}
|
||||
}
|
||||
//if(isActivity) // 如果是去报活动,把基础价格报到3倍以上
|
||||
//{
|
||||
// skuParam.multi_price = (skuInfo.multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
|
||||
|
||||
// if (isAddMorePriceFirst) // 先加后乘
|
||||
// skuParam.multi_price = ((skuInfo.multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
|
||||
// skuParam.price = skuParam.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
|
||||
//}
|
||||
|
||||
if (prodParam.market_price < skuParam.price + 1000)
|
||||
{
|
||||
@@ -1748,6 +1761,158 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
}
|
||||
}
|
||||
|
||||
#region 生成一个fake商品提交参数,价格按照3倍上传,用于参加活动
|
||||
|
||||
string img_signature = "";
|
||||
if (isActivityFake && 1 == 2)
|
||||
{
|
||||
var img_signature_rst = get_uploag_img_signature(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
|
||||
if (!img_signature_rst.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref img_signature_rst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = img_signature_rst;
|
||||
return "获取上传图片密钥失败 " + error;
|
||||
}
|
||||
else
|
||||
{
|
||||
img_signature = BaseRegex.GetStringJson(ref img_signature_rst, "signature");
|
||||
}
|
||||
}
|
||||
|
||||
string fakeImgUrlDefault = "https://img.pddpic.com/mms-material-img/2025-09-22/72122dc1-56d8-4265-9212-5bf0edcf72d4.jpeg.a.jpeg";
|
||||
//fakeImgUrlDefault = "https://img.pddpic.com/mms-goods-image/2025-09-21/4204dcd6-afe0-4090-94fc-a68bf70396da.jpeg.a.jpeg?imageView2/2/w/1700/q/85";
|
||||
if (currentCount % 3 == 0)
|
||||
fakeImgUrlDefault = "https://img.pddpic.com/mms-goods-image/2025-09-21/4204dcd6-afe0-4090-94fc-a68bf70396da.jpeg.a.jpeg";
|
||||
else if (currentCount % 3 == 1)
|
||||
fakeImgUrlDefault = "https://img.pddpic.com/mms-goods-image/2025-09-21/5ec7192b-3da3-4fc1-88fd-66493a5bc9cf.jpeg.a.jpeg";
|
||||
else
|
||||
fakeImgUrlDefault = "https://img.pddpic.com/open-gw/2025-08-13/97a2999c-0f60-47fb-a62f-21ecc0765cb9.jpeg";
|
||||
string fakeImgUrl = fakeImgUrlDefault;
|
||||
if (isActivityFake && 1==2)
|
||||
{
|
||||
string img_base64 = dbProd.sku_img_replace_base64;
|
||||
if (string.IsNullOrEmpty(img_base64))
|
||||
img_base64 = "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
Line truncated
|
||||
byte[] imageBytes = Convert.FromBase64String(img_base64);
|
||||
// 使用MemoryStream创建图片对象
|
||||
using (MemoryStream ms = new MemoryStream(imageBytes))
|
||||
{
|
||||
Image image = Image.FromStream(ms);
|
||||
// 保存图片到文件系统
|
||||
image.Save("C:\\图片1.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
}
|
||||
string boundary = "----WebKitFormBoundaryi5f9ydbgu8bo3yVD";
|
||||
string body = @"------WebKitFormBoundaryi5f9ydbgu8bo3yVD
|
||||
Content-Disposition: form-data; name=""upload_sign""
|
||||
|
||||
" + img_signature + @"
|
||||
------WebKitFormBoundaryi5f9ydbgu8bo3yVD
|
||||
Content-Disposition: form-data; name=""image""; filename=""图片1.jpg""
|
||||
Content-Type: image/jpeg
|
||||
|
||||
<!>C:\图片1.jpg<!>
|
||||
------WebKitFormBoundaryi5f9ydbgu8bo3yVD
|
||||
Content-Disposition: form-data; name=""pic_operations""
|
||||
|
||||
{""rules"":[{""rule"":""imageMogr2/format/jpeg/quality/80|imageView2/2/w/2000/h/2000""}]}
|
||||
------WebKitFormBoundaryi5f9ydbgu8bo3yVD--
|
||||
";
|
||||
Thread.Sleep(Randomx.GetId(5, 20));
|
||||
var uploadImgRst = uploag_sku_img(shop, body, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, boundary);
|
||||
if (!uploadImgRst.Contains("\"url\":\"https:"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref uploadImgRst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = uploadImgRst;
|
||||
return "上传图片失败 " + error;
|
||||
}
|
||||
else
|
||||
{
|
||||
fakeImgUrl = BaseRegex.GetStringJson(ref uploadImgRst, "url");
|
||||
}
|
||||
}
|
||||
fakeImgUrl = fakeImgUrlDefault;
|
||||
|
||||
var prodParamHighPrice = JsonHelper.DeserializeJsonToObject<PDDProductUploadParam>(JsonHelper.SerializeObject(prodParam));
|
||||
prodParamHighPrice.skus = new List<sku_param>();
|
||||
foreach (var skuInfo in prodInfo.detail.sku)
|
||||
{
|
||||
var skuParam = new sku_param()
|
||||
{
|
||||
id = skuInfo.id,
|
||||
is_onsale = skuInfo.is_onsale,
|
||||
limit_quantity = skuInfo.limit_quantity,
|
||||
multi_price = (skuInfo.multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(),
|
||||
out_sku_sn = skuInfo.out_sku_sn,
|
||||
oversea_sku = skuInfo.oversea_sku,
|
||||
price = (skuInfo.price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(),
|
||||
quantity_delta = txtStockNum.Text.Trim().ParseToInt(), //skuInfo.quantity,
|
||||
shipment_limit_second_list = skuInfo.shipment_limit_second_list,
|
||||
sku69_code = skuInfo.sku69_code,
|
||||
sku_srv_templates = skuInfo.sku_srv_templates.ParseToString(),
|
||||
spec = JsonHelper.DeserializeJsonToList<spec_param>(JsonHelper.SerializeObject(skuInfo.spec)),
|
||||
thumb_url = skuInfo.thumb_url,
|
||||
weight = skuInfo.weight,
|
||||
length = skuInfo.length,
|
||||
price_in_yuan = "", // 内部计算直接置空
|
||||
multi_price_in_yuan = "", // 内部计算直接置空
|
||||
pre_sale_time = skuInfo.pre_sale_time,
|
||||
sku_id = skuInfo.sku_id,
|
||||
thumb_url_file_id = skuInfo.thumb_url_file_id,
|
||||
};
|
||||
if (isAddMorePriceFirst) // 先加后乘
|
||||
skuParam.multi_price = ((skuInfo.multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
|
||||
skuParam.price = skuParam.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
|
||||
|
||||
if (prodParamHighPrice.market_price < skuParam.price + 1000)
|
||||
{
|
||||
prodParamHighPrice.market_price = skuParam.price + 1000;
|
||||
prodParamHighPrice.market_price_in_yuan = (prodParamHighPrice.market_price * 0.01).ParseToString();
|
||||
}
|
||||
prodParamHighPrice.skus.Add(skuParam);
|
||||
}
|
||||
|
||||
var prodParamHighPriceFakeSkuImg = JsonHelper.DeserializeJsonToObject<PDDProductUploadParam>(JsonHelper.SerializeObject(prodParam));
|
||||
prodParamHighPriceFakeSkuImg.skus = new List<sku_param>();
|
||||
foreach (var skuInfo in prodInfo.detail.sku)
|
||||
{
|
||||
var skuParam = new sku_param()
|
||||
{
|
||||
id = skuInfo.id,
|
||||
is_onsale = skuInfo.is_onsale,
|
||||
limit_quantity = skuInfo.limit_quantity,
|
||||
multi_price = (skuInfo.multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(),
|
||||
out_sku_sn = skuInfo.out_sku_sn,
|
||||
oversea_sku = skuInfo.oversea_sku,
|
||||
price = (skuInfo.price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(),
|
||||
quantity_delta = txtStockNum.Text.Trim().ParseToInt(), //skuInfo.quantity,
|
||||
shipment_limit_second_list = skuInfo.shipment_limit_second_list,
|
||||
sku69_code = skuInfo.sku69_code,
|
||||
sku_srv_templates = skuInfo.sku_srv_templates.ParseToString(),
|
||||
spec = JsonHelper.DeserializeJsonToList<spec_param>(JsonHelper.SerializeObject(skuInfo.spec)),
|
||||
thumb_url = fakeImgUrl, //skuInfo.thumb_url,
|
||||
weight = skuInfo.weight,
|
||||
length = skuInfo.length,
|
||||
price_in_yuan = "", // 内部计算直接置空
|
||||
multi_price_in_yuan = "", // 内部计算直接置空
|
||||
pre_sale_time = skuInfo.pre_sale_time,
|
||||
sku_id = skuInfo.sku_id,
|
||||
thumb_url_file_id = skuInfo.thumb_url_file_id,
|
||||
};
|
||||
if (isAddMorePriceFirst) // 先加后乘
|
||||
skuParam.multi_price = ((skuInfo.multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
|
||||
skuParam.price = skuParam.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
|
||||
|
||||
if (prodParamHighPriceFakeSkuImg.market_price < skuParam.price + 1000)
|
||||
{
|
||||
prodParamHighPriceFakeSkuImg.market_price = skuParam.price + 1000;
|
||||
prodParamHighPriceFakeSkuImg.market_price_in_yuan = (prodParamHighPriceFakeSkuImg.market_price * 0.01).ParseToString();
|
||||
}
|
||||
prodParamHighPriceFakeSkuImg.skus.Add(skuParam);
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (cell != null)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
@@ -1799,6 +1964,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
if (decoration_preview_html.Contains("\"success\":true"))
|
||||
{
|
||||
prodParam.decorationPreview = BaseRegex.GetStringJson(ref decoration_preview_html, "preview_url");
|
||||
prodParamHighPriceFakeSkuImg.decorationPreview = prodParam.decorationPreview;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1809,7 +1975,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
}
|
||||
|
||||
Thread.Sleep(Randomx.GetId(20, 100));
|
||||
var saveProdRst = save_goods_edit(shop, prodParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
|
||||
var saveProdRst = "";
|
||||
if (isActivityFake)
|
||||
saveProdRst = save_goods_edit(shop, prodParamHighPriceFakeSkuImg, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(), prodParamHighPriceFakeSkuImg.goods_commit_id);
|
||||
else
|
||||
saveProdRst = save_goods_edit(shop, prodParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
|
||||
if (!saveProdRst.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
|
||||
@@ -1820,15 +1990,122 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
|
||||
Thread.Sleep(Randomx.GetId(20, 100));
|
||||
//var str = JsonHelper.SerializeObject(prodParam);
|
||||
var result = submit_goods_edit(shop, prodParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
|
||||
if (!result.Contains("\"success\":true"))
|
||||
var uploadRst = submit_goods_edit(shop, null, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
|
||||
if (!uploadRst.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref result, "error_msg");
|
||||
var error = BaseRegex.GetStringJson(ref uploadRst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = result;
|
||||
error = uploadRst;
|
||||
return "上传失败 " + error;
|
||||
}
|
||||
|
||||
//如果是活动报高价
|
||||
if (isActivityFake)
|
||||
{
|
||||
string activityErr = "";
|
||||
Thread.Sleep(Randomx.GetId(45000, 60000));
|
||||
|
||||
var activityRst1 = activity_goods_info(shop, prodParam.goods_id.ParseToString());
|
||||
if (!activityRst1.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = saveProdRst;
|
||||
activityErr = "上传失败2 981查询失败 " + error;
|
||||
goto restoreSkuImg;
|
||||
}
|
||||
try
|
||||
{
|
||||
var jObj = JObject.Parse(activityRst1);
|
||||
var jStr = JsonHelper.SerializeObject(jObj["result"]["result"]);
|
||||
var pddActivitiInfo = (JsonHelper.DeserializeJsonToObject<PDDActivitiInfo>(jStr)?.theme_activity_quick_enroll_goods_render_form_list).FirstOrDefault();
|
||||
|
||||
foreach (var activitySku in pddActivitiInfo.activity_price_render.sku_activity_price_render_dtolist)
|
||||
{
|
||||
var sku = prodParam.skus.FirstOrDefault(s => s.sku_id == activitySku.sku_id);
|
||||
{
|
||||
if (sku != null && sku.multi_price > activitySku.suggest_price)
|
||||
{
|
||||
activityErr = "上传失败2 981价格更新失败";
|
||||
goto restoreSkuImg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PDDActivitySubmitParam actSubmitParam = new PDDActivitySubmitParam();
|
||||
actSubmitParam.activity_id = 20981;
|
||||
var goods_vo_item = new goods_vo_param();
|
||||
actSubmitParam.goods_volist.Add(goods_vo_item);
|
||||
goods_vo_item.goods_id = prodParam.goods_id;
|
||||
|
||||
foreach (var activitySku in pddActivitiInfo.activity_price_render.sku_activity_price_render_dtolist)
|
||||
{
|
||||
create_sku_vo_item sku_vo_item = new create_sku_vo_item();
|
||||
sku_vo_item.sku_id = activitySku.sku_id;
|
||||
sku_vo_item.sku_activity_price = activitySku.suggest_price;
|
||||
sku_vo_item.sku_front_ctx_vo = new sku_front_ctx_vo_item()
|
||||
{
|
||||
filling_sku_price = activitySku.suggest_price,
|
||||
gear_rule = activitySku.gear_rule,
|
||||
require_price = activitySku.suggest_price,
|
||||
};
|
||||
goods_vo_item.create_activity_price_vo.create_sku_vos.Add(sku_vo_item);
|
||||
}
|
||||
|
||||
var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString());
|
||||
if (!addActivityRst.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref addActivityRst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = addActivityRst;
|
||||
activityErr = "上传失败2 981新建失败 " + error;
|
||||
goto restoreSkuImg;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
activityErr = "上传失败2 981查询/新建失败 " + ex.Message;
|
||||
goto restoreSkuImg;
|
||||
}
|
||||
|
||||
|
||||
restoreSkuImg:
|
||||
Thread.Sleep(Randomx.GetId(6000, 12000));
|
||||
var getProdIdRst = get_prod_commit_id(shop, prodParamHighPrice.goods_id.ParseToString());
|
||||
var newCommitId = BaseRegex.GetStringJson(ref getProdIdRst, "goods_commit_id");
|
||||
prodParamHighPrice.goods_commit_id = newCommitId;
|
||||
if (string.IsNullOrEmpty(newCommitId) || !saveProdRst.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = saveProdRst;
|
||||
return "上传失败2 获取commit_id失败" + error;
|
||||
}
|
||||
|
||||
|
||||
saveProdRst = save_goods_edit(shop, prodParamHighPrice, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, "edit");
|
||||
if (!saveProdRst.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref saveProdRst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = saveProdRst;
|
||||
return "上传失败2 保存失败" + error;
|
||||
}
|
||||
|
||||
Thread.Sleep(Randomx.GetId(20, 100));
|
||||
//var str = JsonHelper.SerializeObject(prodParam);
|
||||
uploadRst = submit_goods_edit(shop, null, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, "edit");
|
||||
if (!uploadRst.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref uploadRst, "error_msg");
|
||||
if (string.IsNullOrEmpty(error))
|
||||
error = uploadRst;
|
||||
return "上传失败2 提交失败" + error;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(activityErr))
|
||||
return "上传失败2 " + activityErr;
|
||||
}
|
||||
return "{\"success\":true,\"draftId\":" + prodParam.goods_id + ",\"status\":\"已上传\"\"msg\":\"上传成功\"}";
|
||||
}
|
||||
|
||||
@@ -1920,6 +2197,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
string url = "https://mms.pinduoduo.com/glide/v2/mms/edit/commit/create_by_sn";
|
||||
string body = @"{""goods_id"":" + prodId + "}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_list?msfrom=mms_sidenav";
|
||||
if (isChanceApi)
|
||||
{
|
||||
refere = "https://mms.pinduoduo.com/goods/category?chance_tab=search";
|
||||
}
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
@@ -2221,6 +2502,62 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
return result;
|
||||
}
|
||||
|
||||
private string get_uploag_img_signature(ShopLoginInfo shop, string goodsId, string commitId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/galerie/business/get_signature";
|
||||
string body = @"{""bucket_tag"":""mms-material-img""}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
|
||||
"&goods_id=" + goodsId + "&sourcePage=goodsList";
|
||||
if (isChanceApi)
|
||||
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
|
||||
"&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && (result.Contains("\\u975E\\u6CD5\\u8BF7\\u6C42") || result.Contains("网络繁忙,请不要频繁操作")); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private string uploag_sku_img(ShopLoginInfo shop, string _body, string goodsId, string commitId, string boundary)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://file.pinduoduo.com/v3/store_image";
|
||||
string body = _body;
|
||||
//string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
|
||||
// "&goods_id=" + goodsId + "&sourcePage=goodsList";
|
||||
//if (isChanceApi)
|
||||
// refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
|
||||
// "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
|
||||
string refere = "https://mms.pinduoduo.com/";
|
||||
var result = HttpResponseBLL.PDDPostResponseUpload(shop, url, body, refere, boundary, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponseUpload(shop, url, body, refere, boundary, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存商品详情图装修列表
|
||||
/// gorse/mms/goods/decoration/commit/save
|
||||
@@ -2267,20 +2604,20 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
/// <param name="prodId"></param>
|
||||
/// <param name="commitId"></param>
|
||||
/// <returns></returns>
|
||||
private string save_goods_edit(ShopLoginInfo shop, PDDProductUploadParam prod, string prodId, string commitId)
|
||||
private string save_goods_edit(ShopLoginInfo shop, PDDProductUploadParam prod, string prodId, string commitId, string type="add")
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/glide/mms/goodsCommit/action/edit";
|
||||
string body = JsonHelper.SerializeObject(prod);
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=category&id=" + commitId +
|
||||
"&goods_id=" + prodId + "&sourcePage=goodsList";
|
||||
if (isChanceApi)
|
||||
{
|
||||
//refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
|
||||
//refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=chance&id=" + commitId +
|
||||
// @"&goods_id=" + prodId + @"&chance_tab=hot_theme&sourcePage=goodsListTopButton_CHANCE";
|
||||
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
|
||||
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=chance&id=" + commitId +
|
||||
@"&goods_id=" + prodId + @"&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
|
||||
}
|
||||
|
||||
@@ -2308,7 +2645,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
/// <param name="prodId"></param>
|
||||
/// <param name="commitId"></param>
|
||||
/// <returns></returns>
|
||||
private string submit_goods_edit(ShopLoginInfo shop, PDDProductUploadParam prod, string prodId, string commitId)
|
||||
private string submit_goods_edit(ShopLoginInfo shop, PDDProductUploadParam prod, string prodId, string commitId, string type="add")
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
@@ -2317,13 +2654,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
string body = @"{""goods_commit_id"":""" + commitId + @""",""goods_id"":" + prodId +
|
||||
@",""is_onsale"":true,""third_type"":0,""if_allow_submit_mall_checking"":true,""crawlerInfo"":""" + anti + @"""}";
|
||||
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=category&id=" + commitId +
|
||||
"&goods_id=" + prodId + "&sourcePage=goodsList";
|
||||
if (isChanceApi)
|
||||
{
|
||||
//refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
|
||||
//refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=chance&id=" + commitId +
|
||||
// @"&goods_id=" + prodId + @"&chance_tab=hot_theme&sourcePage=goodsListTopButton_CHANCE";
|
||||
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
|
||||
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=" + type + "&from=chance&id=" + commitId +
|
||||
@"&goods_id=" + prodId + @"&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
|
||||
}
|
||||
|
||||
@@ -2344,6 +2681,56 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
return result;
|
||||
}
|
||||
|
||||
private string activity_goods_info(ShopLoginInfo shop, string prodId, string activityId = "20981")
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/leekmms/quick_enroll/multi_activity/real_form_info";
|
||||
string body = @"{""activity_id"":" + activityId + @",""page_number"":1,""page_size"":10,""goods_id_list"":[" + prodId + @"],""source_type"":""PROMO-OwnHome""}";
|
||||
|
||||
string refere = "https://mms.pinduoduo.com/act/multi-act-enroll?activityId=" + activityId + "&SourceType=PROMO-OwnHome";
|
||||
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && (result.Contains("当前请求频繁,请2小时后重试") || result.Contains("网络繁忙,请不要频繁操作") || result.Contains("您的店铺操作过于频繁,请稍后操作")); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private string add_activity_goods(ShopLoginInfo shop, PDDActivitySubmitParam actSubmitParam, string prodId, string activityId = "20981")
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/lakemms/enrollV2";
|
||||
string body = JsonHelper.SerializeObject(actSubmitParam);
|
||||
|
||||
string refere = "https://mms.pinduoduo.com/act/multi-act-enroll?activityId=" + activityId + "&SourceType=PROMO-OwnHome";
|
||||
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && (result.Contains("当前请求频繁,请2小时后重试") || result.Contains("网络繁忙,请不要频繁操作") || result.Contains("您的店铺操作过于频繁,请稍后操作")); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void panel1_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
@@ -2811,6 +3198,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
{
|
||||
isUseUpperSizeSpec = chkSizeSpec.Checked;
|
||||
}
|
||||
|
||||
private void chkActivity_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
isActivityFake = chkActivity.Checked;
|
||||
}
|
||||
}
|
||||
|
||||
public class AddPriceRule
|
||||
|
||||
@@ -29,6 +29,16 @@ namespace TemuKJD.ToolForms
|
||||
}
|
||||
}
|
||||
|
||||
public ShowImgForm(Image img)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (img != null)
|
||||
{
|
||||
this.pictureBox1.Image = img;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
|
||||
@@ -19,13 +19,15 @@ namespace Work.BLL.Tools
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public Bitmap ToImage(string imgBase64)
|
||||
public static Bitmap Base64ToImage(string imgBase64)
|
||||
{
|
||||
imgBase64 = imgBase64.Substring("data:image/jpeg;base64,".Length);
|
||||
if (imgBase64.StartsWith("data:image/jpeg;base64,"))
|
||||
imgBase64 = imgBase64.Substring("data:image/jpeg;base64,".Length);
|
||||
byte[] bytes = Convert.FromBase64String(imgBase64);
|
||||
MemoryStream ms = new MemoryStream(bytes);
|
||||
Image mImage = Image.FromStream(ms);
|
||||
Bitmap bmpt = new Bitmap(ms);
|
||||
ms.Dispose();
|
||||
return bmpt;
|
||||
}
|
||||
|
||||
@@ -52,7 +54,7 @@ namespace Work.BLL.Tools
|
||||
}
|
||||
}
|
||||
|
||||
public string CutZoom(string Base64pic)
|
||||
public static string CutZoom(string Base64pic)
|
||||
{
|
||||
|
||||
byte[] arr2 = Convert.FromBase64String(Base64pic);
|
||||
@@ -72,7 +74,7 @@ namespace Work.BLL.Tools
|
||||
/// </summary>
|
||||
/// <param name="Bitmap"></param>
|
||||
/// <returns></returns>
|
||||
public byte[] GetPictureData(Bitmap Bitmap)
|
||||
public static byte[] GetPictureData(Bitmap Bitmap)
|
||||
{
|
||||
MemoryStream ms = null;
|
||||
try
|
||||
@@ -93,13 +95,13 @@ namespace Work.BLL.Tools
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] Base64ChangeBuffer(String imgBase64)
|
||||
public static byte[] Base64ChangeBuffer(String imgBase64)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(imgBase64))
|
||||
{
|
||||
return GetPictureData(ToImage(imgBase64));
|
||||
return GetPictureData(Base64ToImage(imgBase64));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user