Commit 440cc985 authored by liudong1993's avatar liudong1993
parents d44a24cb 55fc26d9
...@@ -39,6 +39,12 @@ namespace Mall.Common ...@@ -39,6 +39,12 @@ namespace Mall.Common
/// </summary> /// </summary>
public int SmallShopId { get; set; } public int SmallShopId { get; set; }
/// <summary>
/// 用户所属店铺id
/// </summary>
public int UserSmallShopId { get; set; }
/// <summary> /// <summary>
/// 唯一码 /// 唯一码
/// </summary> /// </summary>
......
...@@ -265,5 +265,10 @@ namespace Mall.Model.Query ...@@ -265,5 +265,10 @@ namespace Mall.Model.Query
/// </summary> /// </summary>
public string LiveFinanceIds { get; set; } public string LiveFinanceIds { get; set; }
/// <summary>
/// 主播数量
/// </summary>
public int LivePeopleNum { get; set; }
} }
} }
...@@ -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,b.LiveCommission,b.LiveFinanceIds,0 as Paid 0 as OtherPrice,e.FXCommission,f.RemitFXCommission,b.LiveCommission,b.LiveFinanceIds,b.LivePeopleNum,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
...@@ -1374,7 +1374,7 @@ GROUP BY b.Id order by b.Id desc"; ...@@ -1374,7 +1374,7 @@ GROUP BY b.Id order by b.Id desc";
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,b.LivePeopleNum,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
......
...@@ -396,7 +396,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -396,7 +396,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
if (item.LiveCommission > 0) if (item.LiveCommission > 0)
{ {
commissionInfo += (",[主播佣金:" + item.LiveCommission + "]"); commissionInfo += (",[" + item.LivePeopleNum + "位主播佣金:" + 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?"待返":"已返"));
} }
...@@ -485,10 +485,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -485,10 +485,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.FXCommission + item.OtherPrice; item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.FXCommission+item.LiveCommission + 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.OneCommission + item.TwoCommission + 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);
} }
......
...@@ -1081,10 +1081,9 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1081,10 +1081,9 @@ namespace Mall.WebApi.Controllers.MallBase
if (orderDetailsList != null && orderDetailsList.Any(x => !string.IsNullOrWhiteSpace(x.LiveFinanceIds))) if (orderDetailsList != null && orderDetailsList.Any(x => !string.IsNullOrWhiteSpace(x.LiveFinanceIds)))
{ {
return ApiResult.ParamIsNull("选中的订单部分已制单,不能修改"); return ApiResult.ParamIsNull("部分订单已制单,不能修改");
} }
bool flag = orderModule.UpdateOrderDetailLive(Type, LivePeopleNum, LiveCommission, orderDetailsList, req.TenantId, req.MallBaseId); bool flag = orderModule.UpdateOrderDetailLive(Type, LivePeopleNum, LiveCommission, orderDetailsList, req.TenantId, req.MallBaseId);
if (flag) if (flag)
{ {
...@@ -1144,21 +1143,25 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1144,21 +1143,25 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult SetLiveGoodsOrderFinance() { public ApiResult SetLiveGoodsOrderFinance()
{
var req = RequestParm; var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString()); JObject parms = JObject.Parse(req.msg.ToString());
int IsPublic = parms.GetInt("IsPublic", 0);//账户类型 int IsPublic = parms.GetInt("IsPublic", 0);//账户类型
int ErpEmpId = parms.GetInt("ErpEmpId", 0); int ErpEmpId = parms.GetInt("ErpEmpId", 0);
string LiveTime = parms.GetStringValue("LiveTime");//直播时间 string LiveTime = parms.GetStringValue("LiveTime");//直播时间
if (ErpEmpId <= 0) { if (ErpEmpId <= 0)
{
ErpEmpId = req.ERPEmpId; ErpEmpId = req.ERPEmpId;
} }
string AccountIds = parms.GetStringValue("AccountIds");//账户ids string AccountIds = parms.GetStringValue("AccountIds");//账户ids
string OrderDetailIds = parms.GetStringValue("OrderDetailIds");//订单明细ids string OrderDetailIds = parms.GetStringValue("OrderDetailIds");//订单明细ids
if (string.IsNullOrEmpty(AccountIds)) { if (string.IsNullOrEmpty(AccountIds))
{
return ApiResult.ParamIsNull("账户不存在"); return ApiResult.ParamIsNull("账户不存在");
} }
if (string.IsNullOrEmpty(OrderDetailIds)) { if (string.IsNullOrEmpty(OrderDetailIds))
{
return ApiResult.ParamIsNull("订单明细不存在"); return ApiResult.ParamIsNull("订单明细不存在");
} }
List<int> AccountIdList; List<int> AccountIdList;
...@@ -1180,10 +1183,12 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1180,10 +1183,12 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
return ApiResult.ParamIsNull("订单明细格式有误"); return ApiResult.ParamIsNull("订单明细格式有误");
} }
if (!AccountIdList.Any()) { if (!AccountIdList.Any())
{
return ApiResult.ParamIsNull("请选择账户"); return ApiResult.ParamIsNull("请选择账户");
} }
if (!OrderdetailIdList.Any()) { if (!OrderdetailIdList.Any())
{
return ApiResult.ParamIsNull("请选择订单列表"); return ApiResult.ParamIsNull("请选择订单列表");
} }
...@@ -1192,7 +1197,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1192,7 +1197,8 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed(msg); return ApiResult.Failed(msg);
} }
} }
......
...@@ -176,7 +176,8 @@ namespace Mall.WebApi.Controllers.User ...@@ -176,7 +176,8 @@ namespace Mall.WebApi.Controllers.User
SecretKey = demodel.SecretKey, SecretKey = demodel.SecretKey,
SuperiorId = demodel.SuperiorId ?? 0, SuperiorId = demodel.SuperiorId ?? 0,
Token = token, Token = token,
SmallShopId = 0 SmallShopId = 0,
UserSmallShopId= demodel.SmallShopId
}; };
UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, appletUserInfo, Config.JwtExpirTime); UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, appletUserInfo, Config.JwtExpirTime);
if (couponResult != null && couponResult.ID > 0) if (couponResult != null && couponResult.ID > 0)
...@@ -240,7 +241,8 @@ namespace Mall.WebApi.Controllers.User ...@@ -240,7 +241,8 @@ namespace Mall.WebApi.Controllers.User
SecretKey = umodel.SecretKey, SecretKey = umodel.SecretKey,
SuperiorId = umodel.SuperiorId ?? 0, SuperiorId = umodel.SuperiorId ?? 0,
Token = token, Token = token,
SmallShopId =(smallShopsInfoModle != null && smallShopsInfoModle.AuditStatus == DistributorAuditStatusEnum.Audited) ? smallShopsInfoModle.Id : 0 SmallShopId =(smallShopsInfoModle != null && smallShopsInfoModle.AuditStatus == DistributorAuditStatusEnum.Audited) ? smallShopsInfoModle.Id : 0,
UserSmallShopId = demodel.SmallShopId
}; };
UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + umodel.Id, appletUserInfo, Config.JwtExpirTime); UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + umodel.Id, appletUserInfo, Config.JwtExpirTime);
return ApiResult.CouponSuccess(ResultCode.Fail, "", "", appletUserInfo); return ApiResult.CouponSuccess(ResultCode.Fail, "", "", appletUserInfo);
......
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