From 5df74cf6951fbc20f8234fa178a109a4fda2fbdc Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Fri, 14 Feb 2025 09:43:28 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=BA=93=E5=AD=98temu?= =?UTF-8?q?=E7=AD=9B=E9=80=89=20=E6=A0=B9=E6=8D=AEsku=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=90=84=E4=B8=AA=E5=BA=97=E9=93=BA=E6=AF=9B=E5=88=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TradeManageNew/DataNew.cs | 40 ++++++++++++++++++++++ TradeManageNew/ModelNew.cs | 11 ++++++ TradeManageNew/SysManageServiceNew.asmx.cs | 27 +++++++++++++++ 3 files changed, 78 insertions(+) diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index a6478e8..a10f20c 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -7255,6 +7255,46 @@ where 1=1 " + sqlPage + where + " order by GoodsHJNum desc "; #endregion + #region 智能库存temu筛选 根据sku显示各个店铺毛利 + public static List GetTemuShopGrossProfit(int GoodsId) + { + List model = null; + + string where = string.Empty; + + + if (GoodsId>0) + { + where = " and e.GoodsId=" + GoodsId + " "; + } + //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 ShopName,sum(GrossProfit) as GrossProfit from ( +select a.orderid,OrderCode,sh.ShopName,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 +left join JC_Shop sh on a.ShopId=sh.ShopId +where a.State>0 and c.StoreId in (6,9,11) and a.State<3 and a.PlatId=23 " + where +@" +) t +group by ShopName "; + Database db = DatabaseFactory.CreateDatabase(); + DbCommand cmd = db.GetSqlStringCommand(tsql); + + DataSet tb = db.ExecuteDataSet(cmd); + //rowCount = (int)tb.Tables[0].Rows[0]["count"]; + if (tb != null) + { + if (tb.Tables.Count > 0 && tb.Tables[0].Rows.Count > 0) model = tb.Tables[0].ToList(); + } + + + return model; + } + #endregion + + diff --git a/TradeManageNew/ModelNew.cs b/TradeManageNew/ModelNew.cs index 5dd3d6a..748ecde 100644 --- a/TradeManageNew/ModelNew.cs +++ b/TradeManageNew/ModelNew.cs @@ -11289,6 +11289,17 @@ namespace TradeManageNew } + public class TemuSKUShopGrossProfit + { + + public string ShopName { get; set; } + + public decimal? GrossProfit { get; set; } + + } + + + public class TemuShopGoodActive { diff --git a/TradeManageNew/SysManageServiceNew.asmx.cs b/TradeManageNew/SysManageServiceNew.asmx.cs index bb736d8..179c880 100644 --- a/TradeManageNew/SysManageServiceNew.asmx.cs +++ b/TradeManageNew/SysManageServiceNew.asmx.cs @@ -18076,5 +18076,32 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr return failMsg; } #endregion + + #region 智能库存temu筛选 根据sku显示各个店铺毛利 + [WebMethod(EnableSession = true)] + public List GetTemuShopGrossProfit(int GoodsId) + { + // 这里确保您的登录逻辑正确 + //PagesNew.Login(this.Session); + var slist = new List(); + try + { + Pages.Login(this.Session); + #region 信息查询 + + slist = DataNew.GetTemuShopGrossProfit(GoodsId); + #endregion + + + } + catch (Exception ex) + { + + } + return slist; + } + #endregion + + } } From 3ada277251e78f9a3a46fb652055bf69863e2253 Mon Sep 17 00:00:00 2001 From: fxc <541723947@qq.com> Date: Fri, 14 Feb 2025 10:00:00 +0800 Subject: [PATCH 2/5] 11 --- .../Huowu/HW_GoodsDetailList2TemuSku.aspx | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/TradeManageNew/Huowu/HW_GoodsDetailList2TemuSku.aspx b/TradeManageNew/Huowu/HW_GoodsDetailList2TemuSku.aspx index 645176e..ff5adfd 100644 --- a/TradeManageNew/Huowu/HW_GoodsDetailList2TemuSku.aspx +++ b/TradeManageNew/Huowu/HW_GoodsDetailList2TemuSku.aspx @@ -74,7 +74,7 @@ col = new nblf.ui.DataGridColumn(); col.HeaderText = "毛利"; - col.CellTemplate = "{Bind GrossProfit}"; + col.CellTemplate = "{Bind GrossProfit}"; Array.add(datagrid1.Columns, col); col = new nblf.ui.DataGridColumn(); @@ -199,6 +199,32 @@ }); } //#endregion + + //#region 显示各店铺毛利 + function showShopGrossProfitDialog(GoodsId) { + var param = { GoodsId } + WindowLoadModel.Show(); + $.ajax({ + url: "../SysManageServiceNew.asmx/GetTemuShopGrossProfit", + data: Sys.Serialization.JavaScriptSerializer.serialize(param), + success: function (res) { + WindowLoadModel.Hide(); + data = JSON.parse(res.Data) + datagrid1.Set_RowCount(res.rowCount); + datagrid1.DataBind(data); + $.fancybox({ + 'width': '40%', + 'height': '40%', + 'autoScale': false, + 'transitionIn': 'elastic', + 'transitionOut': 'elastic', + 'href': '#mlDialog', + 'onComplete': function () { } + }); + } + }); + } + //#endregion @@ -224,6 +250,11 @@ + + + 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 3/5] =?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(); // 添加列信息 From 0eebe2c65e2c778d001ec942a7e295c5af0323a5 Mon Sep 17 00:00:00 2001 From: fxc <541723947@qq.com> Date: Fri, 14 Feb 2025 10:24:53 +0800 Subject: [PATCH 4/5] 111 --- .../Huowu/HW_GoodsDetailList2TemuSku.aspx | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/TradeManageNew/Huowu/HW_GoodsDetailList2TemuSku.aspx b/TradeManageNew/Huowu/HW_GoodsDetailList2TemuSku.aspx index ff5adfd..8e1ec4b 100644 --- a/TradeManageNew/Huowu/HW_GoodsDetailList2TemuSku.aspx +++ b/TradeManageNew/Huowu/HW_GoodsDetailList2TemuSku.aspx @@ -45,6 +45,7 @@ WindowLoadModel.Load(); ajaxInit(WindowLoadModel); CreateDataGrid(); + CreateDataGrid2(); ReadData(); }); @@ -153,6 +154,32 @@ } var PState = 0; //#endregion + + //#region 初始化DataGrid2 + function CreateDataGrid2() { + + col = new nblf.ui.DataGridColumn(); + col.HeaderText = "店铺"; + col.CellTemplate = "{Bind ShopName}"; + Array.add(datagrid2.Columns, col); + + col = new nblf.ui.DataGridColumn(); + col.HeaderText = "毛利"; + col.CellTemplate = "{Bind GrossProfit}"; + Array.add(datagrid2.Columns, col); + + datagrid2.SortExpression = "Id "; + datagrid2.ViewSortDirection = "desc"; + datagrid2.IsFixHeader = false; + datagrid2.ShowIndexColumn = false; + datagrid2.AllowPaging = false; + datagrid2.AllowPaging2 = false; + datagrid2.ShowIndexColumn = true; + datagrid2.Width = "100%"; + datagrid2.SelectMode = nblf.ui.SelectMode.None; + datagrid2.Init(); + } + //#endregion // 读取数据 //#region 读取数据 @@ -161,6 +188,8 @@ PageSize: datagrid1.Get_PageSize(), PageIndex: datagrid1.Get_PageIndex(), GoodsCode: $('#txt_GoodsCode').val() || null, + Name: $('#txt_Name').val() || null, + IsNegative: $('#txt_IsNegative').is(':checked'), } WindowLoadModel.Show(); $.ajax({ @@ -176,10 +205,12 @@ } //#endregion - //#region 读取数据 + //#region 导出数据 function ExportData() { var param = { GoodsCode: $('#txt_GoodsCode').val() || null, + Name: $('#txt_Name').val() || null, + IsNegative: $('#txt_IsNegative').is(':checked'), } WindowLoadModel.Show(); $.ajax({ @@ -209,12 +240,12 @@ data: Sys.Serialization.JavaScriptSerializer.serialize(param), success: function (res) { WindowLoadModel.Hide(); - data = JSON.parse(res.Data) - datagrid1.Set_RowCount(res.rowCount); - datagrid1.DataBind(data); + data = res.d + datagrid2.Set_RowCount(data.length); + datagrid2.DataBind(data); $.fancybox({ 'width': '40%', - 'height': '40%', + 'height': '', 'autoScale': false, 'transitionIn': 'elastic', 'transitionOut': 'elastic', @@ -239,6 +270,11 @@ + 运营人员: + + + + 负毛利产品    From fb1c42fbe21a0d3406ab80fc0e4c2495500310c5 Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Fri, 14 Feb 2025 10:44:52 +0800 Subject: [PATCH 5/5] 1 --- TradeManageNew/DataNew.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index f89535b..d0acb4f 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -7245,8 +7245,8 @@ 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 " + sqlPage + where + " order by GoodsHJNum desc "; + where 1=1 "+ where + @") t +where 1=1 " + sqlPage + " order by GoodsHJNum desc "; Database db = DatabaseFactory.CreateDatabase(); DbCommand cmd = db.GetSqlStringCommand(tsql);