Commit 476aceba authored by 吴春's avatar 吴春

提交代码

parent 36ec6b1f
...@@ -54,6 +54,13 @@ namespace Mall.Model.Entity.AppletWeChat ...@@ -54,6 +54,13 @@ namespace Mall.Model.Entity.AppletWeChat
/// </summary> /// </summary>
public string start_time { get; set; } public string start_time { get; set; }
/// <summary>
/// 直播计划开始时间
/// </summary>
public DateTime? LiveTime { get; set; }
/// <summary> /// <summary>
/// 直播计划结束时间 /// 直播计划结束时间
/// </summary> /// </summary>
......
...@@ -266,5 +266,16 @@ namespace Mall.Model.Entity.Product ...@@ -266,5 +266,16 @@ namespace Mall.Model.Entity.Product
/// 其他实付金额 /// 其他实付金额
/// </summary> /// </summary>
public decimal? PayMoney { get; set; } public decimal? PayMoney { get; set; }
/// <summary>
/// 公司id
/// </summary>
public int CompanyId { get; set; }
/// <summary>
/// 公司毛利比例
/// </summary>
public decimal CompanyProfitRate { get; set; }
} }
} }
...@@ -208,5 +208,11 @@ namespace Mall.Model.Entity.User ...@@ -208,5 +208,11 @@ namespace Mall.Model.Entity.User
public DateTime? BeDownlineDate { get; set; } public DateTime? BeDownlineDate { get; set; }
public int SmallShopId { get; set; } public int SmallShopId { get; set; }
/// <summary>
/// 公司毛利利润比例
/// </summary>
public decimal CompanyProfitRate { get; set; }
} }
} }
...@@ -83,5 +83,11 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -83,5 +83,11 @@ namespace Mall.Model.Extend.MarketingCenter
/// 领劵中心领取 /// 领劵中心领取
/// </summary> /// </summary>
public new int GetType { get; set; } public new int GetType { get; set; }
/// <summary>
/// 微店名称
/// </summary>
public string SmallShopName { get; set; }
} }
} }
...@@ -270,5 +270,51 @@ namespace Mall.Model.Query ...@@ -270,5 +270,51 @@ namespace Mall.Model.Query
/// </summary> /// </summary>
public int LivePeopleNum { get; set; } public int LivePeopleNum { get; set; }
/// <summary>
/// 其他应收金额
/// </summary>
public decimal YSMoney { get; set; }
/// <summary>
/// 其他实收金额
/// </summary>
public decimal RealMoney { get; set; }
/// <summary>
/// 其他应付金额
/// </summary>
public decimal YFMoney { get; set; }
/// <summary>
/// 其他实付金额
/// </summary>
public decimal PayMoney { get; set; }
/// <summary>
/// 订单优惠金额
/// </summary>
public decimal CouponMoney { get; set; }
/// <summary>
/// 实际退款金额
/// </summary>
public decimal RefundActual { get; set; }
/// <summary>
/// 公司毛利返利
/// </summary>
public decimal CompanyProfitRate { get; set; }
/// <summary>
/// 订单所属公司
/// </summary>
public int CompanyId { get; set; }
/// <summary>
/// 订单所属公司
/// </summary>
public string CompanyName { get; set; }
} }
} }
...@@ -1782,6 +1782,7 @@ namespace Mall.Module.User ...@@ -1782,6 +1782,7 @@ namespace Mall.Module.User
newLiveHouse.room_info.ForEach(x => x.TenantId = model.TenantId ?? 0); newLiveHouse.room_info.ForEach(x => x.TenantId = model.TenantId ?? 0);
newLiveHouse.room_info.ForEach(x => x.MallBaseId = model.MallBaseId); newLiveHouse.room_info.ForEach(x => x.MallBaseId = model.MallBaseId);
newLiveHouse.room_info.ForEach(x => x.CreateDate = System.DateTime.Now); newLiveHouse.room_info.ForEach(x => x.CreateDate = System.DateTime.Now);
AddLiveHouse(newLiveHouse.room_info, new Model.Entity.AppletWeChat.RB_Live_House { TenantId = model.TenantId ?? 0, MallBaseId = model.MallBaseId }); AddLiveHouse(newLiveHouse.room_info, new Model.Entity.AppletWeChat.RB_Live_House { TenantId = model.TenantId ?? 0, MallBaseId = model.MallBaseId });
return true; return true;
} }
...@@ -1793,6 +1794,25 @@ namespace Mall.Module.User ...@@ -1793,6 +1794,25 @@ namespace Mall.Module.User
return false; return false;
} }
/// <summary>
/// 时间戳转为C#格式时间
/// </summary>
/// <param name="timeStamp">Unix时间戳格式</param>
/// <returns>C#格式时间</returns>
public static string GetTime(string timeStamp)
{
try
{
var start = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
var longTimeSpan = long.Parse(timeStamp + "0000000");
return start.AddMilliseconds(longTimeSpan).AddHours(8).ToString("yyyy-MM-dd HH:mm:ss");
}
catch (Exception)
{
return "";
}
}
public Model.Extend.AppletWeChat.PlayBack GetLiveReplayInfo(RB_MiniProgram_Extend model, int room_id) public Model.Extend.AppletWeChat.PlayBack GetLiveReplayInfo(RB_MiniProgram_Extend model, int room_id)
{ {
...@@ -1888,6 +1908,7 @@ namespace Mall.Module.User ...@@ -1888,6 +1908,7 @@ namespace Mall.Module.User
if (list != null && list.Any()) if (list != null && list.Any())
{ {
list.ForEach(x => x.LiveTime = Convert.ToDateTime(GetTime(x.start_time)));
liveHouseRepository.InsertBatch(list); liveHouseRepository.InsertBatch(list);
} }
return true; return true;
...@@ -2016,7 +2037,7 @@ namespace Mall.Module.User ...@@ -2016,7 +2037,7 @@ namespace Mall.Module.User
subList.Add(new MallSalesStatistics() subList.Add(new MallSalesStatistics()
{ {
TimeStr = i.ToString(), TimeStr = i.ToString(),
GoodCount = tempSubList?.Sum(qitem=>qitem.GoodCount) ?? 0, GoodCount = tempSubList?.Sum(qitem => qitem.GoodCount) ?? 0,
Income = tempSubList?.Sum(qitem => qitem.Income) ?? 0, Income = tempSubList?.Sum(qitem => qitem.Income) ?? 0,
OrderCount = tempSubList?.Sum(qitem => qitem.OrderCount) ?? 0, OrderCount = tempSubList?.Sum(qitem => qitem.OrderCount) ?? 0,
UserCount = tempSubList?.GroupBy(qitem => new { qitem.UserId }).Count() ?? 0, UserCount = tempSubList?.GroupBy(qitem => new { qitem.UserId }).Count() ?? 0,
...@@ -2035,7 +2056,7 @@ namespace Mall.Module.User ...@@ -2035,7 +2056,7 @@ namespace Mall.Module.User
GoodCount = tempSubList?.Sum(qitem => qitem.GoodCount) ?? 0, GoodCount = tempSubList?.Sum(qitem => qitem.GoodCount) ?? 0,
Income = tempSubList?.Sum(qitem => qitem.Income) ?? 0, Income = tempSubList?.Sum(qitem => qitem.Income) ?? 0,
OrderCount = tempSubList?.Sum(qitem => qitem.OrderCount) ?? 0, OrderCount = tempSubList?.Sum(qitem => qitem.OrderCount) ?? 0,
UserCount = tempSubList?.GroupBy(qitem=>new { qitem.UserId}).Count() ?? 0, UserCount = tempSubList?.GroupBy(qitem => new { qitem.UserId }).Count() ?? 0,
}); });
} }
} }
...@@ -2047,7 +2068,7 @@ namespace Mall.Module.User ...@@ -2047,7 +2068,7 @@ namespace Mall.Module.User
Income = list?.Sum(qitem => qitem.Income) ?? 0, Income = list?.Sum(qitem => qitem.Income) ?? 0,
//支付人数 //支付人数
UserCount = list?.GroupBy(qitem=>new { qitem.UserId}).Count() ?? 0, UserCount = list?.GroupBy(qitem => new { qitem.UserId }).Count() ?? 0,
//支付件数 //支付件数
GoodCount = list?.Sum(qitem => qitem.GoodCount) ?? 0, GoodCount = list?.Sum(qitem => qitem.GoodCount) ?? 0,
subList, subList,
......
...@@ -95,7 +95,7 @@ namespace Mall.Module.User ...@@ -95,7 +95,7 @@ namespace Mall.Module.User
/// <summary> /// <summary>
/// 可简化 /// 可简化
/// </summary> /// </summary>
private readonly RB_SmallShops_RemitRepository smallShopsRemitRepository = new RB_SmallShops_RemitRepository(); private readonly RB_SmallShops_RemitRepository smallShopsRemitRepository = new RB_SmallShops_RemitRepository();
...@@ -151,6 +151,21 @@ namespace Mall.Module.User ...@@ -151,6 +151,21 @@ namespace Mall.Module.User
return model; return model;
} }
/// <summary>
/// 根据用户id 获取微店信息
/// </summary>
/// <param name="UserId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public List<RB_SmallShops_Info_Extend> GetSmallShopsInfoList_V2(RB_SmallShops_Info_Extend model)
{
return smallShops_InfoRepository.GetListForSingle(model);
}
/// <summary> /// <summary>
/// 微店审核 /// 微店审核
/// </summary> /// </summary>
...@@ -175,7 +190,8 @@ namespace Mall.Module.User ...@@ -175,7 +190,8 @@ namespace Mall.Module.User
{ {
keyValues.Add(nameof(RB_SmallShops_Info.Remark), ssmodel.Remark); keyValues.Add(nameof(RB_SmallShops_Info.Remark), ssmodel.Remark);
} }
else if (type == 4) { else if (type == 4)
{
keyValues.Add(nameof(RB_SmallShops_Info.Status), 1); keyValues.Add(nameof(RB_SmallShops_Info.Status), 1);
} }
else else
...@@ -470,7 +486,8 @@ namespace Mall.Module.User ...@@ -470,7 +486,8 @@ namespace Mall.Module.User
/// </summary> /// </summary>
/// <param name="RemitId"></param> /// <param name="RemitId"></param>
/// <returns></returns> /// <returns></returns>
public RB_SmallShops_Remit_Extend GetSmallShopsRemitInfo(int RemitId) { public RB_SmallShops_Remit_Extend GetSmallShopsRemitInfo(int RemitId)
{
return smallShops_RemitRepository.GetEntity<RB_SmallShops_Remit_Extend>(RemitId); return smallShops_RemitRepository.GetEntity<RB_SmallShops_Remit_Extend>(RemitId);
} }
...@@ -712,7 +729,7 @@ namespace Mall.Module.User ...@@ -712,7 +729,7 @@ namespace Mall.Module.User
}; };
string apiResult = Mall.Common.Plugin.HttpHelper.HttpPost(Config.PaymentFinanceApi, JsonHelper.Serialize(resultInfo), ""); string apiResult = Mall.Common.Plugin.HttpHelper.HttpPost(Config.PaymentFinanceApi, JsonHelper.Serialize(resultInfo), "");
var apir = JsonConvert.DeserializeObject<ApiResult>(apiResult); var apir = JsonConvert.DeserializeObject<ApiResult>(apiResult);
if (apir.resultCode == 1) if (apir.resultCode == 1)
{ {
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
...@@ -774,6 +791,19 @@ namespace Mall.Module.User ...@@ -774,6 +791,19 @@ namespace Mall.Module.User
}; };
return smallShops_RemitRepository.Update(keyValues, wheres); return smallShops_RemitRepository.Update(keyValues, wheres);
} }
/// <summary>
/// 分销提现列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_SmallShops_Remit_Extend> GetSmallShopsRemitList(RB_SmallShops_Remit_Extend demodel)
{
return smallShops_RemitRepository.GetSmallShopsRemitList(demodel);
}
#endregion #endregion
#region 微店小程序 #region 微店小程序
...@@ -1189,7 +1219,7 @@ namespace Mall.Module.User ...@@ -1189,7 +1219,7 @@ namespace Mall.Module.User
var OModel = smallShopsCustomRepository.GetSmallShopsCustomList(new RB_SmallShops_Custom() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault(); var OModel = smallShopsCustomRepository.GetSmallShopsCustomList(new RB_SmallShops_Custom() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
if (OModel != null) if (OModel != null)
{ {
Dictionary<string, object> keyValuePairs = new Dictionary<string, object>() { Dictionary<string, object> keyValuePairs = new Dictionary<string, object>() {
{ nameof(RB_SmallShops_Custom.HeadBackImage),demodel.HeadBackImage}, { nameof(RB_SmallShops_Custom.HeadBackImage),demodel.HeadBackImage},
{ nameof(RB_SmallShops_Custom.WithdrawalFilletPX),demodel.WithdrawalFilletPX}, { nameof(RB_SmallShops_Custom.WithdrawalFilletPX),demodel.WithdrawalFilletPX},
......
...@@ -87,7 +87,7 @@ namespace Mall.Repository.AppletWeChat ...@@ -87,7 +87,7 @@ namespace Mall.Repository.AppletWeChat
builder.Append($" AND a.{nameof(RB_Live_HouseExtension_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND a.{nameof(RB_Live_HouseExtension_Extend.MallBaseId)}={query.MallBaseId}");
} }
} }
builder.Append($" order by a.{nameof(RB_Live_HouseExtension_Extend.ID)} asc"); builder.Append($" order by a.{nameof(RB_Live_HouseExtension_Extend.LiveTime)} desc");
return GetPage<RB_Live_HouseExtension_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList(); return GetPage<RB_Live_HouseExtension_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
} }
} }
......
...@@ -32,23 +32,23 @@ namespace Mall.Repository.MarketingCenter ...@@ -32,23 +32,23 @@ namespace Mall.Repository.MarketingCenter
public List<RB_DiscountCoupon_Extend> GetDiscountCouponPageList(int pageIndex, int pageSize, out long rowCount, RB_DiscountCoupon_Extend query) public List<RB_DiscountCoupon_Extend> GetDiscountCouponPageList(int pageIndex, int pageSize, out long rowCount, RB_DiscountCoupon_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_DiscountCoupon_Extend.Status)}=0"); builder.Append($" SELECT a.*,b.`Name` as SmallShopName FROM {TableName} as A LEFT JOIN rb_smallshops_info as b on a.SmallShopId=b.Id WHERE a.{nameof(RB_DiscountCoupon_Extend.Status)}=0");
if (query != null) if (query != null)
{ {
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND {nameof(RB_DiscountCoupon_Extend.TenantId)}={query.TenantId}"); builder.Append($" AND a.{nameof(RB_DiscountCoupon_Extend.TenantId)}={query.TenantId}");
} }
if (query.TenantId > 0) if (query.TenantId > 0)
{ {
builder.Append($" AND {nameof(RB_DiscountCoupon_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND a.{nameof(RB_DiscountCoupon_Extend.MallBaseId)}={query.MallBaseId}");
} }
if (!string.IsNullOrWhiteSpace(query.Name)) if (!string.IsNullOrWhiteSpace(query.Name))
{ {
builder.Append($" AND {nameof(RB_DiscountCoupon_Extend.Name)} like '%{query.Name}%'"); builder.Append($" AND a.{nameof(RB_DiscountCoupon_Extend.Name)} like '%{query.Name}%'");
} }
} }
builder.Append($" order by {nameof(RB_DiscountCoupon_Extend.ID)} desc"); builder.Append($" order by a.{nameof(RB_DiscountCoupon_Extend.ID)} desc");
return GetPage<RB_DiscountCoupon_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList(); return GetPage<RB_DiscountCoupon_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
} }
......
...@@ -1276,6 +1276,10 @@ GROUP BY od.GoodsId,o.OrderId ...@@ -1276,6 +1276,10 @@ GROUP BY od.GoodsId,o.OrderId
{ {
where += $" and b.GoodsId={dmodel.GoodsID} "; where += $" and b.GoodsId={dmodel.GoodsID} ";
} }
if (dmodel.CompanyId > 0)
{
where += $" and b.CompanyId={dmodel.CompanyId} ";
}
if (!string.IsNullOrWhiteSpace(dmodel.StartDate)) if (!string.IsNullOrWhiteSpace(dmodel.StartDate))
{ {
...@@ -1304,10 +1308,11 @@ GROUP BY od.GoodsId,o.OrderId ...@@ -1304,10 +1308,11 @@ 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,b.LiveCommission,b.LiveFinanceIds,b.LivePeopleNum,0 as Paid 0 as OtherPrice,b.LiveCommission,b.LiveFinanceIds,b.LivePeopleNum,0 as Paid,oa.RefundActual,b.CouponMoney,b.CompanyProfitRate,b.CompanyId,muser.`Name` as CompanyName,b.YSMoney,b.RealMoney,b.YFMoney,b.PayMoney
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
LEFT JOIN rb_member_user as muser on muser.id=b.CompanyId
left join rb_goods_orderaftersale oa on b.ID= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5) {where} left join rb_goods_orderaftersale oa on b.ID= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5) {where}
GROUP BY b.Id order by b.Id desc"; GROUP BY b.Id order by b.Id desc";
...@@ -1375,10 +1380,11 @@ GROUP BY b.Id order by b.Id desc"; ...@@ -1375,10 +1380,11 @@ 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,b.LiveCommission,b.LiveFinanceIds,b.LivePeopleNum,0 as Paid 0 as OtherPrice,b.LiveCommission,b.LiveFinanceIds,b.LivePeopleNum,0 as Paid,oa.RefundActual,b.CouponMoney,b.CompanyProfitRate,b.CompanyId,muser.`Name` as CompanyName,b.YSMoney,b.RealMoney,b.YFMoney,b.PayMoney
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
LEFT JOIN rb_member_user as muser on muser.id=b.CompanyId
left join rb_goods_orderaftersale oa on b.ID= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5) {where} left join rb_goods_orderaftersale oa on b.ID= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5) {where}
GROUP BY b.Id "; GROUP BY b.Id ";
......
...@@ -80,7 +80,7 @@ where {where} order by r.Id desc"; ...@@ -80,7 +80,7 @@ where {where} order by r.Id desc";
/// </summary> /// </summary>
/// <param name="dmodel"></param> /// <param name="dmodel"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_SmallShops_Remit_Extend> GetDistributorRemitList(RB_SmallShops_Remit_Extend dmodel) public List<RB_SmallShops_Remit_Extend> GetSmallShopsRemitList(RB_SmallShops_Remit_Extend dmodel)
{ {
string where = $@" 1=1 "; string where = $@" 1=1 ";
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
......
...@@ -148,7 +148,6 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -148,7 +148,6 @@ namespace Mall.WebApi.Controllers.AppletWeChat
{ {
// 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.LiveCommission + 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.NoPaid = item.ALLCommission;
item.Paid = item.PaidCostMoney + item.RemitFXCommission + (!string.IsNullOrWhiteSpace(item.LiveFinanceIds) ? item.LiveCommission : 0); 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;
...@@ -326,7 +325,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -326,7 +325,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat
new ExcelColumn(value: "其他") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER }, new ExcelColumn(value: "其他") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "已付") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER }, new ExcelColumn(value: "已付") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "应付") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER }, new ExcelColumn(value: "应付") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "退款金额") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "实际收入") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "实际支出") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "毛利") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER }, new ExcelColumn(value: "毛利") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "分公司名称") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "分公司结算") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "毛利率") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER } new ExcelColumn(value: "毛利率") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER }
}, },
}; };
...@@ -405,7 +409,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -405,7 +409,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat
// 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.RefundActual.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.RealMoney.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.PayMoney.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")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.CompanyName) { });
datarow.ExcelRows.Add(new ExcelColumn(value: Math.Round((item.GrossProfit*item.CompanyProfitRate), 2, MidpointRounding.AwayFromZero).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.GrossProfitRate.ToString("#0.00")) { }); datarow.ExcelRows.Add(new ExcelColumn(value: item.GrossProfitRate.ToString("#0.00")) { });
slist.Add(datarow); slist.Add(datarow);
} }
...@@ -485,7 +494,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -485,7 +494,7 @@ 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.LiveCommission + 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 + (!string.IsNullOrWhiteSpace(item.LiveFinanceIds) ? item.LiveCommission : 0); item.Paid = item.PaidCostMoney + item.RemitFXCommission + (!string.IsNullOrWhiteSpace(item.LiveFinanceIds) ? item.LiveCommission : 0);
......
...@@ -204,7 +204,9 @@ namespace Mall.WebApi.Controllers.MarketingCenter ...@@ -204,7 +204,9 @@ namespace Mall.WebApi.Controllers.MarketingCenter
EndDate = x.EndDate.HasValue ? x.EndDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", EndDate = x.EndDate.HasValue ? x.EndDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.TotalNum, x.TotalNum,
ResidueNum = x.ReceiveNum, ResidueNum = x.ReceiveNum,
x.PickupCenter x.PickupCenter,
x.SmallShopName,
x.SmallShopId
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
......
...@@ -1004,7 +1004,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -1004,7 +1004,7 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Failed("优惠券信息不存在,请核实后再操作"); return ApiResult.Failed("优惠券信息不存在,请核实后再操作");
} }
if (oldLogisticsModel.SmallShopId > 0 && oldLogisticsModel.SmallShopId != userInfo.SmallShopId) if (oldLogisticsModel.SmallShopId > 0 && oldLogisticsModel.SmallShopId != userInfo.UserSmallShopId)
{ {
return ApiResult.Failed("领取优惠券不属于当前店铺"); return ApiResult.Failed("领取优惠券不属于当前店铺");
} }
......
...@@ -101,6 +101,33 @@ namespace Mall.WebApi.Controllers.User ...@@ -101,6 +101,33 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
/// <summary>
/// 获取店铺下拉列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAllSmallShopsList()
{
var parms = RequestParm;
RB_SmallShops_Info_Extend demodel = JsonConvert.DeserializeObject<RB_SmallShops_Info_Extend>(parms.msg.ToString());
demodel.TenantId = Convert.ToInt32(parms.uid);
demodel.MallBaseId = parms.MallBaseId;
demodel.AuditStatus = DistributorAuditStatusEnum.Audited;
var list = smallShopsModule.GetSmallShopsInfoList_V2(demodel);
var result = list.Select(x => new
{
x.Id,
x.Name
});
return ApiResult.Success("", result);
}
/// <summary> /// <summary>
/// 获取店铺信息 /// 获取店铺信息
/// </summary> /// </summary>
...@@ -581,6 +608,100 @@ namespace Mall.WebApi.Controllers.User ...@@ -581,6 +608,100 @@ namespace Mall.WebApi.Controllers.User
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
/// <summary>
/// 分销提现信息下载
/// </summary>
[HttpPost]
public FileContentResult GetSmallShopsRemitListToExcel()
{
var parms = RequestParm;
RB_SmallShops_Remit_Extend demodel = JsonConvert.DeserializeObject<RB_SmallShops_Remit_Extend>(parms.msg.ToString());
string ExcelName = "提现列表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
List<ExcelDataSource> slist = new List<ExcelDataSource>();
if (demodel.ExcelEnumIds == null || !demodel.ExcelEnumIds.Any())
{
var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData1, "application/octet-stream", ExcelName);
}
var Enumlist = EnumHelper.GetEnumList(typeof(DistributorRemitExportEnum));
ExcelDataSource header = new ExcelDataSource()
{
ExcelRows = new List<ExcelColumn>(30) {
new ExcelColumn(value: "序号") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER }
}
};
foreach (var item in demodel.ExcelEnumIds)
{
var Name = Enumlist.Where(x => x.Value == item.ToString()).FirstOrDefault().Key ?? "";
header.ExcelRows.Add(new ExcelColumn(value: Name) { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER });
}
slist.Add(header);
try
{
demodel.TenantId = Convert.ToInt32(parms.uid);
demodel.MallBaseId = parms.MallBaseId;
var list = smallShopsModule.GetSmallShopsRemitList(demodel);
#region 组装数据
int Num = 0;
foreach (var item in list)
{
Num++;
ExcelDataSource datarow = new ExcelDataSource()
{
ExcelRows = new List<ExcelColumn>(30) {
new ExcelColumn(value:Num.ToString()){ },
}
};
foreach (var qitem in demodel.ExcelEnumIds)
{
switch (qitem)
{
case 1:
datarow.ExcelRows.Add(new ExcelColumn(value: item.Source.GetEnumName()) { }); break;
case 2:
datarow.ExcelRows.Add(new ExcelColumn(value: item.OrderNum ?? "") { }); break;
case 3:
datarow.ExcelRows.Add(new ExcelColumn(value: item.UserName ?? "") { }); break;
case 4:
datarow.ExcelRows.Add(new ExcelColumn(value: (item.AppliedMoney ?? 0).ToString()) { }); break;
case 5:
datarow.ExcelRows.Add(new ExcelColumn(value: item.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")) { }); break;
case 6:
datarow.ExcelRows.Add(new ExcelColumn(value: item.BankName ?? "") { }); break;
case 7:
datarow.ExcelRows.Add(new ExcelColumn(value: item.AccountNumber ?? "") { }); break;
case 8:
datarow.ExcelRows.Add(new ExcelColumn(value: item.AccountName ?? "") { }); break;
case 9:
datarow.ExcelRows.Add(new ExcelColumn(value: item.AuditStatus.GetEnumName()) { }); break;
case 10:
datarow.ExcelRows.Add(new ExcelColumn(value: item.WithdrawalWay.GetEnumName()) { }); break;
case 11:
datarow.ExcelRows.Add(new ExcelColumn(value: item.RemitDate.HasValue ? item.RemitDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "") { }); break;
}
}
slist.Add(datarow);
}
#endregion
var byteData = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData, "application/octet-stream", ExcelName);
}
catch (Exception ex)
{
LogHelper.Write(ex, string.Format("GetFileFromWebApi_requestData: {0}", JsonHelper.Serialize(RequestParm)));
var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData1, "application/octet-stream", ExcelName);
}
}
#endregion #endregion
} }
} }
\ No newline at end of file
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