diff --git a/CoreCms.Net.Configuration/GlobalEnumVars.cs b/CoreCms.Net.Configuration/GlobalEnumVars.cs
index 641ae4e3..27e6985b 100644
--- a/CoreCms.Net.Configuration/GlobalEnumVars.cs
+++ b/CoreCms.Net.Configuration/GlobalEnumVars.cs
@@ -2828,5 +2828,19 @@ namespace CoreCms.Net.Configuration
#endregion
+ #region 佣金相关
+ ///
+ /// 代理分销通道判定
+ ///
+ public enum CommissionChannel
+ {
+ 仅代理 = 1,
+ 仅分销 = 2,
+ 先代理后分销 = 3,
+ 先分销后代理 = 4,
+ }
+ #endregion
+
+
}
}
diff --git a/CoreCms.Net.Configuration/SystemSettingConstVars.cs b/CoreCms.Net.Configuration/SystemSettingConstVars.cs
index c0dc81a2..33b64be3 100644
--- a/CoreCms.Net.Configuration/SystemSettingConstVars.cs
+++ b/CoreCms.Net.Configuration/SystemSettingConstVars.cs
@@ -101,6 +101,17 @@ namespace CoreCms.Net.Configuration
///
public const string StoreOrderAutomaticDelivery = "storeOrderAutomaticDelivery";
+
+ ///
+ /// 门店订单自动发货
+ ///
+ public const string CommissionChannel = "commissionChannel";
+
+
+
+
+
+
//分销功能(老分销)=============================================================
///
/// 是否开启分销
@@ -594,6 +605,7 @@ namespace CoreCms.Net.Configuration
///
public const string SmsTplForCommon = "smsTplForCommon";
+
//网络打印机============================================================================
///
/// 是否开启
@@ -645,6 +657,10 @@ namespace CoreCms.Net.Configuration
///
public const string AgentAgreement = "agentAgreement";
///
+ /// 是否开启店铺:
+ ///
+ public const string AgentStore = "agentStore";
+ ///
/// 是否允许代理代购服务
///
public const string IsAllowProcurementService = "isAllowProcurementService";
diff --git a/CoreCms.Net.Configuration/SystemSettingDictionary.cs b/CoreCms.Net.Configuration/SystemSettingDictionary.cs
index 6491dc2d..89db6f5c 100644
--- a/CoreCms.Net.Configuration/SystemSettingDictionary.cs
+++ b/CoreCms.Net.Configuration/SystemSettingDictionary.cs
@@ -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;
}
-
-
}
}
diff --git a/CoreCms.Net.IRepository/Agent/ICoreCmsAgentOrderDetailsRepository.cs b/CoreCms.Net.IRepository/Agent/ICoreCmsAgentOrderDetailsRepository.cs
new file mode 100644
index 00000000..e18aebb9
--- /dev/null
+++ b/CoreCms.Net.IRepository/Agent/ICoreCmsAgentOrderDetailsRepository.cs
@@ -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
+{
+ ///
+ /// 代理佣金明细 工厂接口
+ ///
+ public interface ICoreCmsAgentOrderDetailsRepository : IBaseRepository
+ {
+ #region 重写增删改查操作===========================================================
+
+ ///
+ /// 重写异步插入方法
+ ///
+ ///
+ ///
+ new Task InsertAsync(CoreCmsAgentOrderDetails entity);
+
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ new Task UpdateAsync(CoreCmsAgentOrderDetails entity);
+
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ new Task UpdateAsync(List entity);
+
+
+ ///
+ /// 重写删除指定ID的数据
+ ///
+ ///
+ ///
+ new Task DeleteByIdAsync(object id);
+
+
+ ///
+ /// 重写删除指定ID集合的数据(批量删除)
+ ///
+ ///
+ ///
+ new Task DeleteByIdsAsync(int[] ids);
+
+ #endregion
+
+ ///
+ /// 重写根据条件查询分页数据
+ ///
+ /// 判断集合
+ /// 排序方式
+ /// 当前页面索引
+ /// 分布大小
+ ///
+ /// 是否使用WITH(NOLOCK)
+ ///
+ new Task> QueryPageAsync(
+ Expression> predicate,
+ Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
+ int pageSize = 20, bool blUseNoLock = false);
+
+ }
+}
diff --git a/CoreCms.Net.IRepository/Agent/ICoreCmsAgentOrderRepository.cs b/CoreCms.Net.IRepository/Agent/ICoreCmsAgentOrderRepository.cs
index ed1f6376..dfad58a5 100644
--- a/CoreCms.Net.IRepository/Agent/ICoreCmsAgentOrderRepository.cs
+++ b/CoreCms.Net.IRepository/Agent/ICoreCmsAgentOrderRepository.cs
@@ -39,47 +39,6 @@ namespace CoreCms.Net.IRepository
Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false);
- #region 重写增删改查操作===========================================================
-
- ///
- /// 重写异步插入方法
- ///
- ///
- ///
- new Task InsertAsync(CoreCmsAgentOrder entity);
-
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- new Task UpdateAsync(CoreCmsAgentOrder entity);
-
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- new Task UpdateAsync(List entity);
-
-
- ///
- /// 重写删除指定ID的数据
- ///
- ///
- ///
- new Task DeleteByIdAsync(object id);
-
-
- ///
- /// 重写删除指定ID集合的数据(批量删除)
- ///
- ///
- ///
- new Task DeleteByIdsAsync(int[] ids);
-
- #endregion
+
}
}
\ No newline at end of file
diff --git a/CoreCms.Net.IRepository/Distribution/ICoreCmsDistributionOrderDetailsRepository.cs b/CoreCms.Net.IRepository/Distribution/ICoreCmsDistributionOrderDetailsRepository.cs
new file mode 100644
index 00000000..13c448f4
--- /dev/null
+++ b/CoreCms.Net.IRepository/Distribution/ICoreCmsDistributionOrderDetailsRepository.cs
@@ -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
+{
+ ///
+ /// 分销佣金明细 工厂接口
+ ///
+ public interface ICoreCmsDistributionOrderDetailsRepository : IBaseRepository
+ {
+ #region 重写增删改查操作===========================================================
+
+ ///
+ /// 重写异步插入方法
+ ///
+ ///
+ ///
+ new Task InsertAsync(CoreCmsDistributionOrderDetails entity);
+
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ new Task UpdateAsync(CoreCmsDistributionOrderDetails entity);
+
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ new Task UpdateAsync(List entity);
+
+
+ ///
+ /// 重写删除指定ID的数据
+ ///
+ ///
+ ///
+ new Task DeleteByIdAsync(object id);
+
+
+ ///
+ /// 重写删除指定ID集合的数据(批量删除)
+ ///
+ ///
+ ///
+ new Task DeleteByIdsAsync(int[] ids);
+
+ #endregion
+
+ ///
+ /// 重写根据条件查询分页数据
+ ///
+ /// 判断集合
+ /// 排序方式
+ /// 当前页面索引
+ /// 分布大小
+ ///
+ /// 是否使用WITH(NOLOCK)
+ ///
+ new Task> QueryPageAsync(
+ Expression> predicate,
+ Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
+ int pageSize = 20, bool blUseNoLock = false);
+
+ }
+}
diff --git a/CoreCms.Net.IRepository/Distribution/ICoreCmsDistributionOrderRepository.cs b/CoreCms.Net.IRepository/Distribution/ICoreCmsDistributionOrderRepository.cs
index 8b600f7a..f4c4b165 100644
--- a/CoreCms.Net.IRepository/Distribution/ICoreCmsDistributionOrderRepository.cs
+++ b/CoreCms.Net.IRepository/Distribution/ICoreCmsDistributionOrderRepository.cs
@@ -15,49 +15,7 @@ namespace CoreCms.Net.IRepository
///
public interface ICoreCmsDistributionOrderRepository : IBaseRepository
{
- #region 重写增删改查操作===========================================================
-
- ///
- /// 重写异步插入方法
- ///
- ///
- ///
- new Task InsertAsync(CoreCmsDistributionOrder entity);
-
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- new Task UpdateAsync(CoreCmsDistributionOrder entity);
-
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- new Task UpdateAsync(List entity);
-
-
- ///
- /// 重写删除指定ID的数据
- ///
- ///
- ///
- new Task DeleteByIdAsync(object id);
-
-
- ///
- /// 重写删除指定ID集合的数据(批量删除)
- ///
- ///
- ///
- new Task DeleteByIdsAsync(int[] ids);
-
- #endregion
-
+
///
/// 重写根据条件查询分页数据
diff --git a/CoreCms.Net.IServices/Agent/ICoreCmsAgentOrderDetailsServices.cs b/CoreCms.Net.IServices/Agent/ICoreCmsAgentOrderDetailsServices.cs
new file mode 100644
index 00000000..91835028
--- /dev/null
+++ b/CoreCms.Net.IServices/Agent/ICoreCmsAgentOrderDetailsServices.cs
@@ -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
+{
+ ///
+ /// 代理佣金明细 服务工厂接口
+ ///
+ public interface ICoreCmsAgentOrderDetailsServices : IBaseServices
+ {
+ #region 重写增删改查操作===========================================================
+
+ ///
+ /// 重写异步插入方法
+ ///
+ ///
+ ///
+ new Task InsertAsync(CoreCmsAgentOrderDetails entity);
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ new Task UpdateAsync(CoreCmsAgentOrderDetails entity);
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ new Task UpdateAsync(List entity);
+
+ ///
+ /// 重写删除指定ID的数据
+ ///
+ ///
+ ///
+ new Task DeleteByIdAsync(object id);
+
+ ///
+ /// 重写删除指定ID集合的数据(批量删除)
+ ///
+ ///
+ ///
+ new Task DeleteByIdsAsync(int[] ids);
+
+ #endregion
+
+ #region 重写根据条件查询分页数据
+ ///
+ /// 重写根据条件查询分页数据
+ ///
+ /// 判断集合
+ /// 排序方式
+ /// 当前页面索引
+ /// 分布大小
+ ///
+ /// 是否使用WITH(NOLOCK)
+ ///
+ new Task> QueryPageAsync(
+ Expression> predicate,
+ Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
+ int pageSize = 20, bool blUseNoLock = false);
+ #endregion
+ }
+}
diff --git a/CoreCms.Net.IServices/Agent/ICoreCmsAgentOrderServices.cs b/CoreCms.Net.IServices/Agent/ICoreCmsAgentOrderServices.cs
index 867c2476..ae67b1bf 100644
--- a/CoreCms.Net.IServices/Agent/ICoreCmsAgentOrderServices.cs
+++ b/CoreCms.Net.IServices/Agent/ICoreCmsAgentOrderServices.cs
@@ -23,45 +23,7 @@ namespace CoreCms.Net.IServices
///
public interface ICoreCmsAgentOrderServices : IBaseServices
{
- #region 重写增删改查操作===========================================================
-
- ///
- /// 重写异步插入方法
- ///
- ///
- ///
- new Task InsertAsync(CoreCmsAgentOrder entity);
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- new Task UpdateAsync(CoreCmsAgentOrder entity);
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- new Task UpdateAsync(List entity);
-
- ///
- /// 重写删除指定ID的数据
- ///
- ///
- ///
- new Task DeleteByIdAsync(object id);
-
- ///
- /// 重写删除指定ID集合的数据(批量删除)
- ///
- ///
- ///
- new Task DeleteByIdsAsync(int[] ids);
-
- #endregion
-
+
#region 重写根据条件查询分页数据
///
/// 重写根据条件查询分页数据
diff --git a/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionOrderDetailsServices.cs b/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionOrderDetailsServices.cs
new file mode 100644
index 00000000..ec49b448
--- /dev/null
+++ b/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionOrderDetailsServices.cs
@@ -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
+{
+ ///
+ /// 分销佣金明细 服务工厂接口
+ ///
+ public interface ICoreCmsDistributionOrderDetailsServices : IBaseServices
+ {
+ #region 重写增删改查操作===========================================================
+
+ ///
+ /// 重写异步插入方法
+ ///
+ ///
+ ///
+ new Task InsertAsync(CoreCmsDistributionOrderDetails entity);
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ new Task UpdateAsync(CoreCmsDistributionOrderDetails entity);
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ new Task UpdateAsync(List entity);
+
+ ///
+ /// 重写删除指定ID的数据
+ ///
+ ///
+ ///
+ new Task DeleteByIdAsync(object id);
+
+ ///
+ /// 重写删除指定ID集合的数据(批量删除)
+ ///
+ ///
+ ///
+ new Task DeleteByIdsAsync(int[] ids);
+
+ #endregion
+
+ #region 重写根据条件查询分页数据
+ ///
+ /// 重写根据条件查询分页数据
+ ///
+ /// 判断集合
+ /// 排序方式
+ /// 当前页面索引
+ /// 分布大小
+ ///
+ /// 是否使用WITH(NOLOCK)
+ ///
+ new Task> QueryPageAsync(
+ Expression> predicate,
+ Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
+ int pageSize = 20, bool blUseNoLock = false);
+ #endregion
+ }
+}
diff --git a/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionOrderServices.cs b/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionOrderServices.cs
index b5d3a56a..94e08c68 100644
--- a/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionOrderServices.cs
+++ b/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionOrderServices.cs
@@ -86,43 +86,5 @@ namespace CoreCms.Net.IServices
///
Task QueryChildOrderMoneySumAsync(int parentId, int type = 1, bool thisMonth = false);
- #region 重写增删改查操作===========================================================
-
- ///
- /// 重写异步插入方法
- ///
- ///
- ///
- new Task InsertAsync(CoreCmsDistributionOrder entity);
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- new Task UpdateAsync(CoreCmsDistributionOrder entity);
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- new Task UpdateAsync(List entity);
-
- ///
- /// 重写删除指定ID的数据
- ///
- ///
- ///
- new Task DeleteByIdAsync(object id);
-
- ///
- /// 重写删除指定ID集合的数据(批量删除)
- ///
- ///
- ///
- new Task DeleteByIdsAsync(int[] ids);
-
- #endregion
}
}
\ No newline at end of file
diff --git a/CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderDetails.cs b/CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderDetails.cs
new file mode 100644
index 00000000..146f93ab
--- /dev/null
+++ b/CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderDetails.cs
@@ -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
+{
+ ///
+ /// 代理佣金明细
+ ///
+ public partial class CoreCmsAgentOrderDetails
+ {
+ ///
+ /// 构造函数
+ ///
+ public CoreCmsAgentOrderDetails()
+ {
+ }
+
+ ///
+ /// 序列
+ ///
+ [Display(Name = "序列")]
+
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 id { get; set; }
+
+
+ ///
+ /// 代理商佣金订单
+ ///
+ [Display(Name = "代理商佣金订单")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 agentOrderId { get; set; }
+
+
+ ///
+ /// 用户订单编号
+ ///
+ [Display(Name = "用户订单编号")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+ [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
+
+
+ public System.String orderId { get; set; }
+
+
+ ///
+ /// 货品单价
+ ///
+ [Display(Name = "货品单价")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Decimal productPrice { get; set; }
+
+
+ ///
+ /// 结算佣金
+ ///
+ [Display(Name = "结算佣金")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Decimal amount { get; set; }
+
+
+ ///
+ /// 商品序列
+ ///
+ [Display(Name = "商品序列")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 goodId { get; set; }
+
+
+ ///
+ /// 商品名称
+ ///
+ [Display(Name = "商品名称")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+ [StringLength(maximumLength:200,ErrorMessage = "{0}不能超过{1}字")]
+
+
+ public System.String name { get; set; }
+
+
+ ///
+ /// 货品明细序列号存储
+ ///
+ [Display(Name = "货品明细序列号存储")]
+
+
+
+
+
+ public System.String addon { get; set; }
+
+
+ ///
+ /// 货品序列
+ ///
+ [Display(Name = "货品序列")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 productId { get; set; }
+
+
+ ///
+ /// 货品数量
+ ///
+ [Display(Name = "货品数量")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 productNums { get; set; }
+
+
+ ///
+ /// 货品优惠总金额
+ ///
+ [Display(Name = "货品优惠总金额")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Decimal promotionAmount { get; set; }
+
+
+ ///
+ /// 图片
+ ///
+ [Display(Name = "图片")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+ [StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
+
+
+ public System.String imageUrl { get; set; }
+
+
+ ///
+ /// 备注
+ ///
+ [Display(Name = "备注")]
+
+
+ [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
+
+
+ public System.String remark { get; set; }
+
+
+ ///
+ /// 创建时间
+ ///
+ [Display(Name = "创建时间")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.DateTime createTime { get; set; }
+
+
+ }
+}
diff --git a/CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderPartial.cs b/CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderPartial.cs
index c89778cc..6c5a1ca7 100644
--- a/CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderPartial.cs
+++ b/CoreCms.Net.Model/Entities/Agent/CoreCmsAgentOrderPartial.cs
@@ -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; }
+ ///
+ /// 购买人头像
+ ///
+ [Display(Name = "购买人头像")]
+ [SugarColumn(IsIgnore = true)]
+ public System.String buyUserAvatar { get; set; }
+
///
/// 分销商
///
@@ -33,5 +42,26 @@ namespace CoreCms.Net.Model.Entities
[SugarColumn(IsIgnore = true)]
public System.String distributorName { get; set; }
+ ///
+ /// 商品总价
+ ///
+ [Display(Name = "商品总价")]
+ [SugarColumn(IsIgnore = true)]
+ public System.Decimal goodsAmount { get; set; }
+
+ ///
+ /// 用户支付金额
+ ///
+ [Display(Name = "用户支付金额")]
+ [SugarColumn(IsIgnore = true)]
+ public System.Decimal payedAmount { get; set; }
+
+ ///
+ /// 订单详情
+ ///
+ [Display(Name = "订单详情")]
+ [SugarColumn(IsIgnore = true)]
+ public List agentOrderDetails { get; set; }
+
}
}
diff --git a/CoreCms.Net.Model/Entities/Distribution/CoreCmsDistributionOrderDetails.cs b/CoreCms.Net.Model/Entities/Distribution/CoreCmsDistributionOrderDetails.cs
new file mode 100644
index 00000000..4652bd2e
--- /dev/null
+++ b/CoreCms.Net.Model/Entities/Distribution/CoreCmsDistributionOrderDetails.cs
@@ -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
+{
+ ///
+ /// 分销佣金明细
+ ///
+ public partial class CoreCmsDistributionOrderDetails
+ {
+ ///
+ /// 构造函数
+ ///
+ public CoreCmsDistributionOrderDetails()
+ {
+ }
+
+ ///
+ /// 序列
+ ///
+ [Display(Name = "序列")]
+
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 id { get; set; }
+
+
+ ///
+ /// 代理商佣金订单
+ ///
+ [Display(Name = "代理商佣金订单")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 distributionOrderId { get; set; }
+
+
+ ///
+ /// 用户订单编号
+ ///
+ [Display(Name = "用户订单编号")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+ [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
+
+
+ public System.String orderId { get; set; }
+
+
+ ///
+ /// 货品单价
+ ///
+ [Display(Name = "货品单价")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Decimal productPrice { get; set; }
+
+
+ ///
+ /// 结算金额
+ ///
+ [Display(Name = "结算金额")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Decimal amount { get; set; }
+
+
+ ///
+ /// 商品序列
+ ///
+ [Display(Name = "商品序列")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 goodId { get; set; }
+
+
+ ///
+ /// 商品名称
+ ///
+ [Display(Name = "商品名称")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+ [StringLength(maximumLength:200,ErrorMessage = "{0}不能超过{1}字")]
+
+
+ public System.String name { get; set; }
+
+
+ ///
+ /// 货品明细序列号存储
+ ///
+ [Display(Name = "货品明细序列号存储")]
+
+
+
+
+
+ public System.String addon { get; set; }
+
+
+ ///
+ /// 货品序列
+ ///
+ [Display(Name = "货品序列")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 productId { get; set; }
+
+
+ ///
+ /// 货品数量
+ ///
+ [Display(Name = "货品数量")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Int32 productNums { get; set; }
+
+
+ ///
+ /// 货品优惠总金额
+ ///
+ [Display(Name = "货品优惠总金额")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.Decimal promotionAmount { get; set; }
+
+
+ ///
+ /// 图片
+ ///
+ [Display(Name = "图片")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+ [StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
+
+
+ public System.String imageUrl { get; set; }
+
+
+ ///
+ /// 备注
+ ///
+ [Display(Name = "备注")]
+
+
+ [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
+
+
+ public System.String remark { get; set; }
+
+
+ ///
+ /// 创建时间
+ ///
+ [Display(Name = "创建时间")]
+
+ [Required(ErrorMessage = "请输入{0}")]
+
+
+
+ public System.DateTime createTime { get; set; }
+
+
+ }
+}
diff --git a/CoreCms.Net.Model/Entities/Distribution/CoreCmsDistributionOrderPartial.cs b/CoreCms.Net.Model/Entities/Distribution/CoreCmsDistributionOrderPartial.cs
index f0d26050..a34520b8 100644
--- a/CoreCms.Net.Model/Entities/Distribution/CoreCmsDistributionOrderPartial.cs
+++ b/CoreCms.Net.Model/Entities/Distribution/CoreCmsDistributionOrderPartial.cs
@@ -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; }
+
+ ///
+ /// 购买人头像
+ ///
+ [Display(Name = "购买人头像")]
+ [SugarColumn(IsIgnore = true)]
+ public System.String buyUserAvatar { get; set; }
+
+
///
/// 分销商
///
[Display(Name = "分销商")]
[SugarColumn(IsIgnore = true)]
public string distributorName { get; set; }
+
+
+ ///
+ /// 商品总价
+ ///
+ [Display(Name = "商品总价")]
+ [SugarColumn(IsIgnore = true)]
+ public System.Decimal goodsAmount { get; set; }
+
+ ///
+ /// 用户支付金额
+ ///
+ [Display(Name = "用户支付金额")]
+ [SugarColumn(IsIgnore = true)]
+ public System.Decimal payedAmount { get; set; }
+
+ ///
+ /// 订单详情
+ ///
+ [Display(Name = "订单详情")]
+ [SugarColumn(IsIgnore = true)]
+ public List distributionOrderDetails { get; set; }
+
+
}
}
\ No newline at end of file
diff --git a/CoreCms.Net.RedisMQ/Subscribe/OrderAgentOrDistributionSubscribe.cs b/CoreCms.Net.RedisMQ/Subscribe/OrderAgentOrDistributionSubscribe.cs
index a91739b3..56bf8439 100644
--- a/CoreCms.Net.RedisMQ/Subscribe/OrderAgentOrDistributionSubscribe.cs
+++ b/CoreCms.Net.RedisMQ/Subscribe/OrderAgentOrDistributionSubscribe.cs
@@ -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,21 +54,24 @@ namespace CoreCms.Net.RedisMQ.Subscribe
var order = JsonConvert.DeserializeObject(msg);
if (order != null)
{
- var jm = await _agentOrderServices.AddData(order);
+ var allConfigs = await _settingServices.GetConfigDictionaries();
- //判断是走代理还是走分销
- if (jm.status == true)
+ var commissionChannel = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.CommissionChannel).ObjectToInt(1);
+
+ if (commissionChannel == (int)GlobalEnumVars.CommissionChannel.仅代理)
{
- NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走代理结佣", JsonConvert.SerializeObject(jm));
+ var jm = await _agentOrderServices.AddData(order);
+ jm.status = true;
+ jm.msg = "分销成功";
+ NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走代理结佣-仅代理", JsonConvert.SerializeObject(jm));
return;
}
- else
+ else if (commissionChannel == (int)GlobalEnumVars.CommissionChannel.仅分销)
{
- await _distributionOrderServices.AddData(order); //添加分享关联订单日志
+ var jm = await _distributionOrderServices.AddData(order); //添加分享关联订单日志
//判断是否可以成为分销商
//先判断是否已经是经销商了。
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) //无需审核,但是要满足提交
{
@@ -96,11 +100,107 @@ namespace CoreCms.Net.RedisMQ.Subscribe
{
await _distributionServices.CheckUpdate(order.userId);
}
- 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 _agentOrderServices.AddData(order);
+
+ //判断是走代理还是走分销
+ if (jm.status == true)
+ {
+ NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "订单完结后走代理结佣-先代理后分销", JsonConvert.SerializeObject(jm));
+ return;
+ }
+ else
+ {
+ 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);
+ }
+ 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);
+ 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
{
@@ -116,5 +216,7 @@ namespace CoreCms.Net.RedisMQ.Subscribe
}
+
+
}
}
diff --git a/CoreCms.Net.Repository/Agent/CoreCmsAgentOrderDetailsRepository.cs b/CoreCms.Net.Repository/Agent/CoreCmsAgentOrderDetailsRepository.cs
new file mode 100644
index 00000000..f8fe8a74
--- /dev/null
+++ b/CoreCms.Net.Repository/Agent/CoreCmsAgentOrderDetailsRepository.cs
@@ -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
+{
+ ///
+ /// 代理佣金明细 接口实现
+ ///
+ public class CoreCmsAgentOrderDetailsRepository : BaseRepository, ICoreCmsAgentOrderDetailsRepository
+ {
+ private readonly IUnitOfWork _unitOfWork;
+ public CoreCmsAgentOrderDetailsRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
+ {
+ _unitOfWork = unitOfWork;
+ }
+
+ #region 实现重写增删改查操作==========================================================
+
+ ///
+ /// 重写异步插入方法
+ ///
+ /// 实体数据
+ ///
+ public new async Task 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;
+ }
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ public new async Task UpdateAsync(CoreCmsAgentOrderDetails entity)
+ {
+ var jm = new AdminUiCallBack();
+
+ var oldModel = await DbClient.Queryable().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;
+ }
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ public new async Task UpdateAsync(List 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;
+ }
+
+ ///
+ /// 重写删除指定ID的数据
+ ///
+ ///
+ ///
+ public new async Task DeleteByIdAsync(object id)
+ {
+ var jm = new AdminUiCallBack();
+
+ var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync();
+ jm.code = bl ? 0 : 1;
+ jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
+
+ return jm;
+ }
+
+ ///
+ /// 重写删除指定ID集合的数据(批量删除)
+ ///
+ ///
+ ///
+ public new async Task DeleteByIdsAsync(int[] ids)
+ {
+ var jm = new AdminUiCallBack();
+
+ var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync();
+ jm.code = bl ? 0 : 1;
+ jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
+
+ return jm;
+ }
+
+ #endregion
+
+
+ #region 重写根据条件查询分页数据
+ ///
+ /// 重写根据条件查询分页数据
+ ///
+ /// 判断集合
+ /// 排序方式
+ /// 当前页面索引
+ /// 分布大小
+ ///
+ /// 是否使用WITH(NOLOCK)
+ ///
+ public new async Task> QueryPageAsync(Expression> predicate,
+ Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
+ int pageSize = 20, bool blUseNoLock = false)
+ {
+ RefAsync totalCount = 0;
+ List page;
+ if (blUseNoLock)
+ {
+ page = await DbClient.Queryable()
+ .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()
+ .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(page, pageIndex, pageSize, totalCount);
+ return list;
+ }
+
+ #endregion
+
+ }
+}
diff --git a/CoreCms.Net.Repository/Agent/CoreCmsAgentOrderRepository.cs b/CoreCms.Net.Repository/Agent/CoreCmsAgentOrderRepository.cs
index dfec2282..d72e4554 100644
--- a/CoreCms.Net.Repository/Agent/CoreCmsAgentOrderRepository.cs
+++ b/CoreCms.Net.Repository/Agent/CoreCmsAgentOrderRepository.cs
@@ -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 实现重写增删改查操作==========================================================
-
- ///
- /// 重写异步插入方法
- ///
- /// 实体数据
- ///
- public new async Task 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;
- }
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- public new async Task UpdateAsync(CoreCmsAgentOrder entity)
- {
- var jm = new AdminUiCallBack();
-
- var oldModel = await DbClient.Queryable().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;
- }
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- public new async Task UpdateAsync(List 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;
- }
-
- ///
- /// 重写删除指定ID的数据
- ///
- ///
- ///
- public new async Task DeleteByIdAsync(object id)
- {
- var jm = new AdminUiCallBack();
-
- var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync();
- jm.code = bl ? 0 : 1;
- jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
-
- return jm;
- }
-
- ///
- /// 重写删除指定ID集合的数据(批量删除)
- ///
- ///
- ///
- public new async Task DeleteByIdsAsync(int[] ids)
- {
- var jm = new AdminUiCallBack();
-
- var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync();
- jm.code = bl ? 0 : 1;
- jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
-
- return jm;
- }
-
- #endregion
-
-
#region 重写根据条件查询分页数据
///
/// 重写根据条件查询分页数据
diff --git a/CoreCms.Net.Repository/Agent/CoreCmsAgentRepository.cs b/CoreCms.Net.Repository/Agent/CoreCmsAgentRepository.cs
index dc4017ba..2b891655 100644
--- a/CoreCms.Net.Repository/Agent/CoreCmsAgentRepository.cs
+++ b/CoreCms.Net.Repository/Agent/CoreCmsAgentRepository.cs
@@ -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()
+ .Where(p => p.agentOrderId == id).ToList();
+ })
.WhereIF(typeId > 0, p => p.isSettlement == typeId)
.OrderBy(dOrder => dOrder.id, OrderByType.Desc)
.ToPageListAsync(pageIndex, pageSize, totalCount);
diff --git a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionOrderDetailsRepository.cs b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionOrderDetailsRepository.cs
new file mode 100644
index 00000000..be1da8c2
--- /dev/null
+++ b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionOrderDetailsRepository.cs
@@ -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
+{
+ ///
+ /// 分销佣金明细 接口实现
+ ///
+ public class CoreCmsDistributionOrderDetailsRepository : BaseRepository, ICoreCmsDistributionOrderDetailsRepository
+ {
+ private readonly IUnitOfWork _unitOfWork;
+ public CoreCmsDistributionOrderDetailsRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
+ {
+ _unitOfWork = unitOfWork;
+ }
+
+ #region 实现重写增删改查操作==========================================================
+
+ ///
+ /// 重写异步插入方法
+ ///
+ /// 实体数据
+ ///
+ public new async Task 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;
+ }
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ public new async Task UpdateAsync(CoreCmsDistributionOrderDetails entity)
+ {
+ var jm = new AdminUiCallBack();
+
+ var oldModel = await DbClient.Queryable().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;
+ }
+
+ ///
+ /// 重写异步更新方法
+ ///
+ ///
+ ///
+ public new async Task UpdateAsync(List 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;
+ }
+
+ ///
+ /// 重写删除指定ID的数据
+ ///
+ ///
+ ///
+ public new async Task DeleteByIdAsync(object id)
+ {
+ var jm = new AdminUiCallBack();
+
+ var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync();
+ jm.code = bl ? 0 : 1;
+ jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
+
+ return jm;
+ }
+
+ ///
+ /// 重写删除指定ID集合的数据(批量删除)
+ ///
+ ///
+ ///
+ public new async Task DeleteByIdsAsync(int[] ids)
+ {
+ var jm = new AdminUiCallBack();
+
+ var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync();
+ jm.code = bl ? 0 : 1;
+ jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
+
+ return jm;
+ }
+
+ #endregion
+
+
+ #region 重写根据条件查询分页数据
+ ///
+ /// 重写根据条件查询分页数据
+ ///
+ /// 判断集合
+ /// 排序方式
+ /// 当前页面索引
+ /// 分布大小
+ ///
+ /// 是否使用WITH(NOLOCK)
+ ///
+ public new async Task> QueryPageAsync(Expression> predicate,
+ Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
+ int pageSize = 20, bool blUseNoLock = false)
+ {
+ RefAsync totalCount = 0;
+ List page;
+ if (blUseNoLock)
+ {
+ page = await DbClient.Queryable()
+ .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()
+ .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(page, pageIndex, pageSize, totalCount);
+ return list;
+ }
+
+ #endregion
+
+ }
+}
diff --git a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionOrderRepository.cs b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionOrderRepository.cs
index 2db9df8b..1769e455 100644
--- a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionOrderRepository.cs
+++ b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionOrderRepository.cs
@@ -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 实现重写增删改查操作==========================================================
-
- ///
- /// 重写异步插入方法
- ///
- /// 实体数据
- ///
- public new async Task 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;
- }
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- public new async Task UpdateAsync(CoreCmsDistributionOrder entity)
- {
- var jm = new AdminUiCallBack();
-
- var oldModel = await DbClient.Queryable().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;
- }
-
- ///
- /// 重写异步更新方法
- ///
- ///
- ///
- public new async Task UpdateAsync(List 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;
- }
-
- ///
- /// 重写删除指定ID的数据
- ///
- ///
- ///
- public new async Task DeleteByIdAsync(object id)
- {
- var jm = new AdminUiCallBack();
-
- var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync();
- jm.code = bl ? 0 : 1;
- jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
-
- return jm;
- }
-
- ///
- /// 重写删除指定ID集合的数据(批量删除)
- ///
- ///
- ///
- public new async Task DeleteByIdsAsync(int[] ids)
- {
- var jm = new AdminUiCallBack();
-
- var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync();
- jm.code = bl ? 0 : 1;
- jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
-
- return jm;
- }
-
- #endregion
+
#region 重写根据条件查询分页数据
///
@@ -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;
diff --git a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionRepository.cs b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionRepository.cs
index d0c3ec66..90596c48 100644
--- a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionRepository.cs
+++ b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionRepository.cs
@@ -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()
+ .Where(p => p.distributionOrderId == id).ToList();
+ })
.WhereIF(typeId > 0, p => p.isSettlement == typeId)
.OrderBy(dOrder => dOrder.id, OrderByType.Desc)
.ToPageListAsync(pageIndex, pageSize, totalCount);
diff --git a/CoreCms.Net.Services/Agent/CoreCmsAgentOrderDetailsServices.cs b/CoreCms.Net.Services/Agent/CoreCmsAgentOrderDetailsServices.cs
new file mode 100644
index 00000000..c52bd168
--- /dev/null
+++ b/CoreCms.Net.Services/Agent/CoreCmsAgentOrderDetailsServices.cs
@@ -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
+{
+ ///
+ /// 代理佣金明细 接口实现
+ ///
+ public class CoreCmsAgentOrderDetailsServices : BaseServices, ICoreCmsAgentOrderDetailsServices
+ {
+ private readonly ICoreCmsAgentOrderDetailsRepository _dal;
+ private readonly IUnitOfWork _unitOfWork;
+
+ public CoreCmsAgentOrderDetailsServices(IUnitOfWork unitOfWork, ICoreCmsAgentOrderDetailsRepository dal)
+ {
+ this._dal = dal;
+ base.BaseDal = dal;
+ _unitOfWork = unitOfWork;
+ }
+
+ #region 实现重写增删改查操作==========================================================
+
+ ///
+ /// 重写异步插入方法
+ ///
+ /// 实体数据
+ ///
+ public new async Task InsertAsync(CoreCmsAgentOrderDetails entity)
+ {
+ return await _dal.InsertAsync(entity);
+ }
+
+ ///
+ /// 重写异步更新方法方法
+ ///
+ ///
+ ///
+ public new async Task UpdateAsync(CoreCmsAgentOrderDetails entity)
+ {
+ return await _dal.UpdateAsync(entity);
+ }
+
+ ///
+ /// 重写异步更新方法方法
+ ///
+ ///
+ ///
+ public new async Task UpdateAsync(List entity)
+ {
+ return await _dal.UpdateAsync(entity);
+ }
+
+ ///
+ /// 重写删除指定ID的数据
+ ///
+ ///
+ ///
+ public new async Task DeleteByIdAsync(object id)
+ {
+ return await _dal.DeleteByIdAsync(id);
+ }
+
+ ///
+ /// 重写删除指定ID集合的数据(批量删除)
+ ///
+ ///
+ ///
+ public new async Task DeleteByIdsAsync(int[] ids)
+ {
+ return await _dal.DeleteByIdsAsync(ids);
+ }
+
+ #endregion
+
+
+ #region 重写根据条件查询分页数据
+ ///
+ /// 重写根据条件查询分页数据
+ ///
+ /// 判断集合
+ /// 排序方式
+ /// 当前页面索引
+ /// 分布大小
+ ///
+ /// 是否使用WITH(NOLOCK)
+ ///
+ public new async Task> QueryPageAsync(Expression> predicate,
+ Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
+ int pageSize = 20, bool blUseNoLock = false)
+ {
+ return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
+ }
+ #endregion
+
+ }
+}
diff --git a/CoreCms.Net.Services/Agent/CoreCmsAgentOrderServices.cs b/CoreCms.Net.Services/Agent/CoreCmsAgentOrderServices.cs
index e72b7a82..1677bb90 100644
--- a/CoreCms.Net.Services/Agent/CoreCmsAgentOrderServices.cs
+++ b/CoreCms.Net.Services/Agent/CoreCmsAgentOrderServices.cs
@@ -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();
+
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);
+ var id = await _dal.InsertAsync(iData);
+ if (id > 0 && agentOrderDetails.Any())
+ {
+ agentOrderDetails.ForEach(p =>
+ {
+ p.agentOrderId = id;
+ });
+ await _agentOrderDetailsServices.InsertAsync(agentOrderDetails);
+ }
}
}
}
-
- #endregion
-
- #region 实现重写增删改查操作==========================================================
-
- ///
- /// 重写异步插入方法
- ///
- /// 实体数据
- ///
- public new async Task InsertAsync(CoreCmsAgentOrder entity)
- {
- return await _dal.InsertAsync(entity);
- }
-
- ///
- /// 重写异步更新方法方法
- ///
- ///
- ///
- public new async Task UpdateAsync(CoreCmsAgentOrder entity)
- {
- return await _dal.UpdateAsync(entity);
- }
-
- ///
- /// 重写异步更新方法方法
- ///
- ///
- ///
- public new async Task UpdateAsync(List entity)
- {
- return await _dal.UpdateAsync(entity);
- }
-
- ///
- /// 重写删除指定ID的数据
- ///
- ///
- ///
- public new async Task DeleteByIdAsync(object id)
- {
- return await _dal.DeleteByIdAsync(id);
- }
-
- ///
- /// 重写删除指定ID集合的数据(批量删除)
- ///
- ///
- ///
- public new async Task DeleteByIdsAsync(int[] ids)
- {
- return await _dal.DeleteByIdsAsync(ids);
- }
-
#endregion
}
}
\ No newline at end of file
diff --git a/CoreCms.Net.Services/Com/ToolsServices.cs b/CoreCms.Net.Services/Com/ToolsServices.cs
index 5566de2f..e938b937 100644
--- a/CoreCms.Net.Services/Com/ToolsServices.cs
+++ b/CoreCms.Net.Services/Com/ToolsServices.cs
@@ -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);
diff --git a/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderDetailsServices.cs b/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderDetailsServices.cs
new file mode 100644
index 00000000..378e7565
--- /dev/null
+++ b/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderDetailsServices.cs
@@ -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
+{
+ ///
+ /// 分销佣金明细 接口实现
+ ///
+ public class CoreCmsDistributionOrderDetailsServices : BaseServices, ICoreCmsDistributionOrderDetailsServices
+ {
+ private readonly ICoreCmsDistributionOrderDetailsRepository _dal;
+ private readonly IUnitOfWork _unitOfWork;
+
+ public CoreCmsDistributionOrderDetailsServices(IUnitOfWork unitOfWork, ICoreCmsDistributionOrderDetailsRepository dal)
+ {
+ this._dal = dal;
+ base.BaseDal = dal;
+ _unitOfWork = unitOfWork;
+ }
+
+ #region 实现重写增删改查操作==========================================================
+
+ ///
+ /// 重写异步插入方法
+ ///
+ /// 实体数据
+ ///
+ public new async Task InsertAsync(CoreCmsDistributionOrderDetails entity)
+ {
+ return await _dal.InsertAsync(entity);
+ }
+
+ ///
+ /// 重写异步更新方法方法
+ ///
+ ///
+ ///
+ public new async Task UpdateAsync(CoreCmsDistributionOrderDetails entity)
+ {
+ return await _dal.UpdateAsync(entity);
+ }
+
+ ///
+ /// 重写异步更新方法方法
+ ///
+ ///
+ ///
+ public new async Task UpdateAsync(List entity)
+ {
+ return await _dal.UpdateAsync(entity);
+ }
+
+ ///
+ /// 重写删除指定ID的数据
+ ///
+ ///
+ ///
+ public new async Task DeleteByIdAsync(object id)
+ {
+ return await _dal.DeleteByIdAsync(id);
+ }
+
+ ///
+ /// 重写删除指定ID集合的数据(批量删除)
+ ///
+ ///
+ ///
+ public new async Task DeleteByIdsAsync(int[] ids)
+ {
+ return await _dal.DeleteByIdsAsync(ids);
+ }
+
+ #endregion
+
+ #region 重写根据条件查询分页数据
+ ///
+ /// 重写根据条件查询分页数据
+ ///
+ /// 判断集合
+ /// 排序方式
+ /// 当前页面索引
+ /// 分布大小
+ ///
+ /// 是否使用WITH(NOLOCK)
+ ///
+ public new async Task> QueryPageAsync(Expression> predicate,
+ Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1,
+ int pageSize = 20, bool blUseNoLock = false)
+ {
+ return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
+ }
+ #endregion
+
+ }
+}
diff --git a/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderServices.cs b/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderServices.cs
index 55a20688..bef41e0d 100644
--- a/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderServices.cs
+++ b/CoreCms.Net.Services/Distribution/CoreCmsDistributionOrderServices.cs
@@ -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 实现重写增删改查操作==========================================================
-
- ///
- /// 重写异步插入方法
- ///
- /// 实体数据
- ///
- public new async Task InsertAsync(CoreCmsDistributionOrder entity)
- {
- return await _dal.InsertAsync(entity);
- }
-
- ///
- /// 重写异步更新方法方法
- ///
- ///
- ///
- public new async Task UpdateAsync(CoreCmsDistributionOrder entity)
- {
- return await _dal.UpdateAsync(entity);
- }
-
- ///
- /// 重写异步更新方法方法
- ///
- ///
- ///
- public new async Task UpdateAsync(List entity)
- {
- return await _dal.UpdateAsync(entity);
- }
-
- ///
- /// 重写删除指定ID的数据
- ///
- ///
- ///
- public new async Task DeleteByIdAsync(object id)
- {
- return await _dal.DeleteByIdAsync(id);
- }
-
- ///
- /// 重写删除指定ID集合的数据(批量删除)
- ///
- ///
- ///
- public new async Task DeleteByIdsAsync(int[] ids)
- {
- return await _dal.DeleteByIdsAsync(ids);
- }
-
- #endregion
#region 重写根据条件查询分页数据
///
@@ -190,74 +141,103 @@ namespace CoreCms.Net.Services
var ommissionDto = commission.data as DistributionDto;
//直返本级
decimal amount = 0;
+ var distributionOrderDetails = new List();
+
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;
- //一级分销
- if (level == 1 && ommissionDto.commission_1 != null)
+
+ mathMoney = level switch
{
- 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);
- }
- }
- //二级分销
- 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);
- }
- }
- //三级分销
- 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);
- }
- }
+ //一级分销
+ 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),
+ //二级分销
+ 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),
+ //三级分销
+ 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 ChangeForEach(List 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 作废订单
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/commissionDetails/commissionDetails.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/commissionDetails/commissionDetails.vue
index 4d63ff28..60822557 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/commissionDetails/commissionDetails.vue
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/commissionDetails/commissionDetails.vue
@@ -85,6 +85,7 @@
:range-color="rangeColor"
:range-bg-color="rangeBgColor"
:active-bg-color="activeBgColor"
+ :monthNum="13"
btnType="success"
@close="showCalendar=false"
@confirm="selDate">
@@ -108,7 +109,7 @@
//日期选择
showCalendar: false,
minDate: `${year - 1}-${month}-${date}`,
- //maxDate: `${year}-${month}-${date}`,
+ maxDate: `${year}-${month}-${date}`,
mode: 'range',
result: '请选择日期',
startText: '开始',
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/order/order.scss b/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/order/order.scss
index 2cbf9b7f..b3ec2c2d 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/order/order.scss
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/order/order.scss
@@ -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;
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/order/order.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/order/order.vue
index e6d7ea6f..d341d0ca 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/order/order.vue
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/order/order.vue
@@ -72,20 +72,41 @@
-
+
订单编号:{{ item.orderId }}
{{ item.userId==item.buyUserId?'代购订单':'推广订单' }}
-
+
下单人:
-
+
{{ item.buyUserNickName }}
{{ $u.timeFormat(item.createTime, ' yyyy.mm.dd hh:MM ') }}
-
- 提成:¥{{ item.amount || '0'}}
+
+
+
+ {{ goods.name }}
+ 数量: {{ goods.productNums }};{{ goods.addon || '' }}
+
+
+ {{ goods.productPrice * goods.productNums }}
+ 未结算
+
+
+ 佣金:
+ {{ goods.amount }}
+
+
+
+
+
+ 商品总价:¥{{ item.goodsAmount }}, 实付款:¥{{ item.payedAmount }}, 优惠金额:¥{{ item.goodsAmount-item.payedAmount }}
+
+
+
+ 提成:¥{{ item.amount || '0'}}
{{item.isSettlement==1?'已结算':item.isSettlement==2?'未结算':'已退款'}}
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/panel/panel.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/panel/panel.vue
index fb68a0d0..7d4add33 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/panel/panel.vue
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/agent/panel/panel.vue
@@ -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;
}
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/commissionDetails/commissionDetails.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/commissionDetails/commissionDetails.vue
index 4640ec03..fea4e58e 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/commissionDetails/commissionDetails.vue
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/commissionDetails/commissionDetails.vue
@@ -81,6 +81,7 @@
:range-color="rangeColor"
:range-bg-color="rangeBgColor"
:active-bg-color="activeBgColor"
+ :monthNum="13"
btnType="success"
@close="showCalendar=false"
@confirm="selDate">
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/index/index.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/index/index.vue
index 8027e671..5e2ec891 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/index/index.vue
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/index/index.vue
@@ -18,7 +18,8 @@
未达标
{{condition.conditionProgress}}%
-
+
+
{{condition.conditionMsg}}
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/order/order.scss b/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/order/order.scss
index d1c47781..b7ee14f4 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/order/order.scss
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/order/order.scss
@@ -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;
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/order/order.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/order/order.vue
index e395d67e..5d6d02a7 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/order/order.vue
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/distribution/order/order.vue
@@ -72,21 +72,38 @@
-
+
订单编号:{{ item.orderId }}
- {{ item.statusName }}
+ {{item.isSettlement==1?'已结算':item.isSettlement==2?'未结算':'已退款'}}
-
+
下单人:
-
+
{{ item.buyUserNickName }}
{{ $u.timeFormat(item.createTime, ' yyyy.mm.dd hh:MM ') }}
-
- 佣金:¥{{ item.amount || '0'}}
- {{item.isSettlement==1?'已结算':item.isSettlement==2?'未结算':'已退款'}}
+
+
+
+ {{ goods.name }}
+ 数量: {{ goods.productNums }};{{ goods.addon || '' }}
+
+
+ {{ goods.productPrice }}
+ 未结算
+
+
+ 佣金:
+ {{ goods.amount }}
+
+
+
+
+
+ 商品总价:¥{{ item.goodsAmount }}, 实付款:¥{{ item.payedAmount }}, 优惠金额:¥{{ item.goodsAmount-item.payedAmount }},提成:¥{{ item.amount || '0'}}
+
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/setting/userInfo/index.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/setting/userInfo/index.vue
index c88e59f2..3ab7a058 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/setting/userInfo/index.vue
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/setting/userInfo/index.vue
@@ -16,7 +16,7 @@
100%
,太棒啦!
-
+