mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:23:26 +08:00
# 2022-02-11
### 1.3.5 开源社区版(会员专业版同步修改): 无 ### 0.1.6 会员专业版: 【新增】后台【平台设置-订单管理】增加【佣金计算通道】功能,分为【仅代理】【仅分销】【先代理后分销】【先分销后代理】四种自选模式。 【新增】增加【CoreCmsAgentOrderDetails】表,实现代理佣金订单详情列表功能,精确到具体商品明细。 【新增】增加【CoreCmsDistributionOrderDetails】表,实现三级佣金订单详情列表功能,精确到具体商品明细。 【修复】修复代理商商铺开启按钮错用三级分销商店铺开关功能,增加代理商商铺开启开关。 【修复】修复代理商佣金明细日期选择范围错乱问题。 【优化】uniapp自带progress进度条更换为uview2.x进度条。 【优化】敏感词过滤组件启用废弃的【WordsMatch】方法,启用【StringSearch】方法替代。
This commit is contained in:
@@ -2828,5 +2828,19 @@ namespace CoreCms.Net.Configuration
|
||||
|
||||
#endregion
|
||||
|
||||
#region 佣金相关
|
||||
/// <summary>
|
||||
/// 代理分销通道判定
|
||||
/// </summary>
|
||||
public enum CommissionChannel
|
||||
{
|
||||
仅代理 = 1,
|
||||
仅分销 = 2,
|
||||
先代理后分销 = 3,
|
||||
先分销后代理 = 4,
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,17 @@ namespace CoreCms.Net.Configuration
|
||||
/// </summary>
|
||||
public const string StoreOrderAutomaticDelivery = "storeOrderAutomaticDelivery";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 门店订单自动发货
|
||||
/// </summary>
|
||||
public const string CommissionChannel = "commissionChannel";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//分销功能(老分销)=============================================================
|
||||
/// <summary>
|
||||
/// 是否开启分销
|
||||
@@ -594,6 +605,7 @@ namespace CoreCms.Net.Configuration
|
||||
/// </summary>
|
||||
public const string SmsTplForCommon = "smsTplForCommon";
|
||||
|
||||
|
||||
//网络打印机============================================================================
|
||||
/// <summary>
|
||||
/// 是否开启
|
||||
@@ -645,6 +657,10 @@ namespace CoreCms.Net.Configuration
|
||||
/// </summary>
|
||||
public const string AgentAgreement = "agentAgreement";
|
||||
/// <summary>
|
||||
/// 是否开启店铺:
|
||||
/// </summary>
|
||||
public const string AgentStore = "agentStore";
|
||||
/// <summary>
|
||||
/// 是否允许代理代购服务
|
||||
/// </summary>
|
||||
public const string IsAllowProcurementService = "isAllowProcurementService";
|
||||
|
||||
@@ -77,7 +77,6 @@ namespace CoreCms.Net.Configuration
|
||||
di.Add(SystemSettingConstVars.StoreOrderAutomaticDelivery, new DictionaryKeyValues() { sKey = "门店自提自动发货", sValue = "2" });
|
||||
|
||||
|
||||
|
||||
//分销功能
|
||||
|
||||
di.Add(SystemSettingConstVars.OpenDistribution, new DictionaryKeyValues() { sKey = "是否开启三级分销", sValue = "1" });
|
||||
@@ -183,12 +182,13 @@ namespace CoreCms.Net.Configuration
|
||||
di.Add(SystemSettingConstVars.FilesStoragePath, new DictionaryKeyValues() { sKey = "存储路径", sValue = "/upload/" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageFileSuffix, new DictionaryKeyValues() { sKey = "文件后缀类型", sValue = "gif,jpg,jpeg,png,bmp,xls,xlsx,doc,pdf,mp4,WebM,Ogv" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageFileMaxSize, new DictionaryKeyValues() { sKey = "文件最大大小", sValue = "10" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageBucketBindUrl, new DictionaryKeyValues() { sKey = "云存储绑定域名", sValue = "http://www.coreshop.cn/" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageBucketBindUrl, new DictionaryKeyValues() { sKey = "云存储绑定域名", sValue = "https://www.corecms.net/" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageAccessKeyId, new DictionaryKeyValues() { sKey = "云存储授权账户", sValue = "" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageAccessKeySecret, new DictionaryKeyValues() { sKey = "云存储授权密钥", sValue = "" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageTencentAccountId, new DictionaryKeyValues() { sKey = "腾讯云账户标识", sValue = "" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageTencentCosRegion, new DictionaryKeyValues() { sKey = "腾讯云桶地域", sValue = "" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageTencentBucketName, new DictionaryKeyValues() { sKey = "腾讯云桶名称", sValue = "" });
|
||||
|
||||
di.Add(SystemSettingConstVars.FilesStorageAliYunEndpoint, new DictionaryKeyValues() { sKey = "阿里云节点", sValue = "https://oss-cn-shenzhen.aliyuncs.com" });
|
||||
di.Add(SystemSettingConstVars.FilesStorageAliYunBucketName, new DictionaryKeyValues() { sKey = "阿里云桶名称", sValue = "CoreShop" });
|
||||
|
||||
@@ -264,7 +264,5 @@ namespace CoreCms.Net.Configuration
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/9 23:36:03
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 代理佣金明细 工厂接口
|
||||
/// </summary>
|
||||
public interface ICoreCmsAgentOrderDetailsRepository : IBaseRepository<CoreCmsAgentOrderDetails>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsAgentOrderDetails entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentOrderDetails entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentOrderDetails> entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
new Task<IPageList<CoreCmsAgentOrderDetails>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsAgentOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgentOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,47 +39,6 @@ namespace CoreCms.Net.IRepository
|
||||
Expression<Func<CoreCmsAgentOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsAgentOrder entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentOrder entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentOrder> entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/10 0:39:11
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 分销佣金明细 工厂接口
|
||||
/// </summary>
|
||||
public interface ICoreCmsDistributionOrderDetailsRepository : IBaseRepository<CoreCmsDistributionOrderDetails>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrderDetails entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrderDetails entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrderDetails> entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
new Task<IPageList<CoreCmsDistributionOrderDetails>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsDistributionOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,48 +15,6 @@ namespace CoreCms.Net.IRepository
|
||||
/// </summary>
|
||||
public interface ICoreCmsDistributionOrderRepository : IBaseRepository<CoreCmsDistributionOrder>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrder entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrder entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrder> entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/9 23:36:03
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 代理佣金明细 服务工厂接口
|
||||
/// </summary>
|
||||
public interface ICoreCmsAgentOrderDetailsServices : IBaseServices<CoreCmsAgentOrderDetails>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsAgentOrderDetails entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentOrderDetails entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentOrderDetails> entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
new Task<IPageList<CoreCmsAgentOrderDetails>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsAgentOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgentOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -23,44 +23,6 @@ namespace CoreCms.Net.IServices
|
||||
/// </summary>
|
||||
public interface ICoreCmsAgentOrderServices : IBaseServices<CoreCmsAgentOrder>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsAgentOrder entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentOrder entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentOrder> entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/10 0:39:11
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 分销佣金明细 服务工厂接口
|
||||
/// </summary>
|
||||
public interface ICoreCmsDistributionOrderDetailsServices : IBaseServices<CoreCmsDistributionOrderDetails>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrderDetails entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrderDetails entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrderDetails> entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
new Task<IPageList<CoreCmsDistributionOrderDetails>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsDistributionOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -86,43 +86,5 @@ namespace CoreCms.Net.IServices
|
||||
/// <returns></returns>
|
||||
Task<decimal> QueryChildOrderMoneySumAsync(int parentId, int type = 1, bool thisMonth = false);
|
||||
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrder entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrder entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrder> entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
200
CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderDetails.cs
Normal file
200
CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderDetails.cs
Normal file
@@ -0,0 +1,200 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/10 1:27:28
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 代理佣金明细
|
||||
/// </summary>
|
||||
public partial class CoreCmsAgentOrderDetails
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public CoreCmsAgentOrderDetails()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 代理商佣金订单
|
||||
/// </summary>
|
||||
[Display(Name = "代理商佣金订单")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 agentOrderId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户订单编号
|
||||
/// </summary>
|
||||
[Display(Name = "用户订单编号")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String orderId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品单价
|
||||
/// </summary>
|
||||
[Display(Name = "货品单价")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal productPrice { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 结算佣金
|
||||
/// </summary>
|
||||
[Display(Name = "结算佣金")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal amount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品序列
|
||||
/// </summary>
|
||||
[Display(Name = "商品序列")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 goodId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
[Display(Name = "商品名称")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:200,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品明细序列号存储
|
||||
/// </summary>
|
||||
[Display(Name = "货品明细序列号存储")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.String addon { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品序列
|
||||
/// </summary>
|
||||
[Display(Name = "货品序列")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 productId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品数量
|
||||
/// </summary>
|
||||
[Display(Name = "货品数量")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 productNums { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品优惠总金额
|
||||
/// </summary>
|
||||
[Display(Name = "货品优惠总金额")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal promotionAmount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 图片
|
||||
/// </summary>
|
||||
[Display(Name = "图片")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String imageUrl { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Display(Name = "备注")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String remark { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@@ -26,6 +28,13 @@ namespace CoreCms.Net.Model.Entities
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public System.String buyUserNickName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 购买人头像
|
||||
/// </summary>
|
||||
[Display(Name = "购买人头像")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public System.String buyUserAvatar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分销商
|
||||
/// </summary>
|
||||
@@ -33,5 +42,26 @@ namespace CoreCms.Net.Model.Entities
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public System.String distributorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品总价
|
||||
/// </summary>
|
||||
[Display(Name = "商品总价")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public System.Decimal goodsAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户支付金额
|
||||
/// </summary>
|
||||
[Display(Name = "用户支付金额")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public System.Decimal payedAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单详情
|
||||
/// </summary>
|
||||
[Display(Name = "订单详情")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<CoreCmsAgentOrderDetails> agentOrderDetails { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/11 1:02:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 分销佣金明细
|
||||
/// </summary>
|
||||
public partial class CoreCmsDistributionOrderDetails
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public CoreCmsDistributionOrderDetails()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 代理商佣金订单
|
||||
/// </summary>
|
||||
[Display(Name = "代理商佣金订单")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 distributionOrderId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户订单编号
|
||||
/// </summary>
|
||||
[Display(Name = "用户订单编号")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String orderId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品单价
|
||||
/// </summary>
|
||||
[Display(Name = "货品单价")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal productPrice { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 结算金额
|
||||
/// </summary>
|
||||
[Display(Name = "结算金额")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal amount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品序列
|
||||
/// </summary>
|
||||
[Display(Name = "商品序列")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 goodId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
[Display(Name = "商品名称")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:200,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品明细序列号存储
|
||||
/// </summary>
|
||||
[Display(Name = "货品明细序列号存储")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.String addon { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品序列
|
||||
/// </summary>
|
||||
[Display(Name = "货品序列")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 productId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品数量
|
||||
/// </summary>
|
||||
[Display(Name = "货品数量")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 productNums { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 货品优惠总金额
|
||||
/// </summary>
|
||||
[Display(Name = "货品优惠总金额")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal promotionAmount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 图片
|
||||
/// </summary>
|
||||
[Display(Name = "图片")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String imageUrl { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Display(Name = "备注")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String remark { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -25,11 +26,44 @@ namespace CoreCms.Net.Model.Entities
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string buyUserNickName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 购买人头像
|
||||
/// </summary>
|
||||
[Display(Name = "购买人头像")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public System.String buyUserAvatar { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分销商
|
||||
/// </summary>
|
||||
[Display(Name = "分销商")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string distributorName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品总价
|
||||
/// </summary>
|
||||
[Display(Name = "商品总价")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public System.Decimal goodsAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户支付金额
|
||||
/// </summary>
|
||||
[Display(Name = "用户支付金额")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public System.Decimal payedAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单详情
|
||||
/// </summary>
|
||||
[Display(Name = "订单详情")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<CoreCmsDistributionOrderDetails> distributionOrderDetails { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Essensoft.Paylink.WeChatPay.V2;
|
||||
@@ -53,12 +54,64 @@ namespace CoreCms.Net.RedisMQ.Subscribe
|
||||
var order = JsonConvert.DeserializeObject<CoreCmsOrder>(msg);
|
||||
if (order != null)
|
||||
{
|
||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||
|
||||
var commissionChannel = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.CommissionChannel).ObjectToInt(1);
|
||||
|
||||
if (commissionChannel == (int)GlobalEnumVars.CommissionChannel.仅代理)
|
||||
{
|
||||
var jm = await _agentOrderServices.AddData(order);
|
||||
jm.status = true;
|
||||
jm.msg = "分销成功";
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走代理结佣-仅代理", JsonConvert.SerializeObject(jm));
|
||||
return;
|
||||
}
|
||||
else if (commissionChannel == (int)GlobalEnumVars.CommissionChannel.仅分销)
|
||||
{
|
||||
var jm = await _distributionOrderServices.AddData(order); //添加分享关联订单日志
|
||||
//判断是否可以成为分销商
|
||||
//先判断是否已经是经销商了。
|
||||
bool check = await _distributionServices.ExistsAsync(p => p.userId == order.userId);
|
||||
var distributionType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionType).ObjectToInt(0);
|
||||
if (distributionType == 3) //无需审核,但是要满足提交
|
||||
{
|
||||
var info = new CoreCmsDistribution();
|
||||
//判断是否分销商
|
||||
if (check == false)
|
||||
{
|
||||
await _distributionServices.CheckCondition(allConfigs, info, order.userId);
|
||||
if (info.ConditionStatus == true && info.ConditionProgress == 100)
|
||||
{
|
||||
//添加用户
|
||||
var user = await _userServices.QueryByClauseAsync(p => p.id == order.userId);
|
||||
var iData = new CoreCmsDistribution();
|
||||
iData.userId = order.userId;
|
||||
iData.mobile = user.mobile;
|
||||
iData.name = !string.IsNullOrEmpty(user.nickName) ? user.nickName : user.mobile;
|
||||
iData.verifyStatus = (int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes;
|
||||
iData.verifyTime = DateTime.Now;
|
||||
|
||||
await _distributionServices.AddData(iData, order.userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
//已经是经销商的判断是否可以升级
|
||||
if (check)
|
||||
{
|
||||
await _distributionServices.CheckUpdate(order.userId);
|
||||
}
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走分销结佣-仅分销", JsonConvert.SerializeObject(jm));
|
||||
return;
|
||||
}
|
||||
else if (commissionChannel == (int)GlobalEnumVars.CommissionChannel.先代理后分销)
|
||||
{
|
||||
|
||||
var jm = await _agentOrderServices.AddData(order);
|
||||
|
||||
//判断是走代理还是走分销
|
||||
if (jm.status == true)
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走代理结佣", JsonConvert.SerializeObject(jm));
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走代理结佣-先代理后分销", JsonConvert.SerializeObject(jm));
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -67,7 +120,6 @@ namespace CoreCms.Net.RedisMQ.Subscribe
|
||||
//判断是否可以成为分销商
|
||||
//先判断是否已经是经销商了。
|
||||
bool check = await _distributionServices.ExistsAsync(p => p.userId == order.userId);
|
||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||
var distributionType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionType).ObjectToInt(0);
|
||||
if (distributionType == 3) //无需审核,但是要满足提交
|
||||
{
|
||||
@@ -98,10 +150,58 @@ namespace CoreCms.Net.RedisMQ.Subscribe
|
||||
}
|
||||
jm.status = true;
|
||||
jm.msg = "分销成功";
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走分销结佣", JsonConvert.SerializeObject(jm));
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走分销结佣-先代理后分销", JsonConvert.SerializeObject(jm));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (commissionChannel == (int)GlobalEnumVars.CommissionChannel.先分销后代理)
|
||||
{
|
||||
var jm = await _distributionOrderServices.AddData(order);
|
||||
if (jm.status)
|
||||
{
|
||||
bool check = await _distributionServices.ExistsAsync(p => p.userId == order.userId);
|
||||
var distributionType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionType).ObjectToInt(0);
|
||||
if (distributionType == 3) //无需审核,但是要满足提交
|
||||
{
|
||||
var info = new CoreCmsDistribution();
|
||||
//判断是否分销商
|
||||
if (check == false)
|
||||
{
|
||||
await _distributionServices.CheckCondition(allConfigs, info, order.userId);
|
||||
if (info.ConditionStatus && info.ConditionProgress == 100)
|
||||
{
|
||||
//添加用户
|
||||
var user = await _userServices.QueryByClauseAsync(p => p.id == order.userId);
|
||||
var iData = new CoreCmsDistribution();
|
||||
iData.userId = order.userId;
|
||||
iData.mobile = user.mobile;
|
||||
iData.name = !string.IsNullOrEmpty(user.nickName) ? user.nickName : user.mobile;
|
||||
iData.verifyStatus = (int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes;
|
||||
iData.verifyTime = DateTime.Now;
|
||||
|
||||
await _distributionServices.AddData(iData, order.userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
//已经是经销商的判断是否可以升级
|
||||
if (check)
|
||||
{
|
||||
await _distributionServices.CheckUpdate(order.userId);
|
||||
}
|
||||
jm.status = true;
|
||||
jm.msg = "分销成功";
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走分销结佣-先分销后代理", JsonConvert.SerializeObject(jm));
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
jm = await _agentOrderServices.AddData(order);
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走代理结佣-先分销后代理", JsonConvert.SerializeObject(jm));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结结佣", "订单获取失败");
|
||||
@@ -116,5 +216,7 @@ namespace CoreCms.Net.RedisMQ.Subscribe
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/9 23:36:03
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 代理佣金明细 接口实现
|
||||
/// </summary>
|
||||
public class CoreCmsAgentOrderDetailsRepository : BaseRepository<CoreCmsAgentOrderDetails>, ICoreCmsAgentOrderDetailsRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsAgentOrderDetailsRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsAgentOrderDetails entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentOrderDetails entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<CoreCmsAgentOrderDetails>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
oldModel.id = entity.id;
|
||||
oldModel.agentOrderId = entity.agentOrderId;
|
||||
oldModel.orderId = entity.orderId;
|
||||
oldModel.productPrice = entity.productPrice;
|
||||
oldModel.amount = entity.amount;
|
||||
oldModel.goodId = entity.goodId;
|
||||
oldModel.name = entity.name;
|
||||
oldModel.addon = entity.addon;
|
||||
oldModel.productId = entity.productId;
|
||||
oldModel.productNums = entity.productNums;
|
||||
oldModel.promotionAmount = entity.promotionAmount;
|
||||
oldModel.imageUrl = entity.imageUrl;
|
||||
oldModel.remark = entity.remark;
|
||||
oldModel.createTime = entity.createTime;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentOrderDetails> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsAgentOrderDetails>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsAgentOrderDetails>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsAgentOrderDetails>> QueryPageAsync(Expression<Func<CoreCmsAgentOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgentOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<CoreCmsAgentOrderDetails> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsAgentOrderDetails>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsAgentOrderDetails
|
||||
{
|
||||
id = p.id,
|
||||
agentOrderId = p.agentOrderId,
|
||||
orderId = p.orderId,
|
||||
productPrice = p.productPrice,
|
||||
amount = p.amount,
|
||||
goodId = p.goodId,
|
||||
name = p.name,
|
||||
addon = p.addon,
|
||||
productId = p.productId,
|
||||
productNums = p.productNums,
|
||||
promotionAmount = p.promotionAmount,
|
||||
imageUrl = p.imageUrl,
|
||||
remark = p.remark,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsAgentOrderDetails>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsAgentOrderDetails
|
||||
{
|
||||
id = p.id,
|
||||
agentOrderId = p.agentOrderId,
|
||||
orderId = p.orderId,
|
||||
productPrice = p.productPrice,
|
||||
amount = p.amount,
|
||||
goodId = p.goodId,
|
||||
name = p.name,
|
||||
addon = p.addon,
|
||||
productId = p.productId,
|
||||
productNums = p.productNums,
|
||||
promotionAmount = p.promotionAmount,
|
||||
imageUrl = p.imageUrl,
|
||||
remark = p.remark,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<CoreCmsAgentOrderDetails>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,9 @@ using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -32,109 +32,6 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsAgentOrder entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentOrder entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<CoreCmsAgentOrder>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
oldModel.id = entity.id;
|
||||
oldModel.userId = entity.userId;
|
||||
oldModel.buyUserId = entity.buyUserId;
|
||||
oldModel.orderId = entity.orderId;
|
||||
oldModel.amount = entity.amount;
|
||||
oldModel.isSettlement = entity.isSettlement;
|
||||
oldModel.createTime = entity.createTime;
|
||||
oldModel.updateTime = entity.updateTime;
|
||||
oldModel.isDelete = entity.isDelete;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentOrder> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsAgentOrder>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsAgentOrder>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
|
||||
@@ -10,15 +10,16 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.DTO.Agent;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -135,10 +136,20 @@ namespace CoreCms.Net.Repository
|
||||
createTime = dOrder.createTime,
|
||||
updateTime = dOrder.updateTime,
|
||||
isDelete = dOrder.isDelete,
|
||||
buyUserNickName = userInfo.nickName
|
||||
buyUserNickName = userInfo.nickName,
|
||||
buyUserAvatar = userInfo.avatarImage,
|
||||
goodsAmount = cOrder.goodsAmount,
|
||||
payedAmount = cOrder.payedAmount,
|
||||
|
||||
})
|
||||
.With(SqlWith.NoLock)
|
||||
.MergeTable()
|
||||
.Mapper(m =>
|
||||
{
|
||||
var id = m.id;
|
||||
m.agentOrderDetails = DbClient.Queryable<CoreCmsAgentOrderDetails>()
|
||||
.Where(p => p.agentOrderId == id).ToList();
|
||||
})
|
||||
.WhereIF(typeId > 0, p => p.isSettlement == typeId)
|
||||
.OrderBy(dOrder => dOrder.id, OrderByType.Desc)
|
||||
.ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/10 0:39:11
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 分销佣金明细 接口实现
|
||||
/// </summary>
|
||||
public class CoreCmsDistributionOrderDetailsRepository : BaseRepository<CoreCmsDistributionOrderDetails>, ICoreCmsDistributionOrderDetailsRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsDistributionOrderDetailsRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrderDetails entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrderDetails entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<CoreCmsDistributionOrderDetails>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
oldModel.id = entity.id;
|
||||
oldModel.distributionOrderId = entity.distributionOrderId;
|
||||
oldModel.orderId = entity.orderId;
|
||||
oldModel.productPrice = entity.productPrice;
|
||||
oldModel.amount = entity.amount;
|
||||
oldModel.goodId = entity.goodId;
|
||||
oldModel.name = entity.name;
|
||||
oldModel.addon = entity.addon;
|
||||
oldModel.productId = entity.productId;
|
||||
oldModel.productNums = entity.productNums;
|
||||
oldModel.promotionAmount = entity.promotionAmount;
|
||||
oldModel.imageUrl = entity.imageUrl;
|
||||
oldModel.remark = entity.remark;
|
||||
oldModel.createTime = entity.createTime;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrderDetails> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionOrderDetails>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionOrderDetails>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionOrderDetails>> QueryPageAsync(Expression<Func<CoreCmsDistributionOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<CoreCmsDistributionOrderDetails> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsDistributionOrderDetails>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsDistributionOrderDetails
|
||||
{
|
||||
id = p.id,
|
||||
distributionOrderId = p.distributionOrderId,
|
||||
orderId = p.orderId,
|
||||
amount = p.amount,
|
||||
productPrice = p.productPrice,
|
||||
goodId = p.goodId,
|
||||
name = p.name,
|
||||
addon = p.addon,
|
||||
productId = p.productId,
|
||||
productNums = p.productNums,
|
||||
promotionAmount = p.promotionAmount,
|
||||
imageUrl = p.imageUrl,
|
||||
remark = p.remark,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsDistributionOrderDetails>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsDistributionOrderDetails
|
||||
{
|
||||
id = p.id,
|
||||
distributionOrderId = p.distributionOrderId,
|
||||
orderId = p.orderId,
|
||||
amount = p.amount,
|
||||
productPrice = p.productPrice,
|
||||
goodId = p.goodId,
|
||||
name = p.name,
|
||||
addon = p.addon,
|
||||
productId = p.productId,
|
||||
productNums = p.productNums,
|
||||
promotionAmount = p.promotionAmount,
|
||||
imageUrl = p.imageUrl,
|
||||
remark = p.remark,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<CoreCmsDistributionOrderDetails>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,9 +16,9 @@ using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -33,108 +33,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrder entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrder entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<CoreCmsDistributionOrder>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
oldModel.id = entity.id;
|
||||
oldModel.userId = entity.userId;
|
||||
oldModel.buyUserId = entity.buyUserId;
|
||||
oldModel.orderId = entity.orderId;
|
||||
oldModel.amount = entity.amount;
|
||||
oldModel.isSettlement = entity.isSettlement;
|
||||
oldModel.level = entity.level;
|
||||
oldModel.createTime = entity.createTime;
|
||||
oldModel.updateTime = entity.updateTime;
|
||||
oldModel.isDelete = entity.isDelete;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrder> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionOrder>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionOrder>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
@@ -306,6 +205,7 @@ namespace CoreCms.Net.Repository
|
||||
//本月第一天时间
|
||||
DateTime dtFirst = dt.AddDays(1 - (dt.Day));
|
||||
dtFirst = new DateTime(dtFirst.Year, dtFirst.Month, dtFirst.Day, 0, 0, 0);
|
||||
|
||||
//获得某年某月的天数
|
||||
int year = dt.Date.Year;
|
||||
int month = dt.Date.Month;
|
||||
|
||||
@@ -14,10 +14,9 @@ using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.DTO.Agent;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO.Distribution;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -62,10 +61,19 @@ namespace CoreCms.Net.Repository
|
||||
createTime = dOrder.createTime,
|
||||
updateTime = dOrder.updateTime,
|
||||
isDelete = dOrder.isDelete,
|
||||
buyUserNickName = userInfo.nickName
|
||||
buyUserNickName = userInfo.nickName,
|
||||
buyUserAvatar = userInfo.avatarImage,
|
||||
goodsAmount = cOrder.goodsAmount,
|
||||
payedAmount = cOrder.payedAmount,
|
||||
})
|
||||
.With(SqlWith.NoLock)
|
||||
.MergeTable()
|
||||
.Mapper(m =>
|
||||
{
|
||||
var id = m.id;
|
||||
m.distributionOrderDetails = DbClient.Queryable<CoreCmsDistributionOrderDetails>()
|
||||
.Where(p => p.distributionOrderId == id).ToList();
|
||||
})
|
||||
.WhereIF(typeId > 0, p => p.isSettlement == typeId)
|
||||
.OrderBy(dOrder => dOrder.id, OrderByType.Desc)
|
||||
.ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
|
||||
117
CoreCms.Net.Services/Agent/CoreCmsAgentOrderDetailsServices.cs
Normal file
117
CoreCms.Net.Services/Agent/CoreCmsAgentOrderDetailsServices.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/9 23:36:03
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 代理佣金明细 接口实现
|
||||
/// </summary>
|
||||
public class CoreCmsAgentOrderDetailsServices : BaseServices<CoreCmsAgentOrderDetails>, ICoreCmsAgentOrderDetailsServices
|
||||
{
|
||||
private readonly ICoreCmsAgentOrderDetailsRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public CoreCmsAgentOrderDetailsServices(IUnitOfWork unitOfWork, ICoreCmsAgentOrderDetailsRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsAgentOrderDetails entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentOrderDetails entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentOrderDetails> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsAgentOrderDetails>> QueryPageAsync(Expression<Func<CoreCmsAgentOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgentOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ namespace CoreCms.Net.Services
|
||||
private readonly ICoreCmsOrderItemServices _orderItemServices;
|
||||
private readonly ICoreCmsOrderServices _orderServices;
|
||||
private readonly ICoreCmsProductsServices _productsServices;
|
||||
private readonly ICoreCmsAgentOrderDetailsServices _agentOrderDetailsServices;
|
||||
|
||||
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
@@ -55,7 +56,7 @@ namespace CoreCms.Net.Services
|
||||
ICoreCmsProductsServices productsServices, ICoreCmsGoodsServices goodsServices,
|
||||
ICoreCmsAgentProductsServices agentProductsServices, ICoreCmsSettingServices settingServices,
|
||||
ICoreCmsAgentGoodsServices agentGoodsServices, IServiceProvider serviceProvider,
|
||||
ICoreCmsOrderServices orderServices, ICoreCmsUserBalanceServices balanceServices)
|
||||
ICoreCmsOrderServices orderServices, ICoreCmsUserBalanceServices balanceServices, ICoreCmsAgentOrderDetailsServices agentOrderDetailsServices)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
@@ -70,6 +71,7 @@ namespace CoreCms.Net.Services
|
||||
_serviceProvider = serviceProvider;
|
||||
_orderServices = orderServices;
|
||||
_balanceServices = balanceServices;
|
||||
_agentOrderDetailsServices = agentOrderDetailsServices;
|
||||
}
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
@@ -120,7 +122,7 @@ namespace CoreCms.Net.Services
|
||||
if (isAllowProcurementService == 1)
|
||||
{
|
||||
agentModel = await agentServices.QueryByClauseAsync(p =>
|
||||
p.userId == order.userId && p.verifyStatus == (int) GlobalEnumVars.AgentVerifyStatus.VerifyYes);
|
||||
p.userId == order.userId && p.verifyStatus == (int)GlobalEnumVars.AgentVerifyStatus.VerifyYes);
|
||||
if (agentModel != null) user = await _userServices.QueryByClauseAsync(p => p.id == order.userId);
|
||||
}
|
||||
|
||||
@@ -132,7 +134,7 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
agentModel = await agentServices.QueryByClauseAsync(p =>
|
||||
p.userId == userChild.parentId &&
|
||||
p.verifyStatus == (int) GlobalEnumVars.AgentVerifyStatus.VerifyYes);
|
||||
p.verifyStatus == (int)GlobalEnumVars.AgentVerifyStatus.VerifyYes);
|
||||
if (agentModel != null)
|
||||
user = await _userServices.QueryByClauseAsync(p => p.id == userChild.parentId);
|
||||
}
|
||||
@@ -185,7 +187,7 @@ namespace CoreCms.Net.Services
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var order = await _orderServices.QueryByClauseAsync(p =>
|
||||
p.orderId == orderId && p.status == (int) GlobalEnumVars.OrderStatus.Complete);
|
||||
p.orderId == orderId && p.status == (int)GlobalEnumVars.OrderStatus.Complete);
|
||||
if (order == null)
|
||||
{
|
||||
jm.msg = "订单查询失败";
|
||||
@@ -194,14 +196,14 @@ namespace CoreCms.Net.Services
|
||||
|
||||
//更新
|
||||
var list = await _dal.QueryListByClauseAsync(p =>
|
||||
p.orderId == orderId && p.isSettlement == (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo);
|
||||
p.orderId == orderId && p.isSettlement == (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo);
|
||||
if (list != null && list.Any())
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
//钱挪到会员余额里面
|
||||
var result = await _balanceServices.Change(item.userId,
|
||||
(int) GlobalEnumVars.UserBalanceSourceTypes.Agent,
|
||||
(int)GlobalEnumVars.UserBalanceSourceTypes.Agent,
|
||||
item.amount, item.orderId);
|
||||
if (!result.status)
|
||||
{
|
||||
@@ -211,11 +213,11 @@ namespace CoreCms.Net.Services
|
||||
await _dal.UpdateAsync(
|
||||
p => new CoreCmsAgentOrder
|
||||
{
|
||||
isSettlement = (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementYes,
|
||||
isSettlement = (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementYes,
|
||||
updateTime = DateTime.Now
|
||||
},
|
||||
p => p.orderId == orderId &&
|
||||
p.isSettlement == (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo);
|
||||
p.isSettlement == (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo);
|
||||
}
|
||||
|
||||
return jm;
|
||||
@@ -236,9 +238,9 @@ namespace CoreCms.Net.Services
|
||||
|
||||
var res = await _dal.UpdateAsync(
|
||||
p => new CoreCmsAgentOrder
|
||||
{isSettlement = (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementCancel},
|
||||
{ isSettlement = (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementCancel },
|
||||
p => p.orderId == orderId &&
|
||||
p.isSettlement == (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo);
|
||||
p.isSettlement == (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo);
|
||||
if (res == false)
|
||||
{
|
||||
jm.msg = "该未结算的订单不存在";
|
||||
@@ -274,26 +276,64 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
//直返本级
|
||||
decimal amount = 0;
|
||||
var agentOrderDetails = new List<CoreCmsAgentOrderDetails>();
|
||||
|
||||
foreach (var item in orderItems)
|
||||
{
|
||||
var orderDetails = new CoreCmsAgentOrderDetails();
|
||||
orderDetails.agentOrderId = 0;
|
||||
orderDetails.orderId = order.orderId;
|
||||
orderDetails.orderId = order.orderId;
|
||||
orderDetails.productPrice = item.price;
|
||||
orderDetails.amount = 0;
|
||||
orderDetails.goodId = item.goodsId;
|
||||
orderDetails.name = item.name;
|
||||
orderDetails.addon = item.addon;
|
||||
orderDetails.productId = item.productId;
|
||||
orderDetails.productNums = item.nums;
|
||||
orderDetails.promotionAmount = item.promotionAmount;
|
||||
orderDetails.imageUrl = item.imageUrl;
|
||||
orderDetails.remark = "";
|
||||
orderDetails.createTime = DateTime.Now;
|
||||
|
||||
//判断是否存在商品内
|
||||
var good = goods.Find(p => p.id == item.goodsId);
|
||||
if (good == null) continue;
|
||||
if (good == null)
|
||||
{
|
||||
agentOrderDetails.Add(orderDetails);
|
||||
continue;
|
||||
};
|
||||
//判断是否存在货品类
|
||||
var product = products.Find(p => p.id == item.productId);
|
||||
if (product == null) continue;
|
||||
if (product == null)
|
||||
{
|
||||
agentOrderDetails.Add(orderDetails);
|
||||
continue;
|
||||
}
|
||||
//判断代理商代理池是否包含此商品数据
|
||||
var agentGood = agentGoods.Find(p => p.goodId == item.goodsId);
|
||||
if (agentGood == null) continue;
|
||||
if (agentGood == null)
|
||||
{
|
||||
agentOrderDetails.Add(orderDetails);
|
||||
continue;
|
||||
}
|
||||
|
||||
//判断代理商代理池是否包含此货品数据
|
||||
var agentProduct = agentProducts.Find(p => p.productId == item.productId);
|
||||
if (agentProduct == null) continue;
|
||||
if (agentProduct == null)
|
||||
{
|
||||
agentOrderDetails.Add(orderDetails);
|
||||
continue;
|
||||
}
|
||||
|
||||
//获取实际当前单个商品应获得利润
|
||||
var price = item.price - agentProduct.agentGradePrice;
|
||||
//如果销售价减去代理商价格负了,就不计算了。
|
||||
if (price < 0) continue;
|
||||
if (price < 0)
|
||||
{
|
||||
agentOrderDetails.Add(orderDetails);
|
||||
continue;
|
||||
}
|
||||
|
||||
//如果利润减去优惠负了,就不计算了。
|
||||
var mathMoney = Math.Round(price * item.nums - item.promotionAmount, 2);
|
||||
@@ -301,6 +341,9 @@ namespace CoreCms.Net.Services
|
||||
|
||||
//单个商品利润*数量,再减去优惠金额
|
||||
amount += mathMoney;
|
||||
|
||||
orderDetails.amount = mathMoney;
|
||||
agentOrderDetails.Add(orderDetails);
|
||||
}
|
||||
|
||||
if (amount > 0)
|
||||
@@ -310,7 +353,7 @@ namespace CoreCms.Net.Services
|
||||
iData.buyUserId = order.userId;
|
||||
iData.orderId = order.orderId;
|
||||
iData.amount = amount;
|
||||
iData.isSettlement = (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo; //默认未结算
|
||||
iData.isSettlement = (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo; //默认未结算
|
||||
iData.isDelete = false;
|
||||
//判断是否返利过,有历史记录直接更新
|
||||
var agentOrder = await _dal.QueryByClauseAsync(p => p.userId == user.id && p.orderId == order.orderId);
|
||||
@@ -329,65 +372,18 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
iData.createTime = DateTime.Now;
|
||||
iData.updateTime = DateTime.Now;
|
||||
await _dal.InsertAsync(iData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsAgentOrder entity)
|
||||
var id = await _dal.InsertAsync(iData);
|
||||
if (id > 0 && agentOrderDetails.Any())
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentOrder entity)
|
||||
agentOrderDetails.ForEach(p =>
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
p.agentOrderId = id;
|
||||
});
|
||||
await _agentOrderDetailsServices.InsertAsync(agentOrderDetails);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentOrder> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,10 @@ namespace CoreCms.Net.Services
|
||||
ManualDataCache.Instance.Set(ToolsVars.IllegalWordsCahceName, cache);
|
||||
}
|
||||
|
||||
WordsMatch wordsSearch = new WordsMatch();
|
||||
//WordsMatch wordsSearch = new WordsMatch();
|
||||
//wordsSearch.SetKeywords(cache.Split('|', StringSplitOptions.RemoveEmptyEntries));
|
||||
|
||||
StringSearch wordsSearch = new StringSearch();
|
||||
wordsSearch.SetKeywords(cache.Split('|', StringSplitOptions.RemoveEmptyEntries));
|
||||
|
||||
var t = wordsSearch.Replace(oldString, symbol);
|
||||
@@ -104,7 +107,7 @@ namespace CoreCms.Net.Services
|
||||
ManualDataCache.Instance.Set(ToolsVars.IllegalWordsCahceName, cache);
|
||||
}
|
||||
|
||||
WordsMatch wordsSearch = new WordsMatch();
|
||||
StringSearch wordsSearch = new StringSearch();
|
||||
wordsSearch.SetKeywords(cache.Split('|', StringSplitOptions.RemoveEmptyEntries));
|
||||
|
||||
var bl = wordsSearch.ContainsAny(oldString);
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/10 0:39:11
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 分销佣金明细 接口实现
|
||||
/// </summary>
|
||||
public class CoreCmsDistributionOrderDetailsServices : BaseServices<CoreCmsDistributionOrderDetails>, ICoreCmsDistributionOrderDetailsServices
|
||||
{
|
||||
private readonly ICoreCmsDistributionOrderDetailsRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public CoreCmsDistributionOrderDetailsServices(IUnitOfWork unitOfWork, ICoreCmsDistributionOrderDetailsRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrderDetails entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrderDetails entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrderDetails> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionOrderDetails>> QueryPageAsync(Expression<Func<CoreCmsDistributionOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,9 @@ using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.DTO.Distribution;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
@@ -41,9 +42,11 @@ namespace CoreCms.Net.Services
|
||||
private readonly ICoreCmsProductsServices _productsServices;
|
||||
private readonly ICoreCmsUserBalanceServices _balanceServices;
|
||||
private readonly ICoreCmsGoodsServices _goodsServices;
|
||||
private readonly ICoreCmsDistributionOrderDetailsServices _distributionOrderDetailsServices;
|
||||
|
||||
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsDistributionOrderServices(IUnitOfWork unitOfWork, ICoreCmsDistributionOrderRepository dal, ICoreCmsDistributionServices distributionServices, ICoreCmsUserBalanceServices balanceServices, ICoreCmsOrderServices orderServices, ICoreCmsUserServices userServices, ICoreCmsOrderItemServices orderItemServices, ICoreCmsProductsDistributionServices productsDistributionServices, ICoreCmsProductsServices productsServices, ICoreCmsGoodsServices goodsServices)
|
||||
public CoreCmsDistributionOrderServices(IUnitOfWork unitOfWork, ICoreCmsDistributionOrderRepository dal, ICoreCmsDistributionServices distributionServices, ICoreCmsUserBalanceServices balanceServices, ICoreCmsOrderServices orderServices, ICoreCmsUserServices userServices, ICoreCmsOrderItemServices orderItemServices, ICoreCmsProductsDistributionServices productsDistributionServices, ICoreCmsProductsServices productsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsDistributionOrderDetailsServices distributionOrderDetailsServices)
|
||||
{
|
||||
this._dal = dal;
|
||||
_distributionServices = distributionServices;
|
||||
@@ -54,63 +57,11 @@ namespace CoreCms.Net.Services
|
||||
_productsDistributionServices = productsDistributionServices;
|
||||
_productsServices = productsServices;
|
||||
_goodsServices = goodsServices;
|
||||
_distributionOrderDetailsServices = distributionOrderDetailsServices;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrder entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrder entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrder> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
@@ -190,74 +141,103 @@ namespace CoreCms.Net.Services
|
||||
var ommissionDto = commission.data as DistributionDto;
|
||||
//直返本级
|
||||
decimal amount = 0;
|
||||
var distributionOrderDetails = new List<CoreCmsDistributionOrderDetails>();
|
||||
|
||||
foreach (var item in orderItems)
|
||||
{
|
||||
var orderDetails = new CoreCmsDistributionOrderDetails();
|
||||
orderDetails.distributionOrderId = 0;
|
||||
orderDetails.orderId = order.orderId;
|
||||
orderDetails.orderId = order.orderId;
|
||||
orderDetails.productPrice = item.price;
|
||||
orderDetails.amount = 0;
|
||||
orderDetails.goodId = item.goodsId;
|
||||
orderDetails.name = item.name;
|
||||
orderDetails.addon = item.addon;
|
||||
orderDetails.productId = item.productId;
|
||||
orderDetails.productNums = item.nums;
|
||||
orderDetails.promotionAmount = item.promotionAmount;
|
||||
orderDetails.imageUrl = item.imageUrl;
|
||||
orderDetails.remark = "";
|
||||
orderDetails.createTime = DateTime.Now;
|
||||
|
||||
var good = goods.Find(p => p.id == item.goodsId);
|
||||
if (good == null) continue;
|
||||
if (good == null)
|
||||
{
|
||||
distributionOrderDetails.Add(orderDetails);
|
||||
continue;
|
||||
}
|
||||
var product = products.Find(p => p.id == item.productId);
|
||||
if (product == null) continue;
|
||||
if (product == null)
|
||||
{
|
||||
distributionOrderDetails.Add(orderDetails);
|
||||
continue;
|
||||
}
|
||||
|
||||
decimal mathMoney = 0;
|
||||
|
||||
if (good.productsDistributionType == (int)GlobalEnumVars.ProductsDistributionType.Global)
|
||||
{
|
||||
if (ommissionDto == null) continue;
|
||||
if (ommissionDto == null)
|
||||
{
|
||||
distributionOrderDetails.Add(orderDetails);
|
||||
continue;
|
||||
}
|
||||
//获取实际当前支付金额,减去优惠的金额
|
||||
var itemAmount = item.amount - item.promotionAmount;
|
||||
//如果去掉优惠需要负了,就为0
|
||||
if (itemAmount < 0) itemAmount = 0;
|
||||
|
||||
mathMoney = level switch
|
||||
{
|
||||
//一级分销
|
||||
if (level == 1 && ommissionDto.commission_1 != null)
|
||||
{
|
||||
if (ommissionDto.commission_1.type == (int)GlobalEnumVars.DistributionCommissiontype.COMMISSION_TYPE_FIXED)
|
||||
{
|
||||
amount += ommissionDto.commission_1.discount;
|
||||
}
|
||||
else
|
||||
{
|
||||
amount += Math.Round(ommissionDto.commission_1.discount * itemAmount / 100, 2);
|
||||
}
|
||||
}
|
||||
1 when ommissionDto.commission_1 != null => ommissionDto.commission_1.type ==
|
||||
(int)GlobalEnumVars
|
||||
.DistributionCommissiontype
|
||||
.COMMISSION_TYPE_FIXED
|
||||
? ommissionDto.commission_1.discount
|
||||
: Math.Round(ommissionDto.commission_1.discount * itemAmount / 100, 2),
|
||||
//二级分销
|
||||
else if (level == 2 && ommissionDto.commission_2 != null)
|
||||
{
|
||||
if (ommissionDto.commission_2.type == (int)GlobalEnumVars.DistributionCommissiontype.COMMISSION_TYPE_FIXED)
|
||||
{
|
||||
amount += ommissionDto.commission_2.discount;
|
||||
}
|
||||
else
|
||||
{
|
||||
amount += Math.Round(ommissionDto.commission_2.discount * itemAmount / 100, 2);
|
||||
}
|
||||
}
|
||||
2 when ommissionDto.commission_2 != null => ommissionDto.commission_2.type ==
|
||||
(int)GlobalEnumVars
|
||||
.DistributionCommissiontype
|
||||
.COMMISSION_TYPE_FIXED
|
||||
? ommissionDto.commission_2.discount
|
||||
: Math.Round(ommissionDto.commission_2.discount * itemAmount / 100, 2),
|
||||
//三级分销
|
||||
else if (level == 3 && ommissionDto.commission_3 != null)
|
||||
{
|
||||
if (ommissionDto.commission_3.type == (int)GlobalEnumVars.DistributionCommissiontype.COMMISSION_TYPE_FIXED)
|
||||
{
|
||||
amount += ommissionDto.commission_3.discount;
|
||||
}
|
||||
else
|
||||
{
|
||||
amount += Math.Round(ommissionDto.commission_3.discount * itemAmount / 100, 2);
|
||||
}
|
||||
}
|
||||
3 when ommissionDto.commission_3 != null => ommissionDto.commission_3.type ==
|
||||
(int)GlobalEnumVars
|
||||
.DistributionCommissiontype
|
||||
.COMMISSION_TYPE_FIXED
|
||||
? ommissionDto.commission_3.discount
|
||||
: Math.Round(ommissionDto.commission_3.discount * itemAmount / 100, 2),
|
||||
_ => mathMoney
|
||||
};
|
||||
}
|
||||
else if (good.productsDistributionType == (int)GlobalEnumVars.ProductsDistributionType.Detail)
|
||||
{
|
||||
var productsDistribution = productsDistributions.Find(p => p.productsId == item.productId);
|
||||
if (productsDistribution == null) continue;
|
||||
if (productsDistribution == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (level == 1 && productsDistribution.levelOne > 0)
|
||||
mathMoney = level switch
|
||||
{
|
||||
amount += Math.Round(productsDistribution.levelOne * item.nums, 2);
|
||||
}
|
||||
else if (level == 2 && productsDistribution.levelTwo > 0)
|
||||
{
|
||||
amount += Math.Round(productsDistribution.levelTwo * item.nums, 2);
|
||||
}
|
||||
else if (level == 3 && productsDistribution.levelThree > 0)
|
||||
{
|
||||
amount += Math.Round(productsDistribution.levelThree * item.nums, 2);
|
||||
}
|
||||
1 when productsDistribution.levelOne > 0 => Math.Round(
|
||||
productsDistribution.levelOne * item.nums, 2),
|
||||
2 when productsDistribution.levelTwo > 0 => Math.Round(
|
||||
productsDistribution.levelTwo * item.nums, 2),
|
||||
3 when productsDistribution.levelThree > 0 => Math.Round(
|
||||
productsDistribution.levelThree * item.nums, 2),
|
||||
_ => mathMoney
|
||||
};
|
||||
}
|
||||
|
||||
amount += mathMoney;
|
||||
orderDetails.amount = mathMoney;
|
||||
distributionOrderDetails.Add(orderDetails);
|
||||
|
||||
}
|
||||
|
||||
if (amount > 0)
|
||||
@@ -288,7 +268,16 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
iData.createTime = DateTime.Now;
|
||||
iData.updateTime = DateTime.Now;
|
||||
await _dal.InsertAsync(iData);
|
||||
|
||||
var id = await _dal.InsertAsync(iData);
|
||||
if (id > 0 && distributionOrderDetails.Any())
|
||||
{
|
||||
distributionOrderDetails.ForEach(p =>
|
||||
{
|
||||
p.distributionOrderId = id;
|
||||
});
|
||||
await _distributionOrderDetailsServices.InsertAsync(distributionOrderDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,16 +313,25 @@ namespace CoreCms.Net.Services
|
||||
var list = await _dal.QueryListByClauseAsync(p => p.orderId == orderId && p.isSettlement == (int)GlobalEnumVars.DistributionOrderSettlementStatus.SettlementNo);
|
||||
if (list != null && list.Any())
|
||||
{
|
||||
foreach (var item in list)
|
||||
//foreach (var item in list)
|
||||
//{
|
||||
// //钱挪到会员余额里面
|
||||
// var result = await _balanceServices.Change(item.userId, (int)GlobalEnumVars.UserBalanceSourceTypes.Distribution,
|
||||
// item.amount, item.orderId);
|
||||
// if (!result.status)
|
||||
// {
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
await foreach (var result in ChangeForEach(list))
|
||||
{
|
||||
//钱挪到会员余额里面
|
||||
var result = await _balanceServices.Change(item.userId, (int)GlobalEnumVars.UserBalanceSourceTypes.Distribution,
|
||||
item.amount, item.orderId);
|
||||
if (!result.status)
|
||||
{
|
||||
//日常日志处理。
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
await _dal.UpdateAsync(p => new CoreCmsDistributionOrder()
|
||||
{
|
||||
isSettlement = (int)GlobalEnumVars.DistributionOrderSettlementStatus.SettlementYes,
|
||||
@@ -343,6 +341,21 @@ namespace CoreCms.Net.Services
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
//使用迭代器
|
||||
private async IAsyncEnumerable<WebApiCallBack> ChangeForEach(List<CoreCmsDistributionOrder> list)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
//钱挪到会员余额里面
|
||||
var result = await _balanceServices.Change(item.userId, (int)GlobalEnumVars.UserBalanceSourceTypes.Distribution,
|
||||
item.amount, item.orderId);
|
||||
|
||||
yield return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 作废订单
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
:range-color="rangeColor"
|
||||
:range-bg-color="rangeBgColor"
|
||||
:active-bg-color="activeBgColor"
|
||||
:monthNum="13"
|
||||
btnType="success"
|
||||
@close="showCalendar=false"
|
||||
@confirm="selDate"></u-calendar>
|
||||
@@ -108,7 +109,7 @@
|
||||
//日期选择
|
||||
showCalendar: false,
|
||||
minDate: `${year - 1}-${month}-${date}`,
|
||||
//maxDate: `${year}-${month}-${date}`,
|
||||
maxDate: `${year}-${month}-${date}`,
|
||||
mode: 'range',
|
||||
result: '请选择日期',
|
||||
startText: '开始',
|
||||
|
||||
@@ -23,19 +23,19 @@
|
||||
.underline { display: block; width: 34px; height: 2px; background: #fff; border-radius: 1px; }
|
||||
.underline-active { background: #e54d42; display: block; width: 34px; height: 2px; border-radius: 1px; }
|
||||
}
|
||||
.order-list { background-color: #fff; margin-top: 10px;
|
||||
.order-list { background-color: #fff; margin: 10px; border-radius: 10px;
|
||||
.order-head { padding: 10px;
|
||||
.order-code { font-size: 13px; font-weight: 400; color: #999999; }
|
||||
.order-state { font-size: 13px; font-weight: 500; color: #05c3a1; }
|
||||
}
|
||||
.order-from { background-color: #f9f9f9; padding: 10px;
|
||||
.order-from {/* background-color: #f9f9f9;*/ padding: 10px;
|
||||
.from-user { font-size: 12px; font-weight: 400; color: #666666;
|
||||
.user-avatar { width: 13px; height: 13px; border-radius: 50%; margin-right: 4px; }
|
||||
.user-name { font-size: 12px; font-weight: 400; color: #999999; }
|
||||
}
|
||||
.order-time { font-size: 12px; font-weight: 400; color: #999999; }
|
||||
}
|
||||
.goods-card { padding: 15px 10px;
|
||||
.goods-card { padding: 10px 10px;
|
||||
.goods-img-box { margin-right: 15px;
|
||||
.goods-img { width: 80px; height: 80px; background-color: #ccc; }
|
||||
}
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.total-box { height: 40px; padding: 0 10px;
|
||||
.total-box { height: 30px; width: 100%;
|
||||
.num-price { font-size: 12px; font-weight: 400; color: #999999; }
|
||||
.name { font-size: 12px; font-weight: 400; color: #999999; }
|
||||
.commission-num { font-size: 15px; font-weight: 400; color: #eb2b3d;
|
||||
|
||||
@@ -72,20 +72,41 @@
|
||||
<view class="content_box">
|
||||
<!-- 订单列表 -->
|
||||
<view class="order-list" v-for="item in list" :key="item.id" v-if="list.length > 0">
|
||||
<view class="order-head coreshop-flex coreshop-justify-between">
|
||||
<view class="order-head coreshop-flex coreshop-justify-between coreshop-solid-bottom">
|
||||
<text class="order-code">订单编号:{{ item.orderId }}</text>
|
||||
<text class="order-state">{{ item.userId==item.buyUserId?'代购订单':'推广订单' }}</text>
|
||||
</view>
|
||||
<view class="order-from coreshop-flex coreshop-justify-between">
|
||||
<view class="order-from coreshop-flex coreshop-justify-between coreshop-solid-bottom">
|
||||
<view class="from-user coreshop-flex coreshop-align-center">
|
||||
<text>下单人:</text>
|
||||
<!--<image class="user-avatar" :src="item.buyer.avatar" mode=""></image>-->
|
||||
<u-avatar :src="item.buyUserAvatar" size="20"></u-avatar>
|
||||
<text class="user-name">{{ item.buyUserNickName }}</text>
|
||||
</view>
|
||||
<view class="order-time">{{ $u.timeFormat(item.createTime, ' yyyy.mm.dd hh:MM ') }}</view>
|
||||
</view>
|
||||
<view class="total-box coreshop-flex coreshop-justify-between px20">
|
||||
<view class="num-price">提成:¥{{ item.amount || '0'}}</view>
|
||||
<view class="goods-card coreshop-flex coreshop-align-center coreshop-solid-bottom" v-for="goods in item.agentOrderDetails" :key="goods.id">
|
||||
<view class="goods-img-box"><image class="goods-img" :src="goods.imageUrl" mode=""></image></view>
|
||||
<view class="goods-info coreshop-flex coreshop-flex-direction coreshop-align-center coreshop-justify-between">
|
||||
<view class="goods-title more-t">{{ goods.name }}</view>
|
||||
<view class="goods-sku">数量: {{ goods.productNums }};{{ goods.addon || '' }}</view>
|
||||
<view class="total-box coreshop-flex coreshop-align-center coreshop-justify-between">
|
||||
<view class="goods-price">
|
||||
{{ goods.productPrice * goods.productNums }}
|
||||
<text class="goods-state">未结算</text>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<text class="name">佣金:</text>
|
||||
<text class="commission-num">{{ goods.amount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total-box coreshop-flex coreshop-align-center coreshop-justify-between coreshop-padding-left-10 coreshop-padding-right-10">
|
||||
<view class="num-price">商品总价:¥{{ item.goodsAmount }}, 实付款:¥{{ item.payedAmount }}, 优惠金额:¥{{ item.goodsAmount-item.payedAmount }}</view>
|
||||
<view class="x-f"></view>
|
||||
</view>
|
||||
<view class="total-box coreshop-flex coreshop-justify-between coreshop-padding-left-10 coreshop-padding-right-10">
|
||||
<view class="num-price coreshop-flex coreshop-align-center">提成:¥{{ item.amount || '0'}}</view>
|
||||
<view class="coreshop-flex coreshop-align-center">{{item.isSettlement==1?'已结算':item.isSettlement==2?'未结算':'已退款'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
},
|
||||
onShow() {
|
||||
var _this = this;
|
||||
if (_this.$store.state.config.distributionStore != '1') {
|
||||
if (_this.$store.state.config.agentStore != '1') {
|
||||
delete this.utilityMenus.myStore;
|
||||
delete this.utilityMenus.storeSetting;
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
:range-color="rangeColor"
|
||||
:range-bg-color="rangeBgColor"
|
||||
:active-bg-color="activeBgColor"
|
||||
:monthNum="13"
|
||||
btnType="success"
|
||||
@close="showCalendar=false"
|
||||
@confirm="selDate"></u-calendar>
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
<text class="coreshop-text-white" v-if="!condition.conditionStatus">未达标</text>
|
||||
<text class="coreshop-text-white coreshop-font-40">{{condition.conditionProgress}}%</text>
|
||||
</view>
|
||||
<progress class="coreshop-progress-radius" percent="100" active stroke-width="10" activeColor="#fbbd08" />
|
||||
<!--<progress class="coreshop-progress-radius" percent="100" active stroke-width="10" activeColor="#fbbd08" />-->
|
||||
<u-line-progress :percentage="condition.conditionProgress" activeColor="#5FB878"></u-line-progress>
|
||||
<view class="coreshop-text-center coreshop-margin-bottom-10 coreshop-margin-top-10">
|
||||
<text class="coreshop-text-white">{{condition.conditionMsg}}</text>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.direct-box { margin: 10px;
|
||||
.direct-item { width: 170px; height: 57.5px; background: #ffffff; border-radius: 10px; padding: 10px;margin: 0 5px;
|
||||
.direct-item { width: 170px; height: 57.5px; background: #ffffff; border-radius: 10px; padding: 10px; margin: 0 5px;
|
||||
.item-title { font-size: 11px; font-weight: 500; color: #999999; margin-bottom: 3px; }
|
||||
.item-value { font-size: 19px; font-weight: 600; color: #333333; }
|
||||
}
|
||||
@@ -23,19 +23,19 @@
|
||||
.underline { display: block; width: 34px; height: 2px; background: #fff; border-radius: 1px; }
|
||||
.underline-active { background: #e54d42; display: block; width: 34px; height: 2px; border-radius: 1px; }
|
||||
}
|
||||
.order-list { background-color: #fff; margin-top: 10px;
|
||||
.order-list { background-color: #fff; margin: 10px; border-radius: 10px;
|
||||
.order-head { padding: 10px;
|
||||
.order-code { font-size: 13px; font-weight: 400; color: #999999; }
|
||||
.order-state { font-size: 13px; font-weight: 500; color: #05c3a1; }
|
||||
}
|
||||
.order-from { background-color: #f9f9f9; padding: 10px;
|
||||
.order-from { /* background-color: #f9f9f9;*/ padding: 10px;
|
||||
.from-user { font-size: 12px; font-weight: 400; color: #666666;
|
||||
.user-avatar { width: 13px; height: 13px; border-radius: 50%; margin-right: 4px; }
|
||||
.user-name { font-size: 12px; font-weight: 400; color: #999999; }
|
||||
}
|
||||
.order-time { font-size: 12px; font-weight: 400; color: #999999; }
|
||||
}
|
||||
.goods-card { padding: 15px 10px;
|
||||
.goods-card { padding: 10px 10px;
|
||||
.goods-img-box { margin-right: 15px;
|
||||
.goods-img { width: 80px; height: 80px; background-color: #ccc; }
|
||||
}
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.total-box { height: 40px; padding: 0 10px;
|
||||
.total-box { height: 30px; width: 100%;
|
||||
.num-price { font-size: 12px; font-weight: 400; color: #999999; }
|
||||
.name { font-size: 12px; font-weight: 400; color: #999999; }
|
||||
.commission-num { font-size: 15px; font-weight: 400; color: #eb2b3d;
|
||||
|
||||
@@ -72,21 +72,38 @@
|
||||
<view class="content_box">
|
||||
<!-- 订单列表 -->
|
||||
<view class="order-list" v-for="item in list" :key="item.id" v-if="list.length > 0">
|
||||
<view class="order-head coreshop-flex coreshop-justify-between">
|
||||
<view class="order-head coreshop-flex coreshop-justify-between coreshop-solid-bottom">
|
||||
<text class="order-code">订单编号:{{ item.orderId }}</text>
|
||||
<text class="order-state">{{ item.statusName }}</text>
|
||||
<text class="order-state">{{item.isSettlement==1?'已结算':item.isSettlement==2?'未结算':'已退款'}}</text>
|
||||
</view>
|
||||
<view class="order-from coreshop-flex coreshop-justify-between">
|
||||
<view class="order-from coreshop-flex coreshop-justify-between coreshop-solid-bottom">
|
||||
<view class="from-user coreshop-flex coreshop-align-center">
|
||||
<text>下单人:</text>
|
||||
<!--<image class="user-avatar" :src="item.buyer.avatar" mode=""></image>-->
|
||||
<u-avatar :src="item.buyUserAvatar" size="20"></u-avatar>
|
||||
<text class="user-name">{{ item.buyUserNickName }}</text>
|
||||
</view>
|
||||
<view class="order-time">{{ $u.timeFormat(item.createTime, ' yyyy.mm.dd hh:MM ') }}</view>
|
||||
</view>
|
||||
<view class="total-box coreshop-flex coreshop-justify-between px20">
|
||||
<view class="num-price">佣金:¥{{ item.amount || '0'}}</view>
|
||||
<view class="coreshop-flex coreshop-align-center">{{item.isSettlement==1?'已结算':item.isSettlement==2?'未结算':'已退款'}}</view>
|
||||
<view class="goods-card coreshop-flex coreshop-align-center coreshop-solid-bottom" v-for="goods in item.distributionOrderDetails" :key="goods.id">
|
||||
<view class="goods-img-box"><image class="goods-img" :src="goods.imageUrl" mode=""></image></view>
|
||||
<view class="goods-info coreshop-flex coreshop-flex-direction coreshop-align-center coreshop-justify-between">
|
||||
<view class="goods-title more-t">{{ goods.name }}</view>
|
||||
<view class="goods-sku">数量: {{ goods.productNums }};{{ goods.addon || '' }}</view>
|
||||
<view class="total-box coreshop-flex coreshop-align-center coreshop-justify-between">
|
||||
<view class="goods-price">
|
||||
{{ goods.productPrice }}
|
||||
<text class="goods-state">未结算</text>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<text class="name">佣金:</text>
|
||||
<text class="commission-num">{{ goods.amount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total-box coreshop-flex coreshop-align-center coreshop-justify-between coreshop-padding-left-10 coreshop-padding-right-10">
|
||||
<view class="num-price">商品总价:¥{{ item.goodsAmount }}, 实付款:¥{{ item.payedAmount }}, 优惠金额:¥{{ item.goodsAmount-item.payedAmount }},提成:¥{{ item.amount || '0'}}</view>
|
||||
<view class="x-f"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 无数据时默认显示 -->
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<text class="coreshop-text-orange coreshop-font-40">100%</text>
|
||||
<text class="coreshop-text-black">,太棒啦!</text>
|
||||
</view>
|
||||
<progress percent="100" active stroke-width="10" activeColor="#f37b1d" />
|
||||
<u-line-progress percentage="100" activeColor="#5FB878"></u-line-progress>
|
||||
</view>
|
||||
<view class="coreshop-list menu coreshop-bg-white coreshop-padding-15">
|
||||
<u--form :model="model" :rules="rules" ref="uForm" errorType="message" labelPosition="left" labelWidth="80">
|
||||
|
||||
@@ -56,6 +56,13 @@
|
||||
</div>
|
||||
<div class="layui-form-mid">开启此功能,代理商自己下单也将直接计算利润提成</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{{d.data.configs['agentStore']['sKey']}}:</label>
|
||||
<div class="layui-input-inline layui-inline-7">
|
||||
<input type="radio" lay-filter="agentStore" name="agentStore" value="1" title="开启" {{d.data.configs['agentStore']['sValue']==="1" ? 'checked':''}}>
|
||||
<input type="radio" lay-filter="agentStore" name="agentStore" value="2" title="不开启" {{d.data.configs['agentStore']['sValue']==="2" ? 'checked':''}}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"> </label>
|
||||
|
||||
@@ -367,6 +367,27 @@
|
||||
<input type="radio" lay-filter="storeOrderAutomaticDelivery" name="storeOrderAutomaticDelivery" value="2" title="不开启" {{d.data.configs['storeOrderAutomaticDelivery']['sValue']==="2" ? 'checked':''}}>
|
||||
</div>
|
||||
</div>
|
||||
<blockquote class="layui-elem-quote">
|
||||
佣金通道
|
||||
</blockquote>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{{d.data.configs['commissionChannel']['sKey']}}:</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input type="radio" lay-filter="commissionChannel" name="commissionChannel" value="1" title="仅代理" {{d.data.configs['commissionChannel']['sValue']==="1" ? 'checked':''}}>
|
||||
<input type="radio" lay-filter="commissionChannel" name="commissionChannel" value="2" title="仅分销" {{d.data.configs['commissionChannel']['sValue']==="2" ? 'checked':''}}>
|
||||
<input type="radio" lay-filter="commissionChannel" name="commissionChannel" value="3" title="先代理后分销" {{d.data.configs['commissionChannel']['sValue']==="3" ? 'checked':''}}>
|
||||
<input type="radio" lay-filter="commissionChannel" name="commissionChannel" value="4" title="先分销后代理" {{d.data.configs['commissionChannel']['sValue']==="4" ? 'checked':''}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">说明:</label>
|
||||
<div class="layui-form-mid layui-word-aux">
|
||||
仅代理指只计算代理分佣逻辑,如果代理分佣逻辑不满足而不继续执行。<br />
|
||||
仅分销指只计算三级分销佣金,如果三级分佣模式不满足则不继续执行。<br />
|
||||
先代理后分销:指先计算代理分佣逻辑是否满足,如果是则只走代理分佣逻辑,如果不是,验证之后则继续执行三级分销分佣逻辑。<br />
|
||||
先分销后代理:指先计算是否三级分销满足,满足则只计算三级分级分销,如果不满足再继续执行代理分佣逻辑。<br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"> </label>
|
||||
<div class="layui-input-block">
|
||||
@@ -630,6 +651,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"> </label>
|
||||
<div class="layui-input-block">
|
||||
@@ -963,9 +985,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//初始化分销设置是否选中商品
|
||||
if (d.data.configs.distributionGoodsId) {
|
||||
var obj = d.data.configs.distributionGoodsId;
|
||||
|
||||
@@ -20,7 +20,6 @@ using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.Options;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
@@ -125,6 +124,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
distributionAgreement = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionAgreement); //分销协议
|
||||
distributionStore = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionStore).ObjectToInt(2); //是否开启店铺
|
||||
}
|
||||
|
||||
var showInviter = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowInviterInfo).ObjectToInt(); //是否显示邀请人信息
|
||||
var shareTitle = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShareTitle); //分享标题
|
||||
var shareDesc = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShareDesc); //分享描述
|
||||
@@ -148,10 +148,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
var agentNotes = string.Empty;
|
||||
var agentAgreement = string.Empty;
|
||||
var agentStore = 2;
|
||||
if (isOpenAgent == 1 && isShowAgentPortal == 1)
|
||||
{
|
||||
agentNotes = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.AgentNotes); //用户须知
|
||||
agentAgreement = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.AgentAgreement); //分销协议
|
||||
agentStore = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.AgentStore).ObjectToInt(2); //是否开启代理店铺
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +161,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
shopLogo,
|
||||
shopName,
|
||||
shopBeiAn = shopBeiAn,
|
||||
shopBeiAn,
|
||||
shopDesc,
|
||||
imageMax,
|
||||
storeSwitch,
|
||||
@@ -197,7 +199,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
isOpenAgent,
|
||||
isShowAgentPortal,
|
||||
agentNotes,
|
||||
agentAgreement
|
||||
agentAgreement,
|
||||
agentStore
|
||||
};
|
||||
jm.data = model;
|
||||
return jm;
|
||||
|
||||
14729
数据库/MySql/20220211/coreshop20220211完整数据库.sql
Normal file
14729
数据库/MySql/20220211/coreshop20220211完整数据库.sql
Normal file
File diff suppressed because one or more lines are too long
70
数据库/MySql/20220211/升级脚本.sql
Normal file
70
数据库/MySql/20220211/升级脚本.sql
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50732
|
||||
Source Schema : coreshop
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50732
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 11/02/2022 05:22:51
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for CoreCmsAgentOrderDetails
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `CoreCmsAgentOrderDetails`;
|
||||
CREATE TABLE `CoreCmsAgentOrderDetails` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '序列',
|
||||
`agentOrderId` int(11) NULL DEFAULT NULL COMMENT '代理商佣金订单',
|
||||
`orderId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户订单编号',
|
||||
`productPrice` decimal(10, 2) NULL DEFAULT NULL COMMENT '货品单价',
|
||||
`amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '结算佣金',
|
||||
`goodId` int(11) NULL DEFAULT NULL COMMENT '商品序列',
|
||||
`name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品名称',
|
||||
`addon` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '货品明细序列号存储',
|
||||
`productId` int(11) NULL DEFAULT NULL COMMENT '货品序列',
|
||||
`productNums` int(11) NULL DEFAULT NULL COMMENT '货品数量',
|
||||
`promotionAmount` decimal(10, 2) NULL DEFAULT NULL COMMENT '货品优惠总金额',
|
||||
`imageUrl` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片',
|
||||
`remark` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注',
|
||||
`createTime` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of CoreCmsAgentOrderDetails
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for CoreCmsDistributionOrderDetails
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `CoreCmsDistributionOrderDetails`;
|
||||
CREATE TABLE `CoreCmsDistributionOrderDetails` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '序列',
|
||||
`distributionOrderId` int(11) NULL DEFAULT NULL COMMENT '代理商佣金订单',
|
||||
`orderId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户订单编号',
|
||||
`productPrice` decimal(10, 2) NULL DEFAULT NULL COMMENT '货品单价',
|
||||
`amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '结算金额',
|
||||
`goodId` int(11) NULL DEFAULT NULL COMMENT '商品序列',
|
||||
`name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品名称',
|
||||
`addon` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '货品明细序列号存储',
|
||||
`productId` int(11) NULL DEFAULT NULL COMMENT '货品序列',
|
||||
`productNums` int(11) NULL DEFAULT NULL COMMENT '货品数量',
|
||||
`promotionAmount` decimal(10, 2) NULL DEFAULT NULL COMMENT '货品优惠总金额',
|
||||
`imageUrl` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片',
|
||||
`remark` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注',
|
||||
`createTime` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of CoreCmsDistributionOrderDetails
|
||||
-- ----------------------------
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -1,3 +1,8 @@
|
||||
2022-02-11
|
||||
【新增】增加【CoreCmsAgentOrderDetails】表,实现代理佣金订单详情列表功能,精确到具体商品明细。
|
||||
【新增】增加【CoreCmsDistributionOrderDetails】表,实现三级佣金订单详情列表功能,精确到具体商品明细。
|
||||
|
||||
|
||||
2022-01-22
|
||||
【新增】新增【CoreCmsOrderDistributionModel】表
|
||||
|
||||
|
||||
BIN
数据库/SqlServer/20220211/202202110450完整数据库.rar
Normal file
BIN
数据库/SqlServer/20220211/202202110450完整数据库.rar
Normal file
Binary file not shown.
BIN
数据库/SqlServer/20220211/sql升级脚本.sql
Normal file
BIN
数据库/SqlServer/20220211/sql升级脚本.sql
Normal file
Binary file not shown.
@@ -1,3 +1,7 @@
|
||||
2022-02-11
|
||||
【新增】增加【CoreCmsAgentOrderDetails】表,实现代理佣金订单详情列表功能,精确到具体商品明细。
|
||||
【新增】增加【CoreCmsDistributionOrderDetails】表,实现三级佣金订单详情列表功能,精确到具体商品明细。
|
||||
|
||||
2022-01-22
|
||||
【新增】新增【CoreCmsOrderDistributionModel】表
|
||||
|
||||
|
||||
Reference in New Issue
Block a user