Browse Source

pjzs number流程

pjzs_starttask_update
sanji 2 years ago
parent
commit
4b9b0fa7ed
  1. 2
      BBWY.JDSDK/Request/AttrValueAliasJson.cs
  2. 50
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs

2
BBWY.JDSDK/Request/AttrValueAliasJson.cs

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

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

@ -1011,7 +1011,7 @@ namespace BBWY.Server.Business
// } // }
// colorSaleAttrs = colorProperty["attrValueList"].ToList(); // colorSaleAttrs = colorProperty["attrValueList"].ToList();
//} //}
List<AttrValueAliasJson> strutsSaleAttrValueList = new List<AttrValueAliasJson>(); List<List<AttrValueAliasJson>> strutsSaleAttrValueList = new List<List<AttrValueAliasJson>>();
var isStruts = false; var isStruts = false;
{ {
var req = new CategoryReadFindSaleAttrTemplatesRequest(); var req = new CategoryReadFindSaleAttrTemplatesRequest();
@ -1057,16 +1057,46 @@ namespace BBWY.Server.Business
{ {
//[{\"id\":5,\"unit\":\"\",\"value\":\"红色\","valueId":1234567}] //[{\"id\":5,\"unit\":\"\",\"value\":\"红色\","valueId":1234567}]
var tempJarray = tempDataValues_Level1_JToken["properties"]["value"]["enum"][0]["preprocessingSaleAttrValTemplateValueList"] as JArray; 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>()
{ {
id = int.Parse(tempDataValues_Level1_JToken["properties"]["id"]["enum"][0].ToString()), new AttrValueAliasJson
value = j.Value<string>("name"), {
valueId = j.Value<int>("id"), id = int.Parse(tempDataValues_Level1_JToken["properties"]["id"]["enum"][0].ToString()),
unit = string.Empty value = j.Value<string>("name"),
valueId = j.Value<int>("id"),
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 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 #endregion
@ -1131,9 +1161,9 @@ namespace BBWY.Server.Business
var attrValueAlias = string.Empty; var attrValueAlias = string.Empty;
if (isStruts) if (isStruts)
{ {
var value = strutsSaleAttrValueList[skuIndex]; var values = strutsSaleAttrValueList[skuIndex];
value.value = giftSku.Title; values.FirstOrDefault(v => v.isReName).value = giftSku.Title;
attrValueAlias = JsonConvert.SerializeObject(new object[] { value }); attrValueAlias = JsonConvert.SerializeObject(values);
} }
else else
{ {

Loading…
Cancel
Save