| | |
| | | /// <param name="cartTypes">1普通购物/2拼团模式/3团购模式/4秒杀模式/6砍价模式/7赠品</param> |
| | | /// <param name="objectId">关联对象类型</param> |
| | | /// <returns></returns> |
| | | Task<WebApiCallBack> Add(int userId, int productId, int nums, int numType, int cartTypes = 1, int objectId = 0); |
| | | Task<WebApiCallBack> Add(int userId, int productId, int nums, int numType, int cartTypes = 1, int objectId = 0,bool isCustomizable=false); |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// 获取商品分类 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | |
| | | Task<List<CoreCmsGoodsCategory>> GetGoodsCategory(); |
| | | /// <summary> |
| | | /// 检查用户是否是经销商 |
| | |
| | | /// <returns></returns> |
| | | |
| | | Task<bool> IsDictionary(int UserId); |
| | | /// <summary> |
| | | /// 计算定制费用 |
| | | /// </summary> |
| | | /// <param name="count"></param> |
| | | /// <returns></returns> |
| | | public decimal CommandCustomizable(int count); |
| | | } |
| | | |
| | | |
| | |
| | | ***********************************************************************/ |
| | | |
| | | using System.ComponentModel.DataAnnotations; |
| | | using Chuanyin.Attribute; |
| | | using SqlSugar; |
| | | |
| | | namespace CoreCms.Net.Model.Entities |
| | |
| | | /// <summary> |
| | | /// 购物车表 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | public class CoreCmsCart |
| | | { |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | public int objectId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否定制 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable =true)] |
| | | public bool isCustomizable { get; set; }=false; |
| | | } |
| | | } |
| | |
| | | /// 年销售额 |
| | | /// </summary> |
| | | [Display(Name = "年销售额")] |
| | | [SugarColumn(ColumnDescription = "年销售额")] |
| | | public decimal sales { get; set; } = 0; |
| | | [SugarColumn(ColumnDescription = "年销售额" ,IsNullable =true)] |
| | | public decimal? sales { get; set; } = 0; |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | public string storeCoordinate { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 身份证 |
| | | /// </summary> |
| | | [Display(Name = "身份证")] |
| | | [SugarColumn(ColumnDescription = "身份证", IsNullable = true)] |
| | | public string idCradNumber { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 学校名称 |
| | | /// </summary> |
| | | [Display(Name = "学校名称")] |
| | | [SugarColumn(ColumnDescription = "学校名称", IsNullable = true)] |
| | | public string schoolName { get; set; } |
| | | |
| | | |
| | | } |
| | |
| | | /// <summary> |
| | | /// 经销商业绩绩效记录表 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class DistributionAchievement:BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// 业绩业务订单表 |
| | | /// 当有需要计入的业绩订单时,产生一条订单 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class DistributionAchievementOrder: BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | [SugarColumn(IsIgnore = true)] |
| | | public string area { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否有支持定制的 |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public bool isCustomizable { get; set; }= false; |
| | | |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 货品表 |
| | | /// </summary> |
| | | |
| | | [SqlCodeFirst] |
| | | public partial class CoreCmsProducts |
| | | { |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | public System.Boolean isDel { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 是否支持定制 |
| | | /// </summary> |
| | | [Display(Name = "是否支持定制")] |
| | | [SugarColumn(ColumnDescription ="是否支持定制",DefaultValue ="0")] |
| | | public bool isCustomizable { get; set; }=false; |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | * Email: 34161541@qq.com |
| | | * CreateTime: 2024-03-01 22:14:58 |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | ***********************************************************************/ |
| | | using Chuanyin.Attribute; |
| | | using SqlSugar; |
| | | using System.ComponentModel.DataAnnotations; |
| | | |
| | |
| | | /// 订单明细表 |
| | | /// </summary> |
| | | [SugarTable("CoreCmsOrderItem",TableDescription = "订单明细表")] |
| | | [SqlCodeFirst] |
| | | public partial class CoreCmsOrderItem |
| | | { |
| | | /// <summary> |
| | |
| | | [Display(Name = "更新时间")] |
| | | [SugarColumn(ColumnDescription = "更新时间", IsNullable = true)] |
| | | public System.DateTime? updateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 定制费 |
| | | /// </summary> |
| | | [SugarColumn(ColumnDescription = "定制费", IsNullable = true)] |
| | | public decimal? CustomizableMoney { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否定制 |
| | | /// </summary> |
| | | [SugarColumn(ColumnDescription = "是否定制", IsNullable = true)] |
| | | public bool? IsCustomizable { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 计划订单表 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public class CoreCmsPlanOrder : BFBaseModel |
| | | { |
| | | |
| | |
| | | /// <summary> |
| | | /// 订单明细表 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | [SugarTable("CoreCmsPlanOrderItem", TableDescription = "计划订单明细表")] |
| | | public class CoreCmsPlanOrderItem : BFBaseModel |
| | | { |
| | |
| | | /// 门店表 |
| | | /// </summary> |
| | | [SugarTable("CoreCmsStore",TableDescription = "门店表")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class CoreCmsStore |
| | | { |
| | | /// <summary> |
| | |
| | | /// 用户表 |
| | | /// </summary> |
| | | [SugarTable("CoreCmsUser",TableDescription = "用户表")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class CoreCmsUser |
| | | { |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Display(Name = "线下经销商采集")] |
| | | [SugarTable(TableDescription = "线下经销商采集")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class OfflineDistributor: BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Display(Name = "洽谈记录")] |
| | | [SugarTable(TableDescription = "洽谈记录")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public class OfflineDistributorMeeting: BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Display(Name = "线下经销商采集")] |
| | | [SugarTable(TableDescription = "线下经销商采集")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public class OfflineDistributorOder: BFBaseModel |
| | | { |
| | | |
| | |
| | | /// </summary> |
| | | [Display(Name = "推广博主信息")] |
| | | [SugarTable( TableDescription = "推广博主")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class bloggersInfo: BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Display(Name = "推广博主信息")] |
| | | [SugarTable(TableDescription = "推广博主")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class intention:BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Display(Name = "洽谈记录")] |
| | | [SugarTable(TableDescription = "洽谈记录")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class meeting:BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Display(Name = "沟通记录")] |
| | | [SugarTable(TableDescription = "沟通记录")] |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class session:BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 审批流程 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public class applyModel: BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 个人简历 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class Job_ApplicantProfile : BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 工作经历 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class Job_EmploymentRecord |
| | | { |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 家庭成员 |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public class Job_FamilyMember |
| | | { |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// jobsetting |
| | | /// </summary> |
| | | [SqlCodeFirst] |
| | | //[SqlCodeFirst] |
| | | public partial class Job_jobSeting: BFBaseModel |
| | | { |
| | | /// <summary> |
| | |
| | | /// 非普通货品,关联对象序列 |
| | | /// </summary> |
| | | public int objectId { get; set; } = 0; |
| | | /// <summary> |
| | | /// 是否是定制 |
| | | /// </summary> |
| | | public bool isCustomizable { get; set; } = false; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 销售额度 |
| | | /// </summary> |
| | | public decimal sales { get; set; } |
| | | public decimal? sales { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 所属行业 |
| | |
| | | /// 坐标 |
| | | /// </summary> |
| | | public string storeCoordinate { get; set; } |
| | | /// <summary> |
| | | /// 学校名称 |
| | | /// </summary> |
| | | public string schoolName { get; set; } |
| | | /// <summary> |
| | | /// 身份证用, 分割 |
| | | /// </summary> |
| | | public string idCradNumber { get; set; } |
| | | } |
| | | |
| | | |
| | |
| | | using System.Collections.Generic; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using SqlSugar; |
| | | |
| | | namespace CoreCms.Net.Model.ViewModels.DTO |
| | | { |
| | |
| | | public CoreCmsProducts products { get; set; } = new(); |
| | | |
| | | public CoreCmsGoods good { get; set; } |
| | | /// <summary> |
| | | /// 是否定制 |
| | | /// </summary> |
| | | public bool isCustomizable { get; set; } = false; |
| | | |
| | | /// <summary> |
| | | /// 定制费用 |
| | | /// </summary> |
| | | public decimal CustomizableMoney { get; set; } = 0; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// 普通经销商分成 |
| | | /// </summary> |
| | | public decimal distributionCutMoney { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否支持封面定制 |
| | | /// </summary> |
| | | public bool isCustomizable { get; set; } =false; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | updateTime = p.updateTime, |
| | | verifyTime = p.verifyTime, |
| | | isDelete = p.isDelete, |
| | | idCradNumber = p.idCradNumber, |
| | | schoolName = p.schoolName, |
| | | storeCoordinate = p.storeCoordinate, |
| | | UserGradeId = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.id == p.userId).Select(o => o.grade), |
| | | DistributionAchievementTotals = SqlFunc.Subqueryable<DistributionAchievement>() |
| | |
| | | profession = p.profession, |
| | | sales=p.sales, |
| | | storeCoordinate = p.storeCoordinate, |
| | | idCradNumber = p.idCradNumber, |
| | | schoolName = p.schoolName, |
| | | UserGradeId = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.id == p.userId).Select(o => o.grade), |
| | | DistributionAchievementTotals= SqlFunc.Subqueryable<DistributionAchievement>() |
| | | .Where(da=>da.userID==p.userId&&da.isdelete==false) |
| | |
| | | obj.distributionCutMoney = p.distributionCutMoney; |
| | | obj.cutMoney = p.cutMoney; |
| | | obj.distributionPrice= p.distributionPrice; |
| | | obj.isCustomizable = p.isCustomizable; |
| | | products.Add(obj); |
| | | |
| | | var pd = new CoreCmsProductsDistribution(); |
| | |
| | | obj.distributionCutMoney = oldObj.distributionCutMoney; |
| | | obj.cutMoney = oldObj.cutMoney; |
| | | obj.distributionPrice = oldObj.distributionPrice; |
| | | |
| | | obj.isCustomizable = oldObj.isCustomizable; |
| | | if (string.IsNullOrEmpty(obj.images)) |
| | | { |
| | | obj.images = goods.image; |
| | |
| | | p.distributionPrice = child.distributionPrice; |
| | | p.cutMoney = child.cutMoney; |
| | | p.distributionCutMoney = child.distributionCutMoney; |
| | | p.isCustomizable= child.isCustomizable; |
| | | |
| | | } |
| | | }); |
| | |
| | | obj.distributionPrice = p.distributionPrice; |
| | | obj.cutMoney = p.cutMoney; |
| | | obj.distributionCutMoney = p.distributionCutMoney; |
| | | obj.isCustomizable =p.isCustomizable; |
| | | if (string.IsNullOrEmpty(p.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | obj.distributionPrice = newObj.distributionPrice; |
| | | obj.cutMoney = newObj.cutMoney; |
| | | obj.distributionCutMoney = newObj.distributionCutMoney; |
| | | obj.isCustomizable = newObj.isCustomizable; |
| | | if (string.IsNullOrEmpty(newObj.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | obj.distributionPrice = newObj.distributionPrice; |
| | | obj.cutMoney = newObj.cutMoney; |
| | | obj.distributionCutMoney = newObj.distributionCutMoney; |
| | | obj.isCustomizable = newObj.isCustomizable; |
| | | if (string.IsNullOrEmpty(newObj.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | isdel = sOrder.isdel, |
| | | createTime = sOrder.createTime, |
| | | updateTime = sOrder.updateTime, |
| | | userNickName = sUser.nickName |
| | | userNickName = sUser.nickName, |
| | | |
| | | |
| | | }) |
| | | .With(SqlWith.NoLock) |
| | | .MergeTable() |
| | | .Mapper(sOrder => sOrder.aftersalesItem, sOrder => sOrder.aftersalesItem.First().orderId) |
| | | .Mapper(sOrder => sOrder.items, sOrder => sOrder.items.First().orderId) |
| | | .Mapper(sOrder => sOrder.items, sOrder => sOrder.items.First().orderId) |
| | | .OrderByIF(orderByExpression != null, orderByExpression, orderByType) |
| | | .WhereIF(predicate != null, predicate) |
| | | .ToPageListAsync(pageIndex, pageSize, totalCount); |
| | |
| | | oldModel.distributionPrice = entity.distributionPrice; |
| | | oldModel.cutMoney = entity.cutMoney; |
| | | oldModel.distributionCutMoney = entity.distributionCutMoney; |
| | | oldModel.isCustomizable=entity.isCustomizable; |
| | | |
| | | //事物处理过程结束 |
| | | var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); |
| | |
| | | distributionPrice = product.distributionPrice, |
| | | cutMoney = product.cutMoney, |
| | | distributionCutMoney = product.distributionCutMoney, |
| | | isCustomizable=product.isCustomizable, |
| | | CategoryID = Category.id, |
| | | Category = (SqlFunc.Subqueryable<CoreCmsGoodsCategory>().Where(x => x.id == Category.parentId).Select(x => x.name) + "-" + Category.name) ?? Category.name, |
| | | }).With(SqlWith.NoLock) |
| | |
| | | cutMoney = product.cutMoney, |
| | | distributionCutMoney = product.distributionCutMoney, |
| | | CategoryID = Category.id, |
| | | isCustomizable = product.isCustomizable, |
| | | Category = (SqlFunc.Subqueryable<CoreCmsGoodsCategory>().Where(x => x.id == Category.parentId).Select(x => x.name) + "-" + Category.name) ?? Category.name, |
| | | }) |
| | | .MergeTable() |
| | |
| | | cutMoney = product.cutMoney, |
| | | distributionCutMoney = product.distributionCutMoney, |
| | | CategoryID = Category.id, |
| | | isCustomizable = product.isCustomizable, |
| | | Category = (SqlFunc.Subqueryable<CoreCmsGoodsCategory>().Where(x => x.id == Category.parentId).Select(x => x.name) + "-" + Category.name) ?? Category.name, |
| | | }).With(SqlWith.NoLock) |
| | | .MergeTable() |
| | |
| | | cutMoney = product.cutMoney, |
| | | distributionCutMoney = product.distributionCutMoney, |
| | | CategoryID = Category.id, |
| | | isCustomizable = product.isCustomizable, |
| | | Category = (SqlFunc.Subqueryable<CoreCmsGoodsCategory>().Where(x => x.id == Category.parentId).Select(x => x.name) + "-" + Category.name) ?? Category.name, |
| | | }) |
| | | .MergeTable() |
| | |
| | | /// <param name="userId"></param> |
| | | /// <param name="numType"></param> |
| | | /// <param name="type"></param> |
| | | /// <param name="isCustomizable"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebApiCallBack> SetCartNum(int id, int nums, int userId, int numType, int type = 1) |
| | | { |
| | |
| | | jm.msg = "获取购物车数据失败"; |
| | | return jm; |
| | | } |
| | | var outData = await Add(userId, cartModel.productId, nums, numType, type); |
| | | var outData = await Add(userId, cartModel.productId, nums, numType, type,isCustomizable:cartModel.isCustomizable); |
| | | jm.status = outData.status; |
| | | jm.msg = jm.status ? GlobalConstVars.SetDataSuccess : GlobalConstVars.SetDataFailure; |
| | | jm.otherData = outData; |
| | |
| | | /// <param name="numType">数量类型/1是直接增加/2是赋值</param> |
| | | /// <param name="cartTypes">1普通购物还是2团购秒杀3团购模式4秒杀模式6砍价模式7赠品</param> |
| | | /// <param name="objectId">关联对象类型</param> |
| | | /// <param name="isCustomizable">关联对象类型</param> |
| | | /// <returns></returns> |
| | | public async Task<WebApiCallBack> Add(int userId, int productId, int nums, int numType, int cartTypes = 1, int objectId = 0) |
| | | public async Task<WebApiCallBack> Add(int userId, int productId, int nums, int numType, int cartTypes = 1, int objectId = 0,bool isCustomizable = false) |
| | | { |
| | | var jm = new WebApiCallBack(); |
| | | |
| | |
| | | if (products == null) |
| | | { |
| | | jm.msg = "获取货品信息失败"; |
| | | return jm; |
| | | } |
| | | if(isCustomizable==true&&products.isCustomizable!=true) |
| | | { |
| | | jm.msg = "该货物不支持定制"; |
| | | return jm; |
| | | } |
| | | //判断是否下架 |
| | |
| | | productId = productId, |
| | | nums = nums, |
| | | type = cartTypes, |
| | | objectId = objectId |
| | | objectId = objectId, |
| | | //支持定制 |
| | | isCustomizable= isCustomizable, |
| | | }; |
| | | var outId = await _dal.InsertAsync(catInfo); |
| | | jm.status = outId > 0; |
| | |
| | | /// <param name="userId">用户序列</param> |
| | | /// <param name="nums">加入购物车数量</param> |
| | | /// <param name="ruleId">规则序列</param> |
| | | /// <param name="ruleId">货品是否定制</param> |
| | | public async Task<WebApiCallBack> AddCartHavePinTuan(int productId, int userId = 0, int nums = 1, int ruleId = 0) |
| | | { |
| | | var jm = new WebApiCallBack(); |
| | |
| | | cartProducts.type = item.type; |
| | | cartProducts.weight = goodsWeight; |
| | | cartProducts.products = productInfo; |
| | | cartProducts.isCustomizable = item.isCustomizable; |
| | | //如果传过来了购物车数据,就算指定的购物车的数据,否则,就算全部购物车的数据 |
| | | if (ids != null && ids.Any() && ids.Contains(item.id)) |
| | | { |
| | |
| | | } |
| | | //单条商品总价 |
| | | item.products.amount = Math.Round(item.nums * (decimal)item.products.price, 2); |
| | | //定制商品添加定制价格 |
| | | if (item.isCustomizable) |
| | | //是定制商品 |
| | | { |
| | | item.products.amount += _bfbfComAPIService.CommandCustomizable(item.nums); |
| | | item.CustomizableMoney = _bfbfComAPIService.CommandCustomizable(item.nums); |
| | | } |
| | | |
| | | if (item.isSelect) |
| | | { |
| | |
| | | if (product == null) return null; |
| | | |
| | | good.skuList = await GetCoreCmsProductsView(good, products, userId, isPromotion, type, groupId); |
| | | var coutiscut = products.Where(x => x.isCustomizable == true).Count(); |
| | | if (coutiscut > 0) |
| | | good.isCustomizable = true; |
| | | } |
| | | else |
| | | { |
| | |
| | | item.distributionCutMoney = o.distributionCutMoney; |
| | | item.mktPrice = o.mktprice; |
| | | item.selPrice = o.price; |
| | | item.isCustomizable = o.isCustomizable; |
| | | if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant()) |
| | | { |
| | | if (isMaxPinTuanGoodsNums) |
| | |
| | | item.distributionCutMoney = o.distributionCutMoney; |
| | | item.mktPrice = o.mktprice; |
| | | item.selPrice = o.price; |
| | | item.isCustomizable = o.isCustomizable; |
| | | if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant()) |
| | | { |
| | | if (isMaxPinTuanGoodsNums) |
| | |
| | | weight = Math.Round(item.weight * item.nums, 2), |
| | | sendNums = 0, |
| | | addon = item.products.spesDesc, |
| | | createTime = DateTime.Now |
| | | createTime = DateTime.Now, |
| | | CustomizableMoney= item.CustomizableMoney, |
| | | IsCustomizable = item.isCustomizable, |
| | | |
| | | }; |
| | | if (item.products.promotionList.Count > 0) |
| | | { |
| | |
| | | { |
| | | return await _unitOfWork.GetDbClient().Queryable<CoreCmsGoodsCategory>().Where(x=>x.isShow==true).WithCache(10).ToTreeAsync(x=>x.children, x=>x.parentId,0); |
| | | } |
| | | |
| | | |
| | | public decimal CommandCustomizable(int count) |
| | | { |
| | | if (count > 9999) |
| | | return 0; |
| | | return count * 1; |
| | | } |
| | | } |
| | | } |
| | |
| | | unit = good.unit, |
| | | distributionPrice = product.distributionPrice, |
| | | cutMoney = product.cutMoney, |
| | | distributionCutMoney = product.distributionCutMoney, |
| | | distributionCutMoney = product.distributionCutMoney, |
| | | isCustomizable=product.isCustomizable, |
| | | }).With(SqlWith.NoLock) |
| | | .FirstAsync(); |
| | | |
| | |
| | | { |
| | | where = where.And(p => p.distributionCutMoney == distributionCutMoney); |
| | | } |
| | | |
| | | //是否删除 bit |
| | | var isCustomizable = Request.Form["isCustomizable"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(isCustomizable) && isCustomizable.ToLowerInvariant() == "true") |
| | | { |
| | | where = where.And(p => p.isCustomizable == true); |
| | | } |
| | | else if (!string.IsNullOrEmpty(isCustomizable) && isCustomizable.ToLowerInvariant() == "false") |
| | | { |
| | | where = where.And(p => p.isCustomizable == false); |
| | | } |
| | | //获取数据 |
| | | var list = await _CoreCmsProductsServices.QueryDetailPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true); |
| | | //返回数据 |
| | |
| | | [Description("编辑提交")] |
| | | public async Task<AdminUiCallBack> DoEdit([FromBody]CoreCmsProducts entity) |
| | | { |
| | | |
| | | |
| | | var jm = await _CoreCmsProductsServices.UpdateAsync(entity); |
| | | return jm; |
| | | } |
| | |
| | | <img class="coreshop-upload-img" id="viewImgBoximages" src="{{d.params.data.images || layui.setter.noImagePicUrl }}"> |
| | | </div> |
| | | </div> --> |
| | | <!-- |
| | | <div class="layui-form-item" pane> |
| | | <label for="isDel" class="layui-form-label layui-form-required">是否删除</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" lay-filter="switch" name="isDel" {{ d.params.data.isDel ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭"> |
| | | </div> |
| | | </div> --> |
| | | |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="distributionCutMoney" class="layui-form-label layui-form-required" style="width: 180px;">推广经销商采购返现(元)</label> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="layui-form-item" pane> |
| | | <label for="isCustomizable" class="layui-form-label layui-form-required">是否支持定制</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" lay-filter="switch" name="isCustomizable" {{ d.params.data.isCustomizable ? 'checked' : '' }} lay-skin="switch" lay-text="支持|不支持"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item text-right core-hidden"> |
| | | <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsbaifenProducts-editForm-submit" id="LAY-app-CoreCmsbaifenProducts-editForm-submit" value="确认编辑"> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="category">商品分类</label> |
| | | <div class="layui-input-inline"> |
| | | |
| | | <div id="sel_category_ptindes555" class="ew-xmselect-tree" lay-reqText="请选择商品分类"></div> |
| | | <div class="layui-input-inline" style="width: 200px;"> |
| | | <div id="sel_category_ptindes555" class="ew-xmselect-tree" lay-reqText="请选择商品分类"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <!-- <div class="layui-inline"> |
| | | <label class="layui-form-label" for="pointsDeduction">积分可抵扣金额</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | </div> |
| | | </div> --> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="isCustomizable">是否支持定制</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="isCustomizable"> |
| | | <option value="">请选择</option> |
| | | <option value="True">是</option> |
| | | <option value="False">否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsbaifenProducts-search"><i class="layui-icon layui-icon-search"></i>筛选</button> |
| | | </div> |
| | | </div> |
| | |
| | | <i class="layui-icon layui-icon-help"></i> |
| | | 确定要删除吗? |
| | | </div> |
| | | <div class="dropdown-popconfirm-btn"> |
| | | <div class="dropdown-popconfirm-btn" > |
| | | <a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a> |
| | | <a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a> |
| | | </div> |
| | |
| | | // { field: 'isDefalut', title: '是否默认货品', width: 95, templet: '#switch_isDefalut', sort: false , unresize: true}, |
| | | |
| | | // { field: 'isDel', title: '是否删除', width: 95, templet: '#switch_isDel', sort: false , unresize: true}, |
| | | |
| | | { field: 'isCustomizable', title: '是否支持定制', width: 100, sort: false, |
| | | templet: function (d) { |
| | | if (d.isCustomizable==true) { |
| | | return '<span style="color: red;">是</span>'; |
| | | } else { |
| | | return '<span>否</span>'; |
| | | } |
| | | } |
| | | }, |
| | | { width: 162, align: 'center', title:'操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsbaifenProducts-tableBox-bar' } |
| | | ] |
| | | ] |
| | |
| | | function(data) { |
| | | var field = data.field; //获取提交的字段 |
| | | |
| | | field.marketable = field.marketable == 'on'; |
| | | field.isDefalut = field.isDefalut == 'on'; |
| | | field.isDel = field.isDel == 'on'; |
| | | // field.marketable = field.marketable == 'on'; |
| | | // field.isDefalut = field.isDefalut == 'on'; |
| | | // field.isDel = field.isDel == 'on'; |
| | | if(field.isCustomizable=='on') |
| | | { |
| | | field.isCustomizable=true |
| | | } |
| | | else |
| | | { |
| | | field.isCustomizable=false |
| | | } |
| | | |
| | | if (debug) { console.log(field); } //开启调试返回数据 |
| | | //提交 Ajax 成功后,关闭当前弹层并重载表格 |
| | |
| | | <tbody> |
| | | <tr> |
| | | <td style="width:30%;"> |
| | | 开始时间 |
| | | 开始时间 |
| | | </td> |
| | | <td style="width:30%;"> |
| | | 结束时间 |
| | | 结束时间 |
| | | </td> |
| | | <td style="width:20%;"> |
| | | 绩效总额 |
| | | 绩效总额 |
| | | </td> |
| | | <td style="width:20%;"> |
| | | 推广费用 |
| | | 推广费用 |
| | | </td> |
| | | </tr> |
| | | |
| | |
| | | <script> |
| | | var debug = layui.setter.debug; |
| | | layui.data.done = function (d) { |
| | | //开启调试情况下获取接口赋值数据 |
| | | //������������»�ȡ�ӿڸ�ֵ���� |
| | | if (debug) { console.log(d.params.data); } |
| | | |
| | | layui.use(['admin', 'form', 'coreHelper'], function () { |
| | |
| | | <input name="mobile" lay-verify="required|phone" class="layui-input" placeholder="请输入手机号" lay-reqText="请输入手机号" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="schoolName" class="layui-form-label ">学校名称</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="schoolName" class="layui-input" id="CreatschoolName" placeholder="学校名称" lay-reqText="学校名称" value="" /> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="profession" class="layui-form-label layui-form-required">所属行业</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | id: 103, |
| | | }, |
| | | { |
| | | title: "微商", |
| | | title: "电商(微商)", |
| | | id: 104, |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: "教师", |
| | | id: 106, |
| | | }, { |
| | | title: "教育资源商", |
| | | id: 107, |
| | | } |
| | | , { |
| | | title: "校园代理", |
| | | id: 108, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | |
| | | <img src=" {{ d.params.data.model.storeBanner ? d.params.data.model.storeBanner:'/static/images/common/empty-banner.png' }}" /> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <label for="schoolName">学校名称</label> |
| | | </td> |
| | | <td> |
| | | {{ d.params.data.model.schoolName || '' }} |
| | | </td> |
| | | <td> |
| | | <label for="idCradNumber">身份证</label> |
| | | </td> |
| | | <td> |
| | | {{#if(d.params.data.model.idCradNumber){}} |
| | | |
| | | |
| | | <a href="javascript:;" class="preview-image" data-url="{{d.params.data.lisimg1}}"> |
| | | <img src="{{d.params.data.lisimg1}}" alt="图片预览" style="max-width:30px;max-height:30px; margin-left: 5px;"> |
| | | </a> |
| | | <!-- <a href="javascript:void(0);" onclick=""><img style="max-width:30px;max-height:30px; margin-left: 5px;" src="{{d.params.data.lisimg1}}" /></a> |
| | | |
| | | <a href="javascript:void(0);" onclick=""><img style="max-width:30px;max-height:30px; margin-left: 5px;" src="{{d.params.data.lisimg1}}" /></a> --> |
| | | {{# }else{}} |
| | | |
| | | <img src=" /static/images/common/empty-banner.png" /> |
| | | {{# }}} |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <label for="storeDesc">店铺简介</label> |
| | |
| | | //开启调试情况下获取接口赋值数据 |
| | | if (debug) { console.log(d.params.data); } |
| | | |
| | | layui.use(['admin', 'form', 'coreHelper'], function () { |
| | | |
| | | layui.use(['admin', 'form', 'coreHelper','photos'], function () { |
| | | var $ = layui.$ |
| | | , setter = layui.setter |
| | | , admin = layui.admin |
| | | , coreHelper = layui.coreHelper |
| | | ,photos=layui.photos |
| | | , form = layui.form; |
| | | |
| | | form.render(null, 'LAY-app-CoreCmsDistribution-detailsForm'); |
| | | }); |
| | | |
| | | // 监听图片链接的点击事件 |
| | | $('.preview-image').on('click', function () { |
| | | var index = $(this).data('index'); |
| | | var imgSrc = $(this).attr('href'); |
| | | |
| | | // 使用layer的图片预览功能 |
| | | layer.photos({ |
| | | photos: '.image-links' // 这里指定了图片所在的父容器 |
| | | , anim: 5 // 图片切换动画,默认是0,可以设置0-6的数字,代表不同的动画效果 |
| | | , success: function (layero, index) { |
| | | // 当前预览的图片索引 |
| | | console.log('当前预览的图片索引:', index); |
| | | // 如果需要,你可以在这里添加更多的操作,比如关闭时的回调 |
| | | } |
| | | }); |
| | | |
| | | return false; // 阻止默认的链接行为 |
| | | }); |
| | | }; |
| | | </script> |
| | |
| | | * @Author: 小飞侠 |
| | | * @Date: 2024-02-28 13:48:49 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2024-04-16 15:08:49 |
| | | * @LastEditTime: 2024-05-23 08:17:53 |
| | | * Copyright: 2024 MinTinge CO.,LTD. All Rights Reserved. |
| | | * @Descripttion: 写入你的描述 |
| | | --> |
| | |
| | | id: 103, |
| | | }, |
| | | { |
| | | title: "微商", |
| | | title: "电商(微商)", |
| | | id: 104, |
| | | }, |
| | | { |
| | |
| | | title: "教师", |
| | | id: 106, |
| | | }, |
| | | { |
| | | title: "教育资源商", |
| | | id: 107, |
| | | }, |
| | | { |
| | | title: "校园代理", |
| | | id: 108, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | |
| | | // } |
| | | // } |
| | | // }, |
| | | { field: 'schoolName', title: '学校名称', sort: false,width: 133 }, |
| | | { |
| | | field: 'idCradNumber', title: '身份证', width: 120, sort: false, |
| | | templet: function (d) { |
| | | if (d.idCradNumber) { |
| | | |
| | | var listimg= d.idCradNumber.split(",") |
| | | var str=""; |
| | | listimg.forEach((value,index)=> |
| | | { |
| | | str+= '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + value + '")><image style="max-width:30px;max-height:30px; margin-left: 5px;" src="' + value + '" /></a>' |
| | | |
| | | }) |
| | | |
| | | return str; |
| | | } else { |
| | | return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + setter.noImagePicUrl + '")><image style="max-width:30px;max-height:30px; margin-left: 5px;" src="' + setter.noImagePicUrl + '" /></a>'; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | field: 'storeBanner', title: '门头图片', sort: false, width: 100, templet: function (d) { |
| | | if (d.storeBanner) { |
| | |
| | | function doDetails(obj) { |
| | | coreHelper.Post("Api/CoreCmsDistribution/GetDetails", { id: obj.data.id }, function (e) { |
| | | if (e.code === 0) { |
| | | debugger |
| | | if(e.data.model.idCradNumber) |
| | | { |
| | | |
| | | lisimg=e.data.model.idCradNumber.split(','); |
| | | e.data.lisimg1=lisimg[0]; |
| | | |
| | | e.data.lisimg2=lisimg[1]; |
| | | } |
| | | admin.popup({ |
| | | shadeClose: false, |
| | | title: '查看详情', |
| | |
| | | |
| | | <th style="width: 60px;">推广经销商采购返现</th> |
| | | <th>推广用户购买返现</th> |
| | | <th style="width: 80px;">是否支持定制</th> |
| | | <!-- <th>二级返现</th> |
| | | <!-- <th>三级返现</th> --> --> |
| | | <th>操作</th> |
| | |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[cutMoney][]" value="{{item.cutMoney||'0'}}" placeholder="普通用户购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <!-- <input type="checkbox" name="product[isCustomizable][]" value="{{item.isCustomizable||'false'}}" placeholder="普通用户购买返现" class="layui-input layui-inline-1"> --> |
| | | <input type="checkbox" name="product[isCustomizable][]" title="支持|不支持" lay-skin="switch" value="{{item.distributionCutMoney||'false'}}" lay-filter="isCustomizable" class="isCustomizable"> |
| | | </td> |
| | | <!-- <td> |
| | | <input type="text" name="product[levelTwo][]" value="{{item.levelTwo}}" placeholder="二级返现" class="layui-input layui-inline-1"> |
| | |
| | | } |
| | | form.render(); |
| | | }); |
| | | |
| | | |
| | | // 监听开关切换事件 |
| | | form.on('switch(isCustomizable)', function(data){ |
| | | var elem = data.elem; // 当前开关元素 |
| | | elem.value=true; |
| | | |
| | | }); |
| | | function openSpecBox(is_open) { |
| | | if (is_open == '0') { |
| | | $("input[name=openSpec]").val("1"); |
| | |
| | | //多参数产品库生成列表集合 |
| | | var products = []; |
| | | var productsCount = parseInt(field['productsCount']); |
| | | debugger |
| | | |
| | | for (var i = 0; i < productsCount; i++) { |
| | | var productModel = {}; |
| | | productModel.costprice = field['product[costprice][' + i + ']']; |
| | |
| | | productModel.levelThree = field['product[levelThree][' + i + ']']; |
| | | productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']']; |
| | | productModel.points = field['product[points][' + i + ']']; |
| | | debugger |
| | | //百分兵法添加 |
| | | productModel.isCustomizable = field['product[isCustomizable][' + i + ']']; |
| | | productModel.points = field['product[points][' + i + ']']; |
| | | productModel.distributionPrice = field['product[distributionPrice][' + i + ']']; |
| | | productModel.distributionCutMoney = field['product[distributionCutMoney][' + i + ']']; |
| | | productModel.cutMoney = field['product[cutMoney][' + i + ']']; |
| | |
| | | |
| | | <th style="width: 60px;">推广经销商采购返现</th> |
| | | <th>推广用户购买返现</th> |
| | | <th style="width: 80px;">支持定制</th> |
| | | <!-- <th>二级返现</th> |
| | | <!-- <th>三级返现</th> --> --> |
| | | </tr> |
| | |
| | | <td> |
| | | {{item.cutMoney}} |
| | | </td> |
| | | {{#if (item.isCustomizable == true){}} |
| | | <td style="color: red;" >是</td> |
| | | {{#}else{}} |
| | | <td >否</td> |
| | | {{#}}} |
| | | <!-- <td> |
| | | {{item.levelOne}} |
| | | </td> |
| | |
| | | |
| | | <th style="width: 60px;">推广经销商采购返现</th> |
| | | <th>推广用户购买返现</th> |
| | | <th style="width: 80px;">是否支持定制</th> |
| | | <!-- <th>二级返现</th> |
| | | <!-- <th>三级返现</th> --> --> |
| | | |
| | |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[cutMoney][]" value="{{item.cutMoney||'0'}}" placeholder="推广普通用户购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="checkbox" name="product[isCustomizable][]" {{item.isCustomizable==true? 'checked':""}} value="{{item.isCustomizable||'false'}}" title="支持|不支持" lay-skin="switch" lay-filter="isCustomizable" > |
| | | </td> |
| | | <!-- <td> |
| | | <input type="text" name="product[levelTwo][]" value="{{item.levelTwo}}" placeholder="二级返现" class="layui-input layui-inline-1"> |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 监听开关切换事件 |
| | | form.on('switch(isCustomizable)', function(data){ |
| | | var elem = data.elem; // 当前开关元素 |
| | | elem.value=true; |
| | | |
| | | }); |
| | | //图集上传 |
| | | $('#upBtnimageIds').click(function () { |
| | | cropperImg.cropImg({ |
| | |
| | | productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']']; |
| | | productModel.points = field['product[points][' + i + ']']; |
| | | //添加 百分兵法 |
| | | productModel.isCustomizable = field['product[isCustomizable][' + i + ']']; |
| | | productModel.distributionPrice = field['product[distributionPrice][' + i + ']']; |
| | | productModel.distributionCutMoney = field['product[distributionCutMoney][' + i + ']']; |
| | | productModel.cutMoney = field['product[cutMoney][' + i + ']']; |
| | |
| | | <th>商品名称</th> |
| | | <th width="30">商品<br />单价</th> |
| | | <th width="30">购买<br />数量</th> |
| | | <th width="50">是否定制</th> |
| | | <th width="30">促销<br />金额</th> |
| | | <th width="40">商品<br />总价</th> |
| | | <th width="110">促销名称</th> |
| | |
| | | <td>{{item.name}} - {{item.addon}}</td> |
| | | <td>{{item.price}}</td> |
| | | <td>{{item.nums}}</td> |
| | | {{#if (item.isCustomizable == true){}} |
| | | <td style="color: red;" >是</td> |
| | | {{#}else{}} |
| | | <td >否</td> |
| | | {{#}}} |
| | | <td>{{item.promotionAmount}}</td> |
| | | <td>{{item.amount}}</td> |
| | | <td> |
| | |
| | | <tr> |
| | | <th colspan="1" style="width: 400px;">商品名称</th> |
| | | <th colspan="2" style="width: 300px;">货品</th> |
| | | <th style="width: 40px;">数量</th> |
| | | <th style="width: 40px;">单价</th> |
| | | <th style="width: 40px;">优惠</th> |
| | | <th style="width: 40px;">合计</th> |
| | | <th style="width: 60px;">数量</th> |
| | | <th style="width: 60px;">单价</th> |
| | | <th style="width: 60px;">是否定制</th> |
| | | <th style="width: 60px;">优惠</th> |
| | | <th style="width: 80px;">合计</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | |
| | | </td> |
| | | <td>{{item.nums}}</td> |
| | | <td>{{item.price}}</td> |
| | | {{#if (item.isCustomizable == true){}} |
| | | <td style="color: red;" >是</td> |
| | | {{#}else{}} |
| | | <td >否</td> |
| | | {{#}}} |
| | | <td>{{item.promotionAmount}}</td> |
| | | <td>{{item.amount}}</td> |
| | | </tr> |
| | |
| | | <th>商品编码</th> |
| | | <th>货品编码</th> |
| | | <th>购买数量</th> |
| | | <th>是否定制</th> |
| | | <th>已退数量</th> |
| | | <th>已发数量</th> |
| | | <th>发货数量</th> |
| | |
| | | <td>{{item.bn}}</td> |
| | | <td>{{item.sn}}</td> |
| | | <td>{{item.nums}}</td> |
| | | {{#if (item.isCustomizable == true){}} |
| | | <td style="color: red;" >是</td> |
| | | {{#}else{}} |
| | | <td >否</td> |
| | | {{#}}} |
| | | <td>{{item.reshipNums}}</td> |
| | | <td>{{item.sendNums}}</td> |
| | | <td> |
| | |
| | | [Authorize] |
| | | public async Task<WebApiCallBack> AddCart([FromBody] FMCartAdd entity) |
| | | { |
| | | var jm = await _cartServices.Add(_user.ID, entity.ProductId, entity.Nums, entity.type, entity.cartType, entity.objectId); |
| | | var jm = await _cartServices.Add(_user.ID, entity.ProductId, entity.Nums, entity.type, entity.cartType, entity.objectId,entity.isCustomizable); |
| | | return jm; |
| | | } |
| | | |
| | |
| | | iData.sales=entity.sales; |
| | | iData.storeName = entity.storeName; |
| | | iData.storeCoordinate =entity.storeCoordinate; |
| | | iData.schoolName = entity.schoolName; |
| | | iData.idCradNumber = entity.idCradNumber; |
| | | jm = await _distributionServices.AddData(iData, _user.ID); |
| | | |
| | | return jm; |