优化sku关联查询

This commit is contained in:
wule committed 2026-11-05 20:11:13 +08:00
1 parent 2153e881f3
commit 34b1d39108
3 files changed
+62 -1

No files matched your search

+4 -1
View File
@@ -1,9 +1,11 @@
using KJD_Web.Model;
using KJD_Web.Model.PddModel;
using KJD_Web.Model.WxModel;
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using MySqlX.XDevAPI;
using NaiBa.Util.Extension;
using NaiBa.Util.Helper;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
@@ -649,6 +651,7 @@ namespace KJD_Web.BLL.WXXD
List<WXBuyMapSkusInfo> WXBuyMapInfoLst = new List<WXBuyMapSkusInfo>();
foreach (DataRow row in dt.Rows)
{
var map_skus = JsonUtils.SerializeObject(JsonUtils.DeserializeJsonToObject<pddFrontGoods3Lite>(row["map_skus"].ParseToNullableString()));
if (WXBuyMapInfoLst.Where(b => b.spu_code == row["spu_code"].ParseToNullableString()).ToList().Count < 5)
WXBuyMapInfoLst.Add(new WXBuyMapSkusInfo()
{
@@ -658,7 +661,7 @@ namespace KJD_Web.BLL.WXXD
map_url = row["map_url"].ParseToNullableString(),
map_goods_name = row["map_goods_name"].ParseToNullableString(),
map_goods_id = row["map_goods_id"].ParseToNullableString(),
map_skus = row["map_skus"].ParseToNullableString(),
map_skus = map_skus,
map_send_address = row["map_send_address"].ParseToNullableString(),
transit_warehouse_id = row["transit_warehouse_id"].ParseToNullableString(),
add_time = Convert.ToDateTime(row["add_time"]),
+1
View File
@@ -216,6 +216,7 @@
<Compile Include="Controllers\ShopController.cs" />
<Compile Include="Controllers\UserController.cs" />
<Compile Include="Mappers\WeOrderMapper.cs" />
<Compile Include="Model\PddModel\PddFrontGoods3Lite.cs" />
<Compile Include="Model\WxModel\oms_wei_ewaybill_path.cs" />
<Compile Include="Model\WxModel\oms_wei_transfer_extra_package.cs" />
<Compile Include="Model\WxModel\ShopRevenueStatistics.cs" />
@@ -0,0 +1,57 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.PddModel;
public class pddFrontGoods3Lite
{
public long? goodsId { get; set; } // 1661424397,
public string goodsName { get; set; } // "红薏仁5斤装 红薏仁米小薏米仁农家自产新红薏米1斤2斤苡仁糙薏米",
public long? mallId { get; set; } // 525159017
public string mallName { get; set; }
public List<frontSkuInfo3Lite> skus { get; set; }
}
public class frontSkuInfo3Lite
{
public long? skuId { get; set; } // 28790184768,
public long? goodsId { get; set; } // 1661424397,
public string thumbUrl { get; set; } /* "https://t00img.yangkeduo.com/t10img/images/2018-06-09/5c7746a3608e75a2b65926f4ed0f34cb.jpeg", */
//public int? initQuantity { get; set; } // 0,
//public int? quantity { get; set; } // 1000,
//public int? limitQuantity { get; set; } // 999999,
//public int? soldQuantity { get; set; } // 0,
//public int? hotSale { get; set; } // 1,
//public int? defaultQuantity { get; set; } // 100,
//public int? isOnsale { get; set; } // 1,
public string spec { get; set; } // "677094835",
public List<frontSpecInfo3> specs { get; set; }
public int? price { get; set; } // 0,
public string normalPrice { get; set; } // "14.5",
public string groupPrice { get; set; } // "13.5",
public int? oldGroupPrice { get; set; } /* 1350, */
//public int? marketPrice { get; set; } // 0,
//public int? weight { get; set; } // 2500,
//public List<yellowLabelListInfo> yellowLabelList { get; set; }
//public int? previewPriority { get; set; } // 0,
//public int? startTime { get; set; } // 0,
//public int? endTime { get; set; } // 0,
//public int? staticLimitQuantity { get; set; } // 999999,
//public string attribute { get; set; } // "{\"skuPreSaleTime\":0}",
//public string normalSavePrice { get; set; } // "1",
public long? skuID { get; set; } // 28790184768,
//public string skuExpansionPrice { get; set; } // "0"
}
public class frontSpecInfo3
{
public string spec_key { get; set; } // "重量",
public string spec_value { get; set; } // "红薏仁米1斤装",
public long? spec_key_id { get; set; } // 1253,
public long? spec_value_id { get; set; } // 677094835,
public bool? custom { get; set; } // false
}