Commit 00a4b7c7 authored by liudong1993's avatar liudong1993
parents 3f2e3f5c 6cbcb0f9
...@@ -136,5 +136,15 @@ namespace Mall.Model.Extend.Product ...@@ -136,5 +136,15 @@ namespace Mall.Model.Extend.Product
/// 区域列表 /// 区域列表
/// </summary> /// </summary>
public List<RB_GroupBuy_Area_Extend> AreaList { get; set; } public List<RB_GroupBuy_Area_Extend> AreaList { get; set; }
/// <summary>
/// 运费名称
/// </summary>
public string FreightName { get; set; }
/// <summary>
/// 表单名称
/// </summary>
public string FormsName { get; set; }
} }
} }
...@@ -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>
......
...@@ -256,24 +256,73 @@ namespace Mall.Module.MarketingCenter ...@@ -256,24 +256,73 @@ namespace Mall.Module.MarketingCenter
} }
} }
subData.list.Add(new rubikDetailItem() try
{ {
w = w, var rubikModel = new rubikDetailItem()
h = h2, {
x = x, w = w,
y = y, h = h2,
link = links, x = x,
width = subItem["width"].ToString(), y = y,
height = subItem["height"].ToString(), link = links,
left = subItem["left"].ToString(), zIndex = zIndex,
top = subItem["top"].ToString(), width = "",
pic_url = Common.Config.GetFileUrl(subItem["pic_url"].ToString()) , height = "",
backgroundImage = subItem["backgroundImage"].ToString(), left = "",
backgroundRepeat = subItem["backgroundRepeat"].ToString(), top = "",
backgroundSize = subItem["backgroundSize"].ToString(), pic_url = "",
backgroundPosition = subItem["backgroundPosition"].ToString(), backgroundImage = "",
zIndex = zIndex backgroundRepeat = "",
}); ; backgroundSize = "",
backgroundPosition = "",
backgroundColor = ""
};
if (subItem["width"] != null && !string.IsNullOrWhiteSpace(subItem["width"].ToString()))
{
rubikModel.width = subItem["width"].ToString();
}
if (subItem["height"] != null && !string.IsNullOrWhiteSpace(subItem["height"].ToString()))
{
rubikModel.height = subItem["height"].ToString();
}
if (subItem["left"] != null && !string.IsNullOrWhiteSpace(subItem["left"].ToString()))
{
rubikModel.left = subItem["left"].ToString();
}
if (subItem["top"] != null && !string.IsNullOrWhiteSpace(subItem["top"].ToString()))
{
rubikModel.top = subItem["top"].ToString();
}
if (subItem["pic_url"] != null && !string.IsNullOrWhiteSpace(subItem["pic_url"].ToString()))
{
rubikModel.pic_url = Common.Config.GetFileUrl(subItem["pic_url"].ToString());
}
if (subItem["backgroundImage"] != null && !string.IsNullOrWhiteSpace(subItem["backgroundImage"].ToString()))
{
rubikModel.backgroundImage = Common.Config.GetFileUrl(subItem["backgroundImage"].ToString());
}
if (subItem["backgroundRepeat"] != null && !string.IsNullOrWhiteSpace(subItem["backgroundRepeat"].ToString()))
{
rubikModel.backgroundRepeat = subItem["backgroundRepeat"].ToString();
}
if (subItem["backgroundSize"] != null && !string.IsNullOrWhiteSpace(subItem["backgroundSize"].ToString()))
{
rubikModel.backgroundSize = subItem["backgroundSize"].ToString();
}
if (subItem["backgroundPosition"] != null && !string.IsNullOrWhiteSpace(subItem["backgroundPosition"].ToString()))
{
rubikModel.backgroundPosition = subItem["backgroundPosition"].ToString();
}
if (subItem["backgroundColor"] != null && !string.IsNullOrWhiteSpace(subItem["backgroundColor"].ToString()))
{
rubikModel.backgroundColor = subItem["backgroundColor"].ToString();
}
subData.list.Add(rubikModel);
}
catch
{
}
} }
} }
} }
......
using Mall.Model.Entity.Product; using Mall.Model.Entity.Product;
using Mall.Model.Extend.Product; using Mall.Model.Extend.Product;
using Mall.Repository.BaseSetUp;
using Mall.Repository.Product; using Mall.Repository.Product;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -58,6 +59,11 @@ namespace Mall.Module.Product ...@@ -58,6 +59,11 @@ namespace Mall.Module.Product
/// </summary> /// </summary>
private readonly RB_GroupBuy_AreaRepository groupbuy_AreaRepository = new RB_GroupBuy_AreaRepository(); private readonly RB_GroupBuy_AreaRepository groupbuy_AreaRepository = new RB_GroupBuy_AreaRepository();
/// <summary>
/// 运费
/// </summary>
private readonly RB_Logistics_RulesRepository logistics_RulesRepository = new RB_Logistics_RulesRepository();
/// <summary> /// <summary>
/// 根据查询条件获取地区信息 /// 根据查询条件获取地区信息
...@@ -354,6 +360,24 @@ namespace Mall.Module.Product ...@@ -354,6 +360,24 @@ namespace Mall.Module.Product
GoodsId = extModel.GoodId, GoodsId = extModel.GoodId,
}); });
} }
//运费
if (extModel.FreightId > 0)
{
extModel.FreightName = logistics_RulesRepository.GetEntity(extModel.FreightId)?.RulesName ?? "";
}
else
{
extModel.FreightName = "默认运费";
}
//表单
if (extModel.FormsId > 0)
{
extModel.FormsName = "未建表";
}
else
{
extModel.FormsName = "默认表单";
}
extModel.SpecificationList = specificationList; extModel.SpecificationList = specificationList;
extModel.SpecificationPriceList = specPriceList; extModel.SpecificationPriceList = specPriceList;
extModel.GroupList = groupStepList; extModel.GroupList = groupStepList;
......
...@@ -289,7 +289,8 @@ namespace Mall.Module.Product ...@@ -289,7 +289,8 @@ namespace Mall.Module.Product
count = 0; count = 0;
return new List<RB_Goods_ShoppingCart_Extend>(); return new List<RB_Goods_ShoppingCart_Extend>();
} }
if (demodel.SmallShopsId == 0) { if (demodel.SmallShopsId == 0)
{
demodel.SmallShopsId = umodel.SmallShopId; demodel.SmallShopsId = umodel.SmallShopId;
} }
var list = goods_ShoppingCartRepository.GetPageList(pageIndex, pageSize, out count, demodel); var list = goods_ShoppingCartRepository.GetPageList(pageIndex, pageSize, out count, demodel);
...@@ -1255,7 +1256,8 @@ namespace Mall.Module.Product ...@@ -1255,7 +1256,8 @@ namespace Mall.Module.Product
{ {
return ApiResult.Failed("用户不存在"); return ApiResult.Failed("用户不存在");
} }
if (demodel.SmallShopsId == 0) { if (demodel.SmallShopsId == 0)
{
demodel.SmallShopsId = umodel.SmallShopId; demodel.SmallShopsId = umodel.SmallShopId;
} }
//积分 //积分
...@@ -1549,7 +1551,7 @@ namespace Mall.Module.Product ...@@ -1549,7 +1551,7 @@ namespace Mall.Module.Product
{ {
if (smallModel.PriceType == 1) if (smallModel.PriceType == 1)
{ {
gmodel.SellingPrice += Math.Ceiling((gmodel.SellingPrice??0) * (smallModel.UpPrice ?? 0) / 100); gmodel.SellingPrice += Math.Ceiling((gmodel.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
} }
else if (smallModel.PriceType == 2) else if (smallModel.PriceType == 2)
{ {
...@@ -2634,7 +2636,8 @@ namespace Mall.Module.Product ...@@ -2634,7 +2636,8 @@ namespace Mall.Module.Product
{ {
return ApiResult.Failed("用户不存在"); return ApiResult.Failed("用户不存在");
} }
if (demodel.SmallShopsId == 0) { if (demodel.SmallShopsId == 0)
{
demodel.SmallShopsId = umodel.SmallShopId; demodel.SmallShopsId = umodel.SmallShopId;
} }
if (umodel.Blacklist == 1) if (umodel.Blacklist == 1)
...@@ -3279,7 +3282,8 @@ namespace Mall.Module.Product ...@@ -3279,7 +3282,8 @@ namespace Mall.Module.Product
item.CouponMoney = couponModel.CouponMoney; item.CouponMoney = couponModel.CouponMoney;
TotalMoney -= (item.CouponMoney ?? 0);//总价格需减去优惠券金额 TotalMoney -= (item.CouponMoney ?? 0);//总价格需减去优惠券金额
item.Final_Price -= (item.CouponMoney ?? 0); item.Final_Price -= (item.CouponMoney ?? 0);
if (IsCommissionCoupons) { if (IsCommissionCoupons)
{
//通用优惠券 //通用优惠券
item.SmallShopsCostPrice -= (item.CouponMoney ?? 0); item.SmallShopsCostPrice -= (item.CouponMoney ?? 0);
} }
...@@ -3634,7 +3638,8 @@ namespace Mall.Module.Product ...@@ -3634,7 +3638,8 @@ namespace Mall.Module.Product
} }
//任务执行返佣 失败查看日志,手动返佣(空闲可增加手动返佣接口) //任务执行返佣 失败查看日志,手动返佣(空闲可增加手动返佣接口)
if (demodel.User_Coupon_Id > 0 && demodel.CouponMoney > 0) { if (demodel.User_Coupon_Id > 0 && demodel.CouponMoney > 0)
{
demodel.CouponDestription = "使用" + (IsCommissionCoupons ? "通用" : "店铺") + "优惠券抵扣"; demodel.CouponDestription = "使用" + (IsCommissionCoupons ? "通用" : "店铺") + "优惠券抵扣";
} }
Task.Run(() => InsertOrderCommission(demodel, umodel, GoodsIds, OrderId)); Task.Run(() => InsertOrderCommission(demodel, umodel, GoodsIds, OrderId));
...@@ -8967,6 +8972,98 @@ namespace Mall.Module.Product ...@@ -8967,6 +8972,98 @@ namespace Mall.Module.Product
} }
/// <summary>
/// 更新订单直播人数和提成
/// </summary>
/// <param name="type">//1-更新人数和金额,2-更新人数,3-更新金额</param>
/// <param name="LivePeopleNum"></param>
/// <param name="LiveCommission"></param>
/// <param name="orderList"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public bool UpdateOrderDetailLive(int type, int LivePeopleNum, decimal LiveCommission, List<RB_Goods_OrderDetail_Extend> orderList, int tenantId, int mallBaseId)
{
Dictionary<string, object> keyValues;
if (type == 1)
{
keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail.LiveCommission),LiveCommission},
{ nameof(RB_Goods_OrderDetail.LivePeopleNum),LivePeopleNum}
};
}
else if (type == 2)
{
keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail.LivePeopleNum),LivePeopleNum}
};
}
else if (type == 3)
{
keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail.LiveCommission),LiveCommission},
};
}
else
{
return false;
}
bool flag = false;
var trans = goods_OrderDetailRepository.DbTransaction;
try
{
foreach (var item in orderList)
{
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderDetail.Id),
FiledValue=item.Id,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderDetail.TenantId),
FiledValue=tenantId,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderDetail.MallBaseId),
FiledValue=mallBaseId,
OperatorEnum=OperatorEnum.Equal
}
};
flag = goods_OrderDetailRepository.Update(keyValues, wheres1, trans);
if (flag)
{
//记录日志
goods_LogRepository.Insert(new RB_Goods_Log()
{
Content = "修改订单商品:" + item.GoodsName + ((type == 1 || type == 2) ? ("主播人数:" + LivePeopleNum + "原主播人数:" + item.LivePeopleNum) : "") + ((type == 1 || type == 3) ? ("主播返佣金额:" + LiveCommission + "原佣金:" + item.LiveCommission) : ""),
CreateDate = DateTime.Now,
Id = 0,
MallBaseId = mallBaseId,
SourceId = item.OrderId,
TenantId = tenantId,
Type = 1
},trans);
}
}
goods_OrderDetailRepository.DBSession.Commit();
}
catch (Exception ex)
{
LogHelper.Write(ex, "UpdateOrderDetailLive");
goods_OrderDetailRepository.DBSession.Rollback("UpdateOrderDetailLive");
return false;
}
return flag;
}
/// <summary> /// <summary>
/// 根据订单好获取物流id /// 根据订单好获取物流id
/// </summary> /// </summary>
...@@ -9165,9 +9262,11 @@ namespace Mall.Module.Product ...@@ -9165,9 +9262,11 @@ namespace Mall.Module.Product
#region 推荐返佣 #region 推荐返佣
List<RB_Goods_OrderIntroduction_Extend> OrderIntroduction = new List<RB_Goods_OrderIntroduction_Extend>(); List<RB_Goods_OrderIntroduction_Extend> OrderIntroduction = new List<RB_Goods_OrderIntroduction_Extend>();
var introductList = goods_OrderIntroductionRepository.GetList(new RB_Goods_OrderIntroduction_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId }); var introductList = goods_OrderIntroductionRepository.GetList(new RB_Goods_OrderIntroduction_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId });
if (introductList.Any()) { if (introductList.Any())
{
var ulist = member_UserRepository.GetList(new RB_Member_User_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, UserIds = string.Join(",", introductList.Select(x => x.UserId).Distinct()) }); var ulist = member_UserRepository.GetList(new RB_Member_User_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, UserIds = string.Join(",", introductList.Select(x => x.UserId).Distinct()) });
foreach (var item in ulist) { foreach (var item in ulist)
{
decimal Commission = introductList.Where(x => x.UserId == item.Id).Sum(x => x.Commission ?? 0); decimal Commission = introductList.Where(x => x.UserId == item.Id).Sum(x => x.Commission ?? 0);
OrderIntroduction.Add(new RB_Goods_OrderIntroduction_Extend() OrderIntroduction.Add(new RB_Goods_OrderIntroduction_Extend()
{ {
...@@ -9182,10 +9281,12 @@ namespace Mall.Module.Product ...@@ -9182,10 +9281,12 @@ namespace Mall.Module.Product
#region 微店返佣 #region 微店返佣
List<RB_SmallShops_Commission_Extend> SmallShopsCommission = new List<RB_SmallShops_Commission_Extend>(); List<RB_SmallShops_Commission_Extend> SmallShopsCommission = new List<RB_SmallShops_Commission_Extend>();
var ssList = smallShops_CommissionRepository.GetList(new RB_SmallShops_Commission_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId }); var ssList = smallShops_CommissionRepository.GetList(new RB_SmallShops_Commission_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId });
if (ssList.Any()) { if (ssList.Any())
{
var ulist = member_UserRepository.GetList(new RB_Member_User_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, UserIds = string.Join(",", introductList.Select(x => x.UserId).Distinct()) }); var ulist = member_UserRepository.GetList(new RB_Member_User_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, UserIds = string.Join(",", introductList.Select(x => x.UserId).Distinct()) });
var slist = smallShops_InfoRepository.GetListForSingle(new RB_SmallShops_Info_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, UserIds = string.Join(",", introductList.Select(x => x.UserId).Distinct()) }); var slist = smallShops_InfoRepository.GetListForSingle(new RB_SmallShops_Info_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, UserIds = string.Join(",", introductList.Select(x => x.UserId).Distinct()) });
foreach (var item in ulist) { foreach (var item in ulist)
{
decimal Commission = ssList.Where(x => x.UserId == item.Id).Sum(x => x.Commission ?? 0); decimal Commission = ssList.Where(x => x.UserId == item.Id).Sum(x => x.Commission ?? 0);
var smodel = slist.Where(x => x.UserId == item.Id).FirstOrDefault(); var smodel = slist.Where(x => x.UserId == item.Id).FirstOrDefault();
SmallShopsCommission.Add(new RB_SmallShops_Commission_Extend() SmallShopsCommission.Add(new RB_SmallShops_Commission_Extend()
...@@ -9270,13 +9371,13 @@ namespace Mall.Module.Product ...@@ -9270,13 +9371,13 @@ namespace Mall.Module.Product
x.UserName, x.UserName,
x.Commission x.Commission
}), }),
OrderIntroductionInfo = OrderIntroduction.Select(x=>new OrderIntroductionInfo = OrderIntroduction.Select(x => new
{ {
x.UserId, x.UserId,
x.UserName, x.UserName,
x.Commission x.Commission
}), }),
SmallShopsCommissionInfo = SmallShopsCommission.Select(x=>new SmallShopsCommissionInfo = SmallShopsCommission.Select(x => new
{ {
x.UserId, x.UserId,
x.UserName, x.UserName,
......
...@@ -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")) { });
......
...@@ -172,7 +172,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -172,7 +172,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
demodel.TenantId = Convert.ToInt32(parms.uid); demodel.TenantId = Convert.ToInt32(parms.uid);
demodel.MallBaseId = parms.MallBaseId; demodel.MallBaseId = parms.MallBaseId;
if (!(demodel.OrderStatus > 0)) if (!(demodel.OrderStatus > 0))
{ {
demodel.IsNotSelectCancel = 1; demodel.IsNotSelectCancel = 1;
} }
...@@ -895,7 +895,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -895,7 +895,7 @@ namespace Mall.WebApi.Controllers.MallBase
} }
else else
{ {
bool flag = orderModule.SetOrderApplyForCancelAudit(omodel, Type, Remark, "", req.TenantId, req.MallBaseId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, "","","",""); bool flag = orderModule.SetOrderApplyForCancelAudit(omodel, Type, Remark, "", req.TenantId, req.MallBaseId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, "", "", "", "");
if (flag) if (flag)
{ {
return ApiResult.Success(); return ApiResult.Success();
...@@ -1037,6 +1037,68 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1037,6 +1037,68 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Failed(); return ApiResult.Failed();
} }
} }
/// <summary>
/// 修改订单商品的主播信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult UpdateOrderDetailLive()
{
var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
string OrderIds = parms.GetStringValue("Ids");
int Type = parms.GetInt("Type", 0);//1-更新人数和金额,2-更新人数,3-更新金额
int LivePeopleNum = parms.GetInt("LivePeopleNum", 0);
decimal LiveCommission = parms.GetDecimal("LiveCommission");
if (string.IsNullOrWhiteSpace(OrderIds))
{
return ApiResult.ParamIsNull("请传递订单明细id");
}
if (Type < 0)
{
return ApiResult.ParamIsNull("请传递需要操作的类型");
}
if (Type == 1 || Type == 2)
{
if (LivePeopleNum <= 0)
{
return ApiResult.ParamIsNull("人数不能为0");
}
}
if (Type == 1 || Type == 3)
{
if (LiveCommission < 0)
{
return ApiResult.ParamIsNull("佣金不能小于0");
}
}
//根据订单ids判断是否已经制单
var orderDetailsList = orderModule.GetOrderDetailList(new RB_Goods_OrderDetail_Extend { OrderDetailIds = OrderIds, MallBaseId = req.MallBaseId, TenantId = req.TenantId });
if (orderDetailsList != null && orderDetailsList.Any(x => !string.IsNullOrWhiteSpace(x.LiveFinanceIds)))
{
return ApiResult.ParamIsNull("选中的订单部分已制单,不能修改");
}
bool flag = orderModule.UpdateOrderDetailLive(Type, LivePeopleNum, LiveCommission, orderDetailsList, req.TenantId, req.MallBaseId);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#endregion #endregion
#endregion #endregion
...@@ -1661,7 +1723,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1661,7 +1723,8 @@ namespace Mall.WebApi.Controllers.MallBase
}, },
ColumnHight = 30 ColumnHight = 30
}; };
for (var i = 0; i < QNum; i++) { for (var i = 0; i < QNum; i++)
{
datarow.ExcelRows.Add(new ExcelColumn(value: "") { }); datarow.ExcelRows.Add(new ExcelColumn(value: "") { });
} }
} }
...@@ -1674,7 +1737,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1674,7 +1737,8 @@ namespace Mall.WebApi.Controllers.MallBase
IsOCFirst = false; IsOCFirst = false;
} }
} }
else { else
{
datarow.ExcelRows.Add(new ExcelColumn(value: "") { }); datarow.ExcelRows.Add(new ExcelColumn(value: "") { });
datarow.ExcelRows.Add(new ExcelColumn(value: "") { }); datarow.ExcelRows.Add(new ExcelColumn(value: "") { });
datarow.ExcelRows.Add(new ExcelColumn(value: "") { }); datarow.ExcelRows.Add(new ExcelColumn(value: "") { });
...@@ -1749,7 +1813,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1749,7 +1813,7 @@ namespace Mall.WebApi.Controllers.MallBase
Name = y.OrderIntroduction?.Name ?? "", Name = y.OrderIntroduction?.Name ?? "",
Commission = y.OrderIntroduction?.Commission ?? 0, Commission = y.OrderIntroduction?.Commission ?? 0,
CommissionState = y.OrderIntroduction?.CommissionState ?? 1, CommissionState = y.OrderIntroduction?.CommissionState ?? 1,
Remark = y.OrderIntroduction?.Remark , Remark = y.OrderIntroduction?.Remark,
} }
}), }),
x.Consignee, x.Consignee,
...@@ -1914,12 +1978,14 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1914,12 +1978,14 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult SetRecommendOrdersCommission() { public ApiResult SetRecommendOrdersCommission()
{
var req = RequestParm; var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString()); JObject parms = JObject.Parse(req.msg.ToString());
int OrderDetailId = parms.GetInt("OrderDetailId", 0); int OrderDetailId = parms.GetInt("OrderDetailId", 0);
decimal Commission = parms.GetDecimal("Commission"); decimal Commission = parms.GetDecimal("Commission");
if (OrderDetailId <= 0) { if (OrderDetailId <= 0)
{
return ApiResult.ParamIsNull("请传递订单明细id"); return ApiResult.ParamIsNull("请传递订单明细id");
} }
...@@ -1928,7 +1994,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1928,7 +1994,8 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed(); return ApiResult.Failed();
} }
} }
...@@ -2118,7 +2185,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -2118,7 +2185,7 @@ namespace Mall.WebApi.Controllers.MallBase
if (item2.SmallShopsCommission != null) if (item2.SmallShopsCommission != null)
{ {
datarow.ExcelRows.Add(new ExcelColumn(value: item2.SmallShopsCommission.Name) { }); datarow.ExcelRows.Add(new ExcelColumn(value: item2.SmallShopsCommission.Name) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item2.SmallShopsCommission.UserName) { }); datarow.ExcelRows.Add(new ExcelColumn(value: item2.SmallShopsCommission.UserName) { });
datarow.ExcelRows.Add(new ExcelColumn(value: (item2.SmallShopsCommission.Commission ?? 0).ToString()) { }); datarow.ExcelRows.Add(new ExcelColumn(value: (item2.SmallShopsCommission.Commission ?? 0).ToString()) { });
slist.Add(datarow); slist.Add(datarow);
} }
...@@ -2190,7 +2257,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -2190,7 +2257,8 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.TenantId = parms.TenantId; demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId; demodel.MallBaseId = parms.MallBaseId;
if ((demodel.UserId ?? 0) <= 0) { if ((demodel.UserId ?? 0) <= 0)
{
return ApiResult.Failed("请选择用户id"); return ApiResult.Failed("请选择用户id");
} }
var list = orderModule.GetRecommendOrdersCommissionPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel); var list = orderModule.GetRecommendOrdersCommissionPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
...@@ -2198,7 +2266,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -2198,7 +2266,7 @@ namespace Mall.WebApi.Controllers.MallBase
pagelist.pageData = list.Select(y => new pagelist.pageData = list.Select(y => new
{ {
y.OrderId, y.OrderId,
y.OrderNo, y.OrderNo,
y.Id, y.Id,
y.CoverImage, y.CoverImage,
y.GoodsName, y.GoodsName,
......
...@@ -388,16 +388,15 @@ namespace Mall.WebApi.Controllers.User ...@@ -388,16 +388,15 @@ namespace Mall.WebApi.Controllers.User
decimal totalMonry = 0; decimal totalMonry = 0;
if (demodel.IsSelectAll == 0) if (demodel.IsSelectAll == 0)
{ {
totalMonry = result.Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)) + (x.FreightCostMoney ?? 0)); totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 2).Sum(x => x.FreightCostMoney ?? 0));
} }
else if (demodel.IsSelectAll == 1) else if (demodel.IsSelectAll == 1)
{ {
totalMonry = result.Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0))); totalMonry = result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)));
} }
else if (demodel.IsSelectAll == 2) else if (demodel.IsSelectAll == 2)
{ {
totalMonry = result.Sum(x => (x.FreightCostMoney ?? 0)); totalMonry = result.Where(x => x.FinanceType == 2).Sum(x => (x.FreightCostMoney ?? 0));
} }
var financeObj = new var financeObj = new
{ {
......
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