Commit 77d012d1 authored by 黄奎's avatar 黄奎
parents 343b1a96 64ddbd57
...@@ -246,5 +246,9 @@ namespace Mall.Model.Entity.Product ...@@ -246,5 +246,9 @@ namespace Mall.Model.Entity.Product
/// 主播佣金生成的财务单据 逗号分隔 /// 主播佣金生成的财务单据 逗号分隔
/// </summary> /// </summary>
public string LiveFinanceIds { get; set; } public string LiveFinanceIds { get; set; }
/// <summary>
/// 主播数量
/// </summary>
public int? LivePeopleNum { get; set; }
} }
} }
...@@ -13,6 +13,14 @@ namespace Mall.Model.Extend.Product ...@@ -13,6 +13,14 @@ namespace Mall.Model.Extend.Product
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_Goods_OrderDetail_Extend : RB_Goods_OrderDetail public class RB_Goods_OrderDetail_Extend : RB_Goods_OrderDetail
{ {
/// <summary>
/// 是否直播订单
/// </summary>
public int? IsLiveOrder { get; set; }
/// <summary>
/// 单据状态 1已制单 2未制单
/// </summary>
public int? FinanceStatus { get; set; }
/// <summary> /// <summary>
/// 会员优惠 /// 会员优惠
/// </summary> /// </summary>
......
...@@ -250,9 +250,16 @@ namespace Mall.Model.Query ...@@ -250,9 +250,16 @@ namespace Mall.Model.Query
/// <summary> /// <summary>
/// 主播佣金 /// 主播应付佣金
/// </summary> /// </summary>
public decimal LiveCommission { get; set; } public decimal LiveCommission { get; set; }
/// <summary>
/// 主播已付佣金
/// </summary>
public decimal PaidLiveCommission { get; set; }
/// <summary> /// <summary>
/// 主播佣金生成的财务单据 逗号分隔 /// 主播佣金生成的财务单据 逗号分隔
/// </summary> /// </summary>
......
This diff is collapsed.
...@@ -157,6 +157,19 @@ namespace Mall.Repository.Product ...@@ -157,6 +157,19 @@ namespace Mall.Repository.Product
where += $@" and od.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'"; where += $@" and od.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
} }
if (dmodel.IsLiveOrder == 1)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.LiveCommission)} >0";
}
if (dmodel.FinanceStatus == 1)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.LiveFinanceIds)} <> ''";
}
else if (dmodel.FinanceStatus == 2)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.LiveFinanceIds)} = ''";
}
string sql = $@"SELECT od.*,o.OrderNo FROM rb_goods_orderdetail od string sql = $@"SELECT od.*,o.OrderNo FROM rb_goods_orderdetail od
INNER JOIN rb_goods_order o on o.OrderId=od.OrderId INNER JOIN rb_goods_order o on o.OrderId=od.OrderId
where {where} order by o.CreateDate desc"; where {where} order by o.CreateDate desc";
...@@ -268,6 +281,19 @@ where {where} order by o.CreateDate desc"; ...@@ -268,6 +281,19 @@ where {where} order by o.CreateDate desc";
where += $@" and od.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'"; where += $@" and od.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
} }
if (dmodel.IsLiveOrder == 1)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.LiveCommission)} >0";
}
if (dmodel.FinanceStatus == 1)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.LiveFinanceIds)} <> ''";
}
else if (dmodel.FinanceStatus == 2)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.LiveFinanceIds)} = ''";
}
string sql = $@"SELECT od.*,o.OrderNo FROM rb_goods_orderdetail od string sql = $@"SELECT od.*,o.OrderNo FROM rb_goods_orderdetail od
INNER JOIN rb_goods_order o on o.OrderId=od.OrderId INNER JOIN rb_goods_order o on o.OrderId=od.OrderId
where {where} order by o.CreateDate desc"; where {where} order by o.CreateDate desc";
......
...@@ -1123,7 +1123,7 @@ as t GROUP BY t.CreateDate desc"; ...@@ -1123,7 +1123,7 @@ as t GROUP BY t.CreateDate desc";
string sql = $@" SELECT MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName, string sql = $@" SELECT MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
SUM(b.Final_Price) as Final_Price,SUM(b.FreightMoney) as FreightMoney,SUM(b.Final_Price+b.FreightMoney) as AllPrice , SUM(b.Final_Price) as Final_Price,SUM(b.FreightMoney) as FreightMoney,SUM(b.Final_Price+b.FreightMoney) as AllPrice ,
SUM(IFNULL(b.CostMoney,0)*b.Number) as CostMoney,0 as PackingMoney, 0 as CostFreight,0 as GoodsFreight, SUM(IFNULL(b.CostMoney,0)*b.Number) as CostMoney,0 as PackingMoney, 0 as CostFreight,0 as GoodsFreight,
c.OneCommission,c.OneUserId,c.OneUserName,d.TwoCommission,d.TwoUserId,d.TwoUserName,0 as OtherPrice,e.FXCommission,0 as Paid c.OneCommission,c.OneUserId,c.OneUserName,d.TwoCommission,d.TwoUserId,d.TwoUserName,0 as OtherPrice,e.FXCommission,b.LiveCommission,b.LiveFinanceIds,0 as Paid
from rb_goods_orderdetail as b from rb_goods_orderdetail as b
LEFT JOIN rb_goods_order as A on a.OrderId=b.OrderId LEFT JOIN rb_goods_order as A on a.OrderId=b.OrderId
LEFT JOIN rb_supplier as f on f.ID=b.SupplierId LEFT JOIN rb_supplier as f on f.ID=b.SupplierId
...@@ -1302,7 +1302,7 @@ GROUP BY od.GoodsId,o.OrderId ...@@ -1302,7 +1302,7 @@ GROUP BY od.GoodsId,o.OrderId
string sql = $@" SELECT B.Id,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName, string sql = $@" SELECT B.Id,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
SUM(b.Final_Price) as Final_Price,SUM(b.FreightMoney) as FreightMoney,SUM(b.Final_Price+b.FreightMoney) as AllPrice , SUM(b.Final_Price) as Final_Price,SUM(b.FreightMoney) as FreightMoney,SUM(b.Final_Price+b.FreightMoney) as AllPrice ,
SUM(IFNULL(b.CostMoney,0)*b.Number) as CostMoney,0 as PackingMoney, 0 as CostFreight,0 as GoodsFreight, SUM(IFNULL(b.CostMoney,0)*b.Number) as CostMoney,0 as PackingMoney, 0 as CostFreight,0 as GoodsFreight,
0 as OtherPrice,e.FXCommission,f.RemitFXCommission,0 as Paid 0 as OtherPrice,e.FXCommission,f.RemitFXCommission,b.LiveCommission,b.LiveFinanceIds,0 as Paid
from rb_goods_orderdetail as b from rb_goods_orderdetail as b
LEFT JOIN rb_goods_order as A on a.OrderId=b.OrderId LEFT JOIN rb_goods_order as A on a.OrderId=b.OrderId
LEFT JOIN rb_supplier as f on f.ID=b.SupplierId LEFT JOIN rb_supplier as f on f.ID=b.SupplierId
......
...@@ -147,10 +147,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -147,10 +147,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat
foreach (var item in list) foreach (var item in list)
{ {
// item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.OneCommission + item.TwoCommission + item.OtherPrice; // item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.OneCommission + item.TwoCommission + item.OtherPrice;
item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.FXCommission + item.OtherPrice; item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.FXCommission + item.LiveCommission + item.OtherPrice;
// item.NoPaid = item.ALLCommission - item.Paid; // item.NoPaid = item.ALLCommission - item.Paid;
item.NoPaid = item.ALLCommission; item.NoPaid = item.ALLCommission;
item.Paid = item.PaidCostMoney + item.RemitFXCommission; item.Paid = item.PaidCostMoney + item.RemitFXCommission + (!string.IsNullOrWhiteSpace(item.LiveFinanceIds) ? item.LiveCommission : 0);
item.GrossProfit = item.AllPrice - item.ALLCommission; item.GrossProfit = item.AllPrice - item.ALLCommission;
item.GrossProfitRate = item.AllPrice == 0 ? 0 : Math.Round((item.GrossProfit / item.AllPrice), 2, MidpointRounding.AwayFromZero); item.GrossProfitRate = item.AllPrice == 0 ? 0 : Math.Round((item.GrossProfit / item.AllPrice), 2, MidpointRounding.AwayFromZero);
} }
...@@ -345,9 +345,9 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -345,9 +345,9 @@ namespace Mall.WebApi.Controllers.AppletWeChat
foreach (var item in list) foreach (var item in list)
{ {
// item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.OneCommission + item.TwoCommission + item.OtherPrice; // item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.OneCommission + item.TwoCommission + item.OtherPrice;
item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.FXCommission + item.OtherPrice; item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.FXCommission + item.LiveCommission + item.OtherPrice;
item.NoPaid = item.ALLCommission; item.NoPaid = item.ALLCommission;
item.Paid = item.PaidCostMoney + item.RemitFXCommission; item.Paid = item.PaidCostMoney + item.RemitFXCommission + (!string.IsNullOrWhiteSpace(item.LiveFinanceIds) ? item.LiveCommission : 0);
item.GrossProfit = item.AllPrice - item.ALLCommission; item.GrossProfit = item.AllPrice - item.ALLCommission;
item.GrossProfitRate = item.AllPrice == 0 ? 0 : Math.Round((item.GrossProfit / item.AllPrice), 2, MidpointRounding.AwayFromZero); item.GrossProfitRate = item.AllPrice == 0 ? 0 : Math.Round((item.GrossProfit / item.AllPrice), 2, MidpointRounding.AwayFromZero);
} }
...@@ -393,11 +393,16 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -393,11 +393,16 @@ namespace Mall.WebApi.Controllers.AppletWeChat
commissionInfo += ("[" + itemCommi.GradeDescription + ":" + itemCommi.Commission + itemCommi.UserName + "]"); commissionInfo += ("[" + itemCommi.GradeDescription + ":" + itemCommi.Commission + itemCommi.UserName + "]");
} }
} }
if (item.LiveCommission > 0)
{
commissionInfo += (",[主播佣金:" + item.LiveCommission + "]");
}
// commissionInfo = string.Join(",", item.OrderCommissionList.Select(x=>"["+ x.GradeDescription+x.UserName+x.Commission+x.CommissionState==1?"待返":"已返")); // commissionInfo = string.Join(",", item.OrderCommissionList.Select(x=>"["+ x.GradeDescription+x.UserName+x.Commission+x.CommissionState==1?"待返":"已返"));
} }
datarow.ExcelRows.Add(new ExcelColumn(value: commissionInfo) { });//返佣信息 datarow.ExcelRows.Add(new ExcelColumn(value: commissionInfo) { });//返佣信息
datarow.ExcelRows.Add(new ExcelColumn(value: item.OtherPrice.ToString("#0.00")) { }); datarow.ExcelRows.Add(new ExcelColumn(value: item.OtherPrice.ToString("#0.00")) { });
// datarow.ExcelRows.Add(new ExcelColumn(value: item.ALLCommission.ToString("#0.00")) { }); // datarow.ExcelRows.Add(new ExcelColumn(value: item.ALLCommission.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.Paid.ToString("#0.00")) { }); datarow.ExcelRows.Add(new ExcelColumn(value: item.Paid.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.NoPaid.ToString("#0.00")) { }); datarow.ExcelRows.Add(new ExcelColumn(value: item.NoPaid.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.GrossProfit.ToString("#0.00")) { }); datarow.ExcelRows.Add(new ExcelColumn(value: item.GrossProfit.ToString("#0.00")) { });
......
...@@ -236,6 +236,9 @@ namespace Mall.WebApi.Controllers.User ...@@ -236,6 +236,9 @@ namespace Mall.WebApi.Controllers.User
var parms = JObject.Parse(re.msg.ToString()); var parms = JObject.Parse(re.msg.ToString());
int RemitId = parms.GetInt("RemitId", 0); int RemitId = parms.GetInt("RemitId", 0);
int ErpEmpId = parms.GetInt("ErpEmpId", 0);//erp用户id int ErpEmpId = parms.GetInt("ErpEmpId", 0);//erp用户id
if (ErpEmpId <= 0) {
ErpEmpId = re.ERPEmpId;
}
int Type = parms.GetInt("Type", 0);//1审核通过 2打款 3驳回 int Type = parms.GetInt("Type", 0);//1审核通过 2打款 3驳回
string Remark = parms.GetStringValue("Remark"); string Remark = parms.GetStringValue("Remark");
if (RemitId <= 0) if (RemitId <= 0)
......
...@@ -1873,6 +1873,9 @@ namespace Mall.WebApi.Controllers.User ...@@ -1873,6 +1873,9 @@ namespace Mall.WebApi.Controllers.User
var parms = JObject.Parse(re.msg.ToString()); var parms = JObject.Parse(re.msg.ToString());
int RemitId = parms.GetInt("RemitId", 0); int RemitId = parms.GetInt("RemitId", 0);
int ErpEmpId = parms.GetInt("ErpEmpId", 0);//erp用户id int ErpEmpId = parms.GetInt("ErpEmpId", 0);//erp用户id
if (ErpEmpId <= 0) {
ErpEmpId = re.ERPEmpId;
}
int Type = parms.GetInt("Type", 0);//1审核通过 2打款 3驳回 int Type = parms.GetInt("Type", 0);//1审核通过 2打款 3驳回
string Remark = parms.GetStringValue("Remark"); string Remark = parms.GetStringValue("Remark");
if (RemitId <= 0) if (RemitId <= 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment