微信app采集
This commit is contained in:
1 parent
52220daa8b
commit
2f61dc1cdd
67 files changed
+6197
-1118
No files matched your search
@@ -280,14 +280,20 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//lblExtCodeFilter.Visible = true;
|
||||
//txtExtCodeFilter.Visible = true;
|
||||
|
||||
txtIdFilter.Visible = true;
|
||||
cmbSourceType.Visible = true;
|
||||
cmbGroupFilter.Visible = true;
|
||||
lblIdFilter.Visible = true;
|
||||
txtIdFilter.Visible = true;
|
||||
lblSourceType.Visible = true;
|
||||
cmbSourceType.Visible = true;
|
||||
lblGroupFilter.Visible = true;
|
||||
cmbGroupFilter.Visible = true;
|
||||
lblJstInitSet.Visible = true;
|
||||
cmbJstInitSet.Visible = true;
|
||||
}
|
||||
|
||||
if (BaseClass.UserAuthority.ParseToString().Contains("货源选择"))
|
||||
{
|
||||
cmbSourceType.Visible = true;
|
||||
}
|
||||
if (BaseClass.UserAuthority.ParseToString().Contains("微信回采"))
|
||||
{
|
||||
chkWXComplateProd.Visible = true;
|
||||
@@ -1368,6 +1374,16 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 微信小店app
|
||||
if (dbProd.product_get_type_text == "微信小店")
|
||||
{
|
||||
string convertRst = "";
|
||||
var ob = new PDDProdFormConverter().WXClientToPddConvert(out convertRst, dbProd);
|
||||
if (!string.IsNullOrEmpty(convertRst))
|
||||
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + convertRst + "\"}";
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 将产品数据初始化成微信小店支持的参数
|
||||
JObject prodJObj = new JObject();
|
||||
try
|
||||
@@ -2734,6 +2750,10 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
foreach (var propInfo in prodInfo.property.goods_properties)
|
||||
{
|
||||
if (propInfo.name == "单件净含量")
|
||||
{
|
||||
|
||||
}
|
||||
if (propInfo.values.Count == 0)
|
||||
continue;
|
||||
|
||||
@@ -2871,6 +2891,30 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
attrValue = "常规";
|
||||
else if (attrValueLst.Contains("通用"))
|
||||
attrValue = "通用";
|
||||
else if (attrValueLst.Contains("国产"))
|
||||
attrValue = "国产";
|
||||
else if (attr.value.Contains("绒丝;羽毛;白鸭绒;白鹅绒;灰鸭绒;灰鹅绒;鸭毛片;鹅毛片"))
|
||||
{
|
||||
attrValue = "绒丝";
|
||||
}
|
||||
else if (attr.name == "是否进口")
|
||||
{
|
||||
attrValue = "非进口";
|
||||
if (attr.value == "是;否")
|
||||
attrValue = "否";
|
||||
}
|
||||
else if (attr.name == "商品产地")
|
||||
{
|
||||
attrValue = "中国大陆";
|
||||
}
|
||||
else if (attr.name == "产地")
|
||||
{
|
||||
attrValue = "中国大陆";
|
||||
}
|
||||
else if (attrValueLst.Any(v => v.Contains("%")))
|
||||
{
|
||||
attrValue = attrValueLst.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
attrValue = attrValueLst.Where(v => !"真丝、蚕丝、香云纱、羊绒、羊毛、羊羔绒、羊羔毛、羽绒、皮草".Contains(v)).OrderBy(x => Guid.NewGuid()).FirstOrDefault();
|
||||
}
|
||||
@@ -2895,6 +2939,29 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
attrValue = "10 g";
|
||||
else if (attr.value == "kg")
|
||||
attrValue = "1 kg";
|
||||
//else if (attr.value == "g;kg;ml;L")
|
||||
// attrValue = "100 g";
|
||||
//else if (attr.value == "cm")
|
||||
// attrValue = "20 cm";
|
||||
//else if (attr.value.Contains("岁以上") && attr.value.Contains("个月以上"))
|
||||
// attrValue = "7 岁以上";
|
||||
//else if (attr.value == "只;个")
|
||||
// attrValue = "1 个";
|
||||
else if (attr.value == "ml")
|
||||
{
|
||||
if ((propInfo.values.FirstOrDefault()?.value).ParseToString().EndsWith(attr.value))
|
||||
attrValue = propInfo.values.FirstOrDefault()?.value;
|
||||
else
|
||||
attr.value = "100 ml";
|
||||
}
|
||||
else if (attr.value == "g;kg;ml;L")
|
||||
{
|
||||
var propInfoValue = (propInfo.values.FirstOrDefault()?.value).ParseToString();
|
||||
if (propInfoValue.EndsWith("g") || propInfoValue.EndsWith("kg") || propInfoValue.EndsWith("ml") || propInfoValue.EndsWith("L"))
|
||||
attrValue = propInfo.values.FirstOrDefault()?.value;
|
||||
else
|
||||
attr.value = "100 g";
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(attrValue))
|
||||
@@ -3041,6 +3108,10 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
attrValue = "20 cm";
|
||||
else if (attr.value.Contains("岁以上") && attr.value.Contains("个月以上"))
|
||||
attrValue = "7 岁以上";
|
||||
else if (attr.value == "只;个")
|
||||
attrValue = "1 个";
|
||||
else if (attr.value == "ml")
|
||||
attrValue = "100 ml";
|
||||
}
|
||||
|
||||
var wxPropParam = new wxPropParam();
|
||||
@@ -3731,6 +3802,10 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
{
|
||||
upProdParam.product.info.extraService.freightInsurance = 0;
|
||||
}
|
||||
if (upProdParam.product.info.category[0].name == "珠宝首饰" || upProdParam.product.info.category[1].name == "时尚饰品")
|
||||
{
|
||||
upProdParam.product.info.extraService.fakeOnePayFour = 1;
|
||||
}
|
||||
|
||||
if (cell != null)
|
||||
{
|
||||
@@ -4599,10 +4674,20 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void cmbSourceType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "微信店采")
|
||||
if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "1688厂家" && cmbSourceType.Text != "微信店采" && cmbSourceType.Text != "微信小店")
|
||||
fillPddCate();
|
||||
else
|
||||
fillWxCate();
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(cmbSourceType.Text) && cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "1688厂家")
|
||||
{
|
||||
cmbJstInitSet.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbJstInitSet.Text = "已设置";
|
||||
}
|
||||
}
|
||||
|
||||
private void cmbSourceType_TextChanged(object sender, EventArgs e)
|
||||
|
||||
Reference in new issue
Block a user