# 2022-03-21

### 1.4.1 开源社区版:
无
### 0.3.0 专业版:
【新增】微信自定义交易组件增加【免审更新】功能。
【新增】微信自定义交易组件增加【上传品牌信息】功能。
【新增】微信自定义交易组件增加【品牌信息】审核回调验证功能。
This commit is contained in:
JianWeie
2022-03-21 04:10:58 +08:00
parent 88dec4dd21
commit 37c3ff7bf3
36 changed files with 3907 additions and 106 deletions

View File

@@ -8,9 +8,15 @@
* Description: 暂无
***********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using SqlSugar;
namespace CoreCms.Net.Repository
{
@@ -23,5 +29,83 @@ namespace CoreCms.Net.Repository
public CoreCmsUserWeChatInfoRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
#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<CoreCmsUserWeChatInfo>> QueryPageAsync(Expression<Func<CoreCmsUserWeChatInfo, bool>> predicate,
Expression<Func<CoreCmsUserWeChatInfo, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false)
{
RefAsync<int> totalCount = 0;
List<CoreCmsUserWeChatInfo> page;
if (blUseNoLock)
{
page = await DbClient.Queryable<CoreCmsUserWeChatInfo>()
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsUserWeChatInfo
{
id = p.id,
type = p.type,
userId = p.userId,
openid = p.openid,
sessionKey = p.sessionKey,
unionId = p.unionId,
avatar = p.avatar,
nickName = p.nickName,
gender = p.gender,
language = p.language,
city = p.city,
province = p.province,
country = p.country,
countryCode = p.countryCode,
mobile = p.mobile,
createTime = p.createTime,
updateTime = p.updateTime,
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
}
else
{
page = await DbClient.Queryable<CoreCmsUserWeChatInfo>()
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsUserWeChatInfo
{
id = p.id,
type = p.type,
userId = p.userId,
openid = p.openid,
sessionKey = p.sessionKey,
unionId = p.unionId,
avatar = p.avatar,
nickName = p.nickName,
gender = p.gender,
language = p.language,
city = p.city,
province = p.province,
country = p.country,
countryCode = p.countryCode,
mobile = p.mobile,
createTime = p.createTime,
updateTime = p.updateTime,
}).ToPageListAsync(pageIndex, pageSize, totalCount);
}
var list = new PageList<CoreCmsUserWeChatInfo>(page, pageIndex, pageSize, totalCount);
return list;
}
#endregion
}
}

View File

@@ -8,22 +8,31 @@
* Description: 暂无
***********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Caching.Manual;
using CoreCms.Net.Configuration;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.Repository
{
/// <summary>
/// 微信授权交互 接口实现
/// 微信授权交互 接口实现
/// </summary>
public class WeChatAccessTokenRepository : BaseRepository<WeChatAccessToken>, IWeChatAccessTokenRepository
{
private readonly IUnitOfWork _unitOfWork;
public WeChatAccessTokenRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
_unitOfWork = unitOfWork;
}
}
}
}

View File

@@ -0,0 +1,37 @@
/***********************************************************************
* Project: CoreCms
* ProjectName: 核心内容管理系统
* Web: https://www.corecms.net
* Author: 大灰灰
* Email: jianweie@163.com
* CreateTime: 2022/3/21 3:30:18
* Description: 暂无
***********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Caching.Manual;
using CoreCms.Net.Configuration;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.Repository
{
/// <summary>
/// 自定义交易组件上传品牌信息审核结果日志 接口实现
/// </summary>
public class WeChatTransactionComponentBrandAuditLogRepository : BaseRepository<WeChatTransactionComponentBrandAuditLog>, IWeChatTransactionComponentBrandAuditLogRepository
{
private readonly IUnitOfWork _unitOfWork;
public WeChatTransactionComponentBrandAuditLogRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
_unitOfWork = unitOfWork;
}
}
}

View File

@@ -0,0 +1,236 @@
/***********************************************************************
* Project: CoreCms
* ProjectName: 核心内容管理系统
* Web: https://www.corecms.net
* Author: 大灰灰
* Email: jianweie@163.com
* CreateTime: 2022/3/20 1:19:25
* Description: 暂无
***********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Caching.Manual;
using CoreCms.Net.Configuration;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.Repository
{
/// <summary>
/// 自定义交易组件上传品牌信息 接口实现
/// </summary>
public class WeChatTransactionComponentBrandAuditRepository : BaseRepository<WeChatTransactionComponentBrandAudit>, IWeChatTransactionComponentBrandAuditRepository
{
private readonly IUnitOfWork _unitOfWork;
public WeChatTransactionComponentBrandAuditRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
_unitOfWork = unitOfWork;
}
#region ==========================================================
/// <summary>
/// 重写异步插入方法
/// </summary>
/// <param name="entity">实体数据</param>
/// <returns></returns>
public new async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentBrandAudit entity)
{
var jm = new AdminUiCallBack();
entity.createTime = DateTime.Now;
entity.status = (int)CoreCms.Net.WeChat.Service.TransactionComponent.Enum.AuditEnum.AuditCategoryStatus.;
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
return jm;
}
/// <summary>
/// 重写异步更新方法
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public new async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentBrandAudit entity)
{
var jm = new AdminUiCallBack();
var oldModel = await DbClient.Queryable<WeChatTransactionComponentBrandAudit>().In(entity.id).SingleAsync();
if (oldModel == null)
{
jm.msg = "不存在此信息";
return jm;
}
//事物处理过程开始
//oldModel.id = entity.id;
oldModel.license = entity.license;
oldModel.brand_audit_type = entity.brand_audit_type;
oldModel.trademark_type = entity.trademark_type;
oldModel.brand_management_type = entity.brand_management_type;
oldModel.commodity_origin_type = entity.commodity_origin_type;
oldModel.brand_wording = entity.brand_wording;
oldModel.sale_authorization = entity.sale_authorization;
oldModel.trademark_registration_certificate = entity.trademark_registration_certificate;
oldModel.trademark_change_certificate = entity.trademark_change_certificate;
oldModel.trademark_registrant = entity.trademark_registrant;
oldModel.trademark_registrant_nu = entity.trademark_registrant_nu;
oldModel.trademark_authorization_period = entity.trademark_authorization_period;
oldModel.trademark_registration_application = entity.trademark_registration_application;
oldModel.trademark_applicant = entity.trademark_applicant;
oldModel.trademark_application_time = entity.trademark_application_time;
oldModel.imported_goods_form = entity.imported_goods_form;
oldModel.scene_group_list = entity.scene_group_list;
//事物处理过程结束
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
return jm;
}
/// <summary>
/// 重写异步更新方法
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public new async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentBrandAudit> entity)
{
var jm = new AdminUiCallBack();
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
return jm;
}
/// <summary>
/// 重写删除指定ID的数据
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
{
var jm = new AdminUiCallBack();
var bl = await DbClient.Deleteable<WeChatTransactionComponentBrandAudit>(id).ExecuteCommandHasChangeAsync();
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
return jm;
}
/// <summary>
/// 重写删除指定ID集合的数据(批量删除)
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
{
var jm = new AdminUiCallBack();
var bl = await DbClient.Deleteable<WeChatTransactionComponentBrandAudit>().In(ids).ExecuteCommandHasChangeAsync();
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
return jm;
}
#endregion
#region
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
public new async Task<IPageList<WeChatTransactionComponentBrandAudit>> QueryPageAsync(Expression<Func<WeChatTransactionComponentBrandAudit, bool>> predicate,
Expression<Func<WeChatTransactionComponentBrandAudit, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false)
{
RefAsync<int> totalCount = 0;
List<WeChatTransactionComponentBrandAudit> page;
if (blUseNoLock)
{
page = await DbClient.Queryable<WeChatTransactionComponentBrandAudit>()
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentBrandAudit
{
id = p.id,
license = p.license,
brand_audit_type = p.brand_audit_type,
trademark_type = p.trademark_type,
brand_management_type = p.brand_management_type,
commodity_origin_type = p.commodity_origin_type,
brand_wording = p.brand_wording,
sale_authorization = p.sale_authorization,
trademark_registration_certificate = p.trademark_registration_certificate,
trademark_change_certificate = p.trademark_change_certificate,
trademark_registrant = p.trademark_registrant,
trademark_registrant_nu = p.trademark_registrant_nu,
trademark_authorization_period = p.trademark_authorization_period,
trademark_registration_application = p.trademark_registration_application,
trademark_applicant = p.trademark_applicant,
trademark_application_time = p.trademark_application_time,
imported_goods_form = p.imported_goods_form,
scene_group_list = p.scene_group_list,
audit_id = p.audit_id,
status = p.status,
brandId = p.brandId,
rejectReason = p.rejectReason,
createTime = p.createTime,
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
}
else
{
page = await DbClient.Queryable<WeChatTransactionComponentBrandAudit>()
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentBrandAudit
{
id = p.id,
license = p.license,
brand_audit_type = p.brand_audit_type,
trademark_type = p.trademark_type,
brand_management_type = p.brand_management_type,
commodity_origin_type = p.commodity_origin_type,
brand_wording = p.brand_wording,
sale_authorization = p.sale_authorization,
trademark_registration_certificate = p.trademark_registration_certificate,
trademark_change_certificate = p.trademark_change_certificate,
trademark_registrant = p.trademark_registrant,
trademark_registrant_nu = p.trademark_registrant_nu,
trademark_authorization_period = p.trademark_authorization_period,
trademark_registration_application = p.trademark_registration_application,
trademark_applicant = p.trademark_applicant,
trademark_application_time = p.trademark_application_time,
imported_goods_form = p.imported_goods_form,
scene_group_list = p.scene_group_list,
audit_id = p.audit_id,
status = p.status,
brandId = p.brandId,
rejectReason = p.rejectReason,
createTime = p.createTime,
}).ToPageListAsync(pageIndex, pageSize, totalCount);
}
var list = new PageList<WeChatTransactionComponentBrandAudit>(page, pageIndex, pageSize, totalCount);
return list;
}
#endregion
}
}