From e5ec7d2e709ce1a138cd7cc2f1b5a4cba59f53ae Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Fri, 8 Dec 2023 01:43:49 +0800 Subject: [PATCH] =?UTF-8?q?pjzs=E6=9B=B4=E6=96=B0=E4=B8=8A=E6=9E=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformSDK/JDBusiness.cs | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 705dc6f7..b71fe9a1 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -1053,7 +1053,52 @@ namespace BBWY.Server.Business attrId = tempDataJToken.Value("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("name"); + var f_valueId = f_tempJarray.FirstOrDefault().Value("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() + { + 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;