Commit a70a149b authored by liudong1993's avatar liudong1993
parents ca704372 37f3a742
......@@ -57,5 +57,10 @@ namespace Mall.Common.API
/// 语种类型
/// </summary>
public LanguageTypeEnum languageType { get; set; }
/// <summary>
/// 员工编号【员工登录时使用】
/// </summary>
public int EmpId { get; set; }
}
}
......@@ -121,5 +121,10 @@ namespace Mall.Common
/// SecretKey
/// </summary>
public string SecretKey { get; set; }
/// <summary>
/// 员工编号
/// </summary>
public int EmpId { get; set; }
}
}
using Mall.Common.AOP;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 图片魔方表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Mall_Magic
{
/// <summary>
/// 魔方Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 魔方名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 魔方样式
/// </summary>
public int? Style
{
get;
set;
}
/// <summary>
/// 魔方数据[JSON]格式
/// </summary>
public string MagicData
{
get;
set;
}
/// <summary>
/// 商户号Id
/// </summary>
public int? TenantId
{
get;
set;
}
/// <summary>
/// 小程序Id
/// </summary>
public int? MallBaseId
{
get;
set;
}
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// 删除状态
/// </summary>
public int? Status
{
get;
set;
}
}
}
\ No newline at end of file
using Mall.Common.AOP;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 轮播图表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Mall_Nav
{
/// <summary>
/// 导航编号
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 标题
/// </summary>
public string NavName
{
get;
set;
}
/// <summary>
/// 链接
/// </summary>
public string NavLink
{
get;
set;
}
/// <summary>
/// 图片
/// </summary>
public string NavImg
{
get;
set;
}
/// <summary>
/// 商户号Id
/// </summary>
public int? TenantId
{
get;
set;
}
/// <summary>
/// 小程序Id
/// </summary>
public int? MallBaseId
{
get;
set;
}
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// 删除状态
/// </summary>
public int? Status
{
get;
set;
}
}
}
......@@ -377,5 +377,10 @@ namespace Mall.Model.Entity.User
/// </summary>
public string Version { get; set; }
/// <summary>
/// 小程序首页配置
/// </summary>
public string MallHomeData { get; set; }
}
}
......@@ -231,7 +231,7 @@ namespace Mall.Model.Extend.MarketingCenter
public string url { get; set; }
/// <summary>
/// openType
/// 打开方式
/// </summary>
public string openType { get; set; }
}
......@@ -308,16 +308,28 @@ namespace Mall.Model.Extend.MarketingCenter
public class topicItem
{
/// <summary>
/// 样式
/// 专题样式
/// </summary>
public string normal { get; set; }
/// <summary>
/// 显示行数
/// </summary>
public int count { get; set; }
/// <summary>
/// logo(1行)
/// </summary>
public string logo_1 { get; set; }
/// <summary>
/// logo(2行)
/// </summary>
public string logo_2 { get; set; }
/// <summary>
/// 专题标签
/// </summary>
public string icon { get; set; }
/// <summary>
......@@ -517,15 +529,56 @@ namespace Mall.Model.Extend.MarketingCenter
/// </summary>
public class rubikDetailItem
{
/// <summary>
/// 背景颜色
/// </summary>
public string backgroundColor { get; set; }
public int numberX { get; set; }
public int numberY { get; set; }
public int x { get; set; }
public int y { get; set; }
public int w { get; set; }
public int h { get; set; }
/// <summary>
/// 图片导航链接
/// </summary>
public rubikLinkItem link { get; set; }
/// <summary>
/// 宽度
/// </summary>
public string width { get; set; }
/// <summary>
/// 高度
/// </summary>
public string height { get; set; }
/// <summary>
/// 左
/// </summary>
public string left { get; set; }
/// <summary>
/// 顶部
/// </summary>
public string top { get; set; }
public string pic_url { get; set; }
public string backgroundImage { get; set; }
public string backgroundRepeat { get; set; }
public string backgroundSize { get; set; }
public string backgroundPosition { get; set; }
public int zIndex { get; set; }
}
/// <summary>
......@@ -559,22 +612,49 @@ namespace Mall.Model.Extend.MarketingCenter
/// </summary>
public class hotspotItem
{
/// <summary>
/// 热区高度
/// </summary>
public int height { get; set; }
/// <summary>
/// 热区宽度
/// </summary>
public int width { get; set; }
/// <summary>
/// 热区左
/// </summary>
public int left { get; set; }
/// <summary>
/// 热区上
/// </summary>
public int top { get; set; }
/// <summary>
/// 开始点X
/// </summary>
public int defaultX { get; set; }
/// <summary>
/// 开始点Y
/// </summary>
public int defaultY { get; set; }
/// <summary>
/// 是否关闭
/// </summary>
public bool is_close { get; set; }
/// <summary>
/// 热区链接
/// </summary>
public rubikLinkItem link { get; set; }
/// <summary>
/// 打开方式
/// </summary>
public string open_type { get; set; }
}
......@@ -743,7 +823,56 @@ namespace Mall.Model.Extend.MarketingCenter
/// <summary>
/// 商品列表
/// </summary>
public List<GoodsDetailsItem> list { get; set; }
public List<GoodsDetailsItem2> list { get; set; }
}
/// <summary>
/// 商品详情项
/// </summary>
public class GoodsDetailsItem2
{
/// <summary>
/// 商品编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 商品图片
/// </summary>
public string CoverImage { get; set; }
/// <summary>
/// 售价
/// </summary>
public decimal SellingPrice { get; set; }
public int SalesNum { get; set; }
/// <summary>
/// 商品分类列表
/// </summary>
public List<CategoryItem> CategoryList { get; set; }
}
/// <summary>
/// 商品分类
/// </summary>
public class CategoryItem
{
/// <summary>
/// 商品分类编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 商品分类名称
/// </summary>
public string CategoryName { get; set; }
}
/// <summary>
......
using Mall.Common.AOP;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 图片魔方表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Mall_Magic_Extend : Model.Entity.User.RB_Mall_Magic
{
/// <summary>
/// 魔方数据列表
/// </summary>
public List<MagicItem> MagicDataList { get; set; }
/// <summary>
/// 创建时间字符串
/// </summary>
public string CreateDateStr
{
get
{
string str = "";
if (this.CreateDate != null)
{
str = Convert.ToDateTime(this.CreateDate).ToString("yyyy-MM-dd HH:mm:ss");
}
return str;
}
}
}
/// <summary>
/// 魔方数据项
/// </summary>
public class MagicItem
{
/// <summary>
/// 魔方链接
/// </summary>
public string Link { get; set; }
/// <summary>
/// 魔方图片
/// </summary>
public string ImgUrl { get; set; }
}
}
\ No newline at end of file
using Mall.Common.AOP;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 轮播图表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Mall_Nav_Extend : Model.Entity.User.RB_Mall_Nav
{
}
}
\ No newline at end of file
......@@ -27,5 +27,10 @@ namespace Mall.Model.Extend.User
return str;
}
}
/// <summary>
/// 查询菜单编号
/// </summary>
public string QMenuIds { get; set; }
}
}
......@@ -93,6 +93,112 @@ namespace Mall.Model.Extend.User
/// </summary>
public string[] JumpAppIdList { get; set; }
/// <summary>
/// 小程序首页数据
/// </summary>
public List<HomeItem> HomeDataList { get; set; }
}
/// <summary>
/// 首页数据项
/// </summary>
public class HomeItem
{
/// <summary>
/// 插件Key
/// </summary>
public string key { get; set; }
/// <summary>
/// 插件名称
/// </summary>
public string name { get; set; }
/// <summary>
/// 关系Id
/// </summary>
public int relation_id { get; set; }
/// <summary>
/// 是否可编辑[0-不可编辑,1-可编辑]
/// </summary>
public int is_edit { get; set; }
/// <summary>
/// 图片地址
/// </summary>
public string imgBg { get; set; }
/// <summary>
/// 图标一行显示个数【导航图标插件】
/// </summary>
public int row_num { get; set; }
/// <summary>
/// 插件permission_key【video、topic、coupon】
/// </summary>
public string permission_key { get; set; }
/// <summary>
/// 视频地址【视频插件、】
/// </summary>
public string video_url { get; set; }
/// <summary>
/// 视频封面图【视频插件、】
/// </summary>
public string video_pic_url { get; set; }
/// <summary>
/// 公告图片地址【公告插件】
/// </summary>
public string notice_url { get; set; }
/// <summary>
/// 公告背景颜色【公告插件】
/// </summary>
public string notice_bg_color { get; set; }
/// <summary>
/// 公告文字颜色【公告插件】
/// </summary>
public string notice_text_color { get; set; }
/// <summary>
/// 专题显示数量【专题插件】
/// </summary>
public int topic_num { get; set; }
/// <summary>
/// 图标(1个专题)【专题插件】
/// </summary>
public string topic_url { get; set; }
/// <summary>
/// 图标(2个专题)【专题插件】
/// </summary>
public string topic_url_2 { get; set; }
/// <summary>
/// 专题标签图片【专题插件】
/// </summary>
public string label_url { get; set; }
/// <summary>
/// 已领取图
/// </summary>
public string coupon_url { get; set; }
/// <summary>
/// 未领取图(满减券)
/// </summary>
public string coupon_not_url { get; set; }
/// <summary>
/// 打折券未认领
/// </summary>
public string discount_not_url { get; set; }
}
}
......@@ -30,5 +30,10 @@ namespace Mall.Model.Entity.User
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 员工编号
/// </summary>
public int EmpId { get; set; }
}
}
\ No newline at end of file
......@@ -34,5 +34,15 @@ namespace Mall.Model.Extend.User
return str;
}
}
/// <summary>
/// 小程序Id【用于登录验证】
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 当前登录员工编号
/// </summary>
public int EmpId { get; set; }
}
}
......@@ -181,7 +181,8 @@ namespace Mall.Module.Product
{
var rmodel = product_RecommendRepository.GetList(new RB_Product_Recommend_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
RecommendStatus = 2;
if (rmodel == null) {
if (rmodel == null)
{
return new List<RB_Goods_Extend>();
}
pageSize = rmodel.DetailRecommendNum ?? 0;
......@@ -209,7 +210,8 @@ namespace Mall.Module.Product
}
}
}
else if (demodel.RecommendType == 3) {
else if (demodel.RecommendType == 3)
{
RecommendStatus = rmodel.CommentRecommentStatus ?? 2;
if (rmodel.CommentRecommentStatus != 1)
{
......@@ -229,12 +231,15 @@ namespace Mall.Module.Product
List<RB_Goods_Extend> RList = list;
if (list.Any())
{
if (demodel.RecommendType == 2 && rmodel.IsOrderRecommend == 1 && !string.IsNullOrEmpty(rmodel.OrderProductIds)) {
if (demodel.RecommendType == 2 && rmodel.IsOrderRecommend == 1 && !string.IsNullOrEmpty(rmodel.OrderProductIds))
{
List<int> gidList = JsonConvert.DeserializeObject<List<int>>(rmodel.OrderProductIds);
var gList = gidList.Where(x => list.Select(y => y.Id).Contains(x)).Take(10).ToList();
if (gList.Any()) {
if (gList.Any())
{
RList = new List<RB_Goods_Extend>();
foreach (var item in gList) {
foreach (var item in gList)
{
RList.Add(list.Where(x => x.Id == item).FirstOrDefault());
}
}
......@@ -373,7 +378,8 @@ namespace Mall.Module.Product
}
}
}
else if (model.IsDefaultService == 1) {
else if (model.IsDefaultService == 1)
{
var slist = product_ServiceRepository.GetList(new RB_Product_Service_Extend() { IsDefault = 1, TenantId = TenantId, MallBaseId = MallBaseId });
foreach (var item in slist)
{
......@@ -471,7 +477,8 @@ namespace Mall.Module.Product
{
model.Express = pmodel.FirstPrice;
}
else {
else
{
//重量计费
int TotalW = model.GoodsWeight ?? 0;
if (TotalW <= pmodel.First)
......@@ -510,22 +517,28 @@ namespace Mall.Module.Product
{
//获取分销商信息
var disModel = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { TenantId = TenantId, MallBaseId = MallBaseId, UserId = UserId, AuditStatus = Common.Enum.User.DistributorAuditStatusEnum.Audited }).FirstOrDefault();
if (disModel != null) {
if (disModel != null)
{
var BasicsModel = distributor_BasicsRepository.GetList(new RB_Distributor_Basics_Extend() { TenantId = TenantId, MallBaseId = MallBaseId }).FirstOrDefault();
if (model.SeparateDistribution == 1) {
if (model.SeparateDistribution == 1)
{
var dcList = model.DistributionCommissionList.Where(x => x.DistributorGrade == disModel.GradeId).ToList();
if ((BasicsModel?.IsCommissionResidue ?? 2) == 1) {
if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
{
model.MaxShare = dcList.Max(x => (x.OneCommission ?? 0) + (x.TwoCommission ?? 0) + (x.ThreeCommission ?? 0));
}
else {
else
{
model.MaxShare = dcList.Max(x => x.OneCommission ?? 0);
}
// 这里需注意,可能需要分销 是否提所有返佣控制
if (model.SeparateDistributionMoneyType == 1) {
if (model.SeparateDistributionMoneyType == 1)
{
model.MaxShare = Math.Round(model.MaxShare * MaxSellMoney / 100, 2, MidpointRounding.AwayFromZero);
}
}
else {
else
{
if (disModel.GradeId == 0)
{
//拿分销基础配置
......@@ -542,10 +555,12 @@ namespace Mall.Module.Product
model.MaxShare = Math.Round(model.MaxShare * MaxSellMoney / 100, 2, MidpointRounding.AwayFromZero);
}
}
else if (disModel.GradeId > 0) {
else if (disModel.GradeId > 0)
{
//获取分销商等级
var disgradeModel = distributor_GradeRepository.GetEntity(disModel.GradeId);
if (disgradeModel != null) {
if (disgradeModel != null)
{
if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
{
model.MaxShare = (disgradeModel?.OneCommission ?? 0) + (disgradeModel?.TwoCommission ?? 0) + (disgradeModel?.ThreeCommission ?? 0);
......@@ -581,7 +596,8 @@ namespace Mall.Module.Product
if (list.Any())
{
List<int> MaterialIds = new List<int>();
foreach (var item in list) {
foreach (var item in list)
{
if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]")
{
List<int> CarouselIdList = JsonConvert.DeserializeObject<List<int>>(item.CarouselImage);
......@@ -594,7 +610,8 @@ namespace Mall.Module.Product
var categoryList = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var speciList = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var speciVList = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
if (speciVList.Any()) {
if (speciVList.Any())
{
MaterialIds.AddRange(speciVList.Where(x => x.Image > 0).Select(x => x.Image ?? 0));
}
if (MaterialIds.Any())
......@@ -685,8 +702,9 @@ namespace Mall.Module.Product
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Material_Group_Extend> GetMaterialGroupList(RB_Material_Group_Extend dmodel) {
var list= material_GroupRepository.GetList(dmodel);
public List<RB_Material_Group_Extend> GetMaterialGroupList(RB_Material_Group_Extend dmodel)
{
var list = material_GroupRepository.GetList(dmodel);
return list;
}
......@@ -728,7 +746,8 @@ namespace Mall.Module.Product
};
return material_GroupRepository.Update(keyValues, wheres);
}
else {
else
{
return material_GroupRepository.Insert(demodel) > 0;
}
}
......@@ -755,7 +774,8 @@ namespace Mall.Module.Product
};
return material_InfoRepository.Update(keyValues, wheres);
}
else {
else
{
return material_InfoRepository.Insert(demodel) > 0;
}
}
......@@ -770,7 +790,8 @@ namespace Mall.Module.Product
public bool SetMaterialGroupRecycled(int groupId, string uid, int mallBaseId)
{
var gmodel = material_GroupRepository.GetEntity(groupId);
if (gmodel == null) {
if (gmodel == null)
{
return false;
}
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
......@@ -795,7 +816,8 @@ namespace Mall.Module.Product
},
};
bool flag = material_GroupRepository.Update(keyValues, wheres);
if (flag) {
if (flag)
{
//分组下所有素材全回收
material_InfoRepository.SetMaterialInfoRecycled(groupId, Convert.ToInt32(uid), mallBaseId);
}
......@@ -816,7 +838,8 @@ namespace Mall.Module.Product
{
return false;
}
if (gmodel.Recycled != 2) {
if (gmodel.Recycled != 2)
{
return false;
}
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
......@@ -841,7 +864,8 @@ namespace Mall.Module.Product
},
};
bool flag = material_GroupRepository.Update(keyValues, wheres);
if (flag) {
if (flag)
{
//删除分组下所有的素材
material_InfoRepository.DelMaterialInfo("", uid, mallBaseId, groupId);
}
......@@ -935,7 +959,8 @@ namespace Mall.Module.Product
var glist = material_GroupRepository.GetList(new RB_Material_Group_Extend() { GroupIds = string.Join(",", list.Select(x => x.GroupId).Distinct()), TenantId = Convert.ToInt32(uid), MallBaseId = mallBaseId });
if (glist.Where(x => x.Recycled == 2).Any())
{
foreach (var item in glist.Where(x => x.Recycled == 2)) {
foreach (var item in glist.Where(x => x.Recycled == 2))
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Material_Group.Recycled),1},
{ nameof(RB_Material_Group.UpdateDate),DateTime.Now},
......@@ -960,7 +985,8 @@ namespace Mall.Module.Product
material_GroupRepository.Update(keyValues, wheres, trans);
}
}
foreach (var item in list) {
foreach (var item in list)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Material_Info.Recycled),1},
{ nameof(RB_Material_Info.UpdateDate),DateTime.Now},
......@@ -1008,7 +1034,8 @@ namespace Mall.Module.Product
public bool SetMaterialInfoTransfer(string materialIds, int groupId, int Type, string uid, int mallBaseId)
{
var gmodel = material_GroupRepository.GetEntity(groupId);
if (gmodel == null) {
if (gmodel == null)
{
return false;
}
if (gmodel.Status == 1 || gmodel.Recycled == 2 || gmodel.Type != Type)
......@@ -1033,17 +1060,20 @@ namespace Mall.Module.Product
public List<RB_Product_Category_Extend> GetProductCategoryPageList(int pageIndex, int pageSize, out long count, RB_Product_Category_Extend demodel)
{
var list = product_CategoryRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) {
if (list.Any())
{
List<int> ImgIds = new List<int>();
ImgIds.AddRange(list.Select(x => x.Icon ?? 0).Distinct());
ImgIds.AddRange(list.Select(x => x.BigIcon ?? 0).Distinct());
ImgIds.AddRange(list.Select(x => x.AdvertisingImage ?? 0).Distinct());
List<RB_Material_Info_Extend> mlist = new List<RB_Material_Info_Extend>();
if (ImgIds.Any()) {
if (ImgIds.Any())
{
mlist = material_InfoRepository.GetList(new RB_Material_Info_Extend() { MaterialIds = string.Join(",", ImgIds), TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
}
foreach (var item in list) {
foreach (var item in list)
{
item.IconPath = mlist.Where(x => x.Id == item.Icon).FirstOrDefault()?.Path ?? "";
item.BigIconPath = mlist.Where(x => x.Id == item.BigIcon).FirstOrDefault()?.Path ?? "";
item.AdvertisingImagePath = mlist.Where(x => x.Id == item.AdvertisingImage).FirstOrDefault()?.Path ?? "";
......@@ -1065,7 +1095,8 @@ namespace Mall.Module.Product
try
{
var list = GetProductCategoryForALLChlid(categoryId, tenantId, mallBaseId);
foreach (var item in list) {
foreach (var item in list)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Product_Category.Status),1},
{ nameof(RB_Product_Category.UpdateDate),DateTime.Now},
......@@ -1136,7 +1167,8 @@ namespace Mall.Module.Product
};
return product_CategoryStyleRepository.Update(keyValues, wheres);
}
else {
else
{
return product_CategoryStyleRepository.Insert(demodel) > 0;
}
}
......@@ -1224,10 +1256,12 @@ namespace Mall.Module.Product
/// <param name="list"></param>
/// <param name="parentId"></param>
/// <returns></returns>
public List<RB_Product_CategoryTree> GetProductCategoryChildTree(List<RB_Product_Category_Extend> list, int parentId) {
public List<RB_Product_CategoryTree> GetProductCategoryChildTree(List<RB_Product_Category_Extend> list, int parentId)
{
List<RB_Product_CategoryTree> RList = new List<RB_Product_CategoryTree>();
var CList = list.Where(x => x.ParentId == parentId).ToList();
foreach (var item in CList) {
foreach (var item in CList)
{
var cmodel = new RB_Product_CategoryTree
{
Id = item.Id,
......@@ -1273,9 +1307,11 @@ namespace Mall.Module.Product
else
{
int Id = product_CategoryRepository.Insert(demodel);
if (Id > 0) {
if (Id > 0)
{
int RootId = Id;
if (demodel.ParentId > 0) {
if (demodel.ParentId > 0)
{
var pmodel = product_CategoryRepository.GetEntity(demodel.ParentId);
RootId = pmodel?.RootId ?? 0;
}
......@@ -1312,17 +1348,19 @@ namespace Mall.Module.Product
List<RB_Material_Info_Extend> mlist = new List<RB_Material_Info_Extend>();
if (ImgIds.Any())
{
mlist = material_InfoRepository.GetList(new RB_Material_Info_Extend() { MaterialIds = string.Join(",", ImgIds)});
mlist = material_InfoRepository.GetList(new RB_Material_Info_Extend() { MaterialIds = string.Join(",", ImgIds) });
}
model.IconPath = mlist.Where(x => x.Id == model.Icon).FirstOrDefault()?.Path ?? "";
model.BigIconPath = mlist.Where(x => x.Id == model.BigIcon).FirstOrDefault()?.Path ?? "";
model.AdvertisingImagePath = mlist.Where(x => x.Id == model.AdvertisingImage).FirstOrDefault()?.Path ?? "";
var p1Model = product_CategoryRepository.GetEntity(model?.ParentId);
if (p1Model != null) {
if (p1Model != null)
{
model.Parent1Name = p1Model.Name;
var p2Model = product_CategoryRepository.GetEntity(p1Model?.ParentId);
if (p2Model != null) {
if (p2Model != null)
{
model.Parent1Name = p2Model.Name;
model.Parent2Name = p1Model.Name;//黄媛媛要求 1表示1级 2表示2级
}
......@@ -1337,7 +1375,7 @@ namespace Mall.Module.Product
/// <param name="tid"></param>
/// <param name="mid"></param>
/// <returns></returns>
public List<RB_Product_Category_Extend> GetProductCategoryForALLChlid(int categoryId,int tid,int mid)
public List<RB_Product_Category_Extend> GetProductCategoryForALLChlid(int categoryId, int tid, int mid)
{
var model = product_CategoryRepository.GetEntity(categoryId);
var list = product_CategoryRepository.GetList(new RB_Product_Category_Extend() { RootId = model.RootId, TenantId = tid, MallBaseId = mid });
......@@ -1346,6 +1384,16 @@ namespace Mall.Module.Product
return RList;
}
/// <summary>
/// 获取分类列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Product_Category_Extend> GetCategoryListModule(RB_Product_Category_Extend dmodel)
{
return product_CategoryRepository.GetList(dmodel);
}
/// <summary>
/// 获取所有子集
/// </summary>
......@@ -1357,7 +1405,8 @@ namespace Mall.Module.Product
List<RB_Product_Category_Extend> RList = new List<RB_Product_Category_Extend>();
var list2 = list.Where(x => x.ParentId == id).ToList();
RList.AddRange(list2);
foreach (var item in list2) {
foreach (var item in list2)
{
RList.AddRange(GetProductCategoryALLChild(list, item.Id));
}
return RList;
......@@ -1396,7 +1445,8 @@ namespace Mall.Module.Product
{ nameof(RB_Product_Category.UpdateDate),DateTime.Now},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
new WhereHelper()
{
FiledName=nameof(RB_Product_Category.Id),
FiledValue=cmodel.Id,
OperatorEnum=OperatorEnum.Equal
......@@ -1447,9 +1497,11 @@ namespace Mall.Module.Product
public List<RB_Product_Specification_Extend> GetProducSpecificationPageList(int pageIndex, int pageSize, out long count, RB_Product_Specification_Extend demodel)
{
var list = product_SpecificationRepository.GetPageList(pageIndex, pageSize, out count, demodel);
foreach (var item in list) {
foreach (var item in list)
{
item.SpecList = new List<string>();
if (!string.IsNullOrEmpty(item.Content)) {
if (!string.IsNullOrEmpty(item.Content))
{
item.SpecList = JsonConvert.DeserializeObject<List<string>>(item.Content);
}
}
......@@ -1498,7 +1550,8 @@ namespace Mall.Module.Product
};
return product_SpecificationRepository.Update(keyValues, wheres);
}
else {
else
{
return product_SpecificationRepository.Insert(demodel) > 0;
}
}
......@@ -1550,13 +1603,16 @@ namespace Mall.Module.Product
public List<RB_Product_QuickBuy_Extend> GetProductQuickBuyPageList(int pageIndex, int pageSize, out long count, RB_Product_QuickBuy_Extend demodel)
{
var list = product_QuickBuyRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) {
if (list.Any())
{
string imgids = string.Join(",", list.Where(x => x.Icon > 0).Select(x => x.Icon));
List<RB_Material_Info_Extend> mlist = new List<RB_Material_Info_Extend>();
if (!string.IsNullOrEmpty(imgids)) {
if (!string.IsNullOrEmpty(imgids))
{
mlist = material_InfoRepository.GetList(new RB_Material_Info_Extend() { MaterialIds = imgids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
}
foreach (var item in list) {
foreach (var item in list)
{
item.IconPath = mlist.Where(x => x.Id == item.Icon).FirstOrDefault()?.Path ?? "";
}
}
......@@ -1619,8 +1675,10 @@ namespace Mall.Module.Product
OperatorEnum=OperatorEnum.Equal
}
};
if (id > 0) {
wheres.Add(new WhereHelper() {
if (id > 0)
{
wheres.Add(new WhereHelper()
{
FiledName = nameof(RB_Product_QuickBuy.Id),
FiledValue = id,
OperatorEnum = OperatorEnum.NotEqual
......@@ -1662,7 +1720,8 @@ namespace Mall.Module.Product
};
return product_QuickBuyRepository.Update(keyValues, wheres);
}
else {
else
{
return product_QuickBuyRepository.Insert(demodel) > 0;
}
}
......@@ -1712,11 +1771,13 @@ namespace Mall.Module.Product
public RB_Product_Recommend_Extend GetProductRecommendSetInfo(int tenantId, int mallBaseId)
{
var model = product_RecommendRepository.GetList(new RB_Product_Recommend_Extend() { TenantId = tenantId, MallBaseId = mallBaseId }).FirstOrDefault();
if (model == null) {
if (model == null)
{
return new RB_Product_Recommend_Extend();
}
model.OrderProductList = new List<RB_ProductRecommendModel>();
if (model.IsOrderRecommend == 1 && !string.IsNullOrEmpty(model.OrderProductIds)) {
if (model.IsOrderRecommend == 1 && !string.IsNullOrEmpty(model.OrderProductIds))
{
//查询商品
var glist = goodsRepository.GetList(new RB_Goods_Extend() { GoodsIds = model.OrderProductIds, TenantId = tenantId, MallBaseId = mallBaseId });
foreach (var item in glist)
......@@ -1729,7 +1790,8 @@ namespace Mall.Module.Product
item.CoverImage = material_InfoRepository.GetEntity(CarouselIdList[0])?.Path ?? "";
}
}
foreach (var item in glist) {
foreach (var item in glist)
{
model.OrderProductList.Add(new RB_ProductRecommendModel()
{
Id = item.Id,
......@@ -1739,7 +1801,8 @@ namespace Mall.Module.Product
}
}
model.CommentProductList = new List<RB_ProductRecommendModel>();
if (model.IsCommentRecommend == 1 && !string.IsNullOrEmpty(model.CommentProductIds)) {
if (model.IsCommentRecommend == 1 && !string.IsNullOrEmpty(model.CommentProductIds))
{
var glist = goodsRepository.GetList(new RB_Goods_Extend() { GoodsIds = model.CommentProductIds, TenantId = tenantId, MallBaseId = mallBaseId });
foreach (var item in glist)
{
......@@ -1793,7 +1856,8 @@ namespace Mall.Module.Product
};
return product_RecommendRepository.Update(keyValues, wheres);
}
else {
else
{
return product_RecommendRepository.Insert(demodel) > 0;
}
}
......@@ -1845,7 +1909,8 @@ namespace Mall.Module.Product
if (demodel.UpdateType == 1)
{ //只更新默认状态
var model = product_ServiceRepository.GetEntity(demodel.Id);
if (model == null) {
if (model == null)
{
return false;
}
keyValues = new Dictionary<string, object>()
......@@ -1934,15 +1999,18 @@ namespace Mall.Module.Product
public List<RB_Goods_Extend> GetProductGoodsPageList(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel)
{
var list = goodsRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) {
if (list.Any())
{
//查询分类
string ids = string.Join(",", list.Select(x => x.Id));
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
foreach (var item in list) {
foreach (var item in list)
{
item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList();
//轮播图
item.CoverImage = "";
if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]") {
if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]")
{
List<int> CarouselIdList = JsonConvert.DeserializeObject<List<int>>(item.CarouselImage);
//封面图
item.CoverImage = material_InfoRepository.GetEntity(CarouselIdList[0])?.Path ?? "";
......@@ -2055,13 +2123,15 @@ namespace Mall.Module.Product
}
};
bool flag = goodsRepository.Update(keyValues, wheres, trans);
if (flag) {
if (flag)
{
#region 修改分类
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var insertList = demodel.CategoryList.Where(x => !clist.Select(y => y.CategoryId).Contains(x.CategoryId)).ToList();
//var updateList = clist.Where(x => demodel.CategoryList.Select(y => y.CategoryId).Contains(x.CategoryId)).ToList();
var deleteList = clist.Where(x => !demodel.CategoryList.Select(y => y.CategoryId).Contains(x.CategoryId)).ToList();
foreach (var item in insertList) {
foreach (var item in insertList)
{
goods_CategoryRepository.Insert(new RB_Goods_Category()
{
CategoryId = item.CategoryId,
......@@ -2073,7 +2143,8 @@ namespace Mall.Module.Product
TenantId = demodel.TenantId
}, trans);
}
foreach (var item in deleteList) {
foreach (var item in deleteList)
{
goods_CategoryRepository.Delete(item.Id, trans);
}
#endregion
......@@ -2147,7 +2218,8 @@ namespace Mall.Module.Product
//更新
var svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var splist = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
foreach (var item in slist) {
foreach (var item in slist)
{
var supmodel = demodel.SpecificationList.Where(x => x.Id == item.Id).FirstOrDefault();
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_Specification.EnabledImage),supmodel.EnabledImage},
......@@ -2162,7 +2234,8 @@ namespace Mall.Module.Product
}
};
bool flag1 = goods_SpecificationRepository.Update(keyValues1, wheres1, trans);
if (flag1) {
if (flag1)
{
var sv2list = svlist.Where(x => x.SpecificationId == item.Id).ToList();
if (sv2list.Count() != supmodel.SpecificationValueList.Count() || sv2list.Count() != supmodel.SpecificationValueList.Where(x => x.Id > 0).Count())
{
......@@ -2184,7 +2257,8 @@ namespace Mall.Module.Product
}, trans);
}
}
else {
else
{
foreach (var qitem in sv2list)
{
var supModel1 = supmodel.SpecificationValueList.Where(x => x.Id == qitem.Id).FirstOrDefault();
......@@ -2228,8 +2302,10 @@ namespace Mall.Module.Product
}, trans);
}
}
else {
foreach (var item in splist) {
else
{
foreach (var item in splist)
{
var pupmodel = demodel.SpecificationPriceList.Where(x => x.SpecificationSort == item.SpecificationSort).FirstOrDefault();
if (item.SellingPrice != pupmodel.SellingPrice || item.InventoryNum != pupmodel.InventoryNum || item.GoodsNumbers != pupmodel.GoodsNumbers || item.GoodsWeight != pupmodel.GoodsWeight)
{
......@@ -2280,7 +2356,8 @@ namespace Mall.Module.Product
#endregion
//修改卡卷
#region 修改分销佣金
if (demodel.SeparateDistribution == 1) {
if (demodel.SeparateDistribution == 1)
{
//价格新增/更新
var dclist = goods_DistributionCommissionRepository.GetList(new RB_Goods_DistributionCommission_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
if (dclist.Count() != demodel.DistributionCommissionList.Count()
......@@ -2335,7 +2412,8 @@ namespace Mall.Module.Product
}
#endregion
#region 修改会员价格
if (demodel.EnjoyMember == 1 && demodel.SeparateSetMember == 1) {
if (demodel.EnjoyMember == 1 && demodel.SeparateSetMember == 1)
{
var mplist = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
if (mplist.Count() != demodel.MemberPriceList.Count()
|| mplist.Count() != demodel.MemberPriceList.Where(x => mplist.Select(y => y.SpecificationSort).Contains(x.SpecificationSort)).Count()
......@@ -2386,12 +2464,15 @@ namespace Mall.Module.Product
#endregion
}
}
else {
else
{
int Id = goodsRepository.Insert(demodel, trans);
bool flag = Id > 0;
if (flag) {
if (flag)
{
//插入分类
foreach (var item in demodel.CategoryList) {
foreach (var item in demodel.CategoryList)
{
goods_CategoryRepository.Insert(new RB_Goods_Category()
{
CategoryId = item.CategoryId,
......@@ -2404,9 +2485,11 @@ namespace Mall.Module.Product
}, trans);
}
//插入规格
if (demodel.IsCustomSpecification == 1) {
foreach (var item in demodel.SpecificationList) {
int sid= goods_SpecificationRepository.Insert(new RB_Goods_Specification()
if (demodel.IsCustomSpecification == 1)
{
foreach (var item in demodel.SpecificationList)
{
int sid = goods_SpecificationRepository.Insert(new RB_Goods_Specification()
{
CreateDate = demodel.CreateDate,
EnabledImage = item.EnabledImage,
......@@ -2438,7 +2521,8 @@ namespace Mall.Module.Product
}
}
}
foreach (var item in demodel.SpecificationPriceList) {
foreach (var item in demodel.SpecificationPriceList)
{
goods_SpecificationPriceRepository.Insert(new RB_Goods_SpecificationPrice()
{
CreateDate = demodel.CreateDate,
......@@ -2457,7 +2541,8 @@ namespace Mall.Module.Product
}
}
//插入区域
foreach (var item in demodel.AreaList) {
foreach (var item in demodel.AreaList)
{
goods_AreaRepository.Insert(new RB_Goods_Area()
{
AreaId = item.AreaId,
......@@ -2472,7 +2557,8 @@ namespace Mall.Module.Product
}
//插入卡卷
//插入分销佣金
if (demodel.SeparateDistribution == 1) {
if (demodel.SeparateDistribution == 1)
{
foreach (var item in demodel.DistributionCommissionList)
{
goods_DistributionCommissionRepository.Insert(new RB_Goods_DistributionCommission()
......@@ -2493,7 +2579,8 @@ namespace Mall.Module.Product
}
}
//插入会员价格
if (demodel.EnjoyMember == 1 && demodel.SeparateSetMember == 1) {
if (demodel.EnjoyMember == 1 && demodel.SeparateSetMember == 1)
{
foreach (var item in demodel.MemberPriceList)
{
goods_MemberPriceRepository.Insert(new RB_Goods_MemberPrice()
......@@ -2529,32 +2616,39 @@ namespace Mall.Module.Product
/// </summary>
/// <param name="goodsId"></param>
/// <returns></returns>
public RB_Goods_Extend GetProductGoodsInfo(int goodsId,int TenantId,int MallBaseId)
public RB_Goods_Extend GetProductGoodsInfo(int goodsId, int TenantId, int MallBaseId)
{
var model = goodsRepository.GetEntity(goodsId).RefMapperTo<RB_Goods_Extend>();
if (model == null || model.TenantId != TenantId || model.MallBaseId != MallBaseId){
if (model == null || model.TenantId != TenantId || model.MallBaseId != MallBaseId)
{
return null;
}
model.CategoryList = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
model.SpecificationList = new List<RB_Goods_Specification_Extend>();
model.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
if (model.IsCustomSpecification == 1) {
if (model.IsCustomSpecification == 1)
{
model.SpecificationList = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
if (model.SpecificationList.Any()) {
if (model.SpecificationList.Any())
{
var svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
if (svlist.Where(x => x.Image > 0).Any()) {
if (svlist.Where(x => x.Image > 0).Any())
{
string imgIds = string.Join(",", svlist.Where(x => x.Image > 0).Select(x => x.Image).Distinct());
var mlist = material_InfoRepository.GetList(new RB_Material_Info_Extend() { MaterialIds = imgIds, TenantId = TenantId, MallBaseId = MallBaseId });
foreach (var item in svlist.Where(x => x.Image > 0)) {
foreach (var item in svlist.Where(x => x.Image > 0))
{
item.ImagePath = mlist.Where(x => x.Id == item.Image).FirstOrDefault()?.Path ?? "";
}
}
foreach (var item in model.SpecificationList) {
foreach (var item in model.SpecificationList)
{
item.SpecificationValueList = svlist.Where(x => x.SpecificationId == item.Id).ToList();
}
}
model.SpecificationPriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
foreach (var item in model.SpecificationPriceList) {
foreach (var item in model.SpecificationPriceList)
{
if (!string.IsNullOrEmpty(item.SpecificationSort))
{
var ssarr = item.SpecificationSort.Split(':');
......@@ -2578,17 +2672,21 @@ namespace Mall.Module.Product
}
}
model.AreaList = new List<RB_Goods_Area_Extend>();
if (model.IsAreaBuy == 1) {
if (model.IsAreaBuy == 1)
{
model.AreaList = goods_AreaRepository.GetList(new RB_Goods_Area_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
}
model.DistributionCommissionList = new List<RB_Goods_DistributionCommission_Extend>();
model.DistributionCommissionTreeList = new List<RB_Goods_DistributionCommission_Extend>();
if (model.SeparateDistribution == 1) {
if (model.SeparateDistribution == 1)
{
model.DistributionCommissionList = goods_DistributionCommissionRepository.GetList(new RB_Goods_DistributionCommission_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
if (model.DistributionCommissionList.Any()) {
if (model.DistributionCommissionList.Any())
{
var KeyList = model.DistributionCommissionList.Select(x => x.SpecificationSort ?? "").Distinct().ToList();
foreach (var qitem in KeyList) {
foreach (var qitem in KeyList)
{
var treemodel = model.DistributionCommissionList.Where(x => (x.SpecificationSort ?? "") == qitem).FirstOrDefault();
treemodel.GradeCommissionList = model.DistributionCommissionList.Where(x => (x.SpecificationSort ?? "") == qitem).ToList();
if (model.SeparateDistributionType == 2)
......@@ -2620,7 +2718,8 @@ namespace Mall.Module.Product
}
model.MemberPriceList = new List<RB_Goods_MemberPrice_Extend>();
model.MemberPriceTreeList = new List<RB_Goods_MemberPrice_Extend>();
if (model.EnjoyMember == 1 && model.SeparateSetMember == 1){
if (model.EnjoyMember == 1 && model.SeparateSetMember == 1)
{
model.MemberPriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
if (model.MemberPriceList.Any())
{
......@@ -2659,7 +2758,8 @@ namespace Mall.Module.Product
List<int> CarouselIdList = JsonConvert.DeserializeObject<List<int>>(model.CarouselImage);
//轮播图
var mlist = material_InfoRepository.GetList(new RB_Material_Info_Extend() { MaterialIds = string.Join(",", CarouselIdList), TenantId = TenantId, MallBaseId = MallBaseId });
foreach (var item in CarouselIdList) {
foreach (var item in CarouselIdList)
{
var cmodel = mlist.Where(x => x.Id == item).FirstOrDefault();
model.CarouselImageList.Add(new RB_ImageCommonModel()
{
......@@ -2669,17 +2769,20 @@ namespace Mall.Module.Product
});
}
}
if (model.CustomShareImage > 0) {
if (model.CustomShareImage > 0)
{
model.CustomShareImagePath = material_InfoRepository.GetEntity(model.CustomShareImage)?.Path ?? "";
}
//服务列表
model.ServiceList = new List<RB_ImageCommonModel>();
if (model.IsDefaultService == 2)
{
if (!string.IsNullOrEmpty(model.GoodsService) && model.GoodsService != "[]") {
if (!string.IsNullOrEmpty(model.GoodsService) && model.GoodsService != "[]")
{
List<int> ServiceIds = JsonConvert.DeserializeObject<List<int>>(model.GoodsService);
var slist = product_ServiceRepository.GetList(new RB_Product_Service_Extend() { ServiceIds = string.Join(",", ServiceIds), TenantId = TenantId, MallBaseId = MallBaseId });
foreach (var item in slist) {
foreach (var item in slist)
{
model.ServiceList.Add(new RB_ImageCommonModel()
{
Id = item.Id,
......@@ -2693,7 +2796,8 @@ namespace Mall.Module.Product
{
model.FreightName = logistics_RulesRepository.GetEntity(model.FreightId)?.RulesName ?? "";
}
else {
else
{
model.FreightName = "默认运费";
}
//表单
......@@ -2701,7 +2805,8 @@ namespace Mall.Module.Product
{
model.FormsName = "未建表";
}
else {
else
{
model.FormsName = "默认表单";
}
......@@ -2736,14 +2841,16 @@ namespace Mall.Module.Product
else if (type == 3)
{
var model = goodsRepository.GetEntity(goodsId);
if (model == null) {
if (model == null)
{
return false;
}
keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods.IsQuickBuy),model.IsQuickBuy==1?2:1}
};
}
else {
else
{
return false;
}
List<WhereHelper> wheres = new List<WhereHelper>() {
......
......@@ -53,6 +53,16 @@ namespace Mall.Module.User
return roleRepository.GetRoleListRepository(query);
}
/// <summary>
/// 根据员工编号获取角色权限
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Role_Extend> GetRoleListExtModule(RB_Role_Extend query)
{
return roleRepository.GetRoleListExtRepository(query);
}
/// <summary>
/// 新增修改角色
/// </summary>
......
......@@ -10,6 +10,7 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Mall.Common.Plugin;
using NPOI.SS.Formula.Functions;
using Mall.Repository.User;
namespace Mall.Module.User
{
......@@ -46,6 +47,187 @@ namespace Mall.Module.User
/// </summary>
private Repository.AppletWeChat.RB_Live_HouseRepository liveHouseRepository = new Repository.AppletWeChat.RB_Live_HouseRepository();
/// <summary>
/// 轮播图表仓储层对象
/// </summary>
private RB_Mall_NavRepository navRepository = new RB_Mall_NavRepository();
/// <summary>
/// 图片魔方表仓储层对象
/// </summary>
private RB_Mall_MagicRepository magicRepository = new RB_Mall_MagicRepository();
#region 轮播图管理
/// <summary>
/// 轮播图分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Mall_Nav_Extend> GetMallNavPageListModule(int pageIndex, int pageSize, out long rowCount, RB_Mall_Nav_Extend query)
{
return navRepository.GetMallNavPageListRepository(pageIndex, pageSize, out rowCount, query);
}
/// <summary>
/// 获取轮播图列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Mall_Nav_Extend> GetMallNavListModule(RB_Mall_Nav_Extend query)
{
return navRepository.GetMallNavListRepository(query);
}
/// <summary>
/// 添加修改轮播图
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public bool SetMallNavModule(RB_Mall_Nav_Extend extModel)
{
bool flag = false;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Mall_Nav_Extend.NavName),extModel.NavName.Trim()},
{ nameof(RB_Mall_Nav_Extend.NavLink),extModel.NavLink},
{ nameof(RB_Mall_Nav_Extend.NavImg),extModel.NavImg},
};
flag = navRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Nav_Extend.Id), extModel.Id));
}
else
{
int NewId = navRepository.Insert(extModel);
extModel.Id = NewId;
flag = NewId > 0;
}
return flag;
}
/// <summary>
/// 获取轮播图实体
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public RB_Mall_Nav_Extend GetMallNavModule(object Id)
{
var extModel = navRepository.GetEntity<RB_Mall_Nav_Extend>(Id);
if (extModel == null)
{
extModel = new RB_Mall_Nav_Extend();
}
return extModel;
}
/// <summary>
/// 删除轮播图
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemoveMallNavModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Mall_Nav_Extend.Status),1},
};
flag = navRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Nav_Extend.Id), Id));
return flag;
}
#endregion
#region 图片魔方管理
/// <summary>
/// 图片魔方分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Mall_Magic_Extend> GetMallMagicPageListModule(int pageIndex, int pageSize, out long rowCount, RB_Mall_Magic_Extend query)
{
return magicRepository.GetMallMagicPageListRepository(pageIndex, pageSize, out rowCount, query);
}
/// <summary>
/// 获取图片魔方列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Mall_Magic_Extend> GetMallMagicListModule(RB_Mall_Magic_Extend query)
{
return magicRepository.GetMallMagicListRepository(query);
}
/// <summary>
/// 添加修改图片魔方
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public bool SetMallMagicModule(RB_Mall_Magic_Extend extModel)
{
bool flag = false;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Mall_Magic_Extend.Name),extModel.Name.Trim()},
{ nameof(RB_Mall_Magic_Extend.Style),extModel.Style},
{ nameof(RB_Mall_Magic_Extend.MagicData),extModel.MagicData},
};
flag = magicRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Magic_Extend.Id), extModel.Id));
}
else
{
int NewId = magicRepository.Insert(extModel);
extModel.Id = NewId;
flag = NewId > 0;
}
return flag;
}
/// <summary>
/// 获取图片魔方实体
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public RB_Mall_Magic_Extend GetMallMagicModule(object Id)
{
var extModel = magicRepository.GetEntity<RB_Mall_Magic_Extend>(Id);
if (extModel == null)
{
extModel = new RB_Mall_Magic_Extend();
}
if (extModel.MagicData != null && !string.IsNullOrEmpty(extModel.MagicData))
{
extModel.MagicDataList = Common.Plugin.JsonHelper.DeserializeObject<List<MagicItem>>(extModel.MagicData);
}
return extModel;
}
/// <summary>
/// 删除图片魔方
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemoveMallMagicModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Mall_Magic_Extend.Status),1},
};
flag = magicRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Magic_Extend.Id), Id));
return flag;
}
#endregion
#region 小程序
/// <summary>
......@@ -219,8 +401,9 @@ namespace Mall.Module.User
/// <param name="MallBaseId">小程序Id</param>
/// <param name="isGetNav">是否获取顶部底部配置+底部标签导航(0-不获取,1-获取)</param>
/// <param name="isGetUserCenterMenu">是否获取用户中心菜单</param>
/// <param name="isGetHomeData">是否获取首页配置数据</param>
/// <returns></returns>
public RB_MiniProgram_Extend GetMiniProgramModule(object MallBaseId, int isGetNav = 0, bool isGetUserCenterMenu = false)
public RB_MiniProgram_Extend GetMiniProgramModule(object MallBaseId, int isGetNav = 0, bool isGetUserCenterMenu = false,bool isGetHomeData=false)
{
RB_MiniProgram_Extend extModel = programRepository.GetEntity<RB_MiniProgram_Extend>(MallBaseId);
if (extModel == null)
......@@ -246,6 +429,13 @@ namespace Mall.Module.User
extModel.SelfMenuList = menuList?.Where(qitem => qitem.MenuType == 4)?.ToList();
}
}
if (isGetHomeData)
{
if (extModel.MallHomeData != null && !string.IsNullOrEmpty(extModel.MallHomeData))
{
extModel.HomeDataList = Common.Plugin.JsonHelper.DeserializeObject<List<HomeItem>>(extModel.MallHomeData);
}
}
return extModel;
}
......@@ -285,6 +475,24 @@ namespace Mall.Module.User
return flag;
}
/// <summary>
/// 修改小程序首页布局
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public bool SetMiniProgramMallHomeModule(RB_MiniProgram_Extend extModel)
{
bool flag = false;
if (extModel.MallBaseId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.MallHomeData),extModel.MallHomeData},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), extModel.MallBaseId));
}
return flag;
}
/// <summary>
......@@ -507,7 +715,6 @@ namespace Mall.Module.User
#endregion
#region 微信小程序基础配置
......@@ -572,9 +779,6 @@ namespace Mall.Module.User
#endregion
#region 发送小程序订阅信息
......@@ -1522,7 +1726,6 @@ namespace Mall.Module.User
#endregion
#region 小程序直播房间信息
......
......@@ -27,6 +27,16 @@ namespace Mall.Module.User
return tenantRepository.GetListRepository(query);
}
/// <summary>
/// 根据小程序获取商户信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public RB_Tenant_Extend GetTenantByMallModule(RB_Tenant_Extend query)
{
return tenantRepository.GetTenantByMallRepository(query);
}
/// <summary>
/// 获取商户分页列表
/// </summary>
......
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
namespace Mall.Repository.User
{
/// <summary>
/// 图片魔方表仓储层
/// </summary>
public class RB_Mall_MagicRepository : RepositoryBase<RB_Mall_Magic>
{
/// <summary>
/// 图片魔方分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Mall_Magic_Extend> GetMallMagicPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_Mall_Magic_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT * FROM RB_Mall_Magic WHERE 1=1 AND Status=0 ");
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Magic_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Magic_Extend.MallBaseId), query.MallBaseId);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Magic_Extend.Id), query.Id);
}
if (query.Name != null && !string.IsNullOrEmpty(query.Name.Trim()))
{
builder.AppendFormat(" AND {0} LIKE '%{1}%' ", nameof(RB_Mall_Magic_Extend.Name), query.Name.Trim());
}
return GetPage<RB_Mall_Magic_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取图片魔方列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Mall_Magic_Extend> GetMallMagicListRepository(RB_Mall_Magic_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT * FROM RB_Mall_Magic WHERE 1=1 AND Status=0 ");
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Magic_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Magic_Extend.MallBaseId), query.MallBaseId);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Magic_Extend.Id), query.Id);
}
if (query.Name != null && !string.IsNullOrEmpty(query.Name.Trim()))
{
builder.AppendFormat(" AND {0} LIKE '%{1}%' ", nameof(RB_Mall_Magic_Extend.Name), query.Name.Trim());
}
return Get<RB_Mall_Magic_Extend>(builder.ToString()).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
namespace Mall.Repository.User
{
/// <summary>
/// 轮播图表仓储层
/// </summary>
public class RB_Mall_NavRepository : RepositoryBase<RB_Mall_Nav>
{
/// <summary>
/// 轮播图分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Mall_Nav_Extend> GetMallNavPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_Mall_Nav_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT * FROM RB_Mall_Nav WHERE 1=1 AND Status=0 ");
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Nav_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Nav_Extend.MallBaseId), query.MallBaseId);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Nav_Extend.Id), query.Id);
}
if (query.NavName != null && !string.IsNullOrEmpty(query.NavName.Trim()))
{
builder.AppendFormat(" AND {0} LIKE '%{1}%' ", nameof(RB_Mall_Nav_Extend.NavName), query.NavName.Trim());
}
return GetPage<RB_Mall_Nav_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取轮播图列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Mall_Nav_Extend> GetMallNavListRepository(RB_Mall_Nav_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT * FROM RB_Mall_Nav WHERE 1=1 AND Status=0 ");
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Nav_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Nav_Extend.MallBaseId), query.MallBaseId);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Mall_Nav_Extend.Id), query.Id);
}
if (query.NavName != null && !string.IsNullOrEmpty(query.NavName.Trim()))
{
builder.AppendFormat(" AND {0} LIKE '%{1}%' ", nameof(RB_Mall_Nav_Extend.NavName), query.NavName.Trim());
}
return Get<RB_Mall_Nav_Extend>(builder.ToString()).ToList();
}
}
}
......@@ -31,10 +31,16 @@ namespace Mall.Repository.User
{
builder.AppendFormat(" AND MenuName LIKE '%{0}%' ", query.MenuName.Trim());
}
if (query.QMenuIds != null && !string.IsNullOrEmpty(query.QMenuIds.Trim()))
{
builder.AppendFormat(" AND MenuId IN({0}) ", query.QMenuIds.Trim());
}
}
return Get<RB_Menu_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 获取菜单分页列表
/// </summary>
......
......@@ -71,5 +71,21 @@ namespace Mall.Repository.User
}
return Get<RB_Role_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 根据员工编号获取角色权限
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Role_Extend> GetRoleListExtRepository(RB_Role_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT group_concat(RoleAuth) AS RoleAuth
FROM rb_role
WHERE `Status`=0 AND RoleId IN (SELECT group_concat(RoleAuth) AS RoleAuth FROM rb_employee WHERE empId={0} )
",query.EmpId);
return Get<RB_Role_Extend>(builder.ToString()).ToList();
}
}
}
\ No newline at end of file
......@@ -31,6 +31,29 @@ namespace Mall.Repository.User
return Get<RB_Tenant_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 根据小程序获取商户信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public RB_Tenant_Extend GetTenantByMallRepository(RB_Tenant_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.TenantId,B.EmpAccount AS Account,A.Name,A.MobilePhone,A.WeChatNum,A.IsEffective,A.AccountValidate,A.CreateMiniPrograme
,A.AccountStatus,B.EmpPwd AS Password,B.EmpId
FROM RB_Tenant AS A LEFT JOIN rb_employee AS B ON A.TenantId=B.TenantId
WHERE 1=1 ");
if (query != null)
{
if (query.Account != null && !string.IsNullOrEmpty(query.Account.Trim()))
{
builder.AppendFormat(" AND B.EmpAccount='{0}' ", query.Account.Trim());
}
}
return Get<RB_Tenant_Extend>(builder.ToString()).FirstOrDefault();
}
/// <summary>
/// 获取商户分页列表
/// </summary>
......
......@@ -234,29 +234,6 @@ namespace Mall.WebApi.Controllers.ByteDance
proc.Close();
return output;
//////using (var process = new System.Diagnostics.Process())
//////{
////// process.StartInfo.FileName = "cmd.exe cd 'D:\\Tool\\bytedance\\bytedanceide\\resources\\app.asar.unpacked\\bytecli.bat'";//后面的 \"D:\\ServKit\"替换为你需要的路径即可。
////// // process.StartInfo.FileName = "cmd.exe";
////// process.StartInfo.UseShellExecute = false;
////// process.StartInfo.RedirectStandardInput = true;
////// process.StartInfo.RedirectStandardOutput = true;
////// process.StartInfo.RedirectStandardError = true;
////// process.StartInfo.CreateNoWindow = true;
////// process.StartInfo.StandardOutputEncoding = Encoding.UTF8;
////// process.Start();
////// process.StandardInput.AutoFlush = true;
////// process.StandardInput.WriteLine(cmdline + "&exit");
////// //获取cmd窗口的输出信息
////// string output = process.StandardOutput.ReadToEnd();
////// process.WaitForExit();
////// process.Close();
////// return output;
//////}
}
}
......
......@@ -403,6 +403,7 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Success("", list);
}
/// <summary>
/// 获取分类详情
/// </summary>
......
......@@ -18,6 +18,8 @@ using Mall.CacheManager.User;
using Mall.CacheKey;
using Mall.Common.Plugin;
using Mall.Common.Enum.MallBase;
using Mall.Model.Entity.User;
using Mall.Module.Product;
namespace Mall.WebApi.Controllers.User
{
......@@ -62,6 +64,15 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
private Module.User.PlugInModule plugInModule = new Module.User.PlugInModule();
/// <summary>
/// 员工管理处理类
/// </summary>
private Module.User.EmployeeModule employeeModule = new Module.User.EmployeeModule();
/// <summary>
/// 产品处理类
/// </summary>
private ProductModule productModule = new ProductModule();
#region 商户信息
......@@ -72,7 +83,16 @@ namespace Mall.WebApi.Controllers.User
public ApiResult Login()
{
var query = JsonConvert.DeserializeObject<RB_Tenant_Extend>(RequestParm.msg.ToString());
var model = TenantModule.GetTenantListModule(query).FirstOrDefault();
var model = new RB_Tenant_Extend();
if (query.MallBaseId > 0)
{
model = TenantModule.GetTenantByMallModule(query);
}
else
{
model = TenantModule.GetTenantListModule(query).FirstOrDefault();
}
if (model == null)
{
return ApiResult.Failed("未找到此用户");
......@@ -116,11 +136,11 @@ namespace Mall.WebApi.Controllers.User
IsEffective = model.IsEffective,
AccountValidate = model.AccountValidate,
CreateMiniPrograme = model.CreateMiniPrograme,
//MallName = model.MallName,
AccountStatus = model.AccountStatus,
Token = token,
SecretKey = "",
MallBaseId = 0,
EmpId = model.EmpId,
};
UserReidsCache.UserInfoSet(UserModuleCacheKeyConfig.Mall_Login_Info + model.TenantId, obj, Config.JwtExpirTime);
return ApiResult.Success("", obj);
......@@ -402,6 +422,203 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取小程序首页配置
/// </summary>
/// <returns></returns>
public ApiResult GetMiniProgramMallIndex()
{
var data = programModule.GetMiniProgramModule(RequestParm.MallBaseId, isGetHomeData: true);
List<object> resultList = new List<object>();
List<object> normalList = new List<object>();
normalList.Add(new
{
key = "search",
name = "搜索框",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/search-bg.png"
});
normalList.Add(new
{
key = "banner",
name = "轮播图",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/banner-bg.png"
});
normalList.Add(new
{
key = "home_nav",
name = "导航图标",
relation_id = 0,
is_edit = 1,
row_num = 4,
imgBg = Common.Config.GetOssFileUrl + "/Static/home-nav-bg.png"
});
normalList.Add(new
{
key = "video",
name = "视频",
relation_id = 0,
is_edit = 1,
permission_key = "video",
video_url = "",
video_pic_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/video-bg.png"
});
normalList.Add(new
{
key = "notice",
name = "公告",
relation_id = 0,
is_edit = 1,
notice_url = "",
notice_bg_color = "#ED7E78",
notice_text_color = "#FFFFFF",
imgBg = Common.Config.GetOssFileUrl + "/Static/notice-bg.png"
});
normalList.Add(new
{
key = "topic",
name = "专题",
relation_id = 0,
is_edit = 1,
permission_key = "topic",
topic_num = 1,
topic_url = "",
topic_url_2 = "",
label_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/topic-bg.png"
});
normalList.Add(new
{
key = "coupon",
name = "领券中心",
relation_id = 0,
is_edit = 1,
permission_key = "coupon",
coupon_url = "",
coupon_not_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/coupon-bg.png"
});
resultList.Add(new
{
key = "normal",
name = "常用",
list = normalList
});
var categoryList = productModule.GetCategoryListModule(new Model.Extend.Product.RB_Product_Category_Extend() {
MallBaseId = RequestParm.MallBaseId, TenantId = RequestParm.TenantId, Tier = 1, IsShow = 1, Enabled = 1
});
List<object> catList = new List<object>();
catList.Add(new
{
key = "cat",
name = "所有分类",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/cat-bg.png"
});
foreach (var item in categoryList)
{
catList.Add(new
{
key = "cat",
name = item.Name,
relation_id = item.Id,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/cat-bg.png"
});
}
resultList.Add(new
{
key = "cat",
name = "商品分类",
list = catList
});
var magicList = programModule.GetMallMagicListModule(new RB_Mall_Magic_Extend() { MallBaseId = RequestParm.MallBaseId, TenantId = RequestParm.TenantId });
List<object> blockList = new List<object>();
foreach (var item in magicList)
{
blockList.Add(new
{
key = "block",
name = item.Name,
relation_id = item.Id,
imgBg = Common.Config.GetOssFileUrl + "/Static/block-bg.png"
});
}
resultList.Add(new
{
key = "block",
name = "图片魔方",
list = blockList
});
List<object> pluginList = new List<object>();
pluginList.Add(new
{
key = "booking",
name = "预约",
relation_id = 0,
is_edit = 0,
permission_key = "booking",
imgBg = Common.Config.GetOssFileUrl + "/Static/yuyue-bg.png"
});
pluginList.Add(new
{
key = "pintuan",
name = "拼团",
relation_id = 0,
is_edit = 0,
permission_key = "pintuan",
imgBg = Common.Config.GetOssFileUrl + "/Static/yuyue-bg.png"
});
pluginList.Add(new
{
key = "advance",
name = "预售",
relation_id = 0,
is_edit = 0,
permission_key = "advance",
imgBg = Common.Config.GetOssFileUrl + "/Static/yushou-bg.png"
});
resultList.Add(new
{
key = "plugin",
name = "插件",
list = pluginList
});
var obj = new
{
PlusInData = resultList,
HomeDataList = data.HomeDataList
};
return ApiResult.Success(data: obj);
}
/// <summary>
/// 添加修改小程序首页配置
/// </summary>
/// <returns></returns>
public ApiResult SetMiniProgramMallHome()
{
var extModel = JsonConvert.DeserializeObject<RB_MiniProgram_Extend>(RequestParm.msg.ToString());
if (extModel.HomeDataList != null && extModel.HomeDataList.Count > 0)
{
extModel.MallHomeData = JsonConvert.SerializeObject(extModel.HomeDataList);
}
var flag = programModule.SetMiniProgramMallHomeModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#region 设置可跳转小程序 OR 是否开启直播
/// <summary>
......@@ -557,13 +774,25 @@ namespace Mall.WebApi.Controllers.User
public ApiResult GetMenuList()
{
List<object> resultList = new List<object>();
var list = menuModule.GetMenuListModule(new RB_Menu_Extend() { });
var list = new List<RB_Menu_Extend>();
if (RequestParm.EmpId > 0)
{
var roleList = employeeModule.GetRoleListExtModule(new RB_Role_Extend() { EmpId = RequestParm.EmpId });
if (roleList != null && roleList.Count > 0)
{
list = menuModule.GetMenuListModule(new RB_Menu_Extend() { QMenuIds = roleList?.FirstOrDefault()?.RoleAuth });
}
}
else
{
list = menuModule.GetMenuListModule(new RB_Menu_Extend() { });
}
var rootList = list.Where(qitem => qitem.MenuLevel == 1).OrderBy(qitem => qitem.SortNum).ToList();
foreach (var item in rootList)
{
List<object> subResultList = new List<object>();
var subList = list.Where(qitem => qitem.MenuLevel == 2 && qitem.ParentId == item.MenuId).OrderBy(qitem => qitem.SortNum).ToList();
foreach (var subItem in subList)
{
List<object> thirdResultList = new List<object>();
......@@ -906,6 +1135,8 @@ namespace Mall.WebApi.Controllers.User
}
#endregion
#region 插件列表
/// <summary>
/// 获取插件列表
/// </summary>
......@@ -929,5 +1160,152 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Success(data: resultList);
}
#endregion
#region 轮播图
/// <summary>
/// 轮播图分页列表
/// </summary>
/// <returns></returns>
public ApiResult GetMallNavPageList()
{
ResultPageModel pageModel = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
var query = JsonConvert.DeserializeObject<RB_Mall_Nav_Extend>(RequestParm.msg.ToString());
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = programModule.GetMallNavPageListModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取轮播图列表
/// </summary>
/// <returns></returns>
public ApiResult GetMallNavList()
{
var query = JsonConvert.DeserializeObject<RB_Mall_Nav_Extend>(RequestParm.msg.ToString());
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = programModule.GetMallNavListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 新增修改轮播图
/// </summary>
/// <returns></returns>
public ApiResult SetMallNav()
{
var extModel = JsonConvert.DeserializeObject<RB_Mall_Nav_Extend>(RequestParm.msg.ToString());
extModel.Status = 0;
extModel.MallBaseId = RequestParm.MallBaseId;
extModel.TenantId = RequestParm.TenantId;
extModel.CreateDate = DateTime.Now;
var flag = programModule.SetMallNavModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取轮播图实体
/// </summary>
/// <returns></returns>
public ApiResult GetMallNav()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id", 0);
var extModel = programModule.GetMallNavModule(Id);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 删除轮播图
/// </summary>
/// <returns></returns>
public ApiResult RemoveMallNav()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id", 0);
var flag = programModule.RemoveMallNavModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 图片魔方管理
/// <summary>
/// 图片魔方分页列表
/// </summary>
/// <returns></returns>
public ApiResult GetMallMagicPageList()
{
ResultPageModel pageModel = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
var query = JsonConvert.DeserializeObject<RB_Mall_Magic_Extend>(RequestParm.msg.ToString());
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = programModule.GetMallMagicPageListModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取图片魔方列表
/// </summary>
/// <returns></returns>
public ApiResult GetMallMagicList()
{
var query = JsonConvert.DeserializeObject<RB_Mall_Magic_Extend>(RequestParm.msg.ToString());
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = programModule.GetMallMagicListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 新增修改图片魔方
/// </summary>
/// <returns></returns>
public ApiResult SetMallMagic()
{
var extModel = JsonConvert.DeserializeObject<RB_Mall_Magic_Extend>(RequestParm.msg.ToString());
extModel.Status = 0;
extModel.MallBaseId = RequestParm.MallBaseId;
extModel.TenantId = RequestParm.TenantId;
extModel.CreateDate = DateTime.Now;
if (extModel.MagicDataList != null && extModel.MagicDataList.Count > 0)
{
extModel.MagicData = Common.Plugin.JsonHelper.Serialize(extModel.MagicDataList);
}
var flag = programModule.SetMallMagicModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取图片魔方实体
/// </summary>
/// <returns></returns>
public ApiResult GetMallMagic()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id", 0);
var extModel = programModule.GetMallMagicModule(Id);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 删除图片魔方
/// </summary>
/// <returns></returns>
public ApiResult RemoveMallMagic()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id", 0);
var flag = programModule.RemoveMallMagicModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
}
}
\ No newline at end of file
......@@ -4,10 +4,6 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Controllers\ByteDance\ByteDanceController.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="web.config" />
</ItemGroup>
......@@ -29,9 +25,5 @@
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\ByteDance\" />
</ItemGroup>
</Project>
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