chenwenkai 2 weeks ago
commit 0f125dbeb3

@ -752,6 +752,124 @@ left join #ls_fee5 g on a.UserId=g.UserId
}
#endregion
// #region 报表18
// [WebMethod(EnableSession = true)]
// public string GetReportTable18(DateTime? InDate, int DeptId, int ShopId, int PlatId, string MoneyCode, string Sort, bool isyc)
// {
// string dd = "";
// try
// {
// var obj = new BaseService();
// string tj = "";
// string tj1 = "";
// //if (DeptId > 0)
// //{
// // tj += " and b.DeptId=" + DeptId + " ";
// // tj1 += " and a.DeptId=" + DeptId + " ";
// //}
// if (PlatId > 0)
// {
// tj += " and a.PlatId=" + PlatId + " ";
// tj1 += " and a.PlatId=" + PlatId + " ";
// }
// if (ShopId > 0)
// {
// tj += " and a.ShopId=" + ShopId + " ";
// tj1 += " and a.ShopId=" + ShopId + " ";
// }
// //if (MoneyCode != "0")
// // tj += " and a.MoneyCode='" + MoneyCode + "' ";
// // string sql = @"
// //declare @moneyrate decimal(18,4)
// //select @moneyrate=MRate from JC_Money where MCode='USD' and PlatId=2
// //select a.ShopId,a.TotalPrice,escrowFee=isnull(a.escrowFee,0),a.RMBPrice,c.yj,yf=c.yf,cb=c.cb,hwsf=c.hwsf,c.tc,c.ck,c.md,a.Ad_Fee,a.DR_BackFee,a.DR_PostFee,a.DR_SSFee,a.Other_Fee,moneyrate=isnull(c.moneyrate,@moneyrate) into #ls from DT_OrderInfo a with(nolock)
// //inner join DT_OrderXXInfo b with(nolock) on a.OrderId=b.OrderId
// //left join DT_Fees c with(nolock) on a.OrderId=c.orderid
// //where DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 " + tj + @" and a.State>0 and a.State<3
// //select a.*,Num2=isnull(b.Num2,0) into #ls2 from (
// //select b.ShopId,Num=COUNT(0) from HW_GoodsInfo a with(nolock)
// //inner join HW_Shop b with(nolock) on a.GoodsId=b.GoodsId
// //group by b.ShopId)a
// //left join (
// //select a.ShopId,Num2=COUNT(distinct c.GoodsId) from DT_OrderInfo a with(nolock)
// //inner join DT_OrderGoods b with(nolock) on a.OrderId=b.OrderId
// //inner join HW_GoodsDetail c with(nolock) on b.DetailId=c.DetailId
// //where a.State>0 and a.State<3 and DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 group by a.ShopId)b on a.ShopId=b.ShopId
// //select d.ShopName,Master=case when d.Master=d.buyer then d.Master when d.buyer is not null and d.buyer<>'' then d.Master+'-'+d.buyer else d.Master end,a.OrderNum,a.RMBMoney,a.USDMoney,AvgPrice=case when a.OrderNum>0 then cast(a.USDMoney/a.OrderNum as decimal(18,2)) else 0 end,a.InPrice,LR=cast(b.ml as decimal(18,2)),MLL=case when b.TotalPrice>0 then cast(b.ml*100/b.TotalPrice as decimal(18,2)) else 0 end,ShopTJGoods=e.Num,ShopCDGoods=e.Num2,ckfee,a.mdfee,a.adfee,bz=case when a.InPrice>0 then CAST(a.RMBMoney/a.InPrice as decimal(18,2)) else 0 end,c.GoodRate,c.ODR,c.DSRService,c.DSRGoods,h.DSRPost,c.USDUseMoney,c.USDNoMoney,c.RMBUseMoney,c.RMBNoMoney,c.Rate1,c.Rate2,f.Rate3,c.Rate4,c.PropertyViolate,c.Rate5,g.Rate6,Rate7=isnull(c.Rate7,d.dayfee),JL=cast(b.ml as decimal(18,2))+isnull(ckfee,0)+isnull(mdfee,0)-isnull(c.Rate3,0)-isnull(c.Rate7,d.dayfee),FeeDate=isnull(c.FeeDate,d.FeeDate),TXFee=isnull(c.TXFee,d.TXFee) from
// //JC_Shop d left join (
// //select ShopId,OrderNum=COUNT(0),RMBMoney=SUM(RMBPrice),escrowFee=sum(escrowFee),USDMoney=SUM(TotalPrice),InPrice=SUM(cb),ckfee=SUM(ck),mdfee=SUM(md),adfee=SUM(Ad_Fee) from #ls
// //group by ShopId)a on d.ShopId=a.ShopId
// //left join (select ShopId,TotalPrice=sum(TotalPrice),ml=sum(isnull(TotalPrice,0)-isnull(escrowFee,0)-isnull(yj,0)-isnull(yf,0)-((isnull(cb,0)+isnull(hwsf,0))/moneyrate)-isnull(tc,0)-isnull(ck,0)-isnull(md,0)-isnull(Ad_Fee,0)) from #ls where yf>0
// //group by ShopId)b on a.ShopId=b.ShopId
// //left join (
// //select GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee
// //TXFee,ShopId from JC_ShopData
// //where DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 )c on a.ShopId=c.ShopId
// //left Join #ls2 e on a.ShopId=e.ShopId
// // left join (select shopid,SUM(ABS(adfee)) Rate3 from AD_FeeList where DATEDIFF(day,addate,'" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "')=0 group by shopid) f on d.ShopId=f.shopid "+
// // " left join ( select shopid,SUM(ABS(adfee)) Rate6 from AD_FeeList where CONVERT(varchar(7), addate, 120)='"+ InDate.Value.ToString("yyyy-MM") + "' group by shopid) g on d.ShopId=g.shopid "+
// // " left join(select b.name shopName,case when a.Spend=0 or a.ad_sale_amount=0 then 0 else cast((Spend/ad_sale_amount)*100 as decimal(12,2)) end DSRPost from ( select sid,SUM(ISNULL(ABS(spend),0)) Spend, SUM(ISNULL(ad_sales_amount,0)) ad_sale_amount from [192.168.1.187].[UpGoods].dbo.LxERP_ProductPerformance where summary_field='Asin' and RequestDate='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' group by sid) a left join [192.168.1.187].[UpGoods].dbo.LxERP_Amazon_Shop b on a.sid=b.sid) h on d.ShopName=h.shopName "
// // + " order by " + Sort;
// string sql = @"
//declare @moneyrate decimal(18,4)
//select @moneyrate=MRate from JC_Money where MCode='USD' and PlatId=2
//select a.ShopId,a.TotalPrice,escrowFee=isnull(a.escrowFee,0),a.RMBPrice,c.yj,yf=c.yf,cb=c.cb,hwsf=c.hwsf,c.tc,c.ck,c.md,a.Ad_Fee,a.DR_BackFee,a.DR_PostFee,a.DR_SSFee,a.Other_Fee,moneyrate=isnull(c.moneyrate,@moneyrate),ISnull( c.SubsidyFee,0) SubsidyFee into #ls from DT_OrderInfo a with(nolock)
//inner join DT_OrderXXInfo b with(nolock) on a.OrderId=b.OrderId
//left join DT_Fees c with(nolock) on a.OrderId=c.orderid
//where DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 " + tj + @" and a.State>0 and a.State<3
//select a.*,Num2=isnull(b.Num2,0) into #ls2 from (
//select b.ShopId,Num=COUNT(0) from HW_GoodsInfo a with(nolock)
//inner join HW_Shop b with(nolock) on a.GoodsId=b.GoodsId
//group by b.ShopId)a
//left join (
//select a.ShopId,Num2=COUNT(distinct c.GoodsId) from DT_OrderInfo a with(nolock)
//inner join DT_OrderGoods b with(nolock) on a.OrderId=b.OrderId
//inner join HW_GoodsDetail c with(nolock) on b.DetailId=c.DetailId
//where a.State>0 and a.State<3 and DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 group by a.ShopId)b on a.ShopId=b.ShopId
//select * from (
//select d.ShopName,Master=case when d.Master=d.buyer then d.Master when d.buyer is not null and d.buyer<>'' then d.Master+'-'+d.buyer else d.Master end,a.OrderNum,a.RMBMoney,a.USDMoney,AvgPrice=case when a.OrderNum>0 then cast(a.USDMoney/a.OrderNum as decimal(18,2)) else 0 end,a.InPrice,LR=cast(b.ml as decimal(18,2)),MLL=case when b.TotalPrice>0 then cast(b.ml*100/b.TotalPrice as decimal(18,2)) else 0 end,ShopTJGoods=e.Num,ShopCDGoods=e.Num2,ckfee,a.mdfee,a.adfee,bz=case when a.InPrice>0 then CAST(a.RMBMoney/a.InPrice as decimal(18,2)) else 0 end,a.yf,c.GoodRate,c.ODR,t3.CVR DSRService,t3.user_sessions DSRGoods,f.DSRPost,c.USDUseMoney, n1.originalTotalCurrencyAmount as USDNoMoney,c.RMBUseMoney,c.RMBNoMoney,t2.orderDefectRate Rate1,t2.validTrackingRate Rate2,Case when d.PlatType=2 then f.Rate3 else c.Rate3 end Rate3,t4.RefundRate as Rate4, ABS( ISNULL( t4.RefundAmount,0) ) as PropertyViolate,t2.cancelRate Rate5,Case when d.PlatType=2 then g.Rate6 else (select SUM(ISNULL(Rate3,0)) from JC_ShopData where ShopId=d.ShopId and DATEDIFF(MONTH,InDate,'2023-10-18')=0) end Rate6,Rate7=isnull(c.Rate7,d.dayfee),JL=cast(b.ml as decimal(18,2))+isnull(ckfee,0)-isnull(c.Rate3,0)-isnull(c.Rate7,d.dayfee),t1.financialEventGroupEndLocale as FeeDate,t1.originalTotalCurrencyAmount as TXFee from
//JC_Shop d left join (
//select ShopId,OrderNum=COUNT(0),RMBMoney=SUM(RMBPrice),escrowFee=sum(escrowFee),USDMoney=SUM(TotalPrice),InPrice=SUM(cb),ckfee=SUM(ck),mdfee=SUM(md),adfee=SUM(Ad_Fee),yf=SUM(yf) from #ls
//group by ShopId)a on d.ShopId=a.ShopId
//left join (select ShopId,TotalPrice=sum(TotalPrice),ml=sum(isnull(TotalPrice,0)-isnull(escrowFee,0)-isnull(yj,0)-isnull(yf,0)-((isnull(cb,0)+isnull(hwsf,0))/moneyrate)-isnull(tc,0)-isnull(ck,0)-isnull(md,0)-isnull(Ad_Fee,0)+SubsidyFee ) from #ls where yf>0
//group by ShopId)b on a.ShopId=b.ShopId
//left join (
//select GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee
//TXFee,ShopId from JC_ShopData
//where DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 )c on a.ShopId=c.ShopId
//left Join #ls2 e on a.ShopId=e.ShopId
//left join [192.168.1.187].[UpGoods].dbo.LxERP_Amazon_Shop o on d.ShopName=o.name
//left join ( select sid, CONVERT(decimal(12,2), SUM(t.cost)) as Rate3,CONVERT(decimal(12,2), SUM(t.sales)) as ad_sales , case when CONVERT(decimal(12,2), SUM(t.sales))<=0 then '∞' else CONVERT(nvarchar(20), convert(decimal(12,2), (CONVERT(decimal(12,2), SUM(t.cost))/CONVERT(decimal(12,2), SUM(t.sales)))*100)) end DSRPost from( select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SPAdGroupReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SBCampaignReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SDAdGroupReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid) t group by sid ) f on f.sid=o.sid" +
//" \r\n left join (select sid, CONVERT(decimal(12,2), SUM(t.cost)) as Rate6 from( select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SPAdGroupReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SBCampaignReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SDAdGroupReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid) t group by sid) g on o.sid=g.sid " +
// " \r\n left join(select t.row, t.storename,t.financialEventGroupEndLocale,t.originCurrencyIcon,CAST(ISNULL( t.originalTotalCurrencyAmount,0) as decimal(12,2)) as originalTotalCurrencyAmount from ( select ROW_NUMBER() over(PARTITION BY storename ORDER BY requestDate DESC) row,storename, financialEventGroupEndLocale,originCurrencyIcon,originalTotalCurrencyAmount from [192.168.1.187].[UpGoods].dbo.LxERP_SettlementSummaryData where accountType='Standard' and processingStatus='Closed ') t where t.row=1) t1 on d.ShopName=t1.storeName left join (select storename,CONVERT(decimal(12,2), SUM(ISNULL(originalTotalCurrencyAmount,0))) originalTotalCurrencyAmount from [192.168.1.187].[UpGoods].dbo.LxERP_SettlementSummaryData where processingStatus='Open' and accountType='Standard' group by storename) n1 on d.ShopName=n1.storeName " +
// "\r\n" +
// " left join (select sid, CAST( orderDefectRate *100 as decimal(12,2)) orderDefectRate,CAST( validTrackingRate *100 as decimal(12,2)) validTrackingRate,cast(CancelRate *100 as decimal(12,2)) cancelRate from (\r\nselect ROW_NUMBER() over(PARTITION BY sid ORDER BY requestDate DESC) row,sid, orderDefectRate,validTrackingRate,CancelRate from [192.168.1.187].[UpGoods].dbo.Amazon_V2_SELLER_PERFORMANCE_REPORT where CONVERT(date, RequestDate)='" + InDate.Value.AddDays(-1).Date.ToString("yyyy-MM-dd") + "') t where t.row=1)t2 on t2.sid=o.sid \r\nleft join (select sid, user_sessions,totalOrderItems, case when user_sessions=0 or totalOrderItems=0 then 0 else convert(decimal(12,2),(totalOrderItems*1.00/user_sessions)*100 ) end as CVR from [192.168.1.187].[UpGoods].dbo.Amazon_SALES_AND_TRAFFIC_REPORT where CONVERT(date, ReportDate)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "') t3 on t3.sid=o.sid\r\nleft join [192.168.1.187].[UpGoods].dbo.AmazonStoreRefundAmountAndRate t4 on t4.sid=o.sid and Convert(date, t4.ReportDate)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "'\r\n"
// + " where d.PlatType=2 union all\r\n select d.ShopName,Master=case when d.Master=d.buyer then d.Master when d.buyer is not null and d.buyer<>'' then d.Master+'-'+d.buyer else d.Master end,a.OrderNum,a.RMBMoney,a.USDMoney,AvgPrice=case when a.OrderNum>0 then cast(a.USDMoney/a.OrderNum as decimal(18,2)) else 0 end,a.InPrice,LR=cast(b.ml as decimal(18,2)),MLL=case when b.TotalPrice>0 then cast(b.ml*100/b.TotalPrice as decimal(18,2)) else 0 end,ShopTJGoods=e.Num,ShopCDGoods=e.Num2,ckfee,a.mdfee,a.adfee,bz=case when a.InPrice>0 then CAST(a.RMBMoney/a.InPrice as decimal(18,2)) else 0 end,a.yf,c.GoodRate,c.ODR,c.DSRService,c.DSRGoods,case when ISNULL(c.DSRPost,0)=0 then '' else CONVERT(nvarchar(20),c.DSRPost) end DSRPost,c.USDUseMoney,c.USDNoMoney,c.RMBUseMoney,c.RMBNoMoney,c.Rate1,c.Rate2,c.Rate3,c.Rate4,c.PropertyViolate,c.Rate5,c.Rate6,Rate7=isnull(c.Rate7,d.dayfee),JL=cast(b.ml as decimal(18,2))+isnull(ckfee,0)-isnull(c.Rate3,0)-isnull(c.Rate7,d.dayfee),FeeDate=isnull(c.FeeDate,d.FeeDate),TXFee=isnull(c.TXFee,d.TXFee) from \r\nJC_Shop d left join (\r\nselect ShopId,OrderNum=COUNT(0),RMBMoney=SUM(RMBPrice),escrowFee=sum(escrowFee),USDMoney=SUM(TotalPrice),InPrice=SUM(cb),ckfee=SUM(ck),mdfee=SUM(md),adfee=SUM(Ad_Fee),yf=SUM(yf) from #ls\r\ngroup by ShopId)a on d.ShopId=a.ShopId\r\nleft join (select ShopId,TotalPrice=sum(TotalPrice),ml=sum(isnull(TotalPrice,0)-isnull(escrowFee,0)-isnull(yj,0)-isnull(yf,0)-((isnull(cb,0)+isnull(hwsf,0))/moneyrate)-isnull(tc,0)-isnull(ck,0)-isnull(md,0)-isnull(Ad_Fee,0)+ SubsidyFee) from #ls where yf>0\r\ngroup by ShopId)b on a.ShopId=b.ShopId\r\nleft join (\r\nselect GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee\r\nTXFee,ShopId from JC_ShopData\r\nwhere DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + "')=0 )c on a.ShopId=c.ShopId\r\nleft Join #ls2 e on a.ShopId=e.ShopId where d.PlatType!=2 " + (isyc ? " and d.Master!='东南亚专用'" : "") + "\r\n) a order by " + Sort;
// DataTable dt = obj.GetReportData(sql);
// return GetReport3(dt, 18);
// }
// catch (Exception ex)
// {
// string a = dd;
// return "";
// }
// }
// #endregion
#region 报表18
[WebMethod(EnableSession = true)]
public string GetReportTable18(DateTime? InDate, int DeptId, int ShopId, int PlatId, string MoneyCode, string Sort, bool isyc)
@ -779,6 +897,34 @@ left join #ls_fee5 g on a.UserId=g.UserId
tj += " and a.ShopId=" + ShopId + " ";
tj1 += " and a.ShopId=" + ShopId + " ";
}
string tj2 = "";
if (PlatId > 0)
{
tj2 += " where c.PlatType=" + PlatId + " ";
}
if (ShopId > 0)
{
tj2 += " where c.ShopId=" + ShopId + " ";
}
string tj3 = "";
if (PlatId > 0)
{
tj3 += " where d.PlatType=" + PlatId + " ";
}
if (ShopId > 0)
{
tj3 += " where d.ShopId=" + ShopId + " ";
}
//if (MoneyCode != "0")
// tj += " and a.MoneyCode='" + MoneyCode + "' ";
// string sql = @"
@ -816,43 +962,76 @@ left join #ls_fee5 g on a.UserId=g.UserId
// + " order by " + Sort;
//string sql = @"
//declare @moneyrate decimal(18,4)
//select @moneyrate=MRate from JC_Money where MCode='USD' and PlatId=2
//select a.ShopId,a.TotalPrice,escrowFee=isnull(a.escrowFee,0),a.RMBPrice,c.yj,yf=c.yf,cb=c.cb,hwsf=c.hwsf,c.tc,c.ck,c.md,a.Ad_Fee,a.DR_BackFee,a.DR_PostFee,a.DR_SSFee,a.Other_Fee,moneyrate=isnull(c.moneyrate,@moneyrate),ISnull( c.SubsidyFee,0) SubsidyFee into #ls from DT_OrderInfo a with(nolock)
//inner join DT_OrderXXInfo b with(nolock) on a.OrderId=b.OrderId
//left join DT_Fees c with(nolock) on a.OrderId=c.orderid
//where DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 " + tj + @" and a.State>0 and a.State<3
//select a.*,Num2=isnull(b.Num2,0) into #ls2 from (
//select b.ShopId,Num=COUNT(0) from HW_GoodsInfo a with(nolock)
//inner join HW_Shop b with(nolock) on a.GoodsId=b.GoodsId
//left join jc_shop c on b.ShopId=c.ShopId " + tj2 + @"
//group by b.ShopId)a
//left join (
//select a.ShopId,Num2=COUNT(distinct c.GoodsId) from DT_OrderInfo a with(nolock)
//inner join DT_OrderGoods b with(nolock) on a.OrderId=b.OrderId
//inner join HW_GoodsDetail c with(nolock) on b.DetailId=c.DetailId
//where a.State>0 and a.State<3 and DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 group by a.ShopId)b on a.ShopId=b.ShopId
//select * from (
//select d.ShopName,Master=case when d.Master=d.buyer then d.Master when d.buyer is not null and d.buyer<>'' then d.Master+'-'+d.buyer else d.Master end,a.OrderNum,a.RMBMoney,a.USDMoney,AvgPrice=case when a.OrderNum>0 then cast(a.USDMoney/a.OrderNum as decimal(18,2)) else 0 end,a.InPrice,LR=cast(b.ml as decimal(18,2)),MLL=case when b.TotalPrice>0 then cast(b.ml*100/b.TotalPrice as decimal(18,2)) else 0 end,ShopTJGoods=e.Num,ShopCDGoods=e.Num2,ckfee,a.mdfee,a.adfee,bz=case when a.InPrice>0 then CAST(a.RMBMoney/a.InPrice as decimal(18,2)) else 0 end,a.yf,c.GoodRate,c.ODR,DSRService=0,DSRGoods=null,DSRPost=0,c.USDUseMoney, USDNoMoney=0,c.RMBUseMoney,c.RMBNoMoney,Rate1=null,Rate2=null,Rate4=null, PropertyViolate=0, Rate5=0,Rate6=0,Rate7=isnull(c.Rate7,d.dayfee),JL=cast(b.ml as decimal(18,2))+isnull(ckfee,0)-isnull(c.Rate3,0)-isnull(c.Rate7,d.dayfee),FeeDate=null,TXFee=0 from
//JC_Shop d left join (
//select ShopId,OrderNum=COUNT(0),RMBMoney=SUM(RMBPrice),escrowFee=sum(escrowFee),USDMoney=SUM(TotalPrice),InPrice=SUM(cb),ckfee=SUM(ck),mdfee=SUM(md),adfee=SUM(Ad_Fee),yf=SUM(yf) from #ls
//group by ShopId)a on d.ShopId=a.ShopId
//left join (select ShopId,TotalPrice=sum(TotalPrice),ml=sum(isnull(TotalPrice,0)-isnull(escrowFee,0)-isnull(yj,0)-isnull(yf,0)-((isnull(cb,0)+isnull(hwsf,0))/moneyrate)-isnull(tc,0)-isnull(ck,0)-isnull(md,0)-isnull(Ad_Fee,0)+SubsidyFee) from #ls where yf>0
//group by ShopId)b on a.ShopId=b.ShopId
//left join (
//select GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee
//TXFee,ShopId from JC_ShopData
//where DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 )c on a.ShopId=c.ShopId
//left Join #ls2 e on a.ShopId=e.ShopId "+ tj3 + @"
//) a order by " + Sort;
string sql = @"
declare @moneyrate decimal(18,4)
select @moneyrate=MRate from JC_Money where MCode='USD' and PlatId=2
select a.ShopId,a.TotalPrice,escrowFee=isnull(a.escrowFee,0),a.RMBPrice,c.yj,yf=c.yf,cb=c.cb,hwsf=c.hwsf,c.tc,c.ck,c.md,a.Ad_Fee,a.DR_BackFee,a.DR_PostFee,a.DR_SSFee,a.Other_Fee,moneyrate=isnull(c.moneyrate,@moneyrate),ISnull( c.SubsidyFee,0) SubsidyFee into #ls from DT_OrderInfo a with(nolock)
inner join DT_OrderXXInfo b with(nolock) on a.OrderId=b.OrderId
left join DT_Fees c with(nolock) on a.OrderId=c.orderid
where DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 " + tj + @" and a.State>0 and a.State<3
select a.*,Num2=isnull(b.Num2,0) into #ls2 from (
select b.ShopId,Num=COUNT(0) from HW_GoodsInfo a with(nolock)
inner join HW_Shop b with(nolock) on a.GoodsId=b.GoodsId
group by b.ShopId)a
left join (
select a.ShopId,Num2=COUNT(distinct c.GoodsId) from DT_OrderInfo a with(nolock)
inner join DT_OrderGoods b with(nolock) on a.OrderId=b.OrderId
inner join HW_GoodsDetail c with(nolock) on b.DetailId=c.DetailId
where a.State>0 and a.State<3 and DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 group by a.ShopId)b on a.ShopId=b.ShopId
select * from (
select d.ShopName,Master=case when d.Master=d.buyer then d.Master when d.buyer is not null and d.buyer<>'' then d.Master+'-'+d.buyer else d.Master end,a.OrderNum,a.RMBMoney,a.USDMoney,AvgPrice=case when a.OrderNum>0 then cast(a.USDMoney/a.OrderNum as decimal(18,2)) else 0 end,a.InPrice,LR=cast(b.ml as decimal(18,2)),MLL=case when b.TotalPrice>0 then cast(b.ml*100/b.TotalPrice as decimal(18,2)) else 0 end,ShopTJGoods=e.Num,ShopCDGoods=e.Num2,ckfee,a.mdfee,a.adfee,bz=case when a.InPrice>0 then CAST(a.RMBMoney/a.InPrice as decimal(18,2)) else 0 end,a.yf,c.GoodRate,c.ODR,t3.CVR DSRService,t3.user_sessions DSRGoods,f.DSRPost,c.USDUseMoney, n1.originalTotalCurrencyAmount as USDNoMoney,c.RMBUseMoney,c.RMBNoMoney,t2.orderDefectRate Rate1,t2.validTrackingRate Rate2,Case when d.PlatType=2 then f.Rate3 else c.Rate3 end Rate3,t4.RefundRate as Rate4, ABS( ISNULL( t4.RefundAmount,0) ) as PropertyViolate,t2.cancelRate Rate5,Case when d.PlatType=2 then g.Rate6 else (select SUM(ISNULL(Rate3,0)) from JC_ShopData where ShopId=d.ShopId and DATEDIFF(MONTH,InDate,'2023-10-18')=0) end Rate6,Rate7=isnull(c.Rate7,d.dayfee),JL=cast(b.ml as decimal(18,2))+isnull(ckfee,0)-isnull(c.Rate3,0)-isnull(c.Rate7,d.dayfee),t1.financialEventGroupEndLocale as FeeDate,t1.originalTotalCurrencyAmount as TXFee from
JC_Shop d left join (
select ShopId,OrderNum=COUNT(0),RMBMoney=SUM(RMBPrice),escrowFee=sum(escrowFee),USDMoney=SUM(TotalPrice),InPrice=SUM(cb),ckfee=SUM(ck),mdfee=SUM(md),adfee=SUM(Ad_Fee),yf=SUM(yf) from #ls
group by ShopId)a on d.ShopId=a.ShopId
left join (select ShopId,TotalPrice=sum(TotalPrice),ml=sum(isnull(TotalPrice,0)-isnull(escrowFee,0)-isnull(yj,0)-isnull(yf,0)-((isnull(cb,0)+isnull(hwsf,0))/moneyrate)-isnull(tc,0)-isnull(ck,0)-isnull(md,0)-isnull(Ad_Fee,0)+SubsidyFee ) from #ls where yf>0
group by ShopId)b on a.ShopId=b.ShopId
left join (
select GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee
TXFee,ShopId from JC_ShopData
where DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 )c on a.ShopId=c.ShopId
left Join #ls2 e on a.ShopId=e.ShopId
left join [192.168.1.187].[UpGoods].dbo.LxERP_Amazon_Shop o on d.ShopName=o.name
left join ( select sid, CONVERT(decimal(12,2), SUM(t.cost)) as Rate3,CONVERT(decimal(12,2), SUM(t.sales)) as ad_sales , case when CONVERT(decimal(12,2), SUM(t.sales))<=0 then '∞' else CONVERT(nvarchar(20), convert(decimal(12,2), (CONVERT(decimal(12,2), SUM(t.cost))/CONVERT(decimal(12,2), SUM(t.sales)))*100)) end DSRPost from( select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SPAdGroupReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SBCampaignReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SDAdGroupReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid) t group by sid ) f on f.sid=o.sid" +
declare @moneyrate decimal(18,4)
select @moneyrate=MRate from JC_Money where MCode='USD' and PlatId=2
select a.ShopId,a.TotalPrice,escrowFee=isnull(a.escrowFee,0),a.RMBPrice,c.yj,yf=c.yf,cb=c.cb,hwsf=c.hwsf,c.tc,c.ck,c.md,a.Ad_Fee,a.DR_BackFee,a.DR_PostFee,a.DR_SSFee,a.Other_Fee,moneyrate=isnull(c.moneyrate,@moneyrate),ISnull( c.SubsidyFee,0) SubsidyFee into #ls from DT_OrderInfo a with(nolock)
inner join DT_OrderXXInfo b with(nolock) on a.OrderId=b.OrderId
left join DT_Fees c with(nolock) on a.OrderId=c.orderid
where DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 " + tj + @" and a.State>0 and a.State<3
select a.*,Num2=isnull(b.Num2,0) into #ls2 from (
select b.ShopId,Num=COUNT(0) from HW_GoodsInfo a with(nolock)
inner join HW_Shop b with(nolock) on a.GoodsId=b.GoodsId
inner join jc_shop c on b.ShopId=c.ShopId " + tj2 + @"
group by b.ShopId)a
left join (
select a.ShopId,Num2=COUNT(distinct c.GoodsId) from DT_OrderInfo a with(nolock)
inner join DT_OrderGoods b with(nolock) on a.OrderId=b.OrderId
inner join HW_GoodsDetail c with(nolock) on b.DetailId=c.DetailId
where a.State>0 and a.State<3 and DATEDIFF(day,a.OrderDate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 group by a.ShopId)b on a.ShopId=b.ShopId
select * from (
select d.ShopName,Master=case when d.Master=d.buyer then d.Master when d.buyer is not null and d.buyer<>'' then d.Master+'-'+d.buyer else d.Master end,a.OrderNum,a.RMBMoney,a.USDMoney,AvgPrice=case when a.OrderNum>0 then cast(a.USDMoney/a.OrderNum as decimal(18,2)) else 0 end,a.InPrice,LR=cast(b.ml as decimal(18,2)),MLL=case when b.TotalPrice>0 then cast(b.ml*100/b.TotalPrice as decimal(18,2)) else 0 end,ShopTJGoods=e.Num,ShopCDGoods=e.Num2,ckfee,a.mdfee,a.adfee,bz=case when a.InPrice>0 then CAST(a.RMBMoney/a.InPrice as decimal(18,2)) else 0 end,a.yf,c.GoodRate,c.ODR,t3.CVR DSRService,t3.user_sessions DSRGoods,f.DSRPost,c.USDUseMoney, n1.originalTotalCurrencyAmount as USDNoMoney,c.RMBUseMoney,c.RMBNoMoney,t2.orderDefectRate Rate1,t2.validTrackingRate Rate2,Case when d.PlatType=2 then f.Rate3 else c.Rate3 end Rate3,t4.RefundRate as Rate4, ABS( ISNULL( t4.RefundAmount,0) ) as PropertyViolate,t2.cancelRate Rate5,Case when d.PlatType=2 then g.Rate6 else (select SUM(ISNULL(Rate3,0)) from JC_ShopData where ShopId=d.ShopId and DATEDIFF(MONTH,InDate,'2023-10-18')=0) end Rate6,Rate7=isnull(c.Rate7,d.dayfee),JL=cast(b.ml as decimal(18,2))+isnull(ckfee,0)-isnull(c.Rate3,0)-isnull(c.Rate7,d.dayfee),t1.financialEventGroupEndLocale as FeeDate,t1.originalTotalCurrencyAmount as TXFee from
JC_Shop d left join (
select ShopId,OrderNum=COUNT(0),RMBMoney=SUM(RMBPrice),escrowFee=sum(escrowFee),USDMoney=SUM(TotalPrice),InPrice=SUM(cb),ckfee=SUM(ck),mdfee=SUM(md),adfee=SUM(Ad_Fee),yf=SUM(yf) from #ls
group by ShopId)a on d.ShopId=a.ShopId
left join (select ShopId,TotalPrice=sum(TotalPrice),ml=sum(isnull(TotalPrice,0)-isnull(escrowFee,0)-isnull(yj,0)-isnull(yf,0)-((isnull(cb,0)+isnull(hwsf,0))/moneyrate)-isnull(tc,0)-isnull(ck,0)-isnull(md,0)-isnull(Ad_Fee,0)+SubsidyFee) from #ls where yf>0
group by ShopId)b on a.ShopId=b.ShopId
left join (
select GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee
TXFee,ShopId from JC_ShopData
where DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 )c on a.ShopId=c.ShopId
inner Join #ls2 e on a.ShopId=e.ShopId
left join [192.168.1.187].[UpGoods].dbo.LxERP_Amazon_Shop o on d.ShopName=o.name
left join ( select sid, CONVERT(decimal(12,2), SUM(t.cost)) as Rate3,CONVERT(decimal(12,2), SUM(t.sales)) as ad_sales , case when CONVERT(decimal(12,2), SUM(t.sales))<=0 then '∞' else CONVERT(nvarchar(20), convert(decimal(12,2), (CONVERT(decimal(12,2), SUM(t.cost))/CONVERT(decimal(12,2), SUM(t.sales)))*100)) end DSRPost from( select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SPAdGroupReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SBCampaignReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SDAdGroupReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid) t group by sid ) f on f.sid=o.sid" +
" \r\n left join (select sid, CONVERT(decimal(12,2), SUM(t.cost)) as Rate6 from( select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SPAdGroupReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SBCampaignReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SDAdGroupReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid) t group by sid) g on o.sid=g.sid " +
" \r\n left join(select t.row, t.storename,t.financialEventGroupEndLocale,t.originCurrencyIcon,CAST(ISNULL( t.originalTotalCurrencyAmount,0) as decimal(12,2)) as originalTotalCurrencyAmount from ( select ROW_NUMBER() over(PARTITION BY storename ORDER BY requestDate DESC) row,storename, financialEventGroupEndLocale,originCurrencyIcon,originalTotalCurrencyAmount from [192.168.1.187].[UpGoods].dbo.LxERP_SettlementSummaryData where accountType='Standard' and processingStatus='Closed ') t where t.row=1) t1 on d.ShopName=t1.storeName left join (select storename,CONVERT(decimal(12,2), SUM(ISNULL(originalTotalCurrencyAmount,0))) originalTotalCurrencyAmount from [192.168.1.187].[UpGoods].dbo.LxERP_SettlementSummaryData where processingStatus='Open' and accountType='Standard' group by storename) n1 on d.ShopName=n1.storeName " +
"\r\n" +
" left join (select sid, CAST( orderDefectRate *100 as decimal(12,2)) orderDefectRate,CAST( validTrackingRate *100 as decimal(12,2)) validTrackingRate,cast(CancelRate *100 as decimal(12,2)) cancelRate from (\r\nselect ROW_NUMBER() over(PARTITION BY sid ORDER BY requestDate DESC) row,sid, orderDefectRate,validTrackingRate,CancelRate from [192.168.1.187].[UpGoods].dbo.Amazon_V2_SELLER_PERFORMANCE_REPORT where CONVERT(date, RequestDate)='" + InDate.Value.AddDays(-1).Date.ToString("yyyy-MM-dd") + "') t where t.row=1)t2 on t2.sid=o.sid \r\nleft join (select sid, user_sessions,totalOrderItems, case when user_sessions=0 or totalOrderItems=0 then 0 else convert(decimal(12,2),(totalOrderItems*1.00/user_sessions)*100 ) end as CVR from [192.168.1.187].[UpGoods].dbo.Amazon_SALES_AND_TRAFFIC_REPORT where CONVERT(date, ReportDate)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "') t3 on t3.sid=o.sid\r\nleft join [192.168.1.187].[UpGoods].dbo.AmazonStoreRefundAmountAndRate t4 on t4.sid=o.sid and Convert(date, t4.ReportDate)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "'\r\n"
+ " where d.PlatType=2 union all\r\n select d.ShopName,Master=case when d.Master=d.buyer then d.Master when d.buyer is not null and d.buyer<>'' then d.Master+'-'+d.buyer else d.Master end,a.OrderNum,a.RMBMoney,a.USDMoney,AvgPrice=case when a.OrderNum>0 then cast(a.USDMoney/a.OrderNum as decimal(18,2)) else 0 end,a.InPrice,LR=cast(b.ml as decimal(18,2)),MLL=case when b.TotalPrice>0 then cast(b.ml*100/b.TotalPrice as decimal(18,2)) else 0 end,ShopTJGoods=e.Num,ShopCDGoods=e.Num2,ckfee,a.mdfee,a.adfee,bz=case when a.InPrice>0 then CAST(a.RMBMoney/a.InPrice as decimal(18,2)) else 0 end,a.yf,c.GoodRate,c.ODR,c.DSRService,c.DSRGoods,case when ISNULL(c.DSRPost,0)=0 then '' else CONVERT(nvarchar(20),c.DSRPost) end DSRPost,c.USDUseMoney,c.USDNoMoney,c.RMBUseMoney,c.RMBNoMoney,c.Rate1,c.Rate2,c.Rate3,c.Rate4,c.PropertyViolate,c.Rate5,c.Rate6,Rate7=isnull(c.Rate7,d.dayfee),JL=cast(b.ml as decimal(18,2))+isnull(ckfee,0)-isnull(c.Rate3,0)-isnull(c.Rate7,d.dayfee),FeeDate=isnull(c.FeeDate,d.FeeDate),TXFee=isnull(c.TXFee,d.TXFee) from \r\nJC_Shop d left join (\r\nselect ShopId,OrderNum=COUNT(0),RMBMoney=SUM(RMBPrice),escrowFee=sum(escrowFee),USDMoney=SUM(TotalPrice),InPrice=SUM(cb),ckfee=SUM(ck),mdfee=SUM(md),adfee=SUM(Ad_Fee),yf=SUM(yf) from #ls\r\ngroup by ShopId)a on d.ShopId=a.ShopId\r\nleft join (select ShopId,TotalPrice=sum(TotalPrice),ml=sum(isnull(TotalPrice,0)-isnull(escrowFee,0)-isnull(yj,0)-isnull(yf,0)-((isnull(cb,0)+isnull(hwsf,0))/moneyrate)-isnull(tc,0)-isnull(ck,0)-isnull(md,0)-isnull(Ad_Fee,0)+ SubsidyFee) from #ls where yf>0\r\ngroup by ShopId)b on a.ShopId=b.ShopId\r\nleft join (\r\nselect GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee\r\nTXFee,ShopId from JC_ShopData\r\nwhere DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + "')=0 )c on a.ShopId=c.ShopId\r\nleft Join #ls2 e on a.ShopId=e.ShopId where d.PlatType!=2 " + (isyc ? " and d.Master!='东南亚专用'" : "") + "\r\n) a order by " + Sort;
+ " where d.PlatType=2 union all\r\n select d.ShopName,Master=case when d.Master=d.buyer then d.Master when d.buyer is not null and d.buyer<>'' then d.Master+'-'+d.buyer else d.Master end,a.OrderNum,a.RMBMoney,a.USDMoney,AvgPrice=case when a.OrderNum>0 then cast(a.USDMoney/a.OrderNum as decimal(18,2)) else 0 end,a.InPrice,LR=cast(b.ml as decimal(18,2)),MLL=case when b.TotalPrice>0 then cast(b.ml*100/b.TotalPrice as decimal(18,2)) else 0 end,ShopTJGoods=e.Num,ShopCDGoods=e.Num2,ckfee,a.mdfee,a.adfee,bz=case when a.InPrice>0 then CAST(a.RMBMoney/a.InPrice as decimal(18,2)) else 0 end,a.yf,c.GoodRate,c.ODR,c.DSRService,c.DSRGoods,case when ISNULL(c.DSRPost,0)=0 then '' else CONVERT(nvarchar(20),c.DSRPost) end DSRPost,c.USDUseMoney,c.USDNoMoney,c.RMBUseMoney,c.RMBNoMoney,c.Rate1,c.Rate2,c.Rate3,c.Rate4,c.PropertyViolate,c.Rate5,c.Rate6,Rate7=isnull(c.Rate7,d.dayfee),JL=cast(b.ml as decimal(18,2))+isnull(ckfee,0)-isnull(c.Rate3,0)-isnull(c.Rate7,d.dayfee),FeeDate=isnull(c.FeeDate,d.FeeDate),TXFee=isnull(c.TXFee,d.TXFee) from \r\nJC_Shop d left join (\r\nselect ShopId,OrderNum=COUNT(0),RMBMoney=SUM(RMBPrice),escrowFee=sum(escrowFee),USDMoney=SUM(TotalPrice),InPrice=SUM(cb),ckfee=SUM(ck),mdfee=SUM(md),adfee=SUM(Ad_Fee),yf=SUM(yf) from #ls\r\ngroup by ShopId)a on d.ShopId=a.ShopId\r\nleft join (select ShopId,TotalPrice=sum(TotalPrice),ml=sum(isnull(TotalPrice,0)-isnull(escrowFee,0)-isnull(yj,0)-isnull(yf,0)-((isnull(cb,0)+isnull(hwsf,0))/moneyrate)-isnull(tc,0)-isnull(ck,0)-isnull(md,0)-isnull(Ad_Fee,0) + SubsidyFee) from #ls where yf>0\r\ngroup by ShopId)b on a.ShopId=b.ShopId\r\nleft join (\r\nselect GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee\r\nTXFee,ShopId from JC_ShopData\r\nwhere DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + "')=0 )c on a.ShopId=c.ShopId\r\nleft Join #ls2 e on a.ShopId=e.ShopId where d.PlatType!=2 " + (isyc ? " and d.Master!='东南亚专用'" : "") + "\r\n) a order by " + Sort;
DataTable dt = obj.GetReportData(sql);
@ -8591,5 +8770,8 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr
}
#endregion
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -63,11 +63,11 @@
</scripting>
</system.web.extensions>
<appSettings>
<add key="ConnectionString" value="server=.;database=ERPYY;uid=sa;pwd=hz123456" />
<!--<add key="ConnectionString" value="server=.;database=ERPYY;uid=sa;pwd=hz123456" />-->
<!--<add key="ConnectionString" value="server=101.37.88.86;database=erp;uid=sa;pwd=erp@yeyuan123456New"/>-->
<!--<add key="ConnectionString" value="server=60.12.218.120;database=erp;uid=KJERP;pwd=KJERP123456"/>-->
<!--<add key="ConnectionString" value="server=192.168.1.16;database=newerp;uid=erpadmin;pwd=erp@12345" />-->
<!--<add key="ConnectionString" value="server=192.168.1.16;database=newerpbak_cwk;uid=erpadmin;pwd=erp@12345;TrustServerCertificate=True;"/>-->
<add key="ConnectionString" value="server=192.168.1.16;database=newerpbak_cwk;uid=erpadmin;pwd=erp@12345;TrustServerCertificate=True;"/>
<add key="PDAversion" value="1.0.1"/>
</appSettings>
<system.webServer>

@ -7682,6 +7682,16 @@ namespace TradeManageNew
}
#endregion
[WebMethod(EnableSession = true)]
public List<TemuSKUOrder> GetTemuOrderFromSKU(string sku)
{
PagesNew.Login(this.Session);
var datas = DataNew.GetTemuOrderFromSKU(sku);
return datas;
}
}
}

@ -1,693 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HW_TemuGoodsFee.aspx.cs" Inherits="TradeManageNew.Huowu.HW_TemuGoodsFee" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>货物信息</title>
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../Scripts/DataGrid.js" type="text/javascript"></script>
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
<script src="../Scripts/DateBox.js" type="text/javascript"></script>
<script src="../Scripts/FixTable.js" type="text/javascript"></script>
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
<script src="../Scripts/Global2.js?t=1" type="text/javascript"></script>
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
<script src="../Scripts/jquery.cookies.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox2.1/source/jquery.fancybox.css?v=2.1.5"
media="screen" />
<script type="text/javascript" src="../Scripts/fancybox2.1/lib/jquery.mousewheel-3.0.6.pack.js"></script>
<script type="text/javascript" src="../Scripts/fancybox2.1/source/jquery.fancybox.js?v=2.1.5"></script>
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
<script type="text/javascript">
var Name = '<%= Session["Name"].ToString() %>';
var UserId = '<%= Session["UserId"].ToString() %>';
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var WindowLoadModel = new WindowLoad();
var DId = 0;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
CreateDataGrid();
ReadGroup();
ReadUser();
ReadData();
$("#select_groupname").bind("change", function () {
ReadUser();
ReadData();
});
$("#" + datagrid1.TableID + " a[CommandName='dgbtnKC']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
var DId = model.Id;
$("#txt_OutDays2").val(model.OutDays2);
$("#txt_Price").val(model.Price);
$("#txt_Price2").val(model.Price2);
$("#txt_Num").val(model.Num);
$("#txt_Price3").val(model.Price3);
$("#txt_Num2").val(model.Num2);
$("#txt_Price4").val(model.Price4);
$("#txt_PlanInfo").val(model.PlanInfo);
$("#txt_AdviseInfo").val(model.AdviseInfo);
$("#txt_Remark").val(model.Remark);
fopen();
Model = model;
var snames = model.ShopNames;
ReadShopList(snames);
});
});
function ReadGroup() {
if(UserId==1||UserId==51||UserId==53)
$("#select_groupname").append("<option value='-1'>全部</option>");
$.ajax({
url: "../SysManageServiceNew.asmx/GetListUserInfoFromGroup",
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
$(data.d).each(function () {
$("#select_groupname").append("<option value='" + this.UserId + "'>" + this.Name + "</option>");
});
}
});
}
function ReadUser() {
$("#select_name").empty();
if(UserId==1||UserId==51||UserId==53)
$("#select_name").append("<option value=''>全部</option>");
var param = new Object();
param.groupid = $("#select_groupname").val();
$.ajax({
url: "../SysManageServiceNew.asmx/GetListUserInfoFromGroup3",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
$(data.d).each(function () {
//if(UserId!=1&&UserId!=51&&this.UserId==UserId&&UserId!=53)
// $("#select_name").append("<option value='" + this.UserId + "'>" + this.Name + "</option>");
// else
// if(UserId==1||UserId==51||UserId==53)
$("#select_name").append("<option value='" + this.UserId + "'>" + this.Name + "</option>");
});
if(UserId!=1&&UserId!=51&&UserId!=53)
$("#select_name").val(UserId);
}
});
}
//#region 读取分类
function ReadShopList(ShopNames) {
$("#div_shopnames").empty();
var param = new Object();
param.ShopNames = ShopNames;
$.ajax({
url: "../HuoWuServiceNew.asmx/GetZTShopList",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: true,
success: function (data) {
if (data.d != null) {
$(data.d).each(function () {
if (this.IsCheck == true)
$("#div_shopnames").append("<input spid='" + this.ShopId + "' sname='" + this.ShopName + "' type='checkbox' checked='checked'/>"+this.ShopName);
else
$("#div_shopnames").append("<input spid='"+this.ShopId+"' sname='" + this.ShopName + "' type='checkbox' />"+this.ShopName);
});
}
}
});
}
//#endregion
function GetImage(Ids) {
$("#div_img").empty();
var param = new Object();
param.Ids = Ids;
$.ajax({
url: "../BaseData.asmx/GetResourceList",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
if (data.d != null) {
$("#img_1").attr("src", '../' + data.d[0].FileUrl);
$(data.d).each(function () {
$("#div_img").append("<img src='../" + this.FileUrl + "' width='100px' height='80px' style='margin-right:5px'/>");
});
fopen();
}
}
});
}
function fopen() {
$.fancybox({
'width': '40%',
'height': '40%',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#test',
'onComplete': function () {
}
});
}
//#region 初始化DataGrid
function CreateDataGrid() {
Array.clear(datagrid1.Columns);
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "缩略图";
col.CellTemplate = "<a CommandName='cmdImg' class='linka'><img src='{Bind FirstImgUrl}' alt='' width='50px' height='50px'/></a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "货物SKU";
col.Width = "150px";
col.Align = "left";
col.CellTemplate = "<a CommandName='cmdLook' class='linka'>{Bind SKU1}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "人员";
col.CellTemplate = "<div>{Bind mname}</div>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "组长";
col.CellTemplate = "<div>{Bind groupname}</div>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "最长出单周期(天)";
col.CellTemplate = "<span>{Bind OutDays2}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "前期定价$";
col.CellTemplate = "<span>{Bind Price}</span>";
// col.SortExpression = "InPrice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "稳定定价";
col.CellTemplate = "<span>{Bind Price2}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "第一名销量";
col.CellTemplate = "<span>{Bind Num}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "定价$";
col.CellTemplate = "<span>{Bind Price3}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "目标销量";
col.CellTemplate = "<span>{Bind Num2}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "定价$";
col.CellTemplate = "<span>{Bind Price4}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "重推店铺";
col.CellTemplate = "<div>{Bind ShopNames}</div>";
col.Width = "150px";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "计划";
col.CellTemplate = "<div>{Bind PlanInfo}</div>";
col.Width = "150px";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "要求";
col.CellTemplate = "<div>{Bind AdviseInfo}</div>";
col.Width = "150px";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "备注";
col.CellTemplate = "<div>{Bind Remark}</div>";
col.Width = "150px";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "周销量 | 金额";
col.CellTemplate = "<span>{Bind GoodsWeekHJNum}|{Bind GoodsWeekHJPrice}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "月销量|金额";
col.CellTemplate = "<span>{Bind GoodsHJNum2}|{Bind GoodsMonthHJPrice}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "未出单天数(天)";
col.CellTemplate = "<span GNum='{Bind NoOutDays}' SNum='{Bind OutDays2}'>{Bind NoOutDays}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "80px";
col.CellTemplate = "<a CommandName='dgbtnKC' style='color: #23527c;cursor:pointer'>填写</a>";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(20);
datagrid1.SetPageIndex(1);
// datagrid1.SortExpression = "b.GoodsCode,b.Indate";
// datagrid1.ViewSortDirection = "ASC";
datagrid1.IsFixHeader = true;
datagrid1.Height = $(document).height() - 230;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = true;
datagrid1.Width = "100%";
//datagrid1.Sorting(function () {
// ReadData();
//});
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
function AddTr() {
$("span[GNum]").each(function () {
var GNum = $(this).attr("GNum");
var SNum = $(this).attr("SNum");
if (GNum == "")
GNum = 0;
if (SNum == "")
SNum = 0;
if (SNum>0&&parseInt(GNum) >parseInt(SNum)) {
$(this).css("color", "red");
}
});
//$("tr[name='DataGridRow']").each(function (i) {
// if (i % 2 == 0)
// $(this).css("background-color", "#EEEEEE");
// ;
//});
}
function ReadData() {
$("#_fixTableHeader").show();
var param = new Object();
CreateWhere("SelectHtml", param); //读取查询条件
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
param.cs += " and b.State=1 and d.deptid=1 and d.state=1 and a.SKU1 not like 's-%' ";
param.cs = Base64.encode(param.cs);
WindowLoadModel.Show();
$.ajax({
url: "../HuoWuServiceNew.asmx/GetListGoodsUserPlanCount",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
AddTr();
}
});
}
//#endregion
//#region 删除
function DelCol(obj) {
if (window.confirm('确定要删除吗?') == false) return;
var rowindex = $(obj).parent().parent().attr("index");
var param = new Object();
var model = datagrid1.Get_Model(rowindex);
param.GoodsId = model.GoodsId;
$.ajax({
url: "HuoWuService.asmx/DeleteGoodsInfo",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
if (data.d == 0) {
alert("删除成功");
ReadData();
}
else {
alert("该货物有库存或者有订单匹配或者有采购单匹配,无法删除");
}
}
});
}
function UpdateGoodsSafeNum() {
datagrid2.UpdateDataSource();
var param = new Object();
param.list = datagrid2.DataSource;
$.ajax({
url: "HuoWuService.asmx/UpdateGoodsSafeNum",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("备货成功");
ReadData();
$.fancybox.close();
}
});
}
var Model = null;
function Save() {
var param = new Object();
Model.DetailId = Model.Id;
Model.Id = 0;
if( $("#txt_OutDays2").val()!="")
Model.OutDays2 = $("#txt_OutDays2").val();
if( $("#txt_Price").val()!="")
Model.Price = $("#txt_Price").val();
if( $("#txt_Price2").val()!="")
Model.Price2 = $("#txt_Price2").val();
if( $("#txt_Price3").val()!="")
Model.Price3 = $("#txt_Price3").val();
if( $("#txt_Price4").val()!="")
Model.Price4 = $("#txt_Price4").val();
if( $("#txt_Num").val()!="")
Model.Num = $("#txt_Num").val();
if( $("#txt_Num2").val()!="")
Model.Num2 = $("#txt_Num2").val();
Model.PlanInfo=$("#txt_PlanInfo").val();
Model.AdviseInfo=$("#txt_AdviseInfo").val();
Model.Remark = $("#txt_Remark").val();
var snames = "";
$("input[spid]").each(function () {
if ($(this).is(":checked") == true)
snames += $(this).attr("sname")+",";
});
Model.ShopNames = snames;
param.Model =Model;
$.ajax({
url: "../HuoWuServiceNew.asmx/Save_GoodsUserPlanCount",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("保存成功");
$.fancybox.close();
ReadData();
}
});
}
function SaveXP() {
var list = datagrid4.GetSelectListModel();
if (list == null || list.length == 0) {
alert("请选择一个货物");
return;
}
if (list[0].IsAdd == 1) {
alert("该选品货物已经添加过编号,不能新增");
return;
}
window.parent.addTab("货物编辑", "HuoWu/HW_GoodsAddForTM.aspx?Title=货物信息&GoodsId=0&XPId=" + list[0].Id + "&LinkUrl=" + list[0].LinkUrl, true);
}
function DeleteXP() {
var list = datagrid4.GetSelectListModel();
if (list == null || list.length == 0) {
alert("请选择一个货物");
return;
}
if (window.confirm('确定要删除该记录吗?') == false) return;
var param = new Object();
param.Id = list[0].Id;
$.ajax({
url: "../BaseData.asmx/DeleteXP",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("删除成功");
ReadData();
}
});
}
function SyncPrice() {
var price = 0;
$("input[ColName='Price']").each(function () {
if (price == 0 && $(this).val() != "")
price = $(this).val();
});
if (price > 0)
$("input[ColName='Price']").val(price);
}
//#endregion
</script>
</head>
<body class="headbody">
<div class="title_ico">
货物SKU</div>
<div style="display: none">
<div id="test" title="" style="width: 550px; height: 400px;">
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
<tr>
<td class="f1" width="15%">
最长出单周期:
</td>
<td colspan="3">
<input id="txt_OutDays2" class="editTextbox" style="width: 120px;"
type="text" />天
</td>
</tr>
<tr>
<td class="f1" width="15%">
前期定价:
</td>
<td>
<input id="txt_Price" class="editTextbox" style="width: 120px;" type="text" />$
</td>
<td class="f1" width="15%">
稳定定价:
</td>
<td>
<input id="txt_Price2" class="editTextbox" style="width: 120px;"
type="text" />$
</td>
</tr>
<tr>
<td class="f1" width="15%">
第一名销量:
</td>
<td>
<input id="txt_Num" class="editTextbox" style="width: 120px;" type="text" />
</td>
<td class="f1" width="15%">
定价:
</td>
<td>
<input id="txt_Price3" class="editTextbox" style="width: 120px;"
type="text" />$
</td>
</tr>
<tr>
<td class="f1" width="15%">
目标销量:
</td>
<td>
<input id="txt_Num2" class="editTextbox" style="width: 120px;" type="text" />
</td>
<td class="f1" width="15%">
定价:
</td>
<td>
<input id="txt_Price4" class="editTextbox" style="width: 120px;"
type="text" />$
</td>
</tr>
<tr>
<td class="f1" width="15%">
重推店铺:
</td>
<td colspan="3">
<div id="div_shopnames"></div>
</td>
</tr>
<tr>
<td class="f1" width="15%">
计划:
</td>
<td colspan="3">
<textarea id="txt_PlanInfo" cols="20" style="width:99%" rows="3"></textarea>
</td>
</tr>
<tr>
<td class="f1" width="15%">
要求:
</td>
<td colspan="3">
<textarea id="txt_AdviseInfo" cols="20" style="width:99%" rows="3"></textarea>
</td>
</tr>
<tr>
<td class="f1" width="15%">
备注:
</td>
<td colspan="3">
<textarea id="txt_Remark" cols="20" rows="3" style="width:99%"></textarea>
</td>
</tr>
<tr>
<td align="center" colspan="4">
<input id="btn_Save4" type="button" class="btnClass btnClassSave" value="确 定" onclick="Save();" />
</td>
</tr>
</table>
</div>
</div>
<table id="SelectHtml" class="tableAll" style="width: 100%;">
<tr>
<td class="f1">
SKU:
</td>
<td style="width:30%">
<input id="txt_Name" class="editTextbox" style="width: 120px;" type="text" where="a.SKU1 like '%@value%'"/>
</td>
<td class="f1">
分组/人员:
</td>
<td style="width:30%">
<select id="select_groupname" class="selectClass" style="width: 120px" name="D2" where="d.guserid=@value">
</select>组<select id="select_name" class="selectClass" style="width: 120px" name="D1" where="b.muserid=@value">
</select></td>
<td>
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" onclick="ReadData();" />
</td>
</tr>
<tr>
<td class="f1">
未出单天数:</td>
<td style="width:30%">
<input id="txt_SNum" class="editTextbox" style="width: 50px;" type="text" where="DATEDIFF(day,b.LastOrderDate,GETDATE())>=@value"/>-<input id="txt_ENum" class="editTextbox" style="width: 50px;" type="text" where="DATEDIFF(day,b.LastOrderDate,GETDATE())<=@value"/></td>
<td class="f1">
&nbsp;</td>
<td style="width:30%">
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td valign="top" colspan="5">
<div id="DataGrid1" class="DataGridStyle" style="-webkit-overflow-scrolling: touch;
overflow: auto;">
</div>
</td>
</tr>
</table>
</body>
</html>

@ -0,0 +1,292 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemuOrderGoodsFee.aspx.cs" Inherits="TradeManageNew.Huowu.TemuOrderGoodsFee" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>货物信息</title>
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../Scripts/DataGrid.js" type="text/javascript"></script>
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
<script src="../Scripts/DateBox.js" type="text/javascript"></script>
<script src="../Scripts/FixTable.js" type="text/javascript"></script>
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
<script src="../Scripts/Global2.js?t=1" type="text/javascript"></script>
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
<script src="../Scripts/jquery.cookies.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox2.1/source/jquery.fancybox.css?v=2.1.5"
media="screen" />
<script type="text/javascript" src="../Scripts/fancybox2.1/lib/jquery.mousewheel-3.0.6.pack.js"></script>
<script type="text/javascript" src="../Scripts/fancybox2.1/source/jquery.fancybox.js?v=2.1.5"></script>
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
<script type="text/javascript">
var Name = '<%= Session["Name"].ToString() %>';
var UserId = '<%= Session["UserId"].ToString() %>';
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var WindowLoadModel = new WindowLoad();
var DId = 0;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
CreateDataGrid();
ReadGroup();
ReadUser();
ReadData();
$("#select_groupname").bind("change", function () {
ReadUser();
ReadData();
});
$("#" + datagrid1.TableID + " a[CommandName='dgbtnKC']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
var DId = model.Id;
$("#txt_OutDays2").val(model.OutDays2);
$("#txt_Price").val(model.Price);
$("#txt_Price2").val(model.Price2);
$("#txt_Num").val(model.Num);
$("#txt_Price3").val(model.Price3);
$("#txt_Num2").val(model.Num2);
$("#txt_Price4").val(model.Price4);
$("#txt_PlanInfo").val(model.PlanInfo);
$("#txt_AdviseInfo").val(model.AdviseInfo);
$("#txt_Remark").val(model.Remark);
fopen();
Model = model;
var snames = model.ShopNames;
ReadShopList(snames);
});
});
function GetImage(Ids) {
$("#div_img").empty();
var param = new Object();
param.Ids = Ids;
$.ajax({
url: "../BaseData.asmx/GetResourceList",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
if (data.d != null) {
$("#img_1").attr("src", '../' + data.d[0].FileUrl);
$(data.d).each(function () {
$("#div_img").append("<img src='../" + this.FileUrl + "' width='100px' height='80px' style='margin-right:5px'/>");
});
fopen();
}
}
});
}
function fopen() {
$.fancybox({
'width': '40%',
'height': '40%',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#test',
'onComplete': function () {
}
});
}
//#region 初始化DataGrid
function CreateDataGrid() {
Array.clear(datagrid1.Columns);
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "SKU";
col.CellTemplate = "<a>{Bind SKU1}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "店铺";
col.Width = "150px";
col.Align = "left";
col.CellTemplate = "<a>{Bind ShopName}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "订单号";
col.CellTemplate = "<a>{Bind PlatOrderCode}</a>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "订单日期";
col.CellTemplate = "<div>{Bind InDate}</div>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "订单金额$";
col.CellTemplate = "<span>{Bind TotalPrice}</span>";
// col.SortExpression = "b.GoodsInNum";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "佣金$";
col.CellTemplate = "<span>{Bind yj}</span>";
// col.SortExpression = "InPrice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "运费$";
col.CellTemplate = "<span>{Bind sjyf}</span>";
// col.SortExpression = "InPrice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "货物成本$";
col.CellTemplate = "<span>{Bind cb}</span>";
// col.SortExpression = "InPrice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "货物税费$";
col.CellTemplate = "<span>{Bind hwsf}</span>";
// col.SortExpression = "InPrice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "仓储费$";
col.CellTemplate = "<span>{Bind ck}</span>";
// col.SortExpression = "InPrice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "头程$";
col.CellTemplate = "<span>{Bind sjtc}</span>";
// col.SortExpression = "InPrice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "利润$";
col.CellTemplate = "<span>{Bind lr}</span>";
// col.SortExpression = "InPrice";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(20);
datagrid1.SetPageIndex(1);
// datagrid1.SortExpression = "b.GoodsCode,b.Indate";
// datagrid1.ViewSortDirection = "ASC";
datagrid1.IsFixHeader = false;
/* datagrid1.Height = $(document).height() - 230;*/
datagrid1.ShowIndexColumn = true;
datagrid1.AllowPaging = false;
datagrid1.Width = "100%";
//datagrid1.Sorting(function () {
// ReadData();
//});
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
// datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
function AddTr() {
$("span[GNum]").each(function () {
var GNum = $(this).attr("GNum");
var SNum = $(this).attr("SNum");
if (GNum == "")
GNum = 0;
if (SNum == "")
SNum = 0;
if (SNum>0&&parseInt(GNum) >parseInt(SNum)) {
$(this).css("color", "red");
}
});
//$("tr[name='DataGridRow']").each(function (i) {
// if (i % 2 == 0)
// $(this).css("background-color", "#EEEEEE");
// ;
//});
}
function ReadData() {
var param = new Object();
param.sku = $("#txt_Name").val();
WindowLoadModel.Show();
$.ajax({
url: "../HuoWuServiceNew.asmx/GetTemuOrderFromSKU",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.DataBind(data.d);
}
});
}
</script>
</head>
<body class="headbody">
<div class="title_ico">
Temu订单分析</div>
<table id="SelectHtml" class="tableAll" style="width: 100%;">
<tr>
<td class="f1" style="width:30%">
SKU:
</td>
<td>
<input id="txt_Name" class="editTextbox" style="width: 120px;" type="text" where="a.SKU1 like '%@value%'"/>
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" onclick="ReadData();" /></td>
</tr>
<tr>
<td colspan="2">
总数量:<a id="a_zsl"></a> 已售数量:<a id="a_yssl"></a> 剩余数量:<a id="a_sysl"></a> 总利润:<a id="a_zlr"></a>
</td>
</tr>
<tr>
<td valign="top" colspan="2">
<div id="DataGrid1" class="DataGridStyle" style="-webkit-overflow-scrolling: touch;
overflow: auto;height:500px">
</div>
</td>
</tr>
</table>
</body>
</html>

@ -7,7 +7,7 @@ using System.Web.UI.WebControls;
namespace TradeManageNew.Huowu
{
public partial class HW_TemuGoodsFee : System.Web.UI.Page
public partial class TemuOrderGoodsFee : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

@ -11,7 +11,7 @@ namespace TradeManageNew.Huowu
{
public partial class HW_TemuGoodsFee
public partial class TemuOrderGoodsFee
{
}
}

@ -3326,7 +3326,7 @@ left join ( select sid, CONVERT(decimal(12,2), SUM(t.cost)) as Rate3,CONVERT(dec
select GoodRate,ODR,DSRService,DSRGoods,DSRPost,USDUseMoney,USDNoMoney,RMBUseMoney, RMBNoMoney,Rate1,Rate2,Rate3,Rate4,PropertyViolate,Rate5,Rate6,Rate7,FeeDate,TXFee
TXFee,ShopId from JC_ShopData
where DATEDIFF(day,indate,'" + InDate.Value.ToString("yyyy-MM-dd") + @"')=0 )c on a.ShopId=c.ShopId
inner Join #ls2 e on a.ShopId=e.ShopId
left Join #ls2 e on a.ShopId=e.ShopId
left join [192.168.1.187].[UpGoods].dbo.LxERP_Amazon_Shop o on d.ShopName=o.name
left join ( select sid, CONVERT(decimal(12,2), SUM(t.cost)) as Rate3,CONVERT(decimal(12,2), SUM(t.sales)) as ad_sales , case when CONVERT(decimal(12,2), SUM(t.sales))<=0 then '∞' else CONVERT(nvarchar(20), convert(decimal(12,2), (CONVERT(decimal(12,2), SUM(t.cost))/CONVERT(decimal(12,2), SUM(t.sales)))*100)) end DSRPost from( select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SPAdGroupReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SBCampaignReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost,SUM(ISNULL(sales,0))sales from [192.168.1.187].[UpGoods].dbo.LxERP_SDAdGroupReports where CONVERT(date,report_date)='" + InDate.Value.AddDays(-2).Date.ToString("yyyy-MM-dd") + "' group by sid) t group by sid ) f on f.sid=o.sid" +
" \r\n left join (select sid, CONVERT(decimal(12,2), SUM(t.cost)) as Rate6 from( select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SPAdGroupReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SBCampaignReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid union all select sid, SUM( ISNULL(cost,0)) as cost from [192.168.1.187].[UpGoods].dbo.LxERP_SDAdGroupReports where CONVERT(date,report_date)<='" + InDate.Value.AddDays(-2).ToString("yyyy-MM-dd") + "' and CONVERT(date,report_date)>='" + InDate.Value.AddDays(-31).ToString("yyyy-MM-dd") + "' group by sid) t group by sid) g on o.sid=g.sid " +

@ -1415,7 +1415,6 @@
<Content Include="Huowu\HW_GoodsDetailList4.aspx" />
<Content Include="Huowu\HW_GoodsDetailList5.aspx" />
<Content Include="Huowu\HW_GoodsDetailList_EN.aspx" />
<Content Include="Huowu\HW_TemuGoodsFee.aspx" />
<Content Include="Huowu\HW_GoodsInfoForTM2_EN.aspx" />
<Content Include="Huowu\HW_GoodsInfoForTM4.aspx" />
<Content Include="Huowu\HW_GoodsNumCount.aspx" />
@ -1426,6 +1425,7 @@
<Content Include="Huowu\HW_PersonBuyAdd.aspx" />
<Content Include="Huowu\HW_PersonBuyList.aspx" />
<Content Include="Huowu\HW_production.aspx" />
<Content Include="Huowu\TemuOrderGoodsFee.aspx" />
<Content Include="Huowu\TemuShopGoodPrice.aspx" />
<Content Include="Huowu\TemuShopGoodPriceCheck.aspx" />
<Content Include="Huowu\TemuShopGoodPriceNew.aspx" />
@ -2790,13 +2790,6 @@
<Compile Include="Huowu\HW_GoodsDetailList_EN.aspx.designer.cs">
<DependentUpon>HW_GoodsDetailList_EN.aspx</DependentUpon>
</Compile>
<Compile Include="Huowu\HW_TemuGoodsFee.aspx.cs">
<DependentUpon>HW_TemuGoodsFee.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Huowu\HW_TemuGoodsFee.aspx.designer.cs">
<DependentUpon>HW_TemuGoodsFee.aspx</DependentUpon>
</Compile>
<Compile Include="Huowu\HW_GoodsInfoForTM2_EN.aspx.cs">
<DependentUpon>HW_GoodsInfoForTM2_EN.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -2867,6 +2860,13 @@
<Compile Include="Huowu\HW_production.aspx.designer.cs">
<DependentUpon>HW_production.aspx</DependentUpon>
</Compile>
<Compile Include="Huowu\TemuOrderGoodsFee.aspx.cs">
<DependentUpon>TemuOrderGoodsFee.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Huowu\TemuOrderGoodsFee.aspx.designer.cs">
<DependentUpon>TemuOrderGoodsFee.aspx</DependentUpon>
</Compile>
<Compile Include="Huowu\TemuShopGoodPrice.aspx.cs">
<DependentUpon>TemuShopGoodPrice.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

Loading…
Cancel
Save