Commit bac80ab2 authored by liudong1993's avatar liudong1993
parents 01bbb2d0 d611c53d
......@@ -62,5 +62,10 @@ namespace Mall.Common.API
/// 员工编号【员工登录时使用】
/// </summary>
public int EmpId { get; set; }
/// <summary>
/// 小程序Id
/// </summary>
public string MiniAppId { get; set; }
}
}
......@@ -48,5 +48,10 @@ namespace Mall.Model.Entity.MarketingCenter
get;
set;
}
/// <summary>
/// 模板显示名称
/// </summary>
public string TemplateShowName { get; set; }
}
}
......@@ -175,5 +175,8 @@ namespace Mall.Model.Entity.Product
/// 运费
/// </summary>
public decimal? FreightMoney { get; set; }
}
}
......@@ -382,5 +382,19 @@ namespace Mall.Model.Entity.User
/// </summary>
public string MallHomeData { get; set; }
/// <summary>
/// 是否开启授权(1-开启)
/// </summary>
public int IsOpenAuth { get; set; }
/// <summary>
/// 授权图片
/// </summary>
public string AuthUrl { get; set; }
/// <summary>
/// 授权数据
/// </summary>
public string AuthData { get; set; }
}
}
......@@ -13,6 +13,11 @@ namespace Mall.Model.Extend.MarketingCenter
[DB(ConnectionName = "DefaultConnection")]
public class RB_Miniprogram_Template_Extend : Model.Entity.MarketingCenter.RB_Miniprogram_Template
{
/// <summary>
/// 自定义模板编号【查询使用】
/// </summary>
public string QIds { get; set; }
/// <summary>
/// 创建时间字符串
/// </summary>
......
......@@ -62,5 +62,9 @@ namespace Mall.Model.Extend.Product
/// 是否申请售后
/// </summary>
public int? IsApplyForAfterSale { get; set; }
}
}
......@@ -97,6 +97,62 @@ namespace Mall.Model.Extend.User
/// 小程序首页数据
/// </summary>
public List<HomeItem> HomeDataList { get; set; }
/// <summary>
/// 授权热区
/// </summary>
public List<AuthItem> AuthDataList { get; set; }
}
/// <summary>
/// 授权热区
/// </summary>
public class AuthItem
{
/// <summary>
/// 起点X坐标
/// </summary>
public int defaultX { get; set; }
/// <summary>
/// 起点Y坐标
/// </summary>
public int defaultY { get; set; }
/// <summary>
/// 热区高度
/// </summary>
public int height { get; set; }
/// <summary>
/// 是否关闭
/// </summary>
public bool is_close { get; set; }
/// <summary>
/// 距离左边位置
/// </summary>
public int left { get; set; }
/// <summary>
/// 链接
/// </summary>
public string link { get; set; }
/// <summary>
/// 取消或确认
/// </summary>
public string open_type { get; set; }
/// <summary>
/// 距离顶部距离
/// </summary>
public int top { get; set; }
/// <summary>
/// 宽度
/// </summary>
public int width { get; set; }
}
/// <summary>
......
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Query
{
/// <summary>
/// 订单统计
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class OrderStatistics_Query
{
public int TenantId { get; set; }
public int MallBaseId { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string GoodsName { get; set; }
/// <summary>
/// 商品id
/// </summary>
public int GoodsID { get; set; }
/// <summary>
/// 规格
/// </summary>
public string Specification { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal Unit_Price { get; set; }
/// <summary>
/// 数量
/// </summary>
public int Number { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string SupplierName { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public int SupplierId { get; set; }
/// <summary>
/// 结算款
/// </summary>
public decimal Final_Price { get; set; }
/// <summary>
/// 运费
/// </summary>
public string FreightMoney { get; set; }
/// <summary>
/// 合计
/// </summary>
public decimal AllPrice { get; set; }
/// <summary>
/// 采购成本
/// </summary>
public decimal CostMoney { get; set; }
/// <summary>
/// 包装费摊销
/// </summary>
public decimal PackingMoney { get; set; }
/// <summary>
/// 快递费
/// </summary>
public decimal CostFreight { get; set; }
/// <summary>
/// 商品运费
/// </summary>
public decimal GoodsFreight { get; set; }
/// <summary>
/// 一级返佣
/// </summary>
public decimal OneCommission { get; set; }
/// <summary>
/// 二级返佣
/// </summary>
public decimal TwoCommission { get; set; }
/// <summary>
/// 其他
/// </summary>
public decimal OtherPrice { get; set; }
/// <summary>
/// 营业(合计)
/// </summary>
public decimal ALLCommission { get; set; }
/// <summary>
/// 已付
/// </summary>
public decimal Paid { get; set; }
/// <summary>
/// 未付
/// </summary>
public decimal NoPaid { get; set; }
/// <summary>
/// 毛利
/// </summary>
public decimal GrossProfit { get; set; }
/// <summary>
/// 毛利率
/// </summary>
public decimal GrossProfitRate { get; set; }
}
}
......@@ -43,10 +43,29 @@ namespace Mall.Module.MarketingCenter
/// 小程序模板列表
/// </summary>
/// <param name="query">查询条件</param>
/// <param name="IsAnalyzePlus">是否解析插件</param>
/// <returns></returns>
public List<RB_Miniprogram_Template_Extend> GetMiniprogramTemplateListModule(RB_Miniprogram_Template_Extend query)
public List<RB_Miniprogram_Template_Extend> GetMiniprogramTemplateListModule(RB_Miniprogram_Template_Extend query,bool IsAnalyzePlus=false)
{
return miniprogram_TemplateRepository.GetMiniprogramTemplateListRepository(query);
var list= miniprogram_TemplateRepository.GetMiniprogramTemplateListRepository(query);
if (IsAnalyzePlus)
{
foreach (var item in list)
{
if (item.TemplateData != null && !string.IsNullOrEmpty(item.TemplateData))
{
item.ComponentDataList = JsonHelper.DeserializeObject<List<ComponentItem>>(item.TemplateData);
if (item.ComponentDataList != null && item.ComponentDataList.Count > 0)
{
foreach (var subItem in item.ComponentDataList)
{
AnalyzePlusModule(subItem);
}
}
}
}
}
return list;
}
/// <summary>
......@@ -95,48 +114,57 @@ namespace Mall.Module.MarketingCenter
{
foreach (var item in extModel.ComponentDataList)
{
switch (item.Id)
{
case "search": item.data = JsonHelper.DeserializeObject<searchItem>(item.data.ToString()); break;
case "nav": item.data = JsonHelper.DeserializeObject<navItem>(item.data.ToString()); break;
case "banner": item.data = JsonHelper.DeserializeObject<bannerItem>(item.data.ToString()); break;
case "notice": item.data = JsonHelper.DeserializeObject<noticeItem>(item.data.ToString()); break;
//专题
case "topic": item.data = JsonHelper.DeserializeObject<topicItem>(item.data.ToString()); break;
case "link": item.data = JsonHelper.DeserializeObject<linkItem>(item.data.ToString()); break;
case "rubik": item.data = JsonHelper.DeserializeObject<rubikItem>(item.data.ToString()); break;
case "video": item.data = JsonHelper.DeserializeObject<videoItem>(item.data.ToString()); break;
case "goods": item.data = JsonHelper.DeserializeObject<goodsItem>(item.data.ToString()); break;
case "store": item.data = JsonHelper.DeserializeObject<storeItem>(item.data.ToString()); break;
case "copyright": item.data = JsonHelper.DeserializeObject<copyrightItem>(item.data.ToString()); break;
case "check-in": item.data = JsonHelper.DeserializeObject<checkinItem>(item.data.ToString()); break;
case "user-info": item.data = JsonHelper.DeserializeObject<userinfoItem>(item.data.ToString()); break;
case "user-order": item.data = JsonHelper.DeserializeObject<userorderItem>(item.data.ToString()); break;
case "map": item.data = JsonHelper.DeserializeObject<mapItem>(item.data.ToString()); break;
case "mp-link": item.data = JsonHelper.DeserializeObject<mplinkItem>(item.data.ToString()); break;
case "image-text": item.data = JsonHelper.DeserializeObject<imagetextItem>(item.data.ToString()); break;
case "coupon": item.data = JsonHelper.DeserializeObject<couponItem>(item.data.ToString()); break;
case "timer": item.data = JsonHelper.DeserializeObject<timerItem>(item.data.ToString()); break;
case "pintuan": item.data = JsonHelper.DeserializeObject<pintuanItem>(item.data.ToString()); break;
case "booking": item.data = JsonHelper.DeserializeObject<bookingItem>(item.data.ToString()); break;
case "bargain": item.data = JsonHelper.DeserializeObject<bargainItem>(item.data.ToString()); break;
case "integral-mall": item.data = JsonHelper.DeserializeObject<integralmallItem>(item.data.ToString()); break;
case "lottery": item.data = JsonHelper.DeserializeObject<lotteryItem>(item.data.ToString()); break;
case "advance": item.data = JsonHelper.DeserializeObject<advanceItem>(item.data.ToString()); break;
case "vip-card": item.data = JsonHelper.DeserializeObject<vipcardItem>(item.data.ToString()); break;
case "live" :item.data = JsonHelper.DeserializeObject<liveItem>(item.data.ToString()); break;
case "empty": item.data = JsonHelper.DeserializeObject<emptyItem>(item.data.ToString()); break;
case "ad": item.data = JsonHelper.DeserializeObject<adItem>(item.data.ToString()); break;
case "modal": item.data = JsonHelper.DeserializeObject<modalItem>(item.data.ToString()); break;
case "quick-nav": item.data = JsonHelper.DeserializeObject<quicknavItem>(item.data.ToString()); break;
}
AnalyzePlusModule(item);
}
}
}
return extModel;
}
/// <summary>
/// 解析插件
/// </summary>
/// <param name="item"></param>
public void AnalyzePlusModule(ComponentItem item)
{
switch (item.Id)
{
case "search": item.data = JsonHelper.DeserializeObject<searchItem>(item.data.ToString()); break;
case "nav": item.data = JsonHelper.DeserializeObject<navItem>(item.data.ToString()); break;
case "banner": item.data = JsonHelper.DeserializeObject<bannerItem>(item.data.ToString()); break;
case "notice": item.data = JsonHelper.DeserializeObject<noticeItem>(item.data.ToString()); break;
//专题
case "topic": item.data = JsonHelper.DeserializeObject<topicItem>(item.data.ToString()); break;
case "link": item.data = JsonHelper.DeserializeObject<linkItem>(item.data.ToString()); break;
case "rubik": item.data = JsonHelper.DeserializeObject<rubikItem>(item.data.ToString()); break;
case "video": item.data = JsonHelper.DeserializeObject<videoItem>(item.data.ToString()); break;
case "goods": item.data = JsonHelper.DeserializeObject<goodsItem>(item.data.ToString()); break;
case "store": item.data = JsonHelper.DeserializeObject<storeItem>(item.data.ToString()); break;
case "copyright": item.data = JsonHelper.DeserializeObject<copyrightItem>(item.data.ToString()); break;
case "check-in": item.data = JsonHelper.DeserializeObject<checkinItem>(item.data.ToString()); break;
case "user-info": item.data = JsonHelper.DeserializeObject<userinfoItem>(item.data.ToString()); break;
case "user-order": item.data = JsonHelper.DeserializeObject<userorderItem>(item.data.ToString()); break;
case "map": item.data = JsonHelper.DeserializeObject<mapItem>(item.data.ToString()); break;
case "mp-link": item.data = JsonHelper.DeserializeObject<mplinkItem>(item.data.ToString()); break;
case "image-text": item.data = JsonHelper.DeserializeObject<imagetextItem>(item.data.ToString()); break;
case "coupon": item.data = JsonHelper.DeserializeObject<couponItem>(item.data.ToString()); break;
case "timer": item.data = JsonHelper.DeserializeObject<timerItem>(item.data.ToString()); break;
case "pintuan": item.data = JsonHelper.DeserializeObject<pintuanItem>(item.data.ToString()); break;
case "booking": item.data = JsonHelper.DeserializeObject<bookingItem>(item.data.ToString()); break;
case "bargain": item.data = JsonHelper.DeserializeObject<bargainItem>(item.data.ToString()); break;
case "integral-mall": item.data = JsonHelper.DeserializeObject<integralmallItem>(item.data.ToString()); break;
case "lottery": item.data = JsonHelper.DeserializeObject<lotteryItem>(item.data.ToString()); break;
case "advance": item.data = JsonHelper.DeserializeObject<advanceItem>(item.data.ToString()); break;
case "vip-card": item.data = JsonHelper.DeserializeObject<vipcardItem>(item.data.ToString()); break;
case "live": item.data = JsonHelper.DeserializeObject<liveItem>(item.data.ToString()); break;
case "empty": item.data = JsonHelper.DeserializeObject<emptyItem>(item.data.ToString()); break;
case "ad": item.data = JsonHelper.DeserializeObject<adItem>(item.data.ToString()); break;
case "modal": item.data = JsonHelper.DeserializeObject<modalItem>(item.data.ToString()); break;
case "quick-nav": item.data = JsonHelper.DeserializeObject<quicknavItem>(item.data.ToString()); break;
}
}
/// <summary>
/// 删除小程序模板
/// </summary>
......
......@@ -14,6 +14,20 @@ namespace Mall.Module.MarketingCenter
private RB_Goods_OrderRepository orderRepository = new RB_Goods_OrderRepository();
#region 数据统计-数据概况
/// <summary>
/// 损益核算表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<OrderStatistics_Query> GetOrderProfitLossList(int pageIndex, int pageSize, out long count, OrderStatistics_Query dmodel)
{
return orderRepository.GetOrderProfitLossList(pageIndex, pageSize, out count, dmodel);
}
/// <summary>
/// 数据概况
/// </summary>
......@@ -24,6 +38,7 @@ namespace Mall.Module.MarketingCenter
return orderRepository.GetOrdertSatistics(dmodel);
}
/// <summary>
/// 获取近一周的数据
/// </summary>
......@@ -128,7 +143,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public DataStatistics_Query GetSellOrder(DataStatistics_Query dmodel)
{
var List = orderRepository.GetWeeklyOrder(dmodel);
DataStatistics_Query model = new DataStatistics_Query();
......@@ -156,6 +171,6 @@ namespace Mall.Module.MarketingCenter
return orderRepository.GetSellExcel(dmodel);
}
#endregion
}
#endregion
}
}
......@@ -253,6 +253,7 @@ namespace Mall.Module.User
return programRepository.GetPageListRepository(pageIndex, pageSize, out rowCount, query);
}
/// <summary>
/// 判断用户是否存在
......@@ -403,9 +404,9 @@ namespace Mall.Module.User
/// <param name="isGetUserCenterMenu">是否获取用户中心菜单</param>
/// <param name="isGetHomeData">是否获取首页配置数据</param>
/// <returns></returns>
public RB_MiniProgram_Extend GetMiniProgramModule(object MallBaseId, int isGetNav = 0, bool isGetUserCenterMenu = false,bool isGetHomeData=false)
public RB_MiniProgram_Extend GetMiniProgramModule(RB_MiniProgram_Extend query, int isGetNav = 0, bool isGetUserCenterMenu = false,bool isGetHomeData=false)
{
RB_MiniProgram_Extend extModel = programRepository.GetEntity<RB_MiniProgram_Extend>(MallBaseId);
RB_MiniProgram_Extend extModel = programRepository.GetMiniProgramRepository(query);
if (extModel == null)
{
extModel = new RB_MiniProgram_Extend();
......@@ -436,6 +437,10 @@ namespace Mall.Module.User
extModel.HomeDataList = Common.Plugin.JsonHelper.DeserializeObject<List<HomeItem>>(extModel.MallHomeData);
}
}
if (extModel.AuthData != null && !string.IsNullOrEmpty(extModel.AuthData))
{
extModel.AuthDataList = Common.Plugin.JsonHelper.DeserializeObject<List<AuthItem>>(extModel.AuthData);
}
return extModel;
}
......@@ -494,6 +499,26 @@ namespace Mall.Module.User
return flag;
}
/// <summary>
/// 修改小程序首页布局
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public bool SetMiniProgramMallAuthModule(RB_MiniProgram_Extend extModel)
{
bool flag = false;
if (extModel.MallBaseId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.IsOpenAuth),extModel.IsOpenAuth},
{ nameof(RB_MiniProgram_Extend.AuthUrl),extModel.AuthUrl},
{ nameof(RB_MiniProgram_Extend.AuthData),extModel.AuthData},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), extModel.MallBaseId));
}
return flag;
}
/// <summary>
/// 删除小程序底部导航
......
......@@ -66,6 +66,10 @@ namespace Mall.Repository.MarketingCenter
{
builder.Append($" AND {nameof(RB_Miniprogram_Template_Extend.TemplateName)} like '%{query.TemplateName.Trim()}%'");
}
if (query.QIds != null && !string.IsNullOrEmpty(query.QIds.Trim()))
{
builder.AppendFormat(" AND {0} IN({1}) ",nameof(RB_Miniprogram_Template_Extend.Id), query.QIds);
}
}
return Get<RB_Miniprogram_Template_Extend>(builder.ToString()).ToList();
}
......
......@@ -63,7 +63,7 @@ namespace Mall.Repository.Product
{
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)}={(int)dmodel.OrderStatus}";
}
if (!string.IsNullOrEmpty(dmodel.OrderStatusIds))
if (!string.IsNullOrEmpty(dmodel.OrderStatusIds))
{
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} in({dmodel.OrderStatusIds})";
}
......@@ -116,7 +116,8 @@ where {where} group by o.OrderId order by o.CreateDate desc";
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Order_Extend> GetOrderList(RB_Goods_Order_Extend dmodel) {
public List<RB_Goods_Order_Extend> GetOrderList(RB_Goods_Order_Extend dmodel)
{
string where = $" 1=1 and o.{nameof(RB_Goods_Order.Status)}=0";
if (dmodel.TenantId > 0)
{
......@@ -130,13 +131,15 @@ where {where} group by o.OrderId order by o.CreateDate desc";
{
where += $@" and o.{nameof(RB_Goods_Order.OrderId)}={dmodel.OrderId}";
}
if (!string.IsNullOrEmpty(dmodel.OrderIds)) {
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
where += $@" and o.{nameof(RB_Goods_Order.OrderId)} in({dmodel.OrderIds})";
}
if (!string.IsNullOrEmpty(dmodel.orderNos)) {
if (!string.IsNullOrEmpty(dmodel.orderNos))
{
where += $@" and o.{nameof(RB_Goods_Order.OrderNo)} in({dmodel.orderNos})";
}
string sql = $@"SELECT o.* FROM rb_goods_order o
where {where} group by o.OrderId asc";
return Get<RB_Goods_Order_Extend>(sql).ToList();
......@@ -428,7 +431,8 @@ GROUP BY o.OrderId)t";
{
return Convert.ToInt32(obj);
}
else {
else
{
return 0;
}
}
......@@ -579,7 +583,7 @@ LEFT JOIN rb_goods_order as b on a.OrderId=b.OrderId
LEFT JOIN rb_goods as c on a.GoodsId=c.Id {where}
GROUP BY a.GoodsId ORDER BY SUM(a.Final_Price) desc LIMIT 100 ";
return Get<DataStatistics_Query>(sql).ToList();
}
}
/// <summary>
/// 用户购买力TOP排行
......@@ -781,5 +785,36 @@ as t GROUP BY t.CreateDate desc";
return Get<DataStatistics_Query>(sql).ToList();
}
#endregion
#region 损益核算表
public List<OrderStatistics_Query> GetOrderProfitLossList(int pageIndex, int pageSize, out long count, OrderStatistics_Query dmodel)
{
string where = "where 1=1 ";
if (dmodel != null)
{
if (dmodel.GoodsID > 0)
{
where += $" and b.GoodsId={dmodel.GoodsID} ";
}
if (dmodel.SupplierId > 0)
{
where += $" and b.SupplierId={dmodel.SupplierId} ";
}
}
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,'供应商名称' as SupplierName,
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,
c.OneCommission,d.TwoCommission,0 as OtherPrice,e.ALLCommission,0 as Paid
from rb_goods_orderdetail as b
LEFT JOIN rb_goods_order as A on a.OrderId=b.OrderId
LEFT JOIN (SELECT SUM(Commission) as OneCommission,OrderId from rb_goods_ordercommission where Grade=1 and CommissionState=2 GROUP BY OrderId ) as c on a.OrderId=c.OrderId
LEFT JOIN (SELECT SUM(Commission) as TwoCommission,OrderId from rb_goods_ordercommission where Grade=2 and CommissionState=2 GROUP BY OrderId ) as d on a.OrderId=d.OrderId
LEFT JOIN (SELECT SUM(Commission) as ALLCommission,OrderId from rb_goods_ordercommission GROUP BY OrderId ) as e on a.OrderId=e.OrderId {where}
GROUP BY b.OrderId ";
return GetPage<OrderStatistics_Query>(pageIndex, pageSize, out count, sql).ToList();
}
#endregion
}
}
......@@ -36,6 +36,32 @@ namespace Mall.Repository.User
return Get<RB_MiniProgram_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 根据查询条件获取小程序实体
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public RB_MiniProgram_Extend GetMiniProgramRepository(RB_MiniProgram_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(" SELECT * FROM RB_MiniProgram WHERE 1=1 ");
if (query != null)
{
if (query.TenantId != null && query.TenantId > 0)
{
builder.AppendFormat(" AND TenantId={0} ", query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND MallBaseId={0} ", query.MallBaseId);
}
if (query.MiniAppId != null && !string.IsNullOrEmpty(query.MiniAppId))
{
builder.AppendFormat(" AND MiniAppId='{0}' ", query.MiniAppId);
}
}
return Get<RB_MiniProgram_Extend>(builder.ToString()).FirstOrDefault();
}
/// <summary>
/// 获取小程序分页列表
......
......@@ -231,11 +231,11 @@ namespace Mall.WebApi.Controllers.MarketingCenter
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.CreateDate,
x.GoodsNum,
x.OrderNum,
x.PayMoney,
x.PayMemerNum
x.CreateDate,
x.GoodsNum,
x.OrderNum,
x.PayMoney,
x.PayMemerNum
});
return ApiResult.Success("", pagelist);
}
......@@ -321,5 +321,29 @@ namespace Mall.WebApi.Controllers.MarketingCenter
}
#endregion
#region 损益核算表
[HttpPost]
public ApiResult GetOrderProfitLossList()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
OrderStatistics_Query demodel = JsonConvert.DeserializeObject<OrderStatistics_Query>(RequestParm.msg.ToString());
demodel.TenantId = UserInfo.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = statisticsModule.GetOrderProfitLossList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
foreach (var item in list)
{
item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.OneCommission + item.TwoCommission + item.OtherPrice;
item.NoPaid = item.ALLCommission - item.Paid;
item.GrossProfit = item.AllPrice - item.ALLCommission;
item.GrossProfitRate = item.AllPrice == 0 ? 0 : item.GrossProfit / item.AllPrice;
}
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list;
return ApiResult.Success("", pagelist);
}
#endregion
}
}
\ No newline at end of file
......@@ -126,7 +126,7 @@ namespace Mall.WebApi.Controllers.User
string secret = Config.JwtSecretKey;
string token = encoder.Encode(payload, secret);
#endregion
var mmodel = programModule.GetMiniProgramModule(demodel.MallBaseId);
var mmodel = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend() { MallBaseId= demodel.MallBaseId });
AppletUserInfo appletUserInfo = new AppletUserInfo()
{
MallBaseId = demodel.MallBaseId,
......@@ -172,7 +172,7 @@ namespace Mall.WebApi.Controllers.User
string secret = Config.JwtSecretKey;
string token = encoder.Encode(payload, secret);
#endregion
var mmodel = programModule.GetMiniProgramModule(umodel.MallBaseId);
var mmodel = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend() {MallBaseId= umodel.MallBaseId });
AppletUserInfo appletUserInfo = new AppletUserInfo()
{
MallBaseId = umodel.MallBaseId,
......
......@@ -389,7 +389,7 @@ namespace Mall.WebApi.Controllers.User
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var MallBaseId = parms.GetInt("MallBaseId", 0);
int isGetNav = parms.GetInt("isGetNav", 0);
var extModel = programModule.GetMiniProgramModule(MallBaseId, isGetNav: isGetNav);
var extModel = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend() { MallBaseId= MallBaseId }, isGetNav: isGetNav);
return ApiResult.Success(data: extModel);
}
......@@ -428,7 +428,7 @@ namespace Mall.WebApi.Controllers.User
/// <returns></returns>
public ApiResult GetMiniProgramMallIndex()
{
var data = programModule.GetMiniProgramModule(RequestParm.MallBaseId, isGetHomeData: true);
var data = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend() { MallBaseId= RequestParm.MallBaseId }, isGetHomeData: true);
List<object> resultList = new List<object>();
List<object> normalList = new List<object>();
......@@ -617,7 +617,26 @@ namespace Mall.WebApi.Controllers.User
}
var flag = programModule.SetMiniProgramMallHomeModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 添加修改小程序授权页面
/// </summary>
/// <returns></returns>
public ApiResult SetMiniProgramMallAuth()
{
var extModel = JsonConvert.DeserializeObject<RB_MiniProgram_Extend>(RequestParm.msg.ToString());
if (extModel.AuthDataList != null && extModel.AuthDataList.Count > 0)
{
extModel.AuthData = JsonConvert.SerializeObject(extModel.AuthDataList);
}
else
{
extModel.AuthData = "";
}
var flag = programModule.SetMiniProgramMallAuthModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#region 设置可跳转小程序 OR 是否开启直播
......
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