From de9bf3261ee1cb6af81ba803a0268c85e7b37b16 Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Fri, 14 Feb 2025 10:24:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=BA=93=E5=AD=98temusku?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=BA=E5=91=98=E4=B8=8E=E8=B4=9F=E5=88=A9?= =?UTF-8?q?=E6=B6=A6=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TradeManageNew/DataNew.cs | 12 ++++++++++-- TradeManageNew/OuterService/ShageService.ashx.cs | 4 +++- TradeManageNew/SysManageServiceNew.asmx.cs | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index a10f20c..f89535b 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -7138,7 +7138,7 @@ end #region 智能库存temu筛选 - public static List GetTemuSKUData(int PageSize, int PageIndex, string GoodsCode, out int rowCount) + public static List GetTemuSKUData(int PageSize, int PageIndex, string GoodsCode, string Name, bool? IsNegative, out int rowCount) { List model = null; string sqlPage = string.Empty; @@ -7158,7 +7158,15 @@ end } if (!string.IsNullOrEmpty(GoodsCode)) { - where = " and GoodsCode='" + GoodsCode + "' "; + where += " and GoodsCode='" + GoodsCode + "' "; + } + if (!string.IsNullOrEmpty(Name)) + { + where += " and Name like '%" + Name + "%' "; + } + if (IsNegative!=null && IsNegative==true) + { + where += " and GrossProfit <= 0 "; } //string tsql = @"select count(1) count 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" string tsql = @"select count(1) count from ( select ROW_NUMBER() OVER(order by t30.SaleNum desc) row,a.GoodsId, b.GoodsCode,c.Name,a.YuGuJiaGe as temuChengben,b.JYPrice ,Gr.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,isnull(tall.SaleNum,0) GoodsHJNum,sumall.LeftNumW,sumall.LeftNumE,'' as PositionAge,sumall.LeftNumAll 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 and a.PlatId=23 ) 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 and a.PlatId=23 ) 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 and a.PlatId=23 ) 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 and a.PlatId=23 ) 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 and a.PlatId=23 ) 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 and a.PlatId=23 ) t group by t.GoodsId ) t30 on a.GoodsId=t30.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 a.PlatId=23 ) t group by t.GoodsId ) tall on a.GoodsId=tall.GoodsId left join (select a.GoodsId,sum(GoodsHJNum) as GoodsHJNum,LeftNumW= sum(isnull(a.WestNum,0)), LeftNumE=sum(isnull(a.EastNum,0) ),LeftNumAll= sum(isnull(a.WestNum,0))+sum(isnull(a.EastNum,0) ) from HW_GoodsDetail a inner join [TemuChengBen] b on a.goodsid=b.GoodsId group by a.GoodsId) sumall on a.GoodsId=sumall.GoodsId left join (select GoodsId,sum(GrossProfit) as GrossProfit from ( select a.orderid,isnull(e.GoodsId,0) GoodsId , CONVERT(DECIMAL(10, 2),a.TotalPrice-isnull(b.yj,0)-isnull(a.escrowFee,0)-(isnull(b.cb,0)+isnull(b.hwsf,0))/isnull(b.moneyrate,1)-isnull(b.yf,0)-isnull(b.tc,0)-isnull(a.DR_PostFee,0)-isnull(a.Other_Fee,0)+isnull(a.DR_SSFee,0)-ISNULL(b.md,0)+Isnull( b.SubsidyFee,0)-isnull(a.Ad_Fee,0)) GrossProfit from DT_OrderInfo a with(nolock) inner join DT_OrderXXInfo c on a.OrderId=c.OrderId inner join DT_OrderGoods g on a.OrderId=g.OrderId inner join HW_GoodsDetail e on g.DetailId=e.DetailId left Join DT_Fees b with(nolock) on a.OrderId=b.orderid where a.State>0 and c.StoreId in (6,9,11) and a.State<3 and a.PlatId=23)t group by GoodsId) Gr on a.GoodsId=Gr.GoodsId ) t where 1=1 " + where + diff --git a/TradeManageNew/OuterService/ShageService.ashx.cs b/TradeManageNew/OuterService/ShageService.ashx.cs index 7d58252..2021f38 100644 --- a/TradeManageNew/OuterService/ShageService.ashx.cs +++ b/TradeManageNew/OuterService/ShageService.ashx.cs @@ -2039,7 +2039,7 @@ namespace TradeManageNew.OuterService var input = JsonConvert.DeserializeObject(ResponseContent); - var ordermodel = DataNew.GetTemuSKUData(input.PageSize,input.PageIndex,input.GoodsCode, out int rowCount); + var ordermodel = DataNew.GetTemuSKUData(input.PageSize,input.PageIndex,input.GoodsCode, input.Name,input.IsNegative, out int rowCount); if (ordermodel != null) { @@ -2133,6 +2133,8 @@ namespace TradeManageNew.OuterService public class GetDataList { public string GoodsCode { get; set; } + public string Name { get; set; } + public bool? IsNegative { get; set; } public int PageSize { get; set; } public int PageIndex { get; set; } } diff --git a/TradeManageNew/SysManageServiceNew.asmx.cs b/TradeManageNew/SysManageServiceNew.asmx.cs index 0b50c33..730a522 100644 --- a/TradeManageNew/SysManageServiceNew.asmx.cs +++ b/TradeManageNew/SysManageServiceNew.asmx.cs @@ -18032,7 +18032,7 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr #region 智能库存temu sku数据导出 [WebMethod(EnableSession = true)] - public string GetExcelTemuSKUData( string GoodsCode) + public string GetExcelTemuSKUData( string GoodsCode, string Name, bool? IsNegative) { // 这里确保您的登录逻辑正确 //PagesNew.Login(this.Session); @@ -18042,7 +18042,7 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr //Pages.Login(this.Session); #region 信息查询 var slist = new List(); - slist = DataNew.GetTemuSKUData(999999, 1, GoodsCode, out int rowCount); + slist = DataNew.GetTemuSKUData(999999, 1, GoodsCode, Name, IsNegative, out int rowCount); #endregion TableColumnCollection listColumns = new TableColumnCollection(); // 添加列信息