Browse Source

pjzs更新上架问题

pjzs_starttask_update
shanji 2 years ago
parent
commit
e5ec7d2e70
  1. 47
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs

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

@ -1053,7 +1053,52 @@ namespace BBWY.Server.Business
attrId = tempDataJToken.Value<string>("attrId");
var tempDataValuesJToken = JObject.Parse(tempDataJToken["valueRules"].ToString());
var tempDataValues_Level1_JToken = tempDataValuesJToken["items"][0];
if (tempDataValues_Level1_JToken["properties"]["id"]["type"].ToString() == "model")
if (tempDataValuesJToken["items"].Count() == 3 &&
tempDataValuesJToken["items"][0]["properties"]["id"]["type"].ToString() == "model" &&
tempDataValuesJToken["items"][1]["properties"]["id"]["type"].ToString() == "number" &&
tempDataValuesJToken["items"][1]["properties"]["value"]["type"].ToString() == "number" &&
tempDataValuesJToken["items"][2]["properties"]["id"]["type"].ToString() == "number" &&
tempDataValuesJToken["items"][2]["properties"]["value"]["type"].ToString() == "string")
{
var f_id = int.Parse(tempDataValuesJToken["items"][0]["properties"]["id"]["enum"][0].ToString());
var f_tempJarray = tempDataValuesJToken["items"][0]["properties"]["value"]["enum"][0]["preprocessingSaleAttrValTemplateValueList"] as JArray;
var f_value = f_tempJarray.FirstOrDefault().Value<string>("name");
var f_valueId = f_tempJarray.FirstOrDefault().Value<int>("id");
var s_id = int.Parse(tempDataValuesJToken["items"][1]["properties"]["id"]["enum"][0].ToString());
var s_unit = tempDataValuesJToken["items"][1]["properties"]["unit"]["enum"][0].ToString();
//var s_value = "1";
var t_id = int.Parse(tempDataValuesJToken["items"][2]["properties"]["id"]["enum"][0].ToString());
var t_value = "待替换的备注";
for (var i = 0; i < request.GiftTemplateSkuList.Count(); i++)
{
strutsSaleAttrValueList.Add(new List<AttrValueAliasJson>()
{
new AttrValueAliasJson()
{
id = f_id,
value = f_value,
valueId = f_valueId,
unit = string.Empty
},
new AttrValueAliasJson()
{
id = s_id,
value = "1",
unit = s_unit
},
new AttrValueAliasJson()
{
id = t_id,
value = t_value,
isReName = true
}
});
}
}
else if (tempDataValues_Level1_JToken["properties"]["id"]["type"].ToString() == "model")
{
//[{\"id\":5,\"unit\":\"\",\"value\":\"红色\","valueId":1234567}]
var tempJarray = tempDataValues_Level1_JToken["properties"]["value"]["enum"][0]["preprocessingSaleAttrValTemplateValueList"] as JArray;

Loading…
Cancel
Save