Browse Source

Merge branch 'master' of http://code.qiyue666.com/pengcong001/bbwy

pjzs_starttask_update
506583276@qq.com 2 years ago
parent
commit
cd67c4ce12
  1. 2
      BBWY.JDSDK/Request/AttrValueAliasJson.cs
  2. 44
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs

2
BBWY.JDSDK/Request/AttrValueAliasJson.cs

@ -9,5 +9,7 @@
public string value { get; set; }
public int? valueId { get; set; }
public bool isReName { get; set; }
}
}

44
BBWY.Server.Business/PlatformSDK/JDBusiness.cs

@ -1011,7 +1011,7 @@ namespace BBWY.Server.Business
// }
// colorSaleAttrs = colorProperty["attrValueList"].ToList();
//}
List<AttrValueAliasJson> strutsSaleAttrValueList = new List<AttrValueAliasJson>();
List<List<AttrValueAliasJson>> strutsSaleAttrValueList = new List<List<AttrValueAliasJson>>();
var isStruts = false;
{
var req = new CategoryReadFindSaleAttrTemplatesRequest();
@ -1057,16 +1057,46 @@ namespace BBWY.Server.Business
{
//[{\"id\":5,\"unit\":\"\",\"value\":\"红色\","valueId":1234567}]
var tempJarray = tempDataValues_Level1_JToken["properties"]["value"]["enum"][0]["preprocessingSaleAttrValTemplateValueList"] as JArray;
strutsSaleAttrValueList.AddRange(tempJarray.Select(j => new AttrValueAliasJson
strutsSaleAttrValueList.AddRange(tempJarray.Select(j => new List<AttrValueAliasJson>()
{
new AttrValueAliasJson
{
id = int.Parse(tempDataValues_Level1_JToken["properties"]["id"]["enum"][0].ToString()),
value = j.Value<string>("name"),
valueId = j.Value<int>("id"),
unit = string.Empty
unit = string.Empty,
isReName = true
}
}));
}
else if (tempDataValues_Level1_JToken["properties"]["id"]["type"].ToString() == "number" &&
tempDataValues_Level1_JToken["properties"]["value"]["type"].ToString() == "number" &&
tempDataValuesJToken["items"][1]["properties"]["id"]["type"].ToString() == "number" &&
tempDataValuesJToken["items"][1]["properties"]["value"]["type"].ToString() == "string")
{
var f_id = int.Parse(tempDataValues_Level1_JToken["properties"]["id"]["enum"][0].ToString());
var f_unit = tempDataValues_Level1_JToken["properties"]["unit"]["enum"][0].ToString();
var s_id = int.Parse(tempDataValuesJToken["items"][1]["properties"]["id"]["enum"][0].ToString());
strutsSaleAttrValueList.AddRange(request.GiftTemplateSkuList.Select(x => new List<AttrValueAliasJson>()
{
new AttrValueAliasJson()
{
id = f_id,
value = "1",
unit = f_unit
},
new AttrValueAliasJson()
{
id = s_id,
value = "待替换的备注",
isReName = true
}
}));
}
else
throw new BusinessException($"不支持的properties.id.type {tempDataValues_Level1_JToken["properties"]["id"]["type"]}");
throw new BusinessException($"不支持的properties.id.type {tempDataValues_Level1_JToken["properties"]["id"]["type"]} 或取其分支情况");
}
}
#endregion
@ -1131,9 +1161,9 @@ namespace BBWY.Server.Business
var attrValueAlias = string.Empty;
if (isStruts)
{
var value = strutsSaleAttrValueList[skuIndex];
value.value = giftSku.Title;
attrValueAlias = JsonConvert.SerializeObject(new object[] { value });
var values = strutsSaleAttrValueList[skuIndex];
values.FirstOrDefault(v => v.isReName).value = giftSku.Title;
attrValueAlias = JsonConvert.SerializeObject(values);
}
else
{

Loading…
Cancel
Save