mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
### 0.6.0 专业版(大版本升级,破坏性升级,请酌情处理):
【新增】弃用现在sku前端,启用全新sku组件,更加灵活,体验更好。 【新增】新增通过商品序列获取sku全新列表功能。 【新增】仓储层底层增加二级缓存功能,后面将逐步完善底层缓存中心模块。 【新增】0元购,积分兑换模式下,也去计算用户是否科技升级。 【新增】数据及业务仓储增加二级缓存功能。curd可自主控制是否缓存和清除。 【新增】订单导出excel数据增加商品名称+货品sku组合展示的方式。 【新增】自定义交易组件增加【获取商家信息】【更新商家信息】两个接口处理。 【新增】增加公告列表及公告详情页面,首页组件公告点击跳转列表展示。 【新增】个人中心增加【公告中心】入口。 【新增】后台余额变动增加说明录入。 【调整】将前端能进行分包的文件夹都进行分包,减少主包占用,方便进行二开。 【调整】因ckeditor5存在图片不可设置宽度,上传不支持mp4,排版不畅等情况,降级使用ckeditor4版本。 【修复】修复0.5.5版本售后积分返还机制积分模式判断异常的问题。 【修复】修复使用积分全额抵扣,或其他优惠政策导致的0元购,未进行短信提醒及小票打印机未打印的问题。 【修复】修复更换ckeditor4编辑器后接龙添加编辑调用失败的问题。 【修复】修复积分全额抵扣,金额0元购的情况下,进行售后执行完毕,订单未完结的情况。 【优化】去除分销申请面板按钮无用并失效报错的customStyle属性。 【优化】优化部分方法中使用手写字符串的遗留问题,统一采用enum方式。 【优化】优化前端及接口部分命名错误的问题。错将skill误写成seckill。 【优化】去除uniapp端多个客服代码。 【优化】商品详情底部完善购物车数量显示的问题。 【优化】优化团购列表,拼团列表,秒杀页面页面样式布局差异问题。 【优化】调整支付结果界面样式效果,仿微信支付结果界面。更加清晰明朗。 【优化】优化售后提交页面json计算,开放当用户下单后但未发货情况下,可以申请直接售后的操作需求。 【优化】后台商家手机号码支持设置多个,使用小写逗号分隔,方便多个商家管理员接收下单提醒。 【优化】后台售后单审核,调整售后商品为必选项。
This commit is contained in:
@@ -50,7 +50,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsAgentGoods>> QueryPageAsync(
|
||||
public async Task<IPageList<CoreCmsAgentGoods>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsAgentGoods, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgentGoods, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
@@ -85,16 +85,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.UpdateAsync(entity, products);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentGoods> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
@@ -105,16 +95,6 @@ namespace CoreCms.Net.Services
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsAgentGrade>> QueryPageAsync(
|
||||
public async Task<IPageList<CoreCmsAgentGrade>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsAgentGrade, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgentGrade, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
@@ -67,7 +67,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsAgentGrade entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsAgentGrade entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -77,17 +77,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentGrade entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAgentGrade> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsAgentGrade entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -115,14 +105,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsAgentGrade>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -39,79 +39,5 @@ namespace CoreCms.Net.Services
|
||||
_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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsAgentOrder>> QueryPageAsync(
|
||||
public async Task<IPageList<CoreCmsAgentOrder>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsAgentOrder, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgentOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
@@ -232,7 +232,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="orderId">订单编号</param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> CancleOrderByOrderId(string orderId)
|
||||
public async Task<WebApiCallBack> CancelOrderByOrderId(string orderId)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsAgentProducts>> QueryPageAsync(
|
||||
public async Task<IPageList<CoreCmsAgentProducts>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsAgentProducts, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgentProducts, object>> orderByExpression, OrderByType orderByType,
|
||||
int pageIndex = 1,
|
||||
|
||||
@@ -17,8 +17,8 @@ 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.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO.Agent;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -72,19 +72,19 @@ namespace CoreCms.Net.Services
|
||||
|
||||
var info = await _dal.QueryByClauseAsync(p => p.userId == userId);
|
||||
|
||||
if (info is {verifyStatus: (int) GlobalEnumVars.AgentVerifyStatus.VerifyYes})
|
||||
if (info is { verifyStatus: (int)GlobalEnumVars.AgentVerifyStatus.VerifyYes })
|
||||
{
|
||||
//总金额
|
||||
info.TotalSettlementAmount = await _agentOrderServices.GetSumAsync(
|
||||
p => p.isSettlement != (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementCancel &&
|
||||
p => p.isSettlement != (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementCancel &&
|
||||
p.userId == userId, p => p.amount);
|
||||
//已结算金额
|
||||
info.SettlementAmount = await _agentOrderServices.GetSumAsync(
|
||||
p => p.isSettlement == (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementYes &&
|
||||
p => p.isSettlement == (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementYes &&
|
||||
p.userId == userId, p => p.amount);
|
||||
//冻结金额
|
||||
info.FreezeAmount = await _agentOrderServices.GetSumAsync(
|
||||
p => p.isSettlement == (int) GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo &&
|
||||
p => p.isSettlement == (int)GlobalEnumVars.AgentOrderSettlementStatus.SettlementNo &&
|
||||
p.userId == userId, p => p.amount);
|
||||
|
||||
var dt = DateTime.Now;
|
||||
@@ -181,7 +181,7 @@ namespace CoreCms.Net.Services
|
||||
if (disGradeModel != null) iData.gradeId = disGradeModel.id;
|
||||
}
|
||||
|
||||
if (iData.verifyStatus == 0) iData.verifyStatus = (int) GlobalEnumVars.DistributionVerifyStatus.VerifyWait;
|
||||
if (iData.verifyStatus == 0) iData.verifyStatus = (int)GlobalEnumVars.DistributionVerifyStatus.VerifyWait;
|
||||
iData.isDelete = false;
|
||||
iData.createTime = DateTime.Now;
|
||||
|
||||
@@ -252,20 +252,6 @@ namespace CoreCms.Net.Services
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <returns></returns>
|
||||
public async Task<IPageList<CoreCmsAgentOrder>> QueryOrderPageAsync(int userId, int pageIndex = 1,
|
||||
int pageSize = 20)
|
||||
{
|
||||
return await _dal.QueryOrderPageAsync(userId, pageIndex, pageSize);
|
||||
}
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
|
||||
/// <summary>
|
||||
@@ -278,7 +264,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsAgent>> QueryPageAsync(Expression<Func<CoreCmsAgent, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsAgent>> QueryPageAsync(Expression<Func<CoreCmsAgent, bool>> predicate,
|
||||
Expression<Func<CoreCmsAgent, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -68,7 +68,7 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var list = await _dal.QueryListByClauseAsync(p => ids.Contains(p.id));
|
||||
var list = await _dal.QueryListByClauseAsync(p => ids.Contains(p.id) && p.status == false);
|
||||
if (list.Any())
|
||||
{
|
||||
foreach (var item in list)
|
||||
@@ -101,7 +101,7 @@ namespace CoreCms.Net.Services
|
||||
|
||||
var clerks = await _clerkRepository.QueryListByClauseAsync(p => p.userId == userId);
|
||||
var storeIds = clerks.Select(p => p.storeId).ToList();
|
||||
var ladingList = await _dal.QueryPageAsync(p => storeIds.Contains(p.storeId) && p.isDel == false, p => p.status, OrderByType.Asc, page, limit);
|
||||
var ladingList = await _dal.QueryPageAsync(p => storeIds.Contains(p.storeId) && p.isDel == false, p => p.createTime, OrderByType.Desc, page, limit);
|
||||
|
||||
|
||||
jm.status = true;
|
||||
@@ -182,7 +182,7 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var list = await _dal.QueryListByClauseAsync(p => p.id == id || p.orderId == id || p.mobile == id);
|
||||
var list = await _dal.QueryListByClauseAsync(p => p.id.Contains(id) || p.orderId.Contains(id) || p.mobile.Contains(id), p => p.createTime, OrderByType.Desc);
|
||||
var data = new List<CoreCmsBillLading>();
|
||||
if (list != null)
|
||||
{
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace CoreCms.Net.Services
|
||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Seckill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
@@ -275,7 +275,7 @@ namespace CoreCms.Net.Services
|
||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Seckill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
@@ -666,7 +666,7 @@ namespace CoreCms.Net.Services
|
||||
if (billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Seckill
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| billPaymentInfo.type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
@@ -752,7 +752,7 @@ namespace CoreCms.Net.Services
|
||||
if (entity.type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Seckill
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| entity.type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
@@ -812,7 +812,7 @@ namespace CoreCms.Net.Services
|
||||
if (type == (int)GlobalEnumVars.BillPaymentsType.Common
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.PinTuan
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Group
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Skill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Seckill
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Bargain
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Giveaway
|
||||
|| type == (int)GlobalEnumVars.BillPaymentsType.Solitaire
|
||||
@@ -870,7 +870,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsBillPayments>> QueryPageAsync(Expression<Func<CoreCmsBillPayments, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsBillPayments>> QueryPageAsync(Expression<Func<CoreCmsBillPayments, bool>> predicate,
|
||||
Expression<Func<CoreCmsBillPayments, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace CoreCms.Net.Services
|
||||
billRefund.sourceId = sourceId;
|
||||
billRefund.type = type;
|
||||
//取支付成功的支付单号
|
||||
var paymentsInfo = await _billPaymentsServices.QueryByClauseAsync(p => p.sourceId == sourceId && p.type == type && p.status == (int)GlobalEnumVars.BillPaymentsStatus.Payed);
|
||||
var paymentsInfo = await _billPaymentsServices.QueryByClauseAsync(p=>p.sourceId==sourceId && p.type==type && p.status == (int)GlobalEnumVars.BillPaymentsStatus.Payed);
|
||||
if (paymentsInfo != null)
|
||||
{
|
||||
billRefund.paymentCode = paymentsInfo.paymentCode;
|
||||
@@ -260,7 +260,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsBillRefund>> QueryPageAsync(Expression<Func<CoreCmsBillRefund, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsBillRefund>> QueryPageAsync(Expression<Func<CoreCmsBillRefund, bool>> predicate,
|
||||
Expression<Func<CoreCmsBillRefund, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -234,14 +234,14 @@ namespace CoreCms.Net.Services
|
||||
await _dal.DeleteAsync(p => p.type == (int)GlobalEnumVars.OrderType.PinTuan && p.userId == userId);
|
||||
catInfo = null;
|
||||
break;
|
||||
case (int)GlobalEnumVars.OrderType.Group or (int)GlobalEnumVars.OrderType.Skill:
|
||||
case (int)GlobalEnumVars.OrderType.Group or (int)GlobalEnumVars.OrderType.Seckill:
|
||||
//标准模式不需要做什么判断
|
||||
//判断商品是否做团购秒杀
|
||||
if (goodsServices.IsInGroup((int)products.goodsId, out var promotionsModel, objectId) == true)
|
||||
{
|
||||
jm.msg = "进入判断商品是否做团购秒杀";
|
||||
|
||||
var typeIds = new int[] { (int)GlobalEnumVars.OrderType.Group, (int)GlobalEnumVars.OrderType.Skill };
|
||||
var typeIds = new int[] { (int)GlobalEnumVars.OrderType.Group, (int)GlobalEnumVars.OrderType.Seckill };
|
||||
//此人的购物车中的所有购物车拼团商品都删掉,因为立即购买也是要加入购物车的,所以需要清空之前历史的加入过购物车的商品
|
||||
await _dal.DeleteAsync(p => typeIds.Contains(p.type) && p.productId == products.id && p.userId == userId);
|
||||
catInfo = null;
|
||||
@@ -506,7 +506,7 @@ namespace CoreCms.Net.Services
|
||||
case (int)GlobalEnumVars.OrderType.Group:
|
||||
//团购模式不需要修改订单数据和商品数据
|
||||
break;
|
||||
case (int)GlobalEnumVars.OrderType.Skill:
|
||||
case (int)GlobalEnumVars.OrderType.Seckill:
|
||||
//秒杀模式不需要修改订单数据和商品数据
|
||||
break;
|
||||
case (int)GlobalEnumVars.OrderType.Bargain:
|
||||
@@ -619,7 +619,7 @@ namespace CoreCms.Net.Services
|
||||
jm.data = await _promotionServices.ToPromotion(cartDto);
|
||||
jm.msg = "订单促销金额计算";
|
||||
}
|
||||
else if ((orderType == (int)GlobalEnumVars.OrderType.Group || orderType == (int)GlobalEnumVars.OrderType.Skill) && objectId > 0)
|
||||
else if ((orderType == (int)GlobalEnumVars.OrderType.Group || orderType == (int)GlobalEnumVars.OrderType.Seckill) && objectId > 0)
|
||||
{
|
||||
//团购秒杀默认时间过期后,不可以下单
|
||||
var dt = DateTime.Now;
|
||||
|
||||
@@ -45,13 +45,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(List<CoreCmsContinuousCheckInRules> entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(List<CoreCmsContinuousCheckInRules> entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
@@ -61,14 +59,5 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsContinuousCheckInRules>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,72 +39,16 @@ namespace CoreCms.Net.Services
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsCumulativeCheckInRules entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(List<CoreCmsCumulativeCheckInRules> entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(List<CoreCmsCumulativeCheckInRules> entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsCumulativeCheckInRules entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsCumulativeCheckInRules> 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>
|
||||
@@ -114,34 +58,5 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsCumulativeCheckInRules>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#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<CoreCmsCumulativeCheckInRules>> QueryPageAsync(Expression<Func<CoreCmsCumulativeCheckInRules, bool>> predicate,
|
||||
Expression<Func<CoreCmsCumulativeCheckInRules, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace CoreCms.Net.Services
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
@@ -58,14 +57,12 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsUserCheckIn>> QueryPageAsync(Expression<Func<CoreCmsUserCheckIn, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsUserCheckIn>> QueryPageAsync(Expression<Func<CoreCmsUserCheckIn, bool>> predicate,
|
||||
Expression<Func<CoreCmsUserCheckIn, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清理用户连续签到
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionCondition entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionCondition entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,17 +56,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionCondition entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionCondition> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionCondition entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -76,42 +66,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsDistributionCondition>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsDistributionCondition>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
@@ -125,7 +84,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionCondition>> QueryPageAsync(Expression<Func<CoreCmsDistributionCondition, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistributionCondition>> QueryPageAsync(Expression<Func<CoreCmsDistributionCondition, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionCondition, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionGrade entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionGrade entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionGrade entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionGrade entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -84,14 +84,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsDistributionGrade>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
@@ -105,7 +97,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionGrade>> QueryPageAsync(Expression<Func<CoreCmsDistributionGrade, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistributionGrade>> QueryPageAsync(Expression<Func<CoreCmsDistributionGrade, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionGrade, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -39,78 +39,5 @@ namespace CoreCms.Net.Services
|
||||
_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,7 +20,6 @@ using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.DTO.Distribution;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
@@ -74,7 +73,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionOrder>> QueryPageAsync(Expression<Func<CoreCmsDistributionOrder, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistributionOrder>> QueryPageAsync(Expression<Func<CoreCmsDistributionOrder, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionResult entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionResult entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,17 +56,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionResult entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionResult> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionResult entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -76,7 +66,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
@@ -86,34 +76,13 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
public async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsDistributionResult>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsDistributionResult>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -125,7 +94,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionResult>> QueryPageAsync(Expression<Func<CoreCmsDistributionResult, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistributionResult>> QueryPageAsync(Expression<Func<CoreCmsDistributionResult, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionResult, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@ using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.DTO.Distribution;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
@@ -545,7 +544,6 @@ namespace CoreCms.Net.Services
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取代理商排行
|
||||
/// </summary>
|
||||
@@ -569,7 +567,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistribution>> QueryPageAsync(Expression<Func<CoreCmsDistribution, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistribution>> QueryPageAsync(Expression<Func<CoreCmsDistribution, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistribution, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var model = await base.QueryByClauseAsync(p => p.sourceId == orderId && p.category == (int)GlobalEnumVars.OrderTaxCategory.Order);
|
||||
var model = await _dal.QueryByClauseAsync(p => p.sourceId == orderId && p.category == (int)GlobalEnumVars.OrderTaxCategory.Order);
|
||||
jm.status = model != null;
|
||||
jm.data = model;
|
||||
jm.msg = jm.status ? GlobalConstVars.GetDataSuccess : GlobalConstVars.GetDataFailure;
|
||||
@@ -68,7 +68,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsInvoice>> QueryPageAsync(Expression<Func<CoreCmsInvoice, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsInvoice>> QueryPageAsync(Expression<Func<CoreCmsInvoice, bool>> predicate,
|
||||
Expression<Func<CoreCmsInvoice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -17,7 +17,6 @@ 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;
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsGoodsCategory entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsGoodsCategory entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -54,17 +54,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsGoodsCategory entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsGoodsCategory> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsGoodsCategory entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -74,21 +64,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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 获取缓存的所有数据==========================================================
|
||||
|
||||
@@ -20,13 +20,12 @@ 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.UI;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using ToolGood.Words;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
@@ -40,6 +39,8 @@ namespace CoreCms.Net.Services
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly IToolsServices _toolsServices;
|
||||
|
||||
|
||||
public CoreCmsGoodsCommentServices(IUnitOfWork unitOfWork, ICoreCmsGoodsCommentRepository dal,
|
||||
IServiceProvider serviceProvider, IToolsServices toolsServices)
|
||||
{
|
||||
@@ -74,12 +75,10 @@ namespace CoreCms.Net.Services
|
||||
//已经评价或者存在问题
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
var goodComments = new List<CoreCmsGoodsComment>();
|
||||
var gid = new List<int>();
|
||||
|
||||
|
||||
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
//判断此条记录是否是此订单下面的
|
||||
@@ -136,32 +135,12 @@ namespace CoreCms.Net.Services
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsGoodsComment entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsGoodsComment entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsGoodsComment> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsGoodsComment entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -171,21 +150,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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
|
||||
|
||||
/// <summary>
|
||||
@@ -212,9 +181,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.DetailsByIdAsync(predicate, orderByExpression, orderByType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -226,7 +192,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsGoodsComment>> QueryPageAsync(Expression<Func<CoreCmsGoodsComment, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsGoodsComment>> QueryPageAsync(Expression<Func<CoreCmsGoodsComment, bool>> predicate,
|
||||
Expression<Func<CoreCmsGoodsComment, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -23,11 +23,15 @@ using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using static SKIT.FlurlHttpClient.Wechat.Api.Models.CgibinUserInfoBatchGetRequest.Types;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
@@ -46,6 +50,11 @@ namespace CoreCms.Net.Services
|
||||
private readonly ICoreCmsGoodsCollectionServices _goodsCollectionServices;
|
||||
private readonly ICoreCmsBrandServices _brandServices;
|
||||
private readonly ICoreCmsOrderItemServices _orderItemServices;
|
||||
private readonly ICoreCmsUserServices _userServices;
|
||||
private readonly ICoreCmsUserGradeServices _userGradeServices;
|
||||
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
|
||||
public CoreCmsGoodsServices(IUnitOfWork unitOfWork, ICoreCmsGoodsRepository dal
|
||||
, ICoreCmsProductsServices productsServices
|
||||
@@ -54,8 +63,7 @@ namespace CoreCms.Net.Services
|
||||
, ICoreCmsPromotionServices promotionServices
|
||||
, ICoreCmsGoodsCollectionServices goodsCollectionServices
|
||||
, ICoreCmsBrandServices brandServices
|
||||
, ICoreCmsOrderItemServices orderItemServices
|
||||
)
|
||||
, ICoreCmsOrderItemServices orderItemServices, ICoreCmsUserServices userServices, ICoreCmsUserGradeServices userGradeServices, IServiceProvider serviceProvider)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
@@ -67,6 +75,9 @@ namespace CoreCms.Net.Services
|
||||
_goodsCollectionServices = goodsCollectionServices;
|
||||
_brandServices = brandServices;
|
||||
_orderItemServices = orderItemServices;
|
||||
_userServices = userServices;
|
||||
_userGradeServices = userGradeServices;
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +107,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
public async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
@@ -308,7 +319,7 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await base.BaseDal.UpdateAsync(p => new CoreCmsGoods() { isMarketable = false }, p => ids.Contains(p.id));
|
||||
var bl = await _dal.UpdateAsync(p => new CoreCmsGoods() { isMarketable = false }, p => ids.Contains(p.id));
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? "下架成功" : "下架失败";
|
||||
|
||||
@@ -497,6 +508,7 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取商品详情
|
||||
|
||||
/// <summary>
|
||||
@@ -507,57 +519,379 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="isPromotion">是否涉及优惠</param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="groupId"></param>
|
||||
/// <param name="needSku">是否需要sku</param>
|
||||
/// <returns></returns>
|
||||
public async Task<CoreCmsGoods> GetGoodsDetial(int id, int userId = 0, bool isPromotion = false, string type = "goods", int groupId = 0)
|
||||
public async Task<CoreCmsGoods> GetGoodsDetail(int id, int userId = 0, bool isPromotion = false, string type = "goods", int groupId = 0, bool needSku = false)
|
||||
{
|
||||
var model = await _dal.QueryByIdAsync(id);
|
||||
if (model == null) return null;
|
||||
var good = await _dal.QueryByClauseAsync(p => p.id == id, true);
|
||||
if (good == null) return null;
|
||||
//取图片集
|
||||
var album = model.images.Split(",");
|
||||
model.image = !string.IsNullOrEmpty(model.image) ? model.image : "/static/images/common/empty-banner.png";
|
||||
model.album = album;
|
||||
//label_ids
|
||||
good.album = good.images.Split(",");
|
||||
//获取主图
|
||||
good.image = !string.IsNullOrEmpty(good.image) ? good.image : "/static/images/common/empty-banner.png";
|
||||
//获取用户信息
|
||||
if (userId > 0)
|
||||
{
|
||||
model.isFav = await _goodsCollectionServices.ExistsAsync(p => p.goodsId == model.id && p.userId == userId);
|
||||
good.isFav = await _goodsCollectionServices.ExistsAsync(p => p.goodsId == good.id && p.userId == userId, true);
|
||||
}
|
||||
//取默认货品
|
||||
model.sku = await _productsServices.QueryListByClauseAsync(p => p.goodsId == model.id && p.isDel == false);
|
||||
if (!model.sku.Any()) return null;
|
||||
var products = model.sku.Find(p => p.isDefalut);
|
||||
if (products == null) return null;
|
||||
var getProductInfo = await _productsServices.GetProductInfo(products.id, isPromotion, userId, type, groupId);
|
||||
if (getProductInfo == null) return null;
|
||||
|
||||
model.product = getProductInfo;
|
||||
model.sn = getProductInfo.sn;
|
||||
model.price = getProductInfo.price;
|
||||
model.costprice = getProductInfo.costprice;
|
||||
model.mktprice = getProductInfo.mktprice;
|
||||
model.stock = getProductInfo.stock;
|
||||
model.freezeStock = getProductInfo.freezeStock;
|
||||
model.weight = getProductInfo.weight;
|
||||
var product = new CoreCmsProducts();
|
||||
var products = new List<CoreCmsProducts>();
|
||||
if (needSku == true)
|
||||
{
|
||||
//取所有货品
|
||||
products = await _productsServices.QueryListByClauseAsync(p => p.goodsId == good.id && p.isDel == false, p => p.id, OrderByType.Asc, true);
|
||||
if (products == null) return null;
|
||||
//获取默认货品
|
||||
product = products.FirstOrDefault(p => p.isDefalut);
|
||||
if (product == null) return null;
|
||||
|
||||
var minProduct = await _productsServices.QueryByClauseAsync(p => p.isDel == false && p.goodsId == id,
|
||||
p => p.price, OrderByType.Asc);
|
||||
good.skuList = await GetCoreCmsProductsView(good, products, userId, isPromotion, type, groupId);
|
||||
}
|
||||
else
|
||||
{
|
||||
product = await _productsServices.QueryByClauseAsync(p => p.goodsId == good.id && p.isDel == false && p.isDefalut == true, true);
|
||||
}
|
||||
|
||||
var maxProduct = await _productsServices.QueryByClauseAsync(p => p.isDel == false && p.goodsId == id,
|
||||
p => p.price, OrderByType.Desc);
|
||||
|
||||
model.minPrice = minProduct.price;
|
||||
model.maxPrice = maxProduct.price;
|
||||
//商品基础赋值===================================================================================================
|
||||
good.product = product;
|
||||
good.sn = product.sn;
|
||||
good.price = product.price;
|
||||
good.costprice = product.costprice;
|
||||
good.mktprice = product.mktprice;
|
||||
good.stock = product.stock;
|
||||
good.freezeStock = product.freezeStock;
|
||||
good.weight = product.weight;
|
||||
good.buyPinTuanCount = product.buyPinTuanCount;
|
||||
good.buyPromotionCount = product.buyPromotionCount;
|
||||
//获取商品最小价格
|
||||
good.minPrice = products.Any() ? products.OrderBy(p => p.price).First().price : product.price;
|
||||
//获取商品最大价格
|
||||
good.maxPrice = products.Any() ? products.OrderByDescending(p => p.price).First().price : product.price;
|
||||
|
||||
//获取品牌
|
||||
var brand = await _brandServices.QueryByIdAsync(model.brandId);
|
||||
model.brand = brand;
|
||||
good.brand = await _brandServices.QueryByIdAsync(good.brandId, true, true);
|
||||
|
||||
//取出销量
|
||||
model.buyCount = model.initialSales + await _orderItemServices.GetSumAsync(p => p.goodsId == model.id, o => o.nums, true);
|
||||
return model;
|
||||
good.buyCount = good.initialSales + await _orderItemServices.GetSumAsync(p => p.goodsId == good.id, o => o.nums, true);
|
||||
return good;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 通过商品序列获取sku列表
|
||||
/// <summary>
|
||||
/// 通过商品序列获取sku列表
|
||||
/// </summary>
|
||||
/// <param name="good"></param>
|
||||
/// <param name="products"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="isPromotion"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="groupId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<CoreCmsProductsView> GetCoreCmsProductsView(CoreCmsGoods good, List<CoreCmsProducts> products, int userId = 0, bool isPromotion = false, string type = "goods", int groupId = 0)
|
||||
{
|
||||
//获取默认货品
|
||||
var product = products.FirstOrDefault(p => p.isDefalut);
|
||||
if (product == null) return null;
|
||||
|
||||
|
||||
//获取会员级别优惠价
|
||||
//获取会员等级优惠价格体系
|
||||
decimal gradePrice = 0;
|
||||
if (userId > 0 && type == "goods")
|
||||
{
|
||||
//获取用户信息
|
||||
var userInfo = await _userServices.QueryByIdAsync(userId);
|
||||
if (userInfo != null)
|
||||
{
|
||||
var goodsGrades = await _goodsGradeServices.QueryByClauseAsync(p => p.goodsId == good.id && p.gradeId == userInfo.grade);
|
||||
if (goodsGrades != null)
|
||||
{
|
||||
gradePrice = goodsGrades.gradePrice;
|
||||
}
|
||||
}
|
||||
}
|
||||
//sku优惠计算===================================================================================
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
var orderServices = container.ServiceProvider.GetService<ICoreCmsOrderServices>();
|
||||
var pinTuanRuleServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRuleServices>();
|
||||
var promotionServices = container.ServiceProvider.GetService<ICoreCmsPromotionServices>();
|
||||
var promotionConditionServices = container.ServiceProvider.GetService<ICoreCmsPromotionConditionServices>();
|
||||
var promotionResultServices = container.ServiceProvider.GetService<ICoreCmsPromotionResultServices>();
|
||||
|
||||
if (isPromotion)
|
||||
{
|
||||
var dt = DateTime.Now;
|
||||
if (type == GlobalEnumVars.OrderType.Group.ToString().ToLowerInvariant() || type == GlobalEnumVars.OrderType.Seckill.ToString().ToLowerInvariant())
|
||||
{
|
||||
//团购秒杀默认时间过期后,不可以下单
|
||||
var key = false;
|
||||
var promotionInfo = await promotionServices.QueryByClauseAsync(p => p.startTime < dt && p.endTime > dt && p.id == groupId, true);
|
||||
if (promotionInfo != null)
|
||||
{
|
||||
//去除所有的条件
|
||||
var promotionCondition = await promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionInfo.id);
|
||||
if (!string.IsNullOrEmpty(promotionCondition.parameters))
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(promotionCondition.parameters);
|
||||
if (parameters.ContainsKey("goodsId") && parameters.ContainsKey("nums"))
|
||||
{
|
||||
var objNums = Convert.ToInt32(parameters["nums"]);
|
||||
var goodsIds = CommonHelper.StringToIntArray(parameters["goodsId"].ObjectToString());
|
||||
key = goodsIds.Any() && goodsIds.Contains(good.id);
|
||||
}
|
||||
};
|
||||
}
|
||||
if (key)
|
||||
{
|
||||
//走到这一步就说明所有的促销条件都符合,那么就去计算结果
|
||||
var promotionResult = await promotionResultServices.QueryByClauseAsync(p => p.promotionId == promotionInfo.id);
|
||||
if (!string.IsNullOrEmpty(promotionResult.parameters))
|
||||
{
|
||||
foreach (var productModel in products)
|
||||
{
|
||||
var item = new CartProducts()
|
||||
{
|
||||
id = 0,
|
||||
isSelect = true,
|
||||
userId = userId,
|
||||
productId = productModel.id,
|
||||
nums = 1,
|
||||
products = productModel
|
||||
};
|
||||
decimal promotionMoney;
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(promotionResult.parameters);
|
||||
switch (promotionResult.code)
|
||||
{
|
||||
//指定商品减固定金额
|
||||
case "GOODS_REDUCE":
|
||||
promotionMoney = promotionResultServices.result_GOODS_REDUCE(parameters, item, promotionInfo);
|
||||
break;
|
||||
//指定商品打X折
|
||||
case "GOODS_DISCOUNT":
|
||||
promotionMoney = promotionResultServices.result_GOODS_DISCOUNT(parameters, item, promotionInfo);
|
||||
break;
|
||||
//指定商品一口价
|
||||
case "GOODS_ONE_PRICE":
|
||||
promotionMoney = promotionResultServices.result_GOODS_ONE_PRICE(parameters, item, promotionInfo);
|
||||
break;
|
||||
//指定商品每第几件减指定金额
|
||||
case "GOODS_HALF_PRICE": //todo 指定商品每第几件减指定金额
|
||||
promotionMoney = promotionResultServices.result_GOODS_HALF_PRICE(parameters, item, promotionInfo);
|
||||
break;
|
||||
default:
|
||||
promotionMoney = 0;
|
||||
break;
|
||||
}
|
||||
//productModel.price = Math.Round(productModel.price - promotionMoney, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//走全局优惠模式
|
||||
var promotions = await promotionServices.QueryListByClauseAsync(p => p.isEnable == true && p.startTime < dt && p.endTime > dt && p.type == (int)GlobalEnumVars.PromotionType.Promotion && p.isDel == false, p => p.sort, OrderByType.Asc, true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//获取活动数量===================================================================================
|
||||
var stock = 0;
|
||||
var isMaxPinTuanGoodsNums = false;
|
||||
var buyPinTuanCount = 0;
|
||||
var isMaxGroupOrSeckillGoodsNums = false;
|
||||
var buyPromotionCount = 0;
|
||||
if (type == "pinTuan")
|
||||
{
|
||||
//把拼团的一些属性等加上
|
||||
var pinTuanRule = pinTuanRuleServices.QueryMuchFirst<CoreCmsPinTuanRule, CoreCmsPinTuanGoods, CoreCmsPinTuanRule>(
|
||||
(role, pinTuanGoods) => new object[] { JoinType.Inner, role.id == pinTuanGoods.ruleId }
|
||||
, (role, pinTuanGoods) => role
|
||||
, (role, pinTuanGoods) => pinTuanGoods.goodsId == good.id);
|
||||
//调整前台显示数量
|
||||
var checkOrder = orderServices.FindLimitOrderByGoodId(good.id, userId, pinTuanRule.startTime, pinTuanRule.endTime, (int)GlobalEnumVars.OrderType.PinTuan);
|
||||
if (pinTuanRule.maxGoodsNums != 0 && pinTuanRule.maxNums != 0)
|
||||
{
|
||||
isMaxPinTuanGoodsNums = true;
|
||||
//总剩余可购买总数量
|
||||
var residue = pinTuanRule.maxGoodsNums - checkOrder.TotalOrders;
|
||||
//用户剩余可购买数量
|
||||
var userResidue = pinTuanRule.maxGoodsNums - checkOrder.TotalUserOrders;
|
||||
//求最小匹配
|
||||
stock = userResidue > residue ? residue : userResidue;
|
||||
}
|
||||
else if (pinTuanRule.maxNums != 0 && pinTuanRule.maxNums == 0)
|
||||
{
|
||||
//限制个人最多购买数量
|
||||
stock = pinTuanRule.maxNums - checkOrder.TotalUserOrders == 0 ? 0 : pinTuanRule.maxNums - checkOrder.TotalUserOrders;
|
||||
}
|
||||
else if (pinTuanRule.maxNums == 0 && pinTuanRule.maxNums != 0)
|
||||
{
|
||||
//限制最大购买总数
|
||||
stock = pinTuanRule.maxGoodsNums - checkOrder.TotalOrders == 0 ? 0 : pinTuanRule.maxGoodsNums - checkOrder.TotalOrders;
|
||||
}
|
||||
buyPinTuanCount = checkOrder.TotalOrders;
|
||||
}
|
||||
else if (type == GlobalEnumVars.OrderType.Group.ToString().ToLowerInvariant() || type == GlobalEnumVars.OrderType.Seckill.ToString().ToLowerInvariant())
|
||||
{
|
||||
if (!IsInGroup(good.id, out var groupModel, groupId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var orderType = type == GlobalEnumVars.OrderType.Seckill.ToString().ToLowerInvariant()
|
||||
? (int)GlobalEnumVars.OrderType.Group
|
||||
: (int)GlobalEnumVars.OrderType.Seckill;
|
||||
|
||||
//调整前台显示数量
|
||||
var checkOrder = orderServices.FindLimitOrderByGoodId(good.id, userId, groupModel.startTime, groupModel.endTime, orderType);
|
||||
if (groupModel.maxGoodsNums != 0 && groupModel.maxNums != 0)
|
||||
{
|
||||
isMaxGroupOrSeckillGoodsNums = true;
|
||||
//总剩余可购买总数量
|
||||
var residue = groupModel.maxGoodsNums - checkOrder.TotalOrders;
|
||||
//用户剩余可购买数量
|
||||
var userResidue = groupModel.maxGoodsNums - checkOrder.TotalUserOrders;
|
||||
//求最小匹配
|
||||
stock = userResidue > residue ? residue : userResidue;
|
||||
}
|
||||
else if (groupModel.maxNums != 0 && groupModel.maxNums == 0)
|
||||
{
|
||||
isMaxGroupOrSeckillGoodsNums = true;
|
||||
//限制个人最多购买数量
|
||||
stock = groupModel.maxNums - checkOrder.TotalUserOrders;
|
||||
}
|
||||
else if (groupModel.maxNums == 0 && groupModel.maxNums != 0)
|
||||
{
|
||||
isMaxGroupOrSeckillGoodsNums = true;
|
||||
//限制最大购买总数
|
||||
stock = groupModel.maxGoodsNums - checkOrder.TotalOrders;
|
||||
}
|
||||
buyPromotionCount = checkOrder.TotalOrders;
|
||||
}
|
||||
|
||||
|
||||
//sku前端json组合实体===================================================================================
|
||||
CoreCmsProductsView result;
|
||||
//如果是多规格商品,算多规格
|
||||
if (good.openSpec == 1 && !string.IsNullOrEmpty(good.spesDesc))
|
||||
{
|
||||
// 1910&&电线型号:1.5mm²|1911&&电线型号:2.5mm²|1912&&电线型号:4mm²|1913&&电线型号:6mm²|1901&&电线颜色:红色|1902&&电线颜色:蓝色|1903&&电线颜色:黄色|1904&&电线颜色:绿色|1905&&电线颜色:双色
|
||||
// 电线型号:1.5mm²,电线颜色:蓝色
|
||||
var defaultSpec = new Dictionary<string, List<string>>();
|
||||
foreach (var item in good.spesDesc.Split("|"))
|
||||
{
|
||||
//1911&&电线型号:2.5mm²
|
||||
var temp = item.Split(".")[1].Split(":");
|
||||
var name = temp[0];
|
||||
var value = temp[1];
|
||||
if (!defaultSpec.ContainsKey(name))
|
||||
{
|
||||
defaultSpec.Add(name, new List<string>());
|
||||
}
|
||||
defaultSpec[name].Add(value);
|
||||
}
|
||||
result = new CoreCmsProductsView();
|
||||
result._id = product.id.ToString();
|
||||
result.name = product.name;
|
||||
result.goods_thumb = product.images;
|
||||
result.buyPinTuanCount = buyPinTuanCount;
|
||||
result.buyPromotionCount = buyPromotionCount;
|
||||
|
||||
var skuList = new List<Product_Sku_listItem>();
|
||||
products.ForEach(o =>
|
||||
{
|
||||
var item = new Product_Sku_listItem();
|
||||
item._id = o.id.ToString();
|
||||
item.goods_id = good.id.ToString();
|
||||
item.goods_name = good.name;
|
||||
item.image = o.images;
|
||||
item.price = o.price - gradePrice; //减去会员等级价格
|
||||
item.sku_name_arr = o.spesDesc.Split(",").Select(s => s.Split(":")[1]).ToList();
|
||||
item.stock = o.stock;
|
||||
if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant())
|
||||
{
|
||||
if (isMaxPinTuanGoodsNums)
|
||||
{
|
||||
item.stock = stock;
|
||||
}
|
||||
}
|
||||
else if (type == GlobalEnumVars.OrderType.Group.ToString().ToLowerInvariant() || type == GlobalEnumVars.OrderType.Seckill.ToString().ToLowerInvariant())
|
||||
{
|
||||
if (isMaxGroupOrSeckillGoodsNums)
|
||||
{
|
||||
item.stock = stock;
|
||||
}
|
||||
}
|
||||
skuList.Add(item);
|
||||
});
|
||||
|
||||
result.sku_list = skuList;
|
||||
|
||||
result.spec_list = defaultSpec.Select(d => new Product_Spec_listItem()
|
||||
{
|
||||
name = d.Key,
|
||||
list = d.Value.Select(s => new Product_Sku_list
|
||||
{
|
||||
name = s
|
||||
}).ToList(),
|
||||
}).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new CoreCmsProductsView();
|
||||
result._id = product.id.ToString();
|
||||
result.name = product.name;
|
||||
result.goods_thumb = product.images;
|
||||
result.buyPinTuanCount = buyPinTuanCount;
|
||||
result.buyPromotionCount = buyPromotionCount;
|
||||
|
||||
var skuList = new List<Product_Sku_listItem>();
|
||||
products.ForEach(o =>
|
||||
{
|
||||
var item = new Product_Sku_listItem();
|
||||
item._id = o.id.ToString();
|
||||
item.goods_id = good.id.ToString();
|
||||
item.goods_name = good.name;
|
||||
item.image = o.images;
|
||||
item.price = o.price - gradePrice; //减去会员等级价格
|
||||
item.sku_name_arr = new List<string> { "商品信息", product.name };
|
||||
item.stock = o.stock;
|
||||
if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant())
|
||||
{
|
||||
if (isMaxPinTuanGoodsNums)
|
||||
{
|
||||
item.stock = stock;
|
||||
}
|
||||
}
|
||||
else if (type == GlobalEnumVars.OrderType.Group.ToString().ToLowerInvariant() || type == GlobalEnumVars.OrderType.Seckill.ToString().ToLowerInvariant())
|
||||
{
|
||||
if (isMaxGroupOrSeckillGoodsNums)
|
||||
{
|
||||
item.stock = stock;
|
||||
}
|
||||
}
|
||||
|
||||
skuList.Add(item);
|
||||
});
|
||||
result.sku_list = skuList;
|
||||
result.spec_list = new List<Product_Spec_listItem>() {
|
||||
new Product_Spec_listItem(){
|
||||
list = new List<Product_Sku_list>{
|
||||
new Product_Sku_list{
|
||||
name = product.name
|
||||
}
|
||||
},
|
||||
name = "商品信息"
|
||||
}
|
||||
};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取随机推荐数据
|
||||
|
||||
@@ -573,7 +907,6 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取数据总数
|
||||
/// <summary>
|
||||
/// 获取数据总数
|
||||
@@ -599,7 +932,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsGoods>> QueryPageAsync(Expression<Func<CoreCmsGoods, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsGoods>> QueryPageAsync(Expression<Func<CoreCmsGoods, bool>> predicate,
|
||||
Expression<Func<CoreCmsGoods, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
@@ -607,7 +940,6 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询一定数量数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询一定数量数据
|
||||
@@ -618,14 +950,13 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByType">排序顺序</param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<List<CoreCmsGoods>> QueryListByClauseAsync(Expression<Func<CoreCmsGoods, bool>> predicate, int take,
|
||||
public async Task<List<CoreCmsGoods>> QueryListByClauseAsync(Expression<Func<CoreCmsGoods, bool>> predicate, int take,
|
||||
Expression<Func<CoreCmsGoods, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryListByClauseAsync(predicate, take, orderByPredicate, orderByType, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询数据
|
||||
@@ -634,7 +965,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderBy">排序字段,如name asc,age desc</param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns>泛型实体集合</returns>
|
||||
public new async Task<List<CoreCmsGoods>> QueryListByClauseAsync(Expression<Func<CoreCmsGoods, bool>> predicate, string orderBy = "",
|
||||
public async Task<List<CoreCmsGoods>> QueryListByClauseAsync(Expression<Func<CoreCmsGoods, bool>> predicate, string orderBy = "",
|
||||
bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryListByClauseAsync(predicate, orderBy, blUseNoLock);
|
||||
@@ -651,7 +982,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsGoods>> QueryPageAsync(Expression<Func<CoreCmsGoods, bool>> predicate, string orderBy = "",
|
||||
public async Task<IPageList<CoreCmsGoods>> QueryPageAsync(Expression<Func<CoreCmsGoods, bool>> predicate, string orderBy = "",
|
||||
int pageIndex = 1, int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderBy, pageIndex, pageSize, blUseNoLock);
|
||||
|
||||
@@ -64,11 +64,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -16,7 +16,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace CoreCms.Net.Services
|
||||
|
||||
var cartModel = new CartDto();
|
||||
|
||||
if (type == "group" || type == "skill")
|
||||
if (type == GlobalEnumVars.OrderType.Group.ToString().ToLowerInvariant() || type == GlobalEnumVars.OrderType.Seckill.ToString().ToLowerInvariant())
|
||||
{
|
||||
//团购秒杀默认时间过期后,不可以下单
|
||||
var dt = DateTime.Now;
|
||||
@@ -249,7 +249,7 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
//获取活动数量
|
||||
if (type == "pinTuan")
|
||||
if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant())
|
||||
{
|
||||
//把拼团的一些属性等加上
|
||||
var pinTuanRule = pinTuanRuleServices.QueryMuchFirst<CoreCmsPinTuanRule, CoreCmsPinTuanGoods, CoreCmsPinTuanRule>(
|
||||
@@ -274,7 +274,7 @@ namespace CoreCms.Net.Services
|
||||
productModel.buyPinTuanCount = checkOrder.TotalOrders;
|
||||
}
|
||||
}
|
||||
else if (type == "group" || type == "skill")
|
||||
if (type == GlobalEnumVars.OrderType.Group.ToString().ToLowerInvariant() || type == GlobalEnumVars.OrderType.Seckill.ToString().ToLowerInvariant())
|
||||
{
|
||||
if (!goodsServices.IsInGroup(productModel.goodsId, out var groupModel, groupId))
|
||||
{
|
||||
|
||||
@@ -85,29 +85,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsForm entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsForm> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
@@ -118,40 +95,6 @@ namespace CoreCms.Net.Services
|
||||
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>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsForm>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsForm>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
@@ -162,14 +105,12 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsForm>> QueryPageAsync(Expression<Func<CoreCmsForm, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsForm>> QueryPageAsync(Expression<Func<CoreCmsForm, bool>> predicate,
|
||||
Expression<Func<CoreCmsForm, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取form表单详情
|
||||
@@ -243,6 +184,7 @@ namespace CoreCms.Net.Services
|
||||
var items = await _itemRepository.QueryListByClauseAsync(p => p.formId == formModel.id, p => p.sort, OrderByType.Asc);
|
||||
foreach (var item in items)
|
||||
{
|
||||
|
||||
if (item.type == GlobalEnumVars.FormFieldTypes.goods.ToString())
|
||||
{
|
||||
if (noToken == false)
|
||||
@@ -250,7 +192,7 @@ namespace CoreCms.Net.Services
|
||||
var goodId = Convert.ToInt32(item.value);
|
||||
if (goodId > 0)
|
||||
{
|
||||
item.good = await _goodsServices.GetGoodsDetial(goodId);
|
||||
item.good = await _goodsServices.GetGoodsDetail(goodId, 0, false, "goods", 0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -385,7 +327,7 @@ namespace CoreCms.Net.Services
|
||||
formSubmitModel.payStatus = false;
|
||||
formSubmitModel.status = false;
|
||||
formSubmitModel.createTime = DateTime.Now;
|
||||
formSubmitModel.ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ? _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1";
|
||||
formSubmitModel.ip = _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString();
|
||||
|
||||
var formSubmitId = await _formSubmitServices.InsertReturnIdentityAsync(formSubmitModel);
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -18,8 +18,8 @@ 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 CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace CoreCms.Net.Services
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法并返回自增值
|
||||
/// </summary>
|
||||
@@ -52,55 +51,16 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.InsertReturnIdentityAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsFormSubmit entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsFormSubmit entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsFormSubmit> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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
|
||||
|
||||
@@ -115,7 +75,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsFormSubmit>> QueryPageAsync(Expression<Func<CoreCmsFormSubmit, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsFormSubmit>> QueryPageAsync(Expression<Func<CoreCmsFormSubmit, bool>> predicate,
|
||||
Expression<Func<CoreCmsFormSubmit, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
@@ -123,7 +83,6 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 表单支付
|
||||
/// </summary>
|
||||
@@ -140,9 +99,9 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="formId">表单序列</param>
|
||||
/// <param name="day">多少天内的数据</param>
|
||||
/// <returns></returns>
|
||||
public async Task<FormStatisticsViewDto> GetStatisticsByFormid(int formId, int day)
|
||||
public async Task<FormStatisticsViewDto> GetStatisticsByFormId(int formId, int day)
|
||||
{
|
||||
return await _dal.GetStatisticsByFormid(formId, day);
|
||||
return await _dal.GetStatisticsByFormId(formId, day);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace CoreCms.Net.Services
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly IRedisOperationRepository _redisOperationRepository;
|
||||
|
||||
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsMessageCenterServices(IUnitOfWork unitOfWork, ICoreCmsMessageCenterRepository dal, IServiceProvider serviceProvider, ISysTaskLogServices taskLogServices, IRedisOperationRepository redisOperationRepository)
|
||||
{
|
||||
@@ -123,6 +124,7 @@ namespace CoreCms.Net.Services
|
||||
|
||||
//队列推送消息
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.SendWxTemplateMessage, JsonConvert.SerializeObject(data));
|
||||
|
||||
}
|
||||
jm.status = true;
|
||||
return jm;
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace CoreCms.Net.Services
|
||||
await _dal.InsertAsync(oldLog);
|
||||
}
|
||||
|
||||
var str =await SendSms(oldLog.mobile, oldLog.contentBody, smsOptions);
|
||||
var str = await SendSms(oldLog.mobile, oldLog.contentBody, smsOptions);
|
||||
jm.status = true;
|
||||
jm.data = str;
|
||||
jm.msg = "短信发送成功";
|
||||
@@ -155,7 +155,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="mobile"></param>
|
||||
/// <param name="contentBody"></param>
|
||||
/// <param name="smsOptions">配置文件</param>
|
||||
public async Task<string> SendSms(string mobile, string contentBody, SMSOptions smsOptions)
|
||||
public async Task<string> SendSms(string mobile, string contentBody, SmsOptions smsOptions)
|
||||
{
|
||||
if (smsOptions.Enabled)
|
||||
{
|
||||
@@ -234,7 +234,6 @@ namespace CoreCms.Net.Services
|
||||
isUsed = true;
|
||||
}
|
||||
|
||||
|
||||
var str = string.Empty;
|
||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||
|
||||
@@ -331,7 +330,7 @@ namespace CoreCms.Net.Services
|
||||
tpl = parameters["tpl"]?.ToString();
|
||||
}
|
||||
str = tpl;
|
||||
if (!string.IsNullOrEmpty(str))
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
var msg = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.SmsTplForCommon);
|
||||
str = !string.IsNullOrEmpty(msg) ? msg : string.Empty;
|
||||
@@ -350,8 +349,7 @@ namespace CoreCms.Net.Services
|
||||
oldLog.parameters = JsonConvert.SerializeObject(parameters);
|
||||
oldLog.contentBody = str;
|
||||
oldLog.createTime = DateTime.Now;
|
||||
oldLog.ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ?
|
||||
_httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1";
|
||||
oldLog.ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ? _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1";
|
||||
oldLog.isUsed = isUsed;
|
||||
|
||||
await _dal.InsertAsync(oldLog);
|
||||
@@ -364,7 +362,6 @@ namespace CoreCms.Net.Services
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
@@ -76,9 +75,12 @@ namespace CoreCms.Net.Services
|
||||
isOver = false;
|
||||
}
|
||||
|
||||
//await _dal.UpdateAsync(p => new CoreCmsOrderItem() { sendNums = item[child.productId] },
|
||||
// p => p.id == child.id);
|
||||
|
||||
var updateSendNums = item[child.productId] + child.sendNums;
|
||||
await _dal.UpdateAsync(p => new CoreCmsOrderItem() { sendNums = updateSendNums },
|
||||
p => p.id == child.id);
|
||||
await _dal.UpdateAsync(p => new CoreCmsOrderItem() { sendNums = updateSendNums }, p => p.id == child.id);
|
||||
|
||||
|
||||
//发货后,减库存
|
||||
goodsRepository.ChangeStock(child.productId, GlobalEnumVars.OrderChangeStockType.send.ToString(), item[child.productId]);
|
||||
|
||||
@@ -86,8 +86,6 @@ namespace CoreCms.Net.Services
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
|
||||
|
||||
|
||||
public CoreCmsOrderServices(ICoreCmsOrderRepository dal
|
||||
, IHttpContextAccessor httpContextAccessor
|
||||
, ICoreCmsShipServices shipServices
|
||||
@@ -153,10 +151,9 @@ namespace CoreCms.Net.Services
|
||||
_chatTransactionComponentOrderServices = chatTransactionComponentOrderServices;
|
||||
}
|
||||
|
||||
|
||||
#region 查询团购秒杀下单数量
|
||||
#region 查询团购秒杀下单数量(获取货品的秒杀团购数据)
|
||||
/// <summary>
|
||||
/// 查询团购秒杀下单数量
|
||||
/// 查询团购秒杀下单数量(获取货品的秒杀团购数据)
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="userId"></param>
|
||||
@@ -171,6 +168,23 @@ namespace CoreCms.Net.Services
|
||||
|
||||
#endregion
|
||||
|
||||
#region 查询团购秒杀下单数量(获取商品序号的秒杀团购数据)
|
||||
/// <summary>
|
||||
/// 查询团购秒杀下单数量(获取商品序号的秒杀团购数据)
|
||||
/// </summary>
|
||||
/// <param name="goodId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="orderType"></param>
|
||||
/// <returns></returns>
|
||||
public FindLimitOrderDto FindLimitOrderByGoodId(int goodId, int userId, DateTime? startTime, DateTime? endTime, int orderType = 0)
|
||||
{
|
||||
return _dal.FindLimitOrderByGoodId(goodId, userId, startTime, endTime, orderType);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取税号
|
||||
/// <summary>
|
||||
/// 获取税号
|
||||
@@ -290,11 +304,11 @@ namespace CoreCms.Net.Services
|
||||
return groupRes;
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.OrderType.Skill:
|
||||
var rskillRes = await _promotionRecordServices.OrderAdd(order, orderItems, objectId, orderType);
|
||||
if (rskillRes.status == false)
|
||||
case (int)GlobalEnumVars.OrderType.Seckill:
|
||||
var seckillRes = await _promotionRecordServices.OrderAdd(order, orderItems, objectId, orderType);
|
||||
if (seckillRes.status == false)
|
||||
{
|
||||
return rskillRes;
|
||||
return seckillRes;
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.OrderType.Bargain:
|
||||
@@ -1438,7 +1452,6 @@ namespace CoreCms.Net.Services
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 订单支付
|
||||
|
||||
/// <summary>
|
||||
@@ -1870,7 +1883,6 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 构建单个需要发货的数据,和发货单密切关联
|
||||
/// <summary>
|
||||
/// 构建单个需要发货的数据,和发货单密切关联
|
||||
@@ -2260,11 +2272,7 @@ namespace CoreCms.Net.Services
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 重写根据条件列表数据
|
||||
/// <summary>
|
||||
/// 重写根据条件列表数据
|
||||
@@ -2293,7 +2301,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsOrder>> QueryPageAsync(Expression<Func<CoreCmsOrder, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsOrder>> QueryPageAsync(Expression<Func<CoreCmsOrder, bool>> predicate,
|
||||
Expression<Func<CoreCmsOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -18,8 +18,6 @@ using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
@@ -60,7 +58,7 @@ namespace CoreCms.Net.Services
|
||||
var pinTuanRecordServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRecordServices>();
|
||||
var orderServices = container.ServiceProvider.GetService<ICoreCmsOrderServices>();
|
||||
|
||||
var goodsInfo = await goodsServices.GetGoodsDetial(id, userId, false);
|
||||
var goodsInfo = await goodsServices.GetGoodsDetail(id, userId, false, "goods", 0, true);
|
||||
if (goodsInfo == null) return null;
|
||||
//把拼团的一些属性等加上
|
||||
var info =
|
||||
|
||||
@@ -80,8 +80,6 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="ruleId"></param>
|
||||
/// <param name="goodsId"></param>
|
||||
/// <param name="status"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> GetRecord(int ruleId, int goodsId, int status = 0)
|
||||
{
|
||||
@@ -256,7 +254,7 @@ namespace CoreCms.Net.Services
|
||||
/// 自动取消到时间的团
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> AutoCanclePinTuanOrder()
|
||||
public async Task<WebApiCallBack> AutoCancelPinTuanOrder()
|
||||
{
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
|
||||
@@ -364,7 +362,6 @@ namespace CoreCms.Net.Services
|
||||
};
|
||||
await _taskLogServices.InsertAsync(model);
|
||||
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
@@ -443,7 +440,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsPinTuanRecord>> QueryPageAsync(Expression<Func<CoreCmsPinTuanRecord, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsPinTuanRecord>> QueryPageAsync(Expression<Func<CoreCmsPinTuanRecord, bool>> predicate,
|
||||
Expression<Func<CoreCmsPinTuanRecord, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -21,8 +21,8 @@ using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -243,9 +243,6 @@ namespace CoreCms.Net.Services
|
||||
return promotionCodes;
|
||||
}
|
||||
|
||||
|
||||
#region 根据条件查询分页数据及导航数据
|
||||
|
||||
/// <summary>
|
||||
/// 根据条件查询分页数据及导航数据
|
||||
/// </summary>
|
||||
@@ -264,9 +261,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.QueryPageMapperAsync(predicate, orderByExpression, orderByType, isToPage, pageIndex, pageSize);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写数据并获取相关
|
||||
/// </summary>
|
||||
@@ -277,8 +271,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.QueryWithAboutAsync(predicate);
|
||||
}
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
@@ -289,13 +281,12 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsCoupon>> QueryPageAsync(Expression<Func<CoreCmsCoupon, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsCoupon>> QueryPageAsync(Expression<Func<CoreCmsCoupon, bool>> predicate,
|
||||
Expression<Func<CoreCmsCoupon, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 获取 我的优惠券可用数量
|
||||
@@ -306,9 +297,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.GetMyCouponCount(userId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 优惠券返还
|
||||
/// <summary>
|
||||
/// 优惠券返还
|
||||
/// </summary>
|
||||
@@ -344,8 +332,6 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
|
||||
@@ -18,7 +18,6 @@ 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 Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
@@ -94,7 +93,6 @@ namespace CoreCms.Net.Services
|
||||
return jm;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var model = new CoreCmsPromotionRecord();
|
||||
|
||||
@@ -174,6 +174,11 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 获取团购列表数据
|
||||
/// <summary>
|
||||
/// 获取团购列表数据
|
||||
@@ -269,7 +274,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<WebApiCallBack> GetGroupDetail(int goodId = 0, int userId = 0, string type = "group", int groupId = 0)
|
||||
public async Task<WebApiCallBack> GetGroupDetail(int goodId = 0, int userId = 0, string type = "group", int groupId = 0, bool needSku = false)
|
||||
{
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
|
||||
@@ -282,8 +287,15 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
return jm;
|
||||
}
|
||||
|
||||
var typeId = (int)GlobalEnumVars.PromotionType.Group;
|
||||
if (type == GlobalEnumVars.PromotionType.Seckill.ToString().ToLowerInvariant())
|
||||
{
|
||||
typeId = (int)GlobalEnumVars.PromotionType.Seckill;
|
||||
}
|
||||
|
||||
//判断商品是否参加团购
|
||||
var isInGroup = _dal.IsInGroup(goodId, out var promotionId);
|
||||
var isInGroup = _dal.IsInGroup(goodId, out var promotionId, typeId);
|
||||
if (!isInGroup)
|
||||
{
|
||||
jm.msg = "商品未参加团购";
|
||||
@@ -299,7 +311,7 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
var goods = new CoreCmsGoods();
|
||||
goods = await goodsServices.GetGoodsDetial(goodId, userId, true, type, groupId);
|
||||
goods = await goodsServices.GetGoodsDetail(goodId, userId, true, type, groupId, needSku);
|
||||
if (goods == null)
|
||||
{
|
||||
jm.msg = "商品不存在";
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsUserServicesOrder>> QueryPageAsync(Expression<Func<CoreCmsUserServicesOrder, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsUserServicesOrder>> QueryPageAsync(Expression<Func<CoreCmsUserServicesOrder, bool>> predicate,
|
||||
Expression<Func<CoreCmsUserServicesOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsUserServicesTicket>> QueryPageAsync(Expression<Func<CoreCmsUserServicesTicket, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsUserServicesTicket>> QueryPageAsync(Expression<Func<CoreCmsUserServicesTicket, bool>> predicate,
|
||||
Expression<Func<CoreCmsUserServicesTicket, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace CoreCms.Net.Services
|
||||
|
||||
private readonly ICoreCmsGoodsServices _goodsServices;
|
||||
private readonly ICoreCmsSolitaireServices _solitaireServices;
|
||||
private readonly ICoreCmsUserServices _userServices;
|
||||
private readonly WeChatOptions _weChatOptions;
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
@@ -59,7 +60,7 @@ namespace CoreCms.Net.Services
|
||||
public CoreCmsShareServices(IUnitOfWork unitOfWork
|
||||
, IWebHostEnvironment webHostEnvironment
|
||||
, ICoreCmsGoodsServices goodsServices
|
||||
, IOptions<WeChatOptions> weChatOptions, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsSolitaireServices solitaireServices)
|
||||
, IOptions<WeChatOptions> weChatOptions, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsSolitaireServices solitaireServices, ICoreCmsUserServices userServices)
|
||||
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
@@ -67,6 +68,7 @@ namespace CoreCms.Net.Services
|
||||
_goodsServices = goodsServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
_solitaireServices = solitaireServices;
|
||||
_userServices = userServices;
|
||||
_weChatOptions = weChatOptions.Value;
|
||||
|
||||
}
|
||||
@@ -140,7 +142,11 @@ namespace CoreCms.Net.Services
|
||||
return await getQr(url, res.otherData.ToString(), client);
|
||||
}
|
||||
//生成海报图片
|
||||
var result = await Poster(url, res.otherData.ToString(), client);
|
||||
|
||||
var userId = UserHelper.GetUserIdByShareCode(userShareCode);
|
||||
var user = await _userServices.QueryByClauseAsync(p => p.id == userId);
|
||||
|
||||
var result = await Poster(url, res.otherData.ToString(), client, user);
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
@@ -788,8 +794,9 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="url"></param>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="user"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> Poster(string url, string code, int client)
|
||||
public async Task<WebApiCallBack> Poster(string url, string code, int client, CoreCmsUser user)
|
||||
{
|
||||
var jm = new WebApiCallBack() { status = false, msg = "海报生成失败0" };
|
||||
|
||||
@@ -829,7 +836,7 @@ namespace CoreCms.Net.Services
|
||||
return qrResult;
|
||||
}
|
||||
|
||||
var mkResult = await DoMark(res.data, qrResult.otherData.ToString(), fileName);
|
||||
var mkResult = await DoMark(res.data, qrResult.otherData.ToString(), fileName, user);
|
||||
if (mkResult)
|
||||
{
|
||||
jm.status = true;
|
||||
@@ -847,8 +854,9 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="data"></param>
|
||||
/// <param name="otherData">生成的二维码图片地址</param>
|
||||
/// <param name="fileNameStr">海报文件名称</param>
|
||||
/// <param name="user">用户信息</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DoMark(object data, string otherData, string fileNameStr)
|
||||
public async Task<bool> DoMark(object data, string otherData, string fileNameStr, CoreCmsUser user)
|
||||
{
|
||||
var fileName = fileNameStr;
|
||||
|
||||
@@ -866,7 +874,7 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
//2商品详情页,3拼团详情页
|
||||
var page = dataObj["page"].ObjectToInt(0);
|
||||
if (page == (int)GlobalEnumVars.UrlSharePageType.Goods || page == (int)GlobalEnumVars.UrlSharePageType.PinTuan || page == (int)GlobalEnumVars.UrlSharePageType.Seckill)
|
||||
if (page is (int)GlobalEnumVars.UrlSharePageType.Goods or (int)GlobalEnumVars.UrlSharePageType.PinTuan or (int)GlobalEnumVars.UrlSharePageType.Seckill)
|
||||
{
|
||||
if (dataObj.ContainsKey("params"))
|
||||
{
|
||||
@@ -876,7 +884,7 @@ namespace CoreCms.Net.Services
|
||||
return false;
|
||||
}
|
||||
var goodId = paramsObj["goodsId"].ObjectToInt();
|
||||
var goodModel = await _goodsServices.GetGoodsDetial(goodId);
|
||||
var goodModel = await _goodsServices.GetGoodsDetail(goodId);
|
||||
if (goodModel != null)
|
||||
{
|
||||
var images = goodModel.images.Split(",");
|
||||
@@ -892,7 +900,7 @@ namespace CoreCms.Net.Services
|
||||
HttpResponseMessage response = await client.GetAsync(image);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var stream = await response.Content.ReadAsStreamAsync();
|
||||
//载入下载的图片流
|
||||
//载入下载的图片流2
|
||||
var imageThumbnail = await SixLabors.ImageSharp.Image.LoadAsync(stream);
|
||||
//将下载的图片压缩至400X400
|
||||
imageThumbnail.Mutate(x =>
|
||||
|
||||
@@ -21,8 +21,8 @@ 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.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Services.Basic
|
||||
@@ -45,7 +45,7 @@ namespace CoreCms.Net.Services.Basic
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsArea entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsArea entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -55,17 +55,7 @@ namespace CoreCms.Net.Services.Basic
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsArea entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsArea> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsArea entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -75,21 +65,11 @@ namespace CoreCms.Net.Services.Basic
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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 获取缓存的所有数据==========================================================
|
||||
@@ -103,36 +83,8 @@ namespace CoreCms.Net.Services.Basic
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsArea>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#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<CoreCmsArea>> QueryPageAsync(Expression<Func<CoreCmsArea, bool>> predicate,
|
||||
Expression<Func<CoreCmsArea, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取所有省市区信息
|
||||
/// <summary>
|
||||
/// 获取所有省市区信息
|
||||
@@ -141,7 +93,7 @@ namespace CoreCms.Net.Services.Basic
|
||||
public async Task<List<AreaTreeDto>> GetTreeArea(List<PostAreasTreeNode> checkedAreases, int parentId = 0,
|
||||
int currentChecked = 0)
|
||||
{
|
||||
var list = await UpdateCaChe();
|
||||
var list = await GetCaChe();
|
||||
var areaTrees = GetTrees(list, parentId, checkedAreases, currentChecked);
|
||||
return areaTrees;
|
||||
}
|
||||
|
||||
@@ -10,18 +10,17 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Api;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Flurl.Http;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
@@ -85,11 +84,17 @@ namespace CoreCms.Net.Services
|
||||
|
||||
var url = "https://route.showapi.com/64-20?expName=&maxSize=1500&page=&showapi_appid=" + showApiAppid +
|
||||
"&showapi_timestamp=" + showApiTimesTamp + "&showapi_sign=" + md5Sign;
|
||||
var person = await url.GetJsonAsync<ShowApiGetExpressCompanyListResult>();
|
||||
|
||||
if (person.showapi_res_code == 0)
|
||||
|
||||
|
||||
var result = await url.PostAsync().ReceiveJson<ShowApiGetExpressCompanyListResult>();
|
||||
|
||||
|
||||
|
||||
|
||||
if (result.showapi_res_code == 0)
|
||||
{
|
||||
if (person.showapi_res_body != null && person.showapi_res_body.ret_code == 0 && person.showapi_res_body.expressList != null && person.showapi_res_body.expressList.Count > 0)
|
||||
if (result.showapi_res_body != null && result.showapi_res_body.ret_code == 0 && result.showapi_res_body.expressList != null && result.showapi_res_body.expressList.Count > 0)
|
||||
{
|
||||
var list = new List<CoreCmsLogistics>();
|
||||
|
||||
@@ -108,10 +113,10 @@ namespace CoreCms.Net.Services
|
||||
|
||||
list.Add(logistics);
|
||||
});
|
||||
|
||||
|
||||
|
||||
var count = 0;
|
||||
person.showapi_res_body.expressList.ForEach(p =>
|
||||
result.showapi_res_body.expressList.ForEach(p =>
|
||||
{
|
||||
var logistics = new CoreCmsLogistics();
|
||||
logistics.logiCode = p.simpleName;
|
||||
@@ -137,7 +142,7 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.msg = person.showapi_res_error;
|
||||
jm.msg = result.showapi_res_error;
|
||||
}
|
||||
|
||||
return jm;
|
||||
@@ -155,6 +160,7 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(com))
|
||||
{
|
||||
jm.msg = "请提交来源";
|
||||
@@ -183,7 +189,10 @@ namespace CoreCms.Net.Services
|
||||
|
||||
var url = "https://route.showapi.com/64-19?com=" + com + "&nu=" + number + "&phone=" + phone + "&showapi_appid=" + showApiAppid +
|
||||
"&showapi_timestamp=" + showApiTimesTamp + "&showapi_sign=" + md5Sign;
|
||||
var result = await url.GetJsonAsync<ShowApiGetExpressPollResult>();
|
||||
|
||||
|
||||
var result = await url.PostAsync().ReceiveJson<ShowApiGetExpressPollResult>();
|
||||
|
||||
|
||||
if (result.showapi_res_code != 0)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@ 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;
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsOrderDistributionModel entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,17 +56,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsOrderDistributionModel> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -76,21 +66,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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 获取缓存的所有数据==========================================================
|
||||
@@ -104,17 +84,9 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsOrderDistributionModel>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
@@ -125,7 +97,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsOrderDistributionModel>> QueryPageAsync(Expression<Func<CoreCmsOrderDistributionModel, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsOrderDistributionModel>> QueryPageAsync(Expression<Func<CoreCmsOrderDistributionModel, bool>> predicate,
|
||||
Expression<Func<CoreCmsOrderDistributionModel, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsPages entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsPages entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsPages entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsPages entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -293,7 +293,8 @@ namespace CoreCms.Net.Services
|
||||
if (child.ContainsKey("classifyId") && child["classifyId"].ObjectToInt(0) > 0)
|
||||
{
|
||||
var classifyId = child["classifyId"].ObjectToInt(0);
|
||||
var childCats = await _goodsCategoryServices.QueryListByClauseAsync(p => p.parentId == classifyId);
|
||||
var gc = await _goodsCategoryServices.GetCaChe();
|
||||
var childCats = gc.Where(p => p.parentId == classifyId).ToList();
|
||||
var catIds = childCats != null && childCats.Any()
|
||||
? childCats.Select(p => p.id).ToList()
|
||||
: new List<int>();
|
||||
@@ -398,7 +399,8 @@ namespace CoreCms.Net.Services
|
||||
if (parameters.ContainsKey("classifyId") && parameters["classifyId"].ObjectToInt(0) > 0)
|
||||
{
|
||||
var classifyId = parameters["classifyId"].ObjectToInt(0);
|
||||
var childCats = await _goodsCategoryServices.QueryListByClauseAsync(p => p.parentId == classifyId);
|
||||
var gc = await _goodsCategoryServices.GetCaChe();
|
||||
var childCats = gc.Where(p => p.parentId == classifyId).ToList();
|
||||
var catIds = childCats != null && childCats.Any()
|
||||
? childCats.Select(p => p.id).ToList()
|
||||
: new List<int>();
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsServiceDescription entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsServiceDescription entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,17 +56,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsServiceDescription entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsServiceDescription> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsServiceDescription entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -76,21 +66,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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 获取缓存的所有数据==========================================================
|
||||
@@ -104,14 +84,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsServiceDescription>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
@@ -125,7 +97,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsServiceDescription>> QueryPageAsync(Expression<Func<CoreCmsServiceDescription, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsServiceDescription>> QueryPageAsync(Expression<Func<CoreCmsServiceDescription, bool>> predicate,
|
||||
Expression<Func<CoreCmsServiceDescription, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -187,6 +187,7 @@ namespace CoreCms.Net.Services
|
||||
filesStorageOptions.AccountId = GetValue(SystemSettingConstVars.FilesStorageTencentAccountId, configs, settings);
|
||||
filesStorageOptions.CosRegion = GetValue(SystemSettingConstVars.FilesStorageTencentCosRegion, configs, settings);
|
||||
filesStorageOptions.TencentBucketName = GetValue(SystemSettingConstVars.FilesStorageTencentBucketName, configs, settings);
|
||||
|
||||
//阿里云
|
||||
filesStorageOptions.BucketName = GetValue(SystemSettingConstVars.FilesStorageAliYunBucketName, configs, settings);
|
||||
filesStorageOptions.Endpoint = GetValue(SystemSettingConstVars.FilesStorageAliYunEndpoint, configs, settings);
|
||||
@@ -197,6 +198,7 @@ namespace CoreCms.Net.Services
|
||||
//格式化存储文件夹路径
|
||||
filesStorageOptions.Path = UpLoadHelper.PathFormat(filesStorageOptions.StorageType, filesStorageOptions.Path);
|
||||
|
||||
|
||||
return filesStorageOptions;
|
||||
}
|
||||
|
||||
@@ -205,9 +207,9 @@ namespace CoreCms.Net.Services
|
||||
/// 获取短信配置实体
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<SMSOptions> GetSmsOptions()
|
||||
public async Task<SmsOptions> GetSmsOptions()
|
||||
{
|
||||
var sms = new SMSOptions();
|
||||
var sms = new SmsOptions();
|
||||
|
||||
var configs = SystemSettingDictionary.GetConfig();
|
||||
var settings = await GetDatas();
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsShip entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsShip entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsShip entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsShip entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsShip>> QueryPageAsync(Expression<Func<CoreCmsShip, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsShip>> QueryPageAsync(Expression<Func<CoreCmsShip, bool>> predicate,
|
||||
Expression<Func<CoreCmsShip, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsStore entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsStore entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsStore entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsStore entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsSolitaireItems entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsSolitaireItems entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,17 +56,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsSolitaireItems entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsSolitaireItems> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsSolitaireItems entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -76,7 +66,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
@@ -86,34 +76,13 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
public async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsSolitaireItems>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsSolitaireItems>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询列表数据
|
||||
/// </summary>
|
||||
@@ -122,7 +91,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new Task<List<CoreCmsSolitaireItems>> QueryListByClauseAsync(
|
||||
public Task<List<CoreCmsSolitaireItems>> QueryListByClauseAsync(
|
||||
Expression<Func<CoreCmsSolitaireItems, bool>> predicate,
|
||||
Expression<Func<CoreCmsSolitaireItems, object>> orderByExpression, OrderByType orderByType,
|
||||
bool blUseNoLock = false)
|
||||
@@ -130,7 +99,6 @@ namespace CoreCms.Net.Services
|
||||
return _dal.QueryListByClauseAsync(predicate, orderByExpression, orderByType, blUseNoLock);
|
||||
}
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -142,7 +110,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsSolitaireItems>> QueryPageAsync(Expression<Func<CoreCmsSolitaireItems, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsSolitaireItems>> QueryPageAsync(Expression<Func<CoreCmsSolitaireItems, bool>> predicate,
|
||||
Expression<Func<CoreCmsSolitaireItems, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsSolitaire entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsSolitaire entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,63 +56,13 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsSolitaire entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsSolitaire entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsSolitaire> 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>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsSolitaire>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsSolitaire>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
@@ -125,7 +75,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsSolitaire>> QueryPageAsync(Expression<Func<CoreCmsSolitaire, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsSolitaire>> QueryPageAsync(Expression<Func<CoreCmsSolitaire, bool>> predicate,
|
||||
Expression<Func<CoreCmsSolitaire, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -39,60 +39,6 @@ namespace CoreCms.Net.Services
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsStockLog entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsStockLog entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsStockLog> 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>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -104,7 +50,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsStockLog>> QueryPageAsync(Expression<Func<CoreCmsStockLog, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsStockLog>> QueryPageAsync(Expression<Func<CoreCmsStockLog, bool>> predicate,
|
||||
Expression<Func<CoreCmsStockLog, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -52,46 +52,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsStock entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsStock> 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 重写根据条件查询分页数据
|
||||
@@ -105,7 +65,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsStock>> QueryPageAsync(Expression<Func<CoreCmsStock, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsStock>> QueryPageAsync(Expression<Func<CoreCmsStock, bool>> predicate,
|
||||
Expression<Func<CoreCmsStock, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsAppUpdateLog entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsAppUpdateLog entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,17 +56,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsAppUpdateLog entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsAppUpdateLog> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsAppUpdateLog entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -76,25 +66,15 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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 重写根据条件查询分页数据
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
@@ -105,7 +85,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsAppUpdateLog>> QueryPageAsync(Expression<Func<CoreCmsAppUpdateLog, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsAppUpdateLog>> QueryPageAsync(Expression<Func<CoreCmsAppUpdateLog, bool>> predicate,
|
||||
Expression<Func<CoreCmsAppUpdateLog, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -36,8 +36,6 @@ namespace CoreCms.Net.Services
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
@@ -45,7 +43,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(SysMenu entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(SysMenu entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -55,17 +53,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(SysMenu entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<SysMenu> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(SysMenu entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -79,29 +67,6 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<SysMenu>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<SysMenu>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<SysUserOperationLog>> QueryPageAsync(Expression<Func<SysUserOperationLog, bool>> predicate,
|
||||
public async Task<IPageList<SysUserOperationLog>> QueryPageAsync(Expression<Func<SysUserOperationLog, bool>> predicate,
|
||||
Expression<Func<SysUserOperationLog, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using NLog;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
@@ -129,6 +130,7 @@ namespace CoreCms.Net.Services
|
||||
catch (Exception e)
|
||||
{
|
||||
_unitOfWork.RollbackTran();
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.Web, "余额变动记录", "余额变动记录失败", e);
|
||||
}
|
||||
}
|
||||
jm.status = true;
|
||||
@@ -161,7 +163,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsUserBalance>> QueryPageAsync(Expression<Func<CoreCmsUserBalance, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsUserBalance>> QueryPageAsync(Expression<Func<CoreCmsUserBalance, bool>> predicate,
|
||||
Expression<Func<CoreCmsUserBalance, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -254,6 +254,8 @@ namespace CoreCms.Net.Services
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var url = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&cardNo=" + cardCode + "&cardBinCheck=true";
|
||||
|
||||
//var res = HttpHelper.PostSend(url, "");
|
||||
var res = await url.GetStringAsync();
|
||||
var resObj = JObject.Parse(res);
|
||||
if (!resObj.ContainsKey("validated"))
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
@@ -511,8 +512,6 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 手机短信验证码登陆,同时兼有手机短信注册的功能,还有第三方账户绑定的功能
|
||||
|
||||
/// <summary>
|
||||
@@ -522,7 +521,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="loginType">登录方式(1普通,2短信,3微信小程序拉取手机号)</param>
|
||||
/// <param name="platform"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> SmsLogin(FMWxAccountCreate entity, int loginType = (int)GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = 1)
|
||||
public async Task<WebApiCallBack> SmsLogin(FMWxAccountCreate entity, int loginType = (int)GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = (int)GlobalEnumVars.CoreShopSystemCategory.Api)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
@@ -685,16 +684,26 @@ namespace CoreCms.Net.Services
|
||||
|
||||
if (userInfo.status == (int)GlobalEnumVars.UserStatus.正常)
|
||||
{
|
||||
var claims = new List<Claim> {
|
||||
jm.status = true;
|
||||
jm.msg = "成功";
|
||||
jm.otherData = userInfo;
|
||||
|
||||
if (platform == (int)GlobalEnumVars.CoreShopSystemCategory.Api)
|
||||
{
|
||||
var claims = new List<Claim> {
|
||||
new Claim(ClaimTypes.Name, userInfo.nickName),
|
||||
new Claim(JwtRegisteredClaimNames.Jti, userInfo.id.ToString()),
|
||||
new Claim(ClaimTypes.Expiration, DateTime.Now.AddSeconds(_permissionRequirement.Expiration.TotalSeconds).ToString()) };
|
||||
//用户标识
|
||||
var identity = new ClaimsIdentity(JwtBearerDefaults.AuthenticationScheme);
|
||||
identity.AddClaims(claims);
|
||||
jm.status = true;
|
||||
jm.msg = "成功";
|
||||
jm.data = JwtToken.BuildJwtToken(claims.ToArray(), _permissionRequirement);
|
||||
//用户标识
|
||||
var identity = new ClaimsIdentity(JwtBearerDefaults.AuthenticationScheme);
|
||||
identity.AddClaims(claims);
|
||||
jm.data = JwtToken.BuildJwtToken(claims.ToArray(), _permissionRequirement);
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.data = userInfo;
|
||||
}
|
||||
|
||||
//录入登录日志
|
||||
var log = new CoreCmsUserLog();
|
||||
log.userId = userInfo.id;
|
||||
@@ -714,7 +723,6 @@ namespace CoreCms.Net.Services
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据条件查询分页数据
|
||||
/// </summary>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<WebApiCallBack> InsertAsync(CoreCmsUserShip entity)
|
||||
public async Task<WebApiCallBack> InsertAsync(CoreCmsUserShip entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsUserShip entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsUserShip entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
@@ -202,20 +202,15 @@ namespace CoreCms.Net.Services
|
||||
item.cardNumber = UserHelper.BankCardNoFormat(item.cardNumber);
|
||||
}
|
||||
}
|
||||
|
||||
jm.status = true;
|
||||
jm.data = list;
|
||||
jm.otherData = new
|
||||
{
|
||||
list.TotalPages
|
||||
};
|
||||
|
||||
return jm;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 提现审核
|
||||
/// </summary>
|
||||
@@ -391,7 +386,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsUserTocash>> QueryPageAsync(Expression<Func<CoreCmsUserTocash, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsUserTocash>> QueryPageAsync(Expression<Func<CoreCmsUserTocash, bool>> predicate,
|
||||
Expression<Func<CoreCmsUserTocash, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -36,8 +36,6 @@ namespace CoreCms.Net.Services
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -49,7 +47,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsUserWeChatInfo>> QueryPageAsync(Expression<Func<CoreCmsUserWeChatInfo, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsUserWeChatInfo>> QueryPageAsync(Expression<Func<CoreCmsUserWeChatInfo, bool>> predicate,
|
||||
Expression<Func<CoreCmsUserWeChatInfo, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentAuditCategory entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
@@ -111,17 +111,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentAuditCategory> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -131,21 +121,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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
|
||||
|
||||
|
||||
@@ -185,8 +165,6 @@ namespace CoreCms.Net.Services
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -198,7 +176,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<WeChatTransactionComponentAuditCategory>> QueryPageAsync(Expression<Func<WeChatTransactionComponentAuditCategory, bool>> predicate,
|
||||
public async Task<IPageList<WeChatTransactionComponentAuditCategory>> QueryPageAsync(Expression<Func<WeChatTransactionComponentAuditCategory, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentAuditCategory, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentBrandAudit entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentBrandAudit entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,17 +56,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentBrandAudit entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentBrandAudit> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentBrandAudit entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -76,21 +66,11 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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
|
||||
|
||||
|
||||
@@ -105,7 +85,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<WeChatTransactionComponentBrandAudit>> QueryPageAsync(Expression<Func<WeChatTransactionComponentBrandAudit, bool>> predicate,
|
||||
public async Task<IPageList<WeChatTransactionComponentBrandAudit>> QueryPageAsync(Expression<Func<WeChatTransactionComponentBrandAudit, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentBrandAudit, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -49,14 +49,6 @@ namespace CoreCms.Net.Services
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<WeChatTransactionComponentDeliveryCompany>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
@@ -70,7 +62,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<WeChatTransactionComponentDeliveryCompany>> QueryPageAsync(Expression<Func<WeChatTransactionComponentDeliveryCompany, bool>> predicate,
|
||||
public async Task<IPageList<WeChatTransactionComponentDeliveryCompany>> QueryPageAsync(Expression<Func<WeChatTransactionComponentDeliveryCompany, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentDeliveryCompany, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -39,79 +39,15 @@ namespace CoreCms.Net.Services
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentGoodSKU entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentGoodSKU entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentGoodSKU> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentGoodSKU> 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<WeChatTransactionComponentGoodSKU>> QueryPageAsync(Expression<Func<WeChatTransactionComponentGoodSKU, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentGoodSKU, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentGood entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentGood entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
@@ -56,17 +56,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentGood entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentGood> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentGood entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
@@ -76,24 +66,13 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public 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>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -105,7 +84,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<WeChatTransactionComponentGood>> QueryPageAsync(Expression<Func<WeChatTransactionComponentGood, bool>> predicate,
|
||||
public async Task<IPageList<WeChatTransactionComponentGood>> QueryPageAsync(Expression<Func<WeChatTransactionComponentGood, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentGood, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -39,81 +39,6 @@ namespace CoreCms.Net.Services
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentThirdCategory entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentThirdCategory entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentThirdCategory> 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>
|
||||
/// <returns></returns>
|
||||
public async Task<List<WeChatTransactionComponentThirdCategory>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<WeChatTransactionComponentThirdCategory>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -125,7 +50,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<WeChatTransactionComponentThirdCategory>> QueryPageAsync(Expression<Func<WeChatTransactionComponentThirdCategory, bool>> predicate,
|
||||
public async Task<IPageList<WeChatTransactionComponentThirdCategory>> QueryPageAsync(Expression<Func<WeChatTransactionComponentThirdCategory, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentThirdCategory, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user