From 7de9dd1c5a8bf3c1a9fc79397cca9b6e5c0fe8d9 Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Tue, 11 Feb 2025 15:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=BA=93=E5=AD=98=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9F=A5=E8=AF=A2temu=20sku=20=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TradeManageNew/DataNew.cs | 83 +++++++++++++++++++ TradeManageNew/ModelNew.cs | 24 ++++++ .../OuterService/ShageService.ashx.cs | 22 ++++- 3 files changed, 128 insertions(+), 1 deletion(-) diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index 887eb13..47e1b36 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -7137,6 +7137,89 @@ end #endregion + #region 智能库存temu筛选 + public static List GetTemuSKUData() + { + List model = null; + string tsql = @" +select b.GoodsCode,c.Name,a.YuGuJiaGe as temuChengben,b.JYPrice ,'' as GrossProfit,isnull(t1.SaleNum,0) as SaleNum1,isnull(t2.SaleNum,0) as SaleNum2,isnull(t3.SaleNum,0) as SaleNum3,isnull(t7.SaleNum,0) as SaleNum7,isnull(t14.SaleNum,0) as SaleNum14,isnull(t30.SaleNum,0) as SaleNum30,sumall.GoodsHJNum,sumall.LeftNumW,sumall.LeftNumE,'' as PositionAge +from [dbo].[TemuChengBen] a +inner join HW_GoodsInfo b on a.GoodsId=b.GoodsId +inner join JC_UserInfo c on a.mUserId=c.UserId +left join ( select t.GoodsId,SUM(ISNULL(t.GoodsNum,0)) SaleNum from ( +select case when c.StoreId=9 then 6 when c.StoreId=6 then 6 when c.StoreId=11 then 11 end StoreId,isnull(e.GoodsId,0) GoodsId ,b.GoodsNum +from DT_OrderInfo a +inner join DT_OrderXXInfo c on a.OrderId=c.OrderId +inner join DT_OrderGoods b on a.OrderId=b.OrderId +inner join HW_GoodsDetail e on b.DetailId=e.DetailId +where a.State>0 and c.StoreId in (6,9,11) and a.State<3 and DATEDIFF(day,a.OrderDate,getdate())<=1 +) t group by t.GoodsId ) t1 on a.GoodsId=t1.GoodsId +left join ( select t.GoodsId,SUM(ISNULL(t.GoodsNum,0)) SaleNum from ( +select case when c.StoreId=9 then 6 when c.StoreId=6 then 6 when c.StoreId=11 then 11 end StoreId,isnull(e.GoodsId,0) GoodsId ,b.GoodsNum +from DT_OrderInfo a +inner join DT_OrderXXInfo c on a.OrderId=c.OrderId +inner join DT_OrderGoods b on a.OrderId=b.OrderId +inner join HW_GoodsDetail e on b.DetailId=e.DetailId +where a.State>0 and c.StoreId in (6,9,11) and a.State<3 and DATEDIFF(day,a.OrderDate,getdate())<=2 +) t group by t.GoodsId ) t2 on a.GoodsId=t2.GoodsId +left join ( select t.GoodsId,SUM(ISNULL(t.GoodsNum,0)) SaleNum from ( +select case when c.StoreId=9 then 6 when c.StoreId=6 then 6 when c.StoreId=11 then 11 end StoreId,isnull(e.GoodsId,0) GoodsId ,b.GoodsNum +from DT_OrderInfo a +inner join DT_OrderXXInfo c on a.OrderId=c.OrderId +inner join DT_OrderGoods b on a.OrderId=b.OrderId +inner join HW_GoodsDetail e on b.DetailId=e.DetailId +where a.State>0 and c.StoreId in (6,9,11) and a.State<3 and DATEDIFF(day,a.OrderDate,getdate())<=3 +) t group by t.GoodsId ) t3 on a.GoodsId=t3.GoodsId +left join ( select t.GoodsId,SUM(ISNULL(t.GoodsNum,0)) SaleNum from ( +select case when c.StoreId=9 then 6 when c.StoreId=6 then 6 when c.StoreId=11 then 11 end StoreId,isnull(e.GoodsId,0) GoodsId ,b.GoodsNum +from DT_OrderInfo a +inner join DT_OrderXXInfo c on a.OrderId=c.OrderId +inner join DT_OrderGoods b on a.OrderId=b.OrderId +inner join HW_GoodsDetail e on b.DetailId=e.DetailId +where a.State>0 and c.StoreId in (6,9,11) and a.State<3 and DATEDIFF(day,a.OrderDate,getdate())<=7 +) t group by t.GoodsId ) t7 on a.GoodsId=t7.GoodsId +left join ( select t.GoodsId,SUM(ISNULL(t.GoodsNum,0)) SaleNum from ( +select case when c.StoreId=9 then 6 when c.StoreId=6 then 6 when c.StoreId=11 then 11 end StoreId,isnull(e.GoodsId,0) GoodsId ,b.GoodsNum +from DT_OrderInfo a +inner join DT_OrderXXInfo c on a.OrderId=c.OrderId +inner join DT_OrderGoods b on a.OrderId=b.OrderId +inner join HW_GoodsDetail e on b.DetailId=e.DetailId +where a.State>0 and c.StoreId in (6,9,11) and a.State<3 and DATEDIFF(day,a.OrderDate,getdate())<=14 +) t group by t.GoodsId ) t14 on a.GoodsId=t14.GoodsId +left join ( select t.GoodsId,SUM(ISNULL(t.GoodsNum,0)) SaleNum from ( +select case when c.StoreId=9 then 6 when c.StoreId=6 then 6 when c.StoreId=11 then 11 end StoreId,isnull(e.GoodsId,0) GoodsId ,b.GoodsNum +from DT_OrderInfo a +inner join DT_OrderXXInfo c on a.OrderId=c.OrderId +inner join DT_OrderGoods b on a.OrderId=b.OrderId +inner join HW_GoodsDetail e on b.DetailId=e.DetailId +where a.State>0 and c.StoreId in (6,9,11) and a.State<3 and DATEDIFF(day,a.OrderDate,getdate())<=30 +) t group by t.GoodsId ) t30 on a.GoodsId=t30.GoodsId +left join (select a.GoodsId,sum(GoodsHJNum) as GoodsHJNum,LeftNumW= sum(isnull(a.WestNum,0)+isnull(a.GoodsHJNum14,0)-isnull(a.GoodsPlanNumW,0)), +LeftNumE=sum(isnull(a.EastNum,0)+isnull(a.GoodsHJNum15,0)-isnull(a.GoodsPlanNumE,0) ) +from HW_GoodsDetail a +inner join [TemuChengBen] b on a.goodsid=b.GoodsId +group by a.GoodsId) sumall on a.GoodsId=sumall.GoodsId +order by t30.SaleNum desc + +"; + Database db = DatabaseFactory.CreateDatabase(); + DbCommand cmd = db.GetSqlStringCommand(tsql); + + DataSet tb = db.ExecuteDataSet(cmd); + if (tb != null) + { + if (tb.Tables.Count > 0 && tb.Tables[0].Rows.Count > 0) model = tb.Tables[0].ToList(); + } + + + return model; + } + #endregion + + + + + #region 返回扫描订单Model public static DT_OrderScanModel GetScanOrderModelForReturnFinal(string OrderCode, string OrderCode2, int UserId) { diff --git a/TradeManageNew/ModelNew.cs b/TradeManageNew/ModelNew.cs index 727ee4c..ebbb68d 100644 --- a/TradeManageNew/ModelNew.cs +++ b/TradeManageNew/ModelNew.cs @@ -11264,6 +11264,30 @@ namespace TradeManageNew } + public class TemuSKUData_List + { + public int GoodsId { get; set; } + public string GoodsCode { get; set; } + + public string Name { get; set; } + public decimal? temuChengben { get; set; } + public decimal? JYPrice { get; set; } + public string GrossProfit { get; set; } + public int SaleNum1 { get; set; } + public int SaleNum2 { get; set; } + public int SaleNum3 { get; set; } + public int SaleNum7 { get; set; } + public int SaleNum14 { get; set; } + public int SaleNum30 { get; set; } + public int GoodsHJNum { get; set; } + public int LeftNumW { get; set; } + public int LeftNumE { get; set; } + public string PositionAge { get; set; } + + } + + + public class TemuShopGoodActive { /// diff --git a/TradeManageNew/OuterService/ShageService.ashx.cs b/TradeManageNew/OuterService/ShageService.ashx.cs index e7883e6..b4fb1bf 100644 --- a/TradeManageNew/OuterService/ShageService.ashx.cs +++ b/TradeManageNew/OuterService/ShageService.ashx.cs @@ -2034,9 +2034,29 @@ namespace TradeManageNew.OuterService md.Data = null; } + if (Method == "GetTemuSKUData") + { + + + + var ordermodel = DataNew.GetTemuSKUData(); + if (ordermodel != null) + { + md.Code = "100"; + md.Result = "Success"; + md.Data = JsonConvert.SerializeObject(ordermodel); + } + else + { + md.Code = "400"; + md.Result = "false"; + md.Data = null; + } + + + } - } }