mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
2022-01-11
## 1.2.9 开源社区版: 【修复】修复全局定义微信配置引用的配置文件命名错误问题。 【修复】修复自动生成sku模式价格出现货号重复情况,#I4Q4WU ## 0.0.6 会员先行版: 【新增】新增微信自定义交易组件,实现微信视频号直播带货功能。
This commit is contained in:
@@ -1378,6 +1378,13 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
}
|
||||
|
||||
if (order.orderType == (int)GlobalEnumVars.OrderType.Common && order.scene > 0)
|
||||
{
|
||||
order.paymentItem = new List<CoreCmsBillPayments> { billPaymentInfo };
|
||||
//自定义交易组件同步
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.TransactionComponentPayOrderSync, JsonConvert.SerializeObject(order));
|
||||
}
|
||||
|
||||
//结佣处理
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.OrderAgentOrDistribution, JsonConvert.SerializeObject(order));
|
||||
//易联云打印机打印
|
||||
|
||||
@@ -9,21 +9,27 @@
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Auth.HttpContextUser;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.Enum;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.Models;
|
||||
using Essensoft.Paylink.WeChatPay;
|
||||
using Essensoft.Paylink.WeChatPay.V2;
|
||||
using Essensoft.Paylink.WeChatPay.V2.Request;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
@@ -35,15 +41,20 @@ namespace CoreCms.Net.Services
|
||||
private readonly IWeChatPayClient _client;
|
||||
private readonly IOptions<WeChatPayOptions> _optionsAccessor;
|
||||
private readonly IHttpContextUser _user;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
|
||||
|
||||
private readonly ICoreCmsUserServices _userServices;
|
||||
private readonly ICoreCmsUserWeChatInfoServices _userWeChatInfoServices;
|
||||
|
||||
|
||||
public WeChatPayServices(IHttpContextUser user
|
||||
, IWeChatPayClient client
|
||||
, IOptions<WeChatPayOptions> optionsAccessor
|
||||
, ICoreCmsUserServices userServices
|
||||
, ICoreCmsUserWeChatInfoServices userWeChatInfoServices
|
||||
)
|
||||
, ICoreCmsUserWeChatInfoServices userWeChatInfoServices, IServiceProvider serviceProvider, IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
|
||||
_client = client;
|
||||
@@ -51,6 +62,8 @@ namespace CoreCms.Net.Services
|
||||
_user = user;
|
||||
_userServices = userServices;
|
||||
_userWeChatInfoServices = userWeChatInfoServices;
|
||||
_serviceProvider = serviceProvider;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -60,6 +73,12 @@ namespace CoreCms.Net.Services
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> PubPay(CoreCmsBillPayments entity)
|
||||
{
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
var orderServices = container.ServiceProvider.GetService<ICoreCmsOrderServices>();
|
||||
var orderItemServices = container.ServiceProvider.GetService<ICoreCmsOrderItemServices>();
|
||||
var billPaymentsServices = container.ServiceProvider.GetService<ICoreCmsBillPaymentsServices>();
|
||||
var weChatTransactionComponentOrderServices = container.ServiceProvider.GetService<IWeChatTransactionComponentOrderServices>();
|
||||
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var weChatPayUrl = AppSettingsConstVars.PayCallBackWeChatPayUrl;
|
||||
@@ -103,7 +122,7 @@ namespace CoreCms.Net.Services
|
||||
openId = user.openid;
|
||||
}
|
||||
|
||||
var request = new WeChatPayUnifiedOrderRequest
|
||||
var orderRequest = new WeChatPayUnifiedOrderRequest
|
||||
{
|
||||
Body = entity.payTitle,
|
||||
OutTradeNo = entity.paymentId,
|
||||
@@ -114,7 +133,7 @@ namespace CoreCms.Net.Services
|
||||
OpenId = openId
|
||||
};
|
||||
|
||||
var response = await _client.ExecuteAsync(request, _optionsAccessor.Value);
|
||||
var response = await _client.ExecuteAsync(orderRequest, _optionsAccessor.Value);
|
||||
if (response.ReturnCode == WeChatPayCode.Success && response.ResultCode == WeChatPayCode.Success)
|
||||
{
|
||||
var req = new WeChatPayJsApiSdkRequest
|
||||
@@ -126,10 +145,148 @@ namespace CoreCms.Net.Services
|
||||
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
|
||||
if (entity.type == (int)GlobalEnumVars.BillPaymentsType.Order)
|
||||
{
|
||||
var payment = await billPaymentsServices.QueryByClauseAsync(p => p.paymentId == entity.paymentId);
|
||||
if (payment != null)
|
||||
{
|
||||
var is_matched = 0;
|
||||
#region 校验是否微信自定义交易组件
|
||||
var orderModel = await orderServices.QueryByClauseAsync(p => p.orderId == payment.sourceId);
|
||||
var orderInfo = new OrderInfo();
|
||||
//检查支付是否需要校验
|
||||
if (orderModel.source == 3 && orderModel.scene > 0)
|
||||
{
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
|
||||
var sceneRequest = new ShopSceneCheckRequest();
|
||||
sceneRequest.AccessToken = accessToken;
|
||||
sceneRequest.Scene = orderModel.scene;
|
||||
|
||||
var sceneResponse = await client.ExecuteShopSceneCheckAsync(sceneRequest);
|
||||
is_matched = sceneResponse.IsMatched ? 1 : 0;
|
||||
if (sceneResponse.IsSuccessful() && sceneResponse.IsMatched == true)
|
||||
{
|
||||
//基础
|
||||
orderInfo.create_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
orderInfo.type = 0;
|
||||
orderInfo.out_order_id = orderModel.orderId;
|
||||
|
||||
var weChatUserInfo = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == orderModel.userId, true);
|
||||
if (weChatUserInfo != null)
|
||||
{
|
||||
orderInfo.openid = weChatUserInfo.openid;
|
||||
}
|
||||
orderInfo.path = UniAppConst.OrderPath(orderModel.orderId);
|
||||
orderInfo.out_user_id = orderModel.userId.ToString();
|
||||
|
||||
//收货人信息
|
||||
orderInfo.address_info = new AddressInfo();
|
||||
orderInfo.address_info.receiver_name = orderModel.shipName;
|
||||
orderInfo.address_info.detailed_address = orderModel.shipAddress;
|
||||
orderInfo.address_info.tel_number = orderModel.shipMobile;
|
||||
|
||||
|
||||
//发货方式
|
||||
orderInfo.delivery_detail = new DeliveryDetail();
|
||||
|
||||
if (orderModel.receiptType == (int)GlobalEnumVars.OrderReceiptType.Logistics)
|
||||
{
|
||||
orderInfo.delivery_detail.delivery_type = (int)DeliveryTypeEnum.正常快递;
|
||||
}
|
||||
else if (orderModel.receiptType == (int)GlobalEnumVars.OrderReceiptType.IntraCityService)
|
||||
{
|
||||
orderInfo.delivery_detail.delivery_type = (int)DeliveryTypeEnum.线下配送;
|
||||
}
|
||||
else if (orderModel.receiptType == (int)GlobalEnumVars.OrderReceiptType.SelfDelivery)
|
||||
{
|
||||
orderInfo.delivery_detail.delivery_type = (int)DeliveryTypeEnum.用户自提;
|
||||
}
|
||||
|
||||
orderInfo.order_detail = new OrderDetail();
|
||||
//订单详情
|
||||
|
||||
//支付信息
|
||||
orderInfo.order_detail.pay_info = new PayInfo()
|
||||
{
|
||||
pay_method = "微信支付",
|
||||
prepay_id = entity.paymentId,
|
||||
prepay_time = entity.createTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
|
||||
};
|
||||
|
||||
//价格体系
|
||||
orderInfo.order_detail.price_info = new PriceInfo()
|
||||
{
|
||||
order_price = Convert.ToInt32(orderModel.orderAmount * 100),
|
||||
freight = Convert.ToInt32(orderModel.costFreight * 100),
|
||||
discounted_price = Convert.ToInt32((orderModel.pointMoney + orderModel.orderDiscountAmount + orderModel.goodsDiscountAmount + orderModel.couponDiscountAmount) * 100),
|
||||
additional_price = 0,
|
||||
additional_remarks = "无",
|
||||
};
|
||||
|
||||
//商品信息
|
||||
orderInfo.order_detail.product_infos = new List<ProductInfoItem>();
|
||||
|
||||
var orderItems = await orderItemServices.QueryListByClauseAsync(p => p.orderId == orderModel.orderId);
|
||||
|
||||
foreach (var item in orderItems)
|
||||
{
|
||||
orderInfo.order_detail.product_infos.Add(new ProductInfoItem()
|
||||
{
|
||||
out_product_id = item.goodsId.ToString(),
|
||||
out_sku_id = item.productId.ToString(),
|
||||
head_img = item.imageUrl,
|
||||
product_cnt = item.nums,
|
||||
sale_price = Convert.ToInt32(item.amount * 100),
|
||||
path = UniAppConst.GoodDetail(item.goodsId.ToString()),
|
||||
title = item.name
|
||||
});
|
||||
}
|
||||
|
||||
var tcOrder = await weChatTransactionComponentOrderServices.QueryByClauseAsync(p => p.outOrderId == orderModel.orderId);
|
||||
if (tcOrder == null)
|
||||
{
|
||||
tcOrder = new WeChatTransactionComponentOrder
|
||||
{
|
||||
outOrderId = orderModel.orderId,
|
||||
createTime = DateTime.Now,
|
||||
openid = openId
|
||||
};
|
||||
await weChatTransactionComponentOrderServices.InsertAsync(tcOrder);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
jm.otherData = new
|
||||
{
|
||||
response,
|
||||
orderInfo,
|
||||
checkSceneResult = new
|
||||
{
|
||||
is_matched
|
||||
}
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.otherData = response;
|
||||
}
|
||||
|
||||
jm.status = true;
|
||||
jm.msg = "支付成功";
|
||||
//jm.msg = "创建支付环境成功";
|
||||
jm.data = parameter;
|
||||
jm.otherData = response;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/8/1 22:54:37
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件类目审核回调 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentAuditCategoryAuditLogServices : BaseServices<WeChatTransactionComponentAuditCategoryAuditLog>, IWeChatTransactionComponentAuditCategoryAuditLogServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentAuditCategoryAuditLogRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentAuditCategoryAuditLogServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentAuditCategoryAuditLogRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/14 23:14:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.Enum;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传类目资质 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentAuditCategoryServices : BaseServices<WeChatTransactionComponentAuditCategory>, IWeChatTransactionComponentAuditCategoryServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentAuditCategoryRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
|
||||
|
||||
|
||||
public WeChatTransactionComponentAuditCategoryServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentAuditCategoryRepository dal, IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
this._dal = dal;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
entity.createTime = DateTime.Now;
|
||||
|
||||
var id = await _dal.InsertAsync(entity);
|
||||
var bl = id > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
|
||||
if (bl)
|
||||
{
|
||||
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopAuditAuditCategoryRequest();
|
||||
|
||||
request.AccessToken = accessToken;
|
||||
request.Audit = new ShopAuditAuditCategoryRequest.Types.Audit();
|
||||
request.Audit.LicenseUrl = entity.licenseImage;
|
||||
request.Audit.Category = new ShopAuditAuditCategoryRequest.Types.Audit.Types.Category();
|
||||
|
||||
request.Audit.Category.FirstCategoryId = entity.level1;
|
||||
request.Audit.Category.SecondCategroyId = entity.level2;
|
||||
request.Audit.Category.ThirdCategroyId = entity.level3;
|
||||
request.Audit.Category.QualificationUrlList = entity.certificateImage.Split(",").ToList();
|
||||
|
||||
|
||||
var response = await client.ExecuteShopAuditAuditCategoryAsync(request);
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
await _dal.UpdateAsync(p => new WeChatTransactionComponentAuditCategory()
|
||||
{
|
||||
auditId = response.AuditId,
|
||||
status = (int)AuditEnum.AuditCategoryStatus.审核中
|
||||
}, p => p.id == id);
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.msg = response.ErrorMessage;
|
||||
|
||||
}
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </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)
|
||||
{
|
||||
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
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 刷新审核状态
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> RefreshStatus(WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopAuditResultRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.AuditId = entity.auditId;
|
||||
|
||||
|
||||
|
||||
var response = await client.ExecuteShopAuditResultAsync(request);
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
await _dal.UpdateAsync(p => new WeChatTransactionComponentAuditCategory()
|
||||
{
|
||||
status = response.Data.Status,
|
||||
brandId = response.Data.BrandId,
|
||||
rejectReason = response.Data.RejectReason
|
||||
}, p => p.id == entity.id);
|
||||
}
|
||||
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "同步成功" : response.ErrorMessage;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#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<WeChatTransactionComponentAuditCategory>> QueryPageAsync(Expression<Func<WeChatTransactionComponentAuditCategory, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentAuditCategory, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/11 23:48:58
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件快递公司 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentDeliveryCompanyServices : BaseServices<WeChatTransactionComponentDeliveryCompany>, IWeChatTransactionComponentDeliveryCompanyServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentDeliveryCompanyRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentDeliveryCompanyServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentDeliveryCompanyRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<WeChatTransactionComponentDeliveryCompany>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<WeChatTransactionComponentDeliveryCompany>> 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<WeChatTransactionComponentDeliveryCompany>> QueryPageAsync(Expression<Func<WeChatTransactionComponentDeliveryCompany, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentDeliveryCompany, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/8/1 22:18:06
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品审核回调 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentGoodAuditLogServices : BaseServices<WeChatTransactionComponentGoodAuditLog>, IWeChatTransactionComponentGoodAuditLogServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentGoodAuditLogRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentGoodAuditLogServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentGoodAuditLogRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/5 23:23:30
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品关联sku列表 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentGoodSKUServices : BaseServices<WeChatTransactionComponentGoodSKU>, IWeChatTransactionComponentGoodSKUServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentGoodSKURepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentGoodSKUServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentGoodSKURepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_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)
|
||||
{
|
||||
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
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/4 1:24:53
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品列表 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentGoodServices : BaseServices<WeChatTransactionComponentGood>, IWeChatTransactionComponentGoodServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentGoodRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentGoodServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentGoodRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentGood entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </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)
|
||||
{
|
||||
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<WeChatTransactionComponentGood>> QueryPageAsync(Expression<Func<WeChatTransactionComponentGood, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentGood, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/10 23:44:16
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件提交订单 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentOrderServices : BaseServices<WeChatTransactionComponentOrder>, IWeChatTransactionComponentOrderServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentOrderRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentOrderServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentOrderRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/3 16:30:55
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件三级类目 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentThirdCategoryServices : BaseServices<WeChatTransactionComponentThirdCategory>, IWeChatTransactionComponentThirdCategoryServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentThirdCategoryRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentThirdCategoryServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentThirdCategoryRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_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>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </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<WeChatTransactionComponentThirdCategory>> QueryPageAsync(Expression<Func<WeChatTransactionComponentThirdCategory, bool>> predicate,
|
||||
Expression<Func<WeChatTransactionComponentThirdCategory, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user