1688上传类目转换等优化 充值用户服务充值和用户续费店铺功能

This commit is contained in:
wule committed 2026-05-27 22:01:04 +08:00
1 parent ecb291e3d7
commit aab73b978f
56 files changed
+4532 -1748

No files matched your search

+368 -19
View File
@@ -1014,15 +1014,15 @@ namespace TemuKJD.BLL
prodInfo.detail.list_desc = new List<object>();
prodInfo.detail.local_service_id_list = null;
prodInfo.detail.mai_jia_zi_ti = null;
// 聚水潭没有
// 微信没有
prodInfo.detail.mall_id = 0;
// 聚水潭没有
// 微信没有
prodInfo.detail.mall_info = new mall_info_item();
// 聚水潭没有此处随意填
// 微信没有此处随意填
prodInfo.detail.market_price = 0;
// 聚水潭没有此处随意填
// 微信没有此处随意填
prodInfo.detail.max_group_price = 0;
// 聚水潭没有此处随意填
// 微信没有此处随意填
prodInfo.detail.min_group_price = 0;
prodInfo.detail.must_check_type = 0;
prodInfo.detail.name_prefix = "";
@@ -1085,7 +1085,6 @@ namespace TemuKJD.BLL
sku_item skuInfo = new sku_item()
{
id = 0,
// 聚水潭为string,散列取数值
sku_id = wxEditSkuInfo.skuKey.skuId.ParseToLong(),
sku_sn = null,
carnival_price = 0,
@@ -1373,8 +1372,8 @@ namespace TemuKJD.BLL
prodInfo.detail.name_prefix = "";
prodInfo.detail.origin_country_id = 0;
prodInfo.detail.origin_country_name = "";
// 货号 1688没有(没找到)
prodInfo.detail.out_goods_sn = "";//_1688EditProdInfo.product.info.spuCode;
// 货号 1688没有字段直接标明,可能存在属性里面
prodInfo.detail.out_goods_sn = (_1688ClentProdInfo.offerDetail?.featureAttributes?.FirstOrDefault(s=>s.name == "货号")?.value).ParseToString();
//if (prodInfo.detail.out_goods_sn.IsNullOrEmpty())
//{
// convertRst = "货号不存在";
@@ -1426,7 +1425,6 @@ namespace TemuKJD.BLL
sku_item skuInfo = new sku_item()
{
id = 0,
// 聚水潭为string,散列取数值
sku_id = _1688skuInfo.skuId.ParseToLong(),
sku_sn = null,
carnival_price = 0,
@@ -1446,8 +1444,8 @@ namespace TemuKJD.BLL
thumb_url_is_deleted = null,
quantity_delta = 0,
spec = new List<spec_item>(),
// sku货号下面单独设置
out_sku_sn = "",
// sku货号
out_sku_sn = _1688skuInfo.specId,
batch_id = null,
priority = 1,
ware_id = 0,
@@ -1497,8 +1495,6 @@ namespace TemuKJD.BLL
}
}
}
// 1688前端数据没找到货号字段
skuInfo.out_sku_sn = ""; //_1688skuInfo.productSkuInfo.skuCode;
prodInfo.detail.sku.Add(skuInfo);
}
prodInfo.detail.sku_type = null;
@@ -1568,7 +1564,361 @@ namespace TemuKJD.BLL
}
}
/// <summary>
/// 1688外部数据转拼多多
/// </summary>
/// <param name="convertRst"></param>
/// <param name="dbProd"></param>
/// <returns></returns>
public PDDProductInfo _1688OutToPddConvert(out string convertRst, KJDDBProduct dbProd)
{
convertRst = "";
try
{
var prod_json = dbProd.product_json;
_1688OutProductInfo _1688OutProdInfo = JsonHelper.DeserializeJsonToObject<_1688OutProductInfo>(prod_json);
PDDProductInfo prodInfo = new PDDProductInfo()
{
sale_count = dbProd.sale_count.ParseToString(),
sale_count_text = dbProd.sale_count_text,
};
prodInfo.chance_id = null;
prodInfo.chance_refere = null;
prodInfo.chance_tab = null;
prodInfo.decoration = new PDDProductDecorationInfo() { floor_list = new List<PDDProdfloorItem>() };
// 商品详情
prodInfo.detail = new PDDProductDetailInfo();
prodInfo.detail.allergy_refund = 0;
prodInfo.detail.allowed_region = new List<object>();
//prodInfo.detail.appeal_status = null;
//prodInfo.detail.app_id = null;
//prodInfo.detail.app_name = null;
//prodInfo.detail.bad_claim_text = null;
prodInfo.detail.bad_fruit_claim = 0;
//prodInfo.detail.business_source_type = null;
prodInfo.detail.can_appeal = null;
prodInfo.detail.card_verification_list = null;
prodInfo.detail.cats = new List<string>();
prodInfo.detail.cat_id = dbProd.cat_id.ParseToInt();
prodInfo.detail.cat_ids = new List<int?>();
//foreach (var category in _1688EditProdInfo.product.info.category)
//{
// prodInfo.detail.cat_ids.Add(category.catId.ParseToInt());
//}
prodInfo.detail.check_status = 9;
//prodInfo.detail.check_type = null;
//prodInfo.detail.client_id = null;
prodInfo.detail.commit_deleted = 0;
//prodInfo.detail.commit_extension = null;
//prodInfo.detail.community_group_buying = null;
prodInfo.detail.cost_template_id = 0;
//prodInfo.detail.country = null;
prodInfo.detail.country_id = 0;
//prodInfo.detail.created_at = null;
//prodInfo.detail.creator_name = null;
prodInfo.detail.customizable = 0;
prodInfo.detail.customs = "";
prodInfo.detail.damage_claim = 0;
prodInfo.detail.delivery_one_day = 0;
//prodInfo.detail.delivery_type = null;
//prodInfo.detail.elec_goods_attributes = null;
prodInfo.detail.estimate_quantity = 0;
prodInfo.detail.event_type = 0;
prodInfo.detail.extend_warranty_dto = new extend_warranty_dto_item() { extend_warranty = 0 };
//prodInfo.detail.fabric = null;
//prodInfo.detail.fabric_content = null;
prodInfo.detail.galleries = new List<gallery_item>();
foreach (var imgItem in _1688OutProdInfo.itemImgs)
{
prodInfo.detail.galleries.Add(new gallery_item()
{
url = imgItem,
type = 1,
});
}
var desc = _1688OutProdInfo.desc.ParseToString();
var descLst = desc.Split(new string[] { "src=\"", "\" usemap", "\"/>", "\"" }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (var imgItem in descLst)
{
if (!imgItem.StartsWith("http") || (!imgItem.ToLower().Contains(".jpg") && !imgItem.ToLower().Contains(".jpeg") && !imgItem.ToLower().Contains(".png")))
continue;
prodInfo.detail.galleries.Add(new gallery_item()
{
url = imgItem,
type = 2,
});
}
prodInfo.detail.gold_price_template_id = null;
prodInfo.detail.gold_price_type = null;
prodInfo.detail.goods_certificate = null;
prodInfo.detail.goods_commit_check = new List<object>();
prodInfo.detail.goods_desc = _1688OutProdInfo.productName;
prodInfo.detail.goods_id = _1688OutProdInfo.productId.ParseToLong();
prodInfo.detail.goods_name = _1688OutProdInfo.productName;
prodInfo.detail.goods_name_prefix = "";
prodInfo.detail.goods_pattern = 8;
prodInfo.detail.goods_property_list = null;
prodInfo.detail.goods_sn = null;
prodInfo.detail.goods_srv_templates = new List<object>();
prodInfo.detail.goods_trade_attr = null;
prodInfo.detail.goods_travel_attr = null;
prodInfo.detail.goods_type = 1;
prodInfo.detail.groups = new group_item() { single_price = 0, group_price = 0, customer_num = 2, buy_limit = 999999, order_limit = 999999 };
// 复用前面已经填写过的
prodInfo.detail.hd_thumb_url = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1)?.url;
// 编辑id,随意填写
prodInfo.detail.id = 0;
// 复用前面已经填写过的
prodInfo.detail.image_url = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1)?.url;
prodInfo.detail.instruction_vo = new instruction_vo_item() { template_status = -1 };
prodInfo.detail.invoice_mode = null;
prodInfo.detail.invoice_mode_sub_type = null;
prodInfo.detail.invoice_status = 0;
prodInfo.detail.is_all_weight_same = true;
prodInfo.detail.is_app = 0;
prodInfo.detail.is_bangdan = 0;
prodInfo.detail.is_card_secret = false;
prodInfo.detail.is_certificate_provide = 0;
prodInfo.detail.is_customized = 0;
prodInfo.detail.is_customs = 0;
prodInfo.detail.is_deposit = false;
prodInfo.detail.is_draft = false;
prodInfo.detail.is_folt = 0;
prodInfo.detail.is_general_trade = 0;
prodInfo.detail.is_gold_price_matched = null;
prodInfo.detail.is_goods_copy = null;
prodInfo.detail.is_goods_decoration = 1;
prodInfo.detail.is_group_pre_sale = 0;
prodInfo.detail.is_only_for_remote_area = false;
prodInfo.detail.is_pre_sale = 0;
prodInfo.detail.is_refundable = 1;
prodInfo.detail.is_refundable_fifteen_day = 0;
prodInfo.detail.is_shop = 1;
prodInfo.detail.is_size_change_casually = 0;
prodInfo.detail.is_sku_pre_sale = 0;
prodInfo.detail.is_sku_shipment = 0;
prodInfo.detail.is_small_group = null;
prodInfo.detail.is_spring_festival_open_tag = false;
prodInfo.detail.is_two_num_group = false;
prodInfo.detail.is_warranty_one_year = 0;
prodInfo.detail.is_wms = 0;
prodInfo.detail.is_wp_service = 0;
prodInfo.detail.lack_of_weight_claim = 0;
prodInfo.detail.last_commit_check_status = 2;
prodInfo.detail.list_desc = new List<object>();
prodInfo.detail.local_service_id_list = null;
prodInfo.detail.mai_jia_zi_ti = null;
// 1688没有
prodInfo.detail.mall_id = 0;
// 1688没有
prodInfo.detail.mall_info = new mall_info_item();
// 1688没有此处随意填
prodInfo.detail.market_price = 0;
// 1688没有此处随意填
prodInfo.detail.max_group_price = 0;
// 1688没有此处随意填
prodInfo.detail.min_group_price = 0;
prodInfo.detail.must_check_type = 0;
prodInfo.detail.name_prefix = "";
prodInfo.detail.origin_country_id = 0;
prodInfo.detail.origin_country_name = "";
// 货号
prodInfo.detail.out_goods_sn = (_1688OutProdInfo.attribute.FirstOrDefault(a => a.key == "货号")?.value).ParseToString();
//if (prodInfo.detail.out_goods_sn.IsNullOrEmpty())
//{
// convertRst = "货号不存在";
// return null;
//}
prodInfo.detail.out_source_goods_id = null;
prodInfo.detail.out_source_type = null;
prodInfo.detail.oversea_goods = null;
prodInfo.detail.oversea_type = 0;
prodInfo.detail.owner = "主账号";
prodInfo.detail.owner_name = "";
prodInfo.detail.paper_length = null;
prodInfo.detail.paper_net_weight = null;
prodInfo.detail.paper_plies_num = null;
prodInfo.detail.paper_width = null;
prodInfo.detail.pre_sale_time = 0;
prodInfo.detail.privacy_delivery = 0;
prodInfo.detail.processing_charges = null;
prodInfo.detail.processing_charges_type = null;
prodInfo.detail.promised_delivery_seconds = null;
prodInfo.detail.purchase_info_supply = 0;
prodInfo.detail.qualification_id_list = new List<object>();
prodInfo.detail.quan_guo_lian_bao = 0;
prodInfo.detail.quick_refund = 0;
prodInfo.detail.reason = null;
prodInfo.detail.region_limit = 1;
prodInfo.detail.reject_reason = null;
prodInfo.detail.reject_status = null;
prodInfo.detail.same_city_template_id = 0;
prodInfo.detail.schedule_sale = new schedule_sale_item() { sale_type = 0 };
prodInfo.detail.second_hand = 0;
prodInfo.detail.sf_markup_template_sn = null;
prodInfo.detail.shang_men_an_zhuang = null;
// 1688没有
prodInfo.detail.share_desc = "";
prodInfo.detail.shipment_limit_second = 172800;
prodInfo.detail.shoes_template_id = null;
prodInfo.detail.shop_group_id = null;
prodInfo.detail.shop_group_name = null;
prodInfo.detail.show_activity_price = false;
prodInfo.detail.size_parent_spec_id = null;
prodInfo.detail.size_spec_id = null;
prodInfo.detail.sku = new List<sku_item>();
foreach (var sku in _1688OutProdInfo.skus)
{
var postFeeValue = (_1688OutProdInfo.deliveryInfo?.carriageList?.Max(c => c.price)).ParseToDecimal();
//_1688skuInfo _1688skuInfo = _1688OutProdInfo.skuModel.skuInfoMap[sku];
sku_item skuInfo = new sku_item()
{
id = 0,
sku_id = sku.skuId,
sku_sn = null,
carnival_price = 0,
init_quantity = 0,
is_onsale = 1,
limit_quantity = 999999,
multi_price = (sku.price + postFeeValue * 100).ParseToInt(),
multi_price_in_yuan = null,
price = (sku.price + postFeeValue * 100).ParseToInt() + 100,
price_in_yuan = null,
quantity = sku.quantity,
reserve_quantity = 0,
weight = 0,
//thumb_url = _1688skuInfo.productSkuInfo.thumbImg,
thumb_url_file_id = null,
thumb_url_status = null,
thumb_url_is_deleted = null,
quantity_delta = 0,
spec = new List<spec_item>(),
// sku货号
out_sku_sn = "",
batch_id = null,
priority = 1,
ware_id = 0,
ware_biz_type = null,
advice_price = null,
length = null,
oversea_sku = null,
cspu_id = null,
child_skus = null,
ref_sku_commit_id = 0,
start_time = null,
end_time = null,
sku_srv_templates = null,
calendar_rule_id = null,
hot_live_group = null,
pre_sale_time = 0,
out_source_sku_id = null,
dd_grocery_sku_params = null,
sku_extended_attribute_dtos = null,
sku_basic_property_dtos = null,
spec_note_map = null,
delivery_schedule_dtos = null,
shipment_limit_second_list = null,
sku69_code = "",
};
//// 聚水潭供应商价加价10%(最低1元)赚取差价
//int addPrice = (skuInfo.multi_price * 0.1).ParseToInt();
//if (addPrice < 100)
// addPrice = 100;
//skuInfo.multi_price += addPrice;
//skuInfo.price += addPrice;
foreach (_1688PropsName _1688skuProp in _1688OutProdInfo.propsName)
{
foreach (_1688PropsNameValue _1688skuPropValue in _1688skuProp.values)
{
if ((";" + sku.id + ";").Contains(";" + _1688skuProp.pid + ":" + _1688skuPropValue.vid + ";"))
{
skuInfo.spec.Add(new spec_item()
{
parent_id = _1688skuProp.pid.ParseToLong(),
parent_name = _1688skuProp.pname,
spec_id = _1688skuPropValue.vid.ParseToLong(),
spec_name = _1688skuPropValue.vname,
});
if (!string.IsNullOrEmpty(_1688skuPropValue.sku_url))
skuInfo.thumb_url = _1688skuPropValue.sku_url;
}
}
}
prodInfo.detail.sku.Add(skuInfo);
}
prodInfo.detail.sku_type = null;
prodInfo.detail.song_huo_an_zhuang = null;
prodInfo.detail.song_huo_ru_hu = null;
prodInfo.detail.source = 0;
prodInfo.detail.spu_id = null;
prodInfo.detail.spu_version = null;
prodInfo.detail.submit_time = 0;
prodInfo.detail.thawed_refund = 0;
prodInfo.detail.third_type = 0;
// 复用前面填过的主图
prodInfo.detail.thumb_url = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1)?.url;
prodInfo.detail.tiny_name = "";
prodInfo.detail.transport_type_list = null;
prodInfo.detail.two_pieces_discount = 99;
prodInfo.detail.user_source = 1;
prodInfo.detail.warehouse = "";
prodInfo.detail.warm_tips = "";
prodInfo.detail.zhi_huan_bu_xiu = 0;
prodInfo.size = null;
prodInfo.material1 = null;
prodInfo.material3 = null;
prodInfo.property = new PDDProductPropertyInfo();
prodInfo.property.sku_properties = new object();
prodInfo.property.goods_properties = new List<goods_propertie_item>();
if (1 == 1)
{
foreach (_1688AttributeInfo _1688Attr in _1688OutProdInfo.attribute)
{
// 1688会把商品sku属性放到商品属性里面,需要剔除这个属性
if (_1688OutProdInfo.propsName.Any(p => p.pname == _1688Attr.key && string.Join(",", p.values.Select(pp => pp.vname)) == _1688Attr.value))
continue;
goods_propertie_item propInfo = new goods_propertie_item();
prodInfo.property.goods_properties.Add(propInfo);
propInfo.name = _1688Attr.key;
propInfo.ref_pid = null;
propInfo.values = new List<value_item>();
List<string> values = new List<string> { _1688Attr.value };
foreach (var wxPropVal in values)
{
propInfo.values.Add(new value_item()
{
value = wxPropVal,
raw_value = wxPropVal,
vid = null,
unit = ""
});
}
}
}
else
{
//outGoodsParam.productAttrs.Add(new osProductAttrParam { attrKey = "品牌", attrValue = "无品牌" });
}
// 主图 复用前面的
dbProd.main_img = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url;
dbProd.product_json = JsonHelper.SerializeObject(prodInfo);
return prodInfo;
}
catch (Exception ex)
{
convertRst = "转换错误 " + ex.Message;
return null;
}
}
public PDDProductInfo WXClientToPddConvert(out string convertRst, KJDDBProduct dbProd)
{
@@ -1755,15 +2105,15 @@ namespace TemuKJD.BLL
prodInfo.detail.list_desc = new List<object>();
prodInfo.detail.local_service_id_list = null;
prodInfo.detail.mai_jia_zi_ti = null;
// 聚水潭没有
// 微信没有
prodInfo.detail.mall_id = 0;
// 聚水潭没有
// 微信没有
prodInfo.detail.mall_info = new mall_info_item();
// 聚水潭没有此处随意填
// 微信没有此处随意填
prodInfo.detail.market_price = 0;
// 聚水潭没有此处随意填
// 微信没有此处随意填
prodInfo.detail.max_group_price = 0;
// 聚水潭没有此处随意填
// 微信没有此处随意填
prodInfo.detail.min_group_price = 0;
prodInfo.detail.must_check_type = 0;
prodInfo.detail.name_prefix = "";
@@ -1827,7 +2177,6 @@ namespace TemuKJD.BLL
sku_item skuInfo = new sku_item()
{
id = 0,
// 聚水潭为string,散列取数值
sku_id = wxEditSkuInfo.skuKey.skuId.ParseToLong(),
sku_sn = null,
carnival_price = 0,